Skip to content

Commit

Permalink
fixes after discussion
Browse files Browse the repository at this point in the history
  • Loading branch information
sstanculeanu committed Feb 7, 2025
1 parent 113c0ad commit 30a98a8
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions process/block/shardblock.go
Original file line number Diff line number Diff line change
Expand Up @@ -1821,8 +1821,7 @@ func (sp *shardProcessor) computeExistingAndRequestMissingMetaHeaders(header dat
defer sp.hdrsForCurrBlock.mutHdrsForBlock.Unlock()

metaBlockHashes := header.GetMetaBlockHashes()
lastMetablockNonce := uint64(0)
hasProofForLastMetablock := false
lastMetablockNonceWithProof := uint64(0)
for i := 0; i < len(metaBlockHashes); i++ {
hdr, err := process.GetMetaHeaderFromPool(
metaBlockHashes[i],
Expand Down Expand Up @@ -1861,14 +1860,12 @@ func (sp *shardProcessor) computeExistingAndRequestMissingMetaHeaders(header dat
continue
}

if hdr.GetNonce() > lastMetablockNonce {
lastMetablockNonce = hdr.GetNonce()
hasProofForLastMetablock = hasProofForMetablock
if hdr.GetNonce() > lastMetablockNonceWithProof {
lastMetablockNonceWithProof = hdr.GetNonce()
}
}

requestedFinalityAttestingBasedOnProofs := sp.hdrsForCurrBlock.missingFinalityAttestingHdrs > 0
if sp.hdrsForCurrBlock.missingHdrs == 0 && !requestedFinalityAttestingBasedOnProofs && !hasProofForLastMetablock {
if sp.hdrsForCurrBlock.missingHdrs == 0 && lastMetablockNonceWithProof == 0 {
sp.hdrsForCurrBlock.missingFinalityAttestingHdrs = sp.requestMissingFinalityAttestingHeaders(
core.MetachainShardId,
sp.metaBlockFinality,
Expand Down

0 comments on commit 30a98a8

Please sign in to comment.