-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metachain notarizez based on equivalent proofs #6513
base: feat/equivalent-messages
Are you sure you want to change the base?
Changes from 3 commits
1eae0e9
4197d2b
71187d1
367d1d1
3df3761
8236823
d96462a
e970b06
2e1b145
f34b5cf
6aad53b
50ba8a1
3fb045b
93afc4e
1158d33
450d335
644d8be
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,6 +60,7 @@ type nonceAndHashInfo struct { | |
|
||
type hdrInfo struct { | ||
usedInBlock bool | ||
hasProof bool | ||
hdr data.HeaderHandler | ||
} | ||
|
||
|
@@ -123,6 +124,8 @@ type baseProcessor struct { | |
mutNonceOfFirstCommittedBlock sync.RWMutex | ||
nonceOfFirstCommittedBlock core.OptionalUint64 | ||
extraDelayRequestBlockInfo time.Duration | ||
|
||
proofsPool dataRetriever.ProofsPool | ||
} | ||
|
||
type bootStorerDataArgs struct { | ||
|
@@ -639,7 +642,7 @@ func (bp *baseProcessor) sortHeaderHashesForCurrentBlockByNonce(usedInBlock bool | |
|
||
bp.hdrsForCurrBlock.mutHdrsForBlock.RLock() | ||
for metaBlockHash, headerInfo := range bp.hdrsForCurrBlock.hdrHashAndInfo { | ||
if headerInfo.usedInBlock != usedInBlock { | ||
if headerInfo.usedInBlock != usedInBlock || !headerInfo.hasProof { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that if a header is used in block but has no valid proof, then this is an error case There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. check for enabled flag here? |
||
continue | ||
} | ||
|
||
|
@@ -978,8 +981,8 @@ func (bp *baseProcessor) cleanupPools(headerHandler data.HeaderHandler) { | |
|
||
err := bp.dataPool.Proofs().CleanupProofsBehindNonce(bp.shardCoordinator.SelfId(), highestPrevFinalBlockNonce) | ||
if err != nil { | ||
log.Warn("%w: failed to cleanup notarized proofs behind nonce %d on shardID %d", | ||
err, noncesToPrevFinal, bp.shardCoordinator.SelfId()) | ||
log.Warn(fmt.Sprintf("%s: failed to cleanup notarized proofs behind nonce %d on shardID %d", | ||
err.Error(), noncesToPrevFinal, bp.shardCoordinator.SelfId())) | ||
} | ||
|
||
if bp.shardCoordinator.SelfId() == core.MetachainShardId { | ||
|
@@ -2167,3 +2170,17 @@ func (bp *baseProcessor) checkSentSignaturesAtCommitTime(header data.HeaderHandl | |
|
||
return nil | ||
} | ||
|
||
func (bp *baseProcessor) isFirstBlockAfterEquivalentMessagesFlag(header data.HeaderHandler) bool { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe rename this - from the name it is a bit unclear if it refers to the start of epoch block when EquivalentMessages activate or the block after that - FirstBlockAfter maybe rename to: isEpochChangeBlockForEquivalentMessagesActivation |
||
isStartOfEpochBlock := header.IsStartOfEpochBlock() | ||
isBlockInActivationEpoch := header.GetEpoch() == bp.enableEpochsHandler.GetCurrentEpoch() | ||
|
||
return isBlockInActivationEpoch && isStartOfEpochBlock | ||
} | ||
|
||
func (bp *baseProcessor) shouldConsiderProofsForNotarization(header data.HeaderHandler) bool { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should consider proofs for notarization I think from the block following the equivalents messages activation block. Not to forget that the first block (which follows the new consensus) if it is considered as a confirmation block then it needs itself to have a valid proof. |
||
isEquivalentMessagesFlagEnabledForHeader := bp.enableEpochsHandler.IsFlagEnabledInEpoch(common.EquivalentMessagesFlag, header.GetEpoch()) | ||
isFirstBlockAfterEquivalentMessagesFlag := bp.isFirstBlockAfterEquivalentMessagesFlag(header) | ||
|
||
return isEquivalentMessagesFlagEnabledForHeader && !isFirstBlockAfterEquivalentMessagesFlag | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ import ( | |
type hdrForBlock struct { | ||
missingHdrs uint32 | ||
missingFinalityAttestingHdrs uint32 | ||
missingHdrsProofs uint32 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i might help to rename here to indicate that it's num missing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed it |
||
highestHdrNonce map[uint32]uint64 | ||
mutHdrsForBlock sync.RWMutex | ||
hdrHashAndInfo map[string]*hdrInfo | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -139,6 +139,7 @@ func NewMetaProcessor(arguments ArgMetaProcessor) (*metaProcessor, error) { | |
managedPeersHolder: arguments.ManagedPeersHolder, | ||
sentSignaturesTracker: arguments.SentSignaturesTracker, | ||
extraDelayRequestBlockInfo: time.Duration(arguments.Config.EpochStartConfig.ExtraDelayForRequestBlockInfoInMilliseconds) * time.Millisecond, | ||
proofsPool: arguments.DataComponents.Datapool().Proofs(), | ||
} | ||
|
||
mp := metaProcessor{ | ||
|
@@ -297,7 +298,7 @@ func (mp *metaProcessor) ProcessBlock( | |
} | ||
|
||
mp.txCoordinator.RequestBlockTransactions(body) | ||
requestedShardHdrs, requestedFinalityAttestingShardHdrs := mp.requestShardHeaders(header) | ||
requestedShardHdrs, requestedFinalityAttestingShardHdrs, missingShardHdrProofs := mp.requestShardHeaders(header) | ||
|
||
if haveTime() < 0 { | ||
return process.ErrTimeIsOut | ||
|
@@ -308,7 +309,9 @@ func (mp *metaProcessor) ProcessBlock( | |
return err | ||
} | ||
|
||
haveMissingShardHeaders := requestedShardHdrs > 0 || requestedFinalityAttestingShardHdrs > 0 | ||
haveMissingShardHeaders := requestedShardHdrs > 0 || | ||
requestedFinalityAttestingShardHdrs > 0 || | ||
missingShardHdrProofs > 0 | ||
if haveMissingShardHeaders { | ||
if requestedShardHdrs > 0 { | ||
log.Debug("requested missing shard headers", | ||
|
@@ -320,8 +323,13 @@ func (mp *metaProcessor) ProcessBlock( | |
"num finality shard headers", requestedFinalityAttestingShardHdrs, | ||
) | ||
} | ||
if missingShardHdrProofs > 0 { | ||
log.Debug("missing shard header proofs", | ||
"num", missingShardHdrProofs, | ||
) | ||
} | ||
|
||
err = mp.waitForBlockHeaders(haveTime()) | ||
err = mp.waitForBlockHeadersAndProofs(haveTime()) | ||
|
||
mp.hdrsForCurrBlock.mutHdrsForBlock.RLock() | ||
missingShardHdrs := mp.hdrsForCurrBlock.missingHdrs | ||
|
@@ -1081,8 +1089,18 @@ func (mp *metaProcessor) createAndProcessCrossMiniBlocksDstMe( | |
continue | ||
} | ||
|
||
shouldCheckProof := mp.enableEpochsHandler.IsFlagEnabledInEpoch(common.EquivalentMessagesFlag, currShardHdr.GetEpoch()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the computeLongestChainFromLastNotarized would return I think the chain of headers without the last one (which is considered the confirmation for the last returned one). Was computeLongestChainFromLastNotarized updated for equivalent proofs? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated the blockProcessor as well |
||
hasProofForHdr := mp.proofsPool.HasProof(currShardHdr.GetShardID(), orderedHdrsHashes[i]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think here we should check if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. correct, optimization.. implemented it |
||
if shouldCheckProof && !hasProofForHdr { | ||
log.Trace("no proof for shard header", | ||
"shard", currShardHdr.GetShardID(), | ||
"hash", logger.DisplayByteSlice(orderedHdrsHashes[i]), | ||
) | ||
continue | ||
} | ||
|
||
if len(currShardHdr.GetMiniBlockHeadersWithDst(mp.shardCoordinator.SelfId())) == 0 { | ||
mp.hdrsForCurrBlock.hdrHashAndInfo[string(orderedHdrsHashes[i])] = &hdrInfo{hdr: currShardHdr, usedInBlock: true} | ||
mp.hdrsForCurrBlock.hdrHashAndInfo[string(orderedHdrsHashes[i])] = &hdrInfo{hdr: currShardHdr, usedInBlock: true, hasProof: true} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. split on multiple lines for better visibility? same below |
||
hdrsAdded++ | ||
hdrsAddedForShard[currShardHdr.GetShardID()]++ | ||
lastShardHdr[currShardHdr.GetShardID()] = currShardHdr | ||
|
@@ -1121,7 +1139,7 @@ func (mp *metaProcessor) createAndProcessCrossMiniBlocksDstMe( | |
miniBlocks = append(miniBlocks, currMBProcessed...) | ||
txsAdded += currTxsAdded | ||
|
||
mp.hdrsForCurrBlock.hdrHashAndInfo[string(orderedHdrsHashes[i])] = &hdrInfo{hdr: currShardHdr, usedInBlock: true} | ||
mp.hdrsForCurrBlock.hdrHashAndInfo[string(orderedHdrsHashes[i])] = &hdrInfo{hdr: currShardHdr, usedInBlock: true, hasProof: true} | ||
hdrsAdded++ | ||
hdrsAddedForShard[currShardHdr.GetShardID()]++ | ||
|
||
|
@@ -1284,6 +1302,17 @@ func (mp *metaProcessor) CommitBlock( | |
mp.lastRestartNonce = header.GetNonce() | ||
} | ||
|
||
isBlockAfterEquivalentMessagesFlag := !check.IfNil(lastMetaBlock) && | ||
mp.enableEpochsHandler.IsFlagEnabledInEpoch(common.EquivalentMessagesFlag, lastMetaBlock.GetEpoch()) | ||
if isBlockAfterEquivalentMessagesFlag { | ||
// for the first block we need to update both the state of the previous one and for current | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and for all future blocks, updateState should be done only for current, not lastMetaBlock. I would use a different variable e.g finalMetaBlock and not overwrite the lastMetaBlock (that should still point to the last committed meta block not the one currently being committed). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should work as described, updated the variable name for clarity |
||
if mp.isFirstBlockAfterEquivalentMessagesFlag(header) { | ||
mp.updateState(lastMetaBlock, lastMetaBlockHash) | ||
} | ||
|
||
lastMetaBlock = header | ||
lastMetaBlockHash = headerHash | ||
} | ||
mp.updateState(lastMetaBlock, lastMetaBlockHash) | ||
|
||
committedRootHash, err := mp.accountsDB[state.UserAccountsState].RootHash() | ||
|
@@ -1838,6 +1867,20 @@ func (mp *metaProcessor) checkShardHeadersFinality( | |
continue | ||
} | ||
|
||
if mp.enableEpochsHandler.IsFlagEnabledInEpoch(common.EquivalentMessagesFlag, lastVerifiedHdr.GetEpoch()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this loop is correct, as it does not get to iterate over all shard headers and verify. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. true, moved this if into the next for loop and switched the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does it fits better to check proof in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it should stay here, as here is the place where we check for finality |
||
marshalledHeader, err := mp.marshalizer.Marshal(lastVerifiedHdr) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
headerHash := mp.hasher.Compute(string(marshalledHeader)) | ||
if !mp.proofsPool.HasProof(shardId, headerHash) { | ||
return process.ErrHeaderNotFinal | ||
} | ||
|
||
return nil | ||
} | ||
|
||
// verify if there are "K" block after current to make this one final | ||
nextBlocksVerified := uint32(0) | ||
for _, shardHdr := range finalityAttestingShardHdrs[shardId] { | ||
|
@@ -1886,7 +1929,9 @@ func (mp *metaProcessor) receivedShardHeader(headerHandler data.HeaderHandler, s | |
|
||
mp.hdrsForCurrBlock.mutHdrsForBlock.Lock() | ||
|
||
haveMissingShardHeaders := mp.hdrsForCurrBlock.missingHdrs > 0 || mp.hdrsForCurrBlock.missingFinalityAttestingHdrs > 0 | ||
haveMissingShardHeaders := mp.hdrsForCurrBlock.missingHdrs > 0 || | ||
mp.hdrsForCurrBlock.missingFinalityAttestingHdrs > 0 || | ||
mp.hdrsForCurrBlock.missingHdrsProofs > 0 | ||
if haveMissingShardHeaders { | ||
hdrInfoForHash := mp.hdrsForCurrBlock.hdrHashAndInfo[string(shardHeaderHash)] | ||
headerInfoIsNotNil := hdrInfoForHash != nil | ||
|
@@ -1900,18 +1945,36 @@ func (mp *metaProcessor) receivedShardHeader(headerHandler data.HeaderHandler, s | |
} | ||
} | ||
|
||
if hdrInfoForHash != nil && !hdrInfoForHash.hasProof { | ||
hasProof := mp.proofsPool.HasProof(shardHeader.GetShardID(), shardHeaderHash) | ||
hdrInfoForHash.hasProof = hasProof | ||
if hasProof { | ||
mp.hdrsForCurrBlock.missingHdrsProofs-- | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. missingHdrsProofs should be decreased if that proof was missing previously and still missing at this step only e.g you receive a shard hdr which is not part of the metablock (an older block maybe), so here you would end up decreasing the missing headers proofs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated the condition, it was not working as expected |
||
} | ||
} | ||
|
||
if mp.hdrsForCurrBlock.missingHdrs == 0 { | ||
mp.hdrsForCurrBlock.missingFinalityAttestingHdrs = mp.requestMissingFinalityAttestingShardHeaders() | ||
if !mp.shouldConsiderProofsForNotarization(shardHeader) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. on the else, you should check that there is a valid proof for this header, otherwise add it to the missing proofs. |
||
mp.hdrsForCurrBlock.missingFinalityAttestingHdrs = mp.requestMissingFinalityAttestingShardHeaders() | ||
} | ||
|
||
if mp.hdrsForCurrBlock.missingFinalityAttestingHdrs == 0 { | ||
log.Debug("received all missing finality attesting shard headers") | ||
} | ||
|
||
if mp.hdrsForCurrBlock.missingHdrsProofs == 0 { | ||
log.Debug("received all shard header proofs") | ||
} | ||
} | ||
|
||
missingShardHdrs := mp.hdrsForCurrBlock.missingHdrs | ||
missingFinalityAttestingShardHdrs := mp.hdrsForCurrBlock.missingFinalityAttestingHdrs | ||
missingHdrsProofs := mp.hdrsForCurrBlock.missingHdrsProofs | ||
mp.hdrsForCurrBlock.mutHdrsForBlock.Unlock() | ||
|
||
allMissingShardHeadersReceived := missingShardHdrs == 0 && missingFinalityAttestingShardHdrs == 0 | ||
allMissingShardHeadersReceived := missingShardHdrs == 0 && | ||
missingFinalityAttestingShardHdrs == 0 && | ||
missingHdrsProofs == 0 | ||
if allMissingShardHeadersReceived { | ||
mp.chRcvAllHdrs <- true | ||
} | ||
|
@@ -1941,20 +2004,21 @@ func (mp *metaProcessor) requestMissingFinalityAttestingShardHeaders() uint32 { | |
return missingFinalityAttestingShardHeaders | ||
} | ||
|
||
func (mp *metaProcessor) requestShardHeaders(metaBlock *block.MetaBlock) (uint32, uint32) { | ||
func (mp *metaProcessor) requestShardHeaders(metaBlock *block.MetaBlock) (uint32, uint32, uint32) { | ||
_ = core.EmptyChannel(mp.chRcvAllHdrs) | ||
|
||
if len(metaBlock.ShardInfo) == 0 { | ||
return 0, 0 | ||
return 0, 0, 0 | ||
} | ||
|
||
return mp.computeExistingAndRequestMissingShardHeaders(metaBlock) | ||
} | ||
|
||
func (mp *metaProcessor) computeExistingAndRequestMissingShardHeaders(metaBlock *block.MetaBlock) (uint32, uint32) { | ||
func (mp *metaProcessor) computeExistingAndRequestMissingShardHeaders(metaBlock *block.MetaBlock) (uint32, uint32, uint32) { | ||
mp.hdrsForCurrBlock.mutHdrsForBlock.Lock() | ||
defer mp.hdrsForCurrBlock.mutHdrsForBlock.Unlock() | ||
|
||
notarizedShardHdrsBasedOnProofs := 0 | ||
for _, shardData := range metaBlock.ShardInfo { | ||
if shardData.Nonce == mp.genesisNonce { | ||
lastCrossNotarizedHeaderForShard, hash, err := mp.blockTracker.GetLastCrossNotarizedHeader(shardData.ShardID) | ||
|
@@ -1982,6 +2046,7 @@ func (mp *metaProcessor) computeExistingAndRequestMissingShardHeaders(metaBlock | |
hdr: nil, | ||
usedInBlock: true, | ||
} | ||
|
||
go mp.requestHandler.RequestShardHeader(shardData.ShardID, shardData.HeaderHash) | ||
continue | ||
} | ||
|
@@ -1994,13 +2059,24 @@ func (mp *metaProcessor) computeExistingAndRequestMissingShardHeaders(metaBlock | |
if hdr.GetNonce() > mp.hdrsForCurrBlock.highestHdrNonce[shardData.ShardID] { | ||
mp.hdrsForCurrBlock.highestHdrNonce[shardData.ShardID] = hdr.GetNonce() | ||
} | ||
|
||
if mp.shouldConsiderProofsForNotarization(hdr) { | ||
notarizedShardHdrsBasedOnProofs++ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. instead of incrementing the missing headers proofs, maybe use a map for the missing header proofs, with key the header hash then you could correctly check which proofs are still missing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated |
||
|
||
hasProofForShardHdr := mp.proofsPool.HasProof(shardData.ShardID, shardData.HeaderHash) | ||
mp.hdrsForCurrBlock.hdrHashAndInfo[string(shardData.HeaderHash)].hasProof = hasProofForShardHdr | ||
if !hasProofForShardHdr { | ||
mp.hdrsForCurrBlock.missingHdrsProofs++ | ||
} | ||
} | ||
} | ||
|
||
if mp.hdrsForCurrBlock.missingHdrs == 0 { | ||
shouldRequestMissingFinalityAttestingShardHeaders := notarizedShardHdrsBasedOnProofs != len(metaBlock.ShardInfo) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. check this only if equivalent flag enabled? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not needed, here notarizedShardHdrsBasedOnProofs would be 0, thus the second condition will always be true |
||
if mp.hdrsForCurrBlock.missingHdrs == 0 && shouldRequestMissingFinalityAttestingShardHeaders { | ||
mp.hdrsForCurrBlock.missingFinalityAttestingHdrs = mp.requestMissingFinalityAttestingShardHeaders() | ||
} | ||
|
||
return mp.hdrsForCurrBlock.missingHdrs, mp.hdrsForCurrBlock.missingFinalityAttestingHdrs | ||
return mp.hdrsForCurrBlock.missingHdrs, mp.hdrsForCurrBlock.missingFinalityAttestingHdrs, mp.hdrsForCurrBlock.missingHdrsProofs | ||
} | ||
|
||
func (mp *metaProcessor) createShardInfo() ([]data.ShardDataHandler, error) { | ||
|
@@ -2017,6 +2093,13 @@ func (mp *metaProcessor) createShardInfo() ([]data.ShardDataHandler, error) { | |
continue | ||
} | ||
|
||
isBlockAfterEquivalentMessagesFlag := check.IfNil(headerInfo.hdr) && | ||
mp.enableEpochsHandler.IsFlagEnabledInEpoch(common.EquivalentMessagesFlag, headerInfo.hdr.GetEpoch()) | ||
hasMissingProof := isBlockAfterEquivalentMessagesFlag && !headerInfo.hasProof | ||
if hasMissingProof { | ||
continue | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is an error if a header was used in block but has no proof, should not continue but return an error. Please check that the shardInfo (createShardInfo) contains the proof for the shard header itself, along with the proof for the previous block. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated to return error There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated also to use both proofs |
||
} | ||
|
||
shardHdr, ok := headerInfo.hdr.(data.ShardHeaderHandler) | ||
if !ok { | ||
return nil, process.ErrWrongTypeAssertion | ||
|
@@ -2274,7 +2357,7 @@ func (mp *metaProcessor) prepareBlockHeaderInternalMapForValidatorProcessor() { | |
} | ||
|
||
mp.hdrsForCurrBlock.mutHdrsForBlock.Lock() | ||
mp.hdrsForCurrBlock.hdrHashAndInfo[string(currentBlockHeaderHash)] = &hdrInfo{false, currentBlockHeader} | ||
mp.hdrsForCurrBlock.hdrHashAndInfo[string(currentBlockHeaderHash)] = &hdrInfo{false, false, currentBlockHeader} | ||
mp.hdrsForCurrBlock.mutHdrsForBlock.Unlock() | ||
} | ||
|
||
|
@@ -2301,7 +2384,7 @@ func (mp *metaProcessor) verifyValidatorStatisticsRootHash(header *block.MetaBlo | |
return nil | ||
} | ||
|
||
func (mp *metaProcessor) waitForBlockHeaders(waitTime time.Duration) error { | ||
func (mp *metaProcessor) waitForBlockHeadersAndProofs(waitTime time.Duration) error { | ||
select { | ||
case <-mp.chRcvAllHdrs: | ||
return nil | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adapt also
sortHeadersForCurrentBlockByNonce
to have hasProof check?