From 6cd1ce6d94bd9ed13b90f10e39d8094407cf4a91 Mon Sep 17 00:00:00 2001 From: ssd04 Date: Thu, 16 Jan 2025 16:16:57 +0200 Subject: [PATCH 1/7] change AddProof to return bool if was added of not --- common/errors.go | 3 +++ consensus/interface.go | 2 +- consensus/spos/bls/v2/subroundBlock.go | 6 +++--- consensus/spos/bls/v2/subroundEndRound.go | 6 +++--- consensus/spos/bls/v2/subroundEndRound_test.go | 4 ++-- dataRetriever/dataPool/proofsCache/errors.go | 3 --- dataRetriever/dataPool/proofsCache/proofsPool.go | 9 ++++----- dataRetriever/dataPool/proofsCache/proofsPool_test.go | 4 ++-- dataRetriever/interface.go | 2 +- integrationTests/testProcessorNode.go | 6 +++--- .../interceptedBlocks/interceptedEquivalentProof.go | 3 +-- .../processor/equivalentProofsInterceptorProcessor.go | 8 +++++++- .../equivalentProofsInterceptorProcessor_test.go | 4 ++-- .../interceptors/processor/hdrInterceptorProcessor.go | 6 +----- .../processor/hdrInterceptorProcessor_test.go | 4 ++-- process/interceptors/processor/interface.go | 2 +- testscommon/dataRetriever/proofsPoolMock.go | 6 +++--- 17 files changed, 39 insertions(+), 39 deletions(-) diff --git a/common/errors.go b/common/errors.go index eeeaf94c804..261b8308083 100644 --- a/common/errors.go +++ b/common/errors.go @@ -13,3 +13,6 @@ var ErrNilStateSyncNotifierSubscriber = errors.New("nil state sync notifier subs // ErrInvalidHeaderProof signals that an invalid equivalent proof has been provided var ErrInvalidHeaderProof = errors.New("invalid equivalent proof") + +// ErrAlreadyExistingEquivalentProof signals that the provided proof was already exiting in the pool +var ErrAlreadyExistingEquivalentProof = errors.New("already existing equivalent proof") diff --git a/consensus/interface.go b/consensus/interface.go index 8dfc1018172..057206d4b0b 100644 --- a/consensus/interface.go +++ b/consensus/interface.go @@ -203,7 +203,7 @@ type KeysHandler interface { // EquivalentProofsPool defines the behaviour of a proofs pool components type EquivalentProofsPool interface { - AddProof(headerProof data.HeaderProofHandler) error + AddProof(headerProof data.HeaderProofHandler) bool GetProof(shardID uint32, headerHash []byte) (data.HeaderProofHandler, error) HasProof(shardID uint32, headerHash []byte) bool IsInterfaceNil() bool diff --git a/consensus/spos/bls/v2/subroundBlock.go b/consensus/spos/bls/v2/subroundBlock.go index b55365df25e..b64c577a1a1 100644 --- a/consensus/spos/bls/v2/subroundBlock.go +++ b/consensus/spos/bls/v2/subroundBlock.go @@ -367,9 +367,9 @@ func (sr *subroundBlock) saveProofForPreviousHeaderIfNeeded(header data.HeaderHa return } - err = sr.EquivalentProofsPool().AddProof(proof) - if err != nil { - log.Debug("saveProofForPreviousHeaderIfNeeded: failed to add proof, %w", err) + ok := sr.EquivalentProofsPool().AddProof(proof) + if !ok { + log.Debug("saveProofForPreviousHeaderIfNeeded: proof not added", "headerHash", proof.GetHeaderHash()) } } diff --git a/consensus/spos/bls/v2/subroundEndRound.go b/consensus/spos/bls/v2/subroundEndRound.go index b91001bb2a7..414862bbeb1 100644 --- a/consensus/spos/bls/v2/subroundEndRound.go +++ b/consensus/spos/bls/v2/subroundEndRound.go @@ -261,9 +261,9 @@ func (sr *subroundEndRound) doEndRoundJobByNode() bool { // if proof not nil, it was created and broadcasted so it has to be added to the pool if proof != nil { - err = sr.EquivalentProofsPool().AddProof(proof) - if err != nil { - log.Debug("doEndRoundJobByNode.AddProof", "error", err) + ok := sr.EquivalentProofsPool().AddProof(proof) + if !ok { + log.Trace("doEndRoundJobByNode.AddProof", "added", ok) } } diff --git a/consensus/spos/bls/v2/subroundEndRound_test.go b/consensus/spos/bls/v2/subroundEndRound_test.go index 1db112cfff5..394df2b8d20 100644 --- a/consensus/spos/bls/v2/subroundEndRound_test.go +++ b/consensus/spos/bls/v2/subroundEndRound_test.go @@ -1244,11 +1244,11 @@ func TestSubroundEndRound_DoEndRoundJobByNode(t *testing.T) { wasSetCurrentHeaderProofCalled := false container.SetEquivalentProofsPool(&dataRetriever.ProofsPoolMock{ - AddProofCalled: func(headerProof data.HeaderProofHandler) error { + AddProofCalled: func(headerProof data.HeaderProofHandler) bool { wasSetCurrentHeaderProofCalled = true require.NotEqual(t, providedPrevSig, headerProof.GetAggregatedSignature()) require.NotEqual(t, providedPrevBitmap, headerProof.GetPubKeysBitmap()) - return nil + return true }, }) diff --git a/dataRetriever/dataPool/proofsCache/errors.go b/dataRetriever/dataPool/proofsCache/errors.go index 630dd8cc394..63376ef0a92 100644 --- a/dataRetriever/dataPool/proofsCache/errors.go +++ b/dataRetriever/dataPool/proofsCache/errors.go @@ -7,6 +7,3 @@ var ErrMissingProof = errors.New("missing proof") // ErrNilProof signals that a nil proof has been provided var ErrNilProof = errors.New("nil proof provided") - -// ErrAlreadyExistingEquivalentProof signals that the provided proof was already exiting in the pool -var ErrAlreadyExistingEquivalentProof = errors.New("already existing equivalent proof") diff --git a/dataRetriever/dataPool/proofsCache/proofsPool.go b/dataRetriever/dataPool/proofsCache/proofsPool.go index a412794a6db..472cc0876bd 100644 --- a/dataRetriever/dataPool/proofsCache/proofsPool.go +++ b/dataRetriever/dataPool/proofsCache/proofsPool.go @@ -1,7 +1,6 @@ package proofscache import ( - "encoding/hex" "fmt" "sync" @@ -31,9 +30,9 @@ func NewProofsPool() *proofsPool { // AddProof will add the provided proof to the pool func (pp *proofsPool) AddProof( headerProof data.HeaderProofHandler, -) error { +) bool { if check.IfNilReflect(headerProof) { - return ErrNilProof + return false } shardID := headerProof.GetHeaderShardId() @@ -41,7 +40,7 @@ func (pp *proofsPool) AddProof( hasProof := pp.HasProof(shardID, headerHash) if hasProof { - return fmt.Errorf("%w, headerHash: %s", ErrAlreadyExistingEquivalentProof, hex.EncodeToString(headerHash)) + return false } pp.mutCache.Lock() @@ -65,7 +64,7 @@ func (pp *proofsPool) AddProof( pp.callAddedProofSubscribers(headerProof) - return nil + return true } func (pp *proofsPool) callAddedProofSubscribers(headerProof data.HeaderProofHandler) { diff --git a/dataRetriever/dataPool/proofsCache/proofsPool_test.go b/dataRetriever/dataPool/proofsCache/proofsPool_test.go index c4e373eeba7..3073526ef54 100644 --- a/dataRetriever/dataPool/proofsCache/proofsPool_test.go +++ b/dataRetriever/dataPool/proofsCache/proofsPool_test.go @@ -66,8 +66,8 @@ func TestProofsPool_ShouldWork(t *testing.T) { _ = pp.AddProof(proof3) _ = pp.AddProof(proof4) - err := pp.AddProof(proof4) - require.True(t, errors.Is(err, proofscache.ErrAlreadyExistingEquivalentProof)) + ok := pp.AddProof(proof4) + require.False(t, ok) proof, err := pp.GetProof(shardID, []byte("hash3")) require.Nil(t, err) diff --git a/dataRetriever/interface.go b/dataRetriever/interface.go index c28843491d0..886ed42a186 100644 --- a/dataRetriever/interface.go +++ b/dataRetriever/interface.go @@ -362,7 +362,7 @@ type PeerAuthenticationPayloadValidator interface { // ProofsPool defines the behaviour of a proofs pool components type ProofsPool interface { - AddProof(headerProof data.HeaderProofHandler) error + AddProof(headerProof data.HeaderProofHandler) bool RegisterHandler(handler func(headerProof data.HeaderProofHandler)) CleanupProofsBehindNonce(shardID uint32, nonce uint64) error GetProof(shardID uint32, headerHash []byte) (data.HeaderProofHandler, error) diff --git a/integrationTests/testProcessorNode.go b/integrationTests/testProcessorNode.go index 7fe4a9d1eaf..b29f3064b7c 100644 --- a/integrationTests/testProcessorNode.go +++ b/integrationTests/testProcessorNode.go @@ -2833,9 +2833,9 @@ func (tpn *TestProcessorNode) setBlockSignatures(blockHeader data.HeaderHandler) } blockHeader.SetPreviousProof(previousProof) - err = tpn.ProofsPool.AddProof(previousProof) - if err != nil { - log.Warn("ProofsPool.AddProof", "currHdrHash", currHdrHash, "node", tpn.OwnAccount.Address, "err", err.Error()) + wasAdded := tpn.ProofsPool.AddProof(previousProof) + if !wasAdded { + log.Warn("ProofsPool.AddProof not added", "currHdrHash", currHdrHash, "node", tpn.OwnAccount.Address) } return err } diff --git a/process/block/interceptedBlocks/interceptedEquivalentProof.go b/process/block/interceptedBlocks/interceptedEquivalentProof.go index 3793a98b36c..acc070b6380 100644 --- a/process/block/interceptedBlocks/interceptedEquivalentProof.go +++ b/process/block/interceptedBlocks/interceptedEquivalentProof.go @@ -16,7 +16,6 @@ import ( "github.com/multiversx/mx-chain-go/common" "github.com/multiversx/mx-chain-go/consensus" "github.com/multiversx/mx-chain-go/dataRetriever" - proofscache "github.com/multiversx/mx-chain-go/dataRetriever/dataPool/proofsCache" "github.com/multiversx/mx-chain-go/process" "github.com/multiversx/mx-chain-go/sharding" "github.com/multiversx/mx-chain-go/storage" @@ -146,7 +145,7 @@ func (iep *interceptedEquivalentProof) CheckValidity() error { ok := iep.proofsPool.HasProof(iep.proof.GetHeaderShardId(), iep.proof.GetHeaderHash()) if ok { - return proofscache.ErrAlreadyExistingEquivalentProof + return common.ErrAlreadyExistingEquivalentProof } err = iep.checkHeaderParamsFromProof() diff --git a/process/interceptors/processor/equivalentProofsInterceptorProcessor.go b/process/interceptors/processor/equivalentProofsInterceptorProcessor.go index ef8beff12af..be111820d65 100644 --- a/process/interceptors/processor/equivalentProofsInterceptorProcessor.go +++ b/process/interceptors/processor/equivalentProofsInterceptorProcessor.go @@ -4,6 +4,7 @@ import ( "github.com/multiversx/mx-chain-core-go/core" "github.com/multiversx/mx-chain-core-go/core/check" "github.com/multiversx/mx-chain-core-go/marshal" + "github.com/multiversx/mx-chain-go/common" "github.com/multiversx/mx-chain-go/process" ) @@ -56,7 +57,12 @@ func (epip *equivalentProofsInterceptorProcessor) Save(data process.InterceptedD return process.ErrWrongTypeAssertion } - return epip.equivalentProofsPool.AddProof(interceptedProof.GetProof()) + wasAdded := epip.equivalentProofsPool.AddProof(interceptedProof.GetProof()) + if !wasAdded { + return common.ErrAlreadyExistingEquivalentProof + } + + return nil } // RegisterHandler registers a callback function to be notified of incoming equivalent proofs diff --git a/process/interceptors/processor/equivalentProofsInterceptorProcessor_test.go b/process/interceptors/processor/equivalentProofsInterceptorProcessor_test.go index c817db54a9f..fe150584f23 100644 --- a/process/interceptors/processor/equivalentProofsInterceptorProcessor_test.go +++ b/process/interceptors/processor/equivalentProofsInterceptorProcessor_test.go @@ -96,9 +96,9 @@ func TestEquivalentProofsInterceptorProcessor_Save(t *testing.T) { wasCalled := false args := createMockArgEquivalentProofsInterceptorProcessor() args.EquivalentProofsPool = &dataRetriever.ProofsPoolMock{ - AddProofCalled: func(notarizedProof data.HeaderProofHandler) error { + AddProofCalled: func(notarizedProof data.HeaderProofHandler) bool { wasCalled = true - return nil + return true }, } epip, err := NewEquivalentProofsInterceptorProcessor(args) diff --git a/process/interceptors/processor/hdrInterceptorProcessor.go b/process/interceptors/processor/hdrInterceptorProcessor.go index c49f2bb9703..c9f6d67c4d1 100644 --- a/process/interceptors/processor/hdrInterceptorProcessor.go +++ b/process/interceptors/processor/hdrInterceptorProcessor.go @@ -1,7 +1,6 @@ package processor import ( - "reflect" "sync" "github.com/multiversx/mx-chain-core-go/core" @@ -82,10 +81,7 @@ func (hip *HdrInterceptorProcessor) Save(data process.InterceptedData, _ core.Pe hip.headers.AddHeader(interceptedHdr.Hash(), interceptedHdr.HeaderHandler()) if common.ShouldBlockHavePrevProof(interceptedHdr.HeaderHandler(), hip.enableEpochsHandler, common.EquivalentMessagesFlag) { - err := hip.proofs.AddProof(interceptedHdr.HeaderHandler().GetPreviousProof()) - if err != nil { - log.Error("failed to add proof", "error", err, "intercepted header hash", interceptedHdr.Hash(), "header type", reflect.TypeOf(interceptedHdr.HeaderHandler())) - } + _ = hip.proofs.AddProof(interceptedHdr.HeaderHandler().GetPreviousProof()) } return nil diff --git a/process/interceptors/processor/hdrInterceptorProcessor_test.go b/process/interceptors/processor/hdrInterceptorProcessor_test.go index 6b611f3a1c5..1dd904b38f7 100644 --- a/process/interceptors/processor/hdrInterceptorProcessor_test.go +++ b/process/interceptors/processor/hdrInterceptorProcessor_test.go @@ -207,9 +207,9 @@ func TestHdrInterceptorProcessor_SaveShouldWork(t *testing.T) { wasAddedProofs := false arg.Proofs = &dataRetriever.ProofsPoolMock{ - AddProofCalled: func(headerProof data.HeaderProofHandler) error { + AddProofCalled: func(headerProof data.HeaderProofHandler) bool { wasAddedProofs = true - return nil + return true }, } diff --git a/process/interceptors/processor/interface.go b/process/interceptors/processor/interface.go index 14c0ae73bd6..58d142a09a9 100644 --- a/process/interceptors/processor/interface.go +++ b/process/interceptors/processor/interface.go @@ -33,7 +33,7 @@ type interceptedEquivalentProof interface { // EquivalentProofsPool defines the behaviour of a proofs pool components type EquivalentProofsPool interface { - AddProof(headerProof data.HeaderProofHandler) error + AddProof(headerProof data.HeaderProofHandler) bool CleanupProofsBehindNonce(shardID uint32, nonce uint64) error GetProof(shardID uint32, headerHash []byte) (data.HeaderProofHandler, error) HasProof(shardID uint32, headerHash []byte) bool diff --git a/testscommon/dataRetriever/proofsPoolMock.go b/testscommon/dataRetriever/proofsPoolMock.go index 09a5d4646b9..bc9d1998cff 100644 --- a/testscommon/dataRetriever/proofsPoolMock.go +++ b/testscommon/dataRetriever/proofsPoolMock.go @@ -7,7 +7,7 @@ import ( // ProofsPoolMock - type ProofsPoolMock struct { - AddProofCalled func(headerProof data.HeaderProofHandler) error + AddProofCalled func(headerProof data.HeaderProofHandler) bool CleanupProofsBehindNonceCalled func(shardID uint32, nonce uint64) error GetProofCalled func(shardID uint32, headerHash []byte) (data.HeaderProofHandler, error) HasProofCalled func(shardID uint32, headerHash []byte) bool @@ -15,12 +15,12 @@ type ProofsPoolMock struct { } // AddProof - -func (p *ProofsPoolMock) AddProof(headerProof data.HeaderProofHandler) error { +func (p *ProofsPoolMock) AddProof(headerProof data.HeaderProofHandler) bool { if p.AddProofCalled != nil { return p.AddProofCalled(headerProof) } - return nil + return false } // CleanupProofsBehindNonce - From ae23f8711bb688114e93d482dbb51d26531f0492 Mon Sep 17 00:00:00 2001 From: ssd04 Date: Thu, 16 Jan 2025 17:52:37 +0200 Subject: [PATCH 2/7] added trace log for AddProof --- process/interceptors/processor/hdrInterceptorProcessor.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/process/interceptors/processor/hdrInterceptorProcessor.go b/process/interceptors/processor/hdrInterceptorProcessor.go index c9f6d67c4d1..987bf40e74b 100644 --- a/process/interceptors/processor/hdrInterceptorProcessor.go +++ b/process/interceptors/processor/hdrInterceptorProcessor.go @@ -81,7 +81,8 @@ func (hip *HdrInterceptorProcessor) Save(data process.InterceptedData, _ core.Pe hip.headers.AddHeader(interceptedHdr.Hash(), interceptedHdr.HeaderHandler()) if common.ShouldBlockHavePrevProof(interceptedHdr.HeaderHandler(), hip.enableEpochsHandler, common.EquivalentMessagesFlag) { - _ = hip.proofs.AddProof(interceptedHdr.HeaderHandler().GetPreviousProof()) + ok = hip.proofs.AddProof(interceptedHdr.HeaderHandler().GetPreviousProof()) + log.Trace("HdrInterceptorProcessor.AddProof", "added", ok) } return nil From b1fe37264c4db0ab10f8a2582dc207aaa191637a Mon Sep 17 00:00:00 2001 From: ssd04 Date: Thu, 16 Jan 2025 17:55:45 +0200 Subject: [PATCH 3/7] update proof log --- process/interceptors/processor/hdrInterceptorProcessor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/process/interceptors/processor/hdrInterceptorProcessor.go b/process/interceptors/processor/hdrInterceptorProcessor.go index 987bf40e74b..22950e91785 100644 --- a/process/interceptors/processor/hdrInterceptorProcessor.go +++ b/process/interceptors/processor/hdrInterceptorProcessor.go @@ -82,7 +82,7 @@ func (hip *HdrInterceptorProcessor) Save(data process.InterceptedData, _ core.Pe if common.ShouldBlockHavePrevProof(interceptedHdr.HeaderHandler(), hip.enableEpochsHandler, common.EquivalentMessagesFlag) { ok = hip.proofs.AddProof(interceptedHdr.HeaderHandler().GetPreviousProof()) - log.Trace("HdrInterceptorProcessor.AddProof", "added", ok) + log.Trace("HdrInterceptorProcessor.AddProof: add previous proof", "intercepted header hash", interceptedHdr.Hash(), "added", ok) } return nil From eb045779d4aa7d5507fe46361779541e49ac4328 Mon Sep 17 00:00:00 2001 From: ssd04 Date: Mon, 20 Jan 2025 14:11:35 +0200 Subject: [PATCH 4/7] fixes after merge --- process/block/interceptedBlocks/interceptedEquivalentProof.go | 1 + .../interceptedBlocks/interceptedEquivalentProof_test.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/process/block/interceptedBlocks/interceptedEquivalentProof.go b/process/block/interceptedBlocks/interceptedEquivalentProof.go index 611b9fd580b..49bc7cad791 100644 --- a/process/block/interceptedBlocks/interceptedEquivalentProof.go +++ b/process/block/interceptedBlocks/interceptedEquivalentProof.go @@ -12,6 +12,7 @@ import ( logger "github.com/multiversx/mx-chain-logger-go" "github.com/multiversx/mx-chain-vm-v1_2-go/ipc/marshaling" + "github.com/multiversx/mx-chain-go/common" "github.com/multiversx/mx-chain-go/consensus" "github.com/multiversx/mx-chain-go/dataRetriever" "github.com/multiversx/mx-chain-go/process" diff --git a/process/block/interceptedBlocks/interceptedEquivalentProof_test.go b/process/block/interceptedBlocks/interceptedEquivalentProof_test.go index 85262c297bc..86879344097 100644 --- a/process/block/interceptedBlocks/interceptedEquivalentProof_test.go +++ b/process/block/interceptedBlocks/interceptedEquivalentProof_test.go @@ -11,8 +11,8 @@ import ( logger "github.com/multiversx/mx-chain-logger-go" "github.com/stretchr/testify/require" + "github.com/multiversx/mx-chain-go/common" "github.com/multiversx/mx-chain-go/consensus/mock" - proofscache "github.com/multiversx/mx-chain-go/dataRetriever/dataPool/proofsCache" "github.com/multiversx/mx-chain-go/process" "github.com/multiversx/mx-chain-go/testscommon" "github.com/multiversx/mx-chain-go/testscommon/consensus" @@ -202,7 +202,7 @@ func TestInterceptedEquivalentProof_CheckValidity(t *testing.T) { require.NoError(t, err) err = iep.CheckValidity() - require.Equal(t, proofscache.ErrAlreadyExistingEquivalentProof, err) + require.Equal(t, common.ErrAlreadyExistingEquivalentProof, err) }) t.Run("should work", func(t *testing.T) { t.Parallel() From 275e516a6c34ea1ef891006a22b258466a0958d4 Mon Sep 17 00:00:00 2001 From: Darius Date: Mon, 20 Jan 2025 14:26:53 +0200 Subject: [PATCH 5/7] Update consensus/spos/bls/v2/subroundBlock.go Co-authored-by: Sorin Stanculeanu <34831323+sstanculeanu@users.noreply.github.com> --- consensus/spos/bls/v2/subroundBlock.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/consensus/spos/bls/v2/subroundBlock.go b/consensus/spos/bls/v2/subroundBlock.go index f21546fa355..8edfb354eff 100644 --- a/consensus/spos/bls/v2/subroundBlock.go +++ b/consensus/spos/bls/v2/subroundBlock.go @@ -369,7 +369,7 @@ func (sr *subroundBlock) saveProofForPreviousHeaderIfNeeded(header data.HeaderHa ok := sr.EquivalentProofsPool().AddProof(proof) if !ok { - log.Debug("saveProofForPreviousHeaderIfNeeded: proof not added", "headerHash", proof.GetHeaderHash()) + log.Debug("saveProofForPreviousHeaderIfNeeded: proof not added", "headerHash", hex.EncodeToString(proof.GetHeaderHash())) } } From 9e359e46bc99726f9f9ff8b7bebae7b9e5b61f0f Mon Sep 17 00:00:00 2001 From: ssd04 Date: Mon, 20 Jan 2025 14:36:38 +0200 Subject: [PATCH 6/7] fix import --- consensus/spos/bls/v2/subroundBlock.go | 1 + 1 file changed, 1 insertion(+) diff --git a/consensus/spos/bls/v2/subroundBlock.go b/consensus/spos/bls/v2/subroundBlock.go index 8edfb354eff..3de20efe41a 100644 --- a/consensus/spos/bls/v2/subroundBlock.go +++ b/consensus/spos/bls/v2/subroundBlock.go @@ -3,6 +3,7 @@ package v2 import ( "bytes" "context" + "encoding/hex" "time" "github.com/multiversx/mx-chain-core-go/core" From e509e4731d656a4ee969d499a091f766927e3572 Mon Sep 17 00:00:00 2001 From: ssd04 Date: Mon, 20 Jan 2025 15:18:36 +0200 Subject: [PATCH 7/7] fixes after review --- integrationTests/testProcessorNode.go | 1 - testscommon/dataRetriever/proofsPoolMock.go | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/integrationTests/testProcessorNode.go b/integrationTests/testProcessorNode.go index 491b147dc00..8533c24530f 100644 --- a/integrationTests/testProcessorNode.go +++ b/integrationTests/testProcessorNode.go @@ -2837,7 +2837,6 @@ func (tpn *TestProcessorNode) setBlockSignatures(blockHeader data.HeaderHandler) if !wasAdded { log.Warn("ProofsPool.AddProof not added", "currHdrHash", currHdrHash, "node", tpn.OwnAccount.Address) } - return err } err = blockHeader.SetPubKeysBitmap(pubKeysBitmap) diff --git a/testscommon/dataRetriever/proofsPoolMock.go b/testscommon/dataRetriever/proofsPoolMock.go index bc9d1998cff..7461f28abef 100644 --- a/testscommon/dataRetriever/proofsPoolMock.go +++ b/testscommon/dataRetriever/proofsPoolMock.go @@ -20,7 +20,7 @@ func (p *ProofsPoolMock) AddProof(headerProof data.HeaderProofHandler) bool { return p.AddProofCalled(headerProof) } - return false + return true } // CleanupProofsBehindNonce -