strip extensions in blocksync

This commit is contained in:
William Banfield
2022-05-16 19:20:08 -04:00
parent 44f1f045e2
commit 93ea3d0b7d
18 changed files with 55 additions and 44 deletions
+2
View File
@@ -560,6 +560,8 @@ func (r *Reactor) poolRoutine(ctx context.Context, stateSynced bool, blockSyncCh
if err == nil && state.ConsensusParams.ABCI.VoteExtensionsEnabled(extCommit.Height) {
// if vote extensions were required at this height, ensure they exist.
err = extCommit.EnsureExtensions()
} else if err == nil && !state.ConsensusParams.ABCI.VoteExtensionsEnabled(extCommit.Height) {
extCommit.StripExtensions()
}
// If either of the checks failed we log the error and request for a new block
// at that height
+1 -1
View File
@@ -155,7 +155,7 @@ func (rts *reactorTestSuite) addNode(
for blockHeight := int64(1); blockHeight <= maxBlockHeight; blockHeight++ {
lastExtCommit = seenExtCommit.Clone()
thisBlock := sf.MakeBlock(state, blockHeight, lastExtCommit.StripExtensions())
thisBlock := sf.MakeBlock(state, blockHeight, lastExtCommit.ToCommit())
thisParts, err := thisBlock.MakePartSet(types.BlockPartSizeBytes)
require.NoError(t, err)
blockID := types.BlockID{Hash: thisBlock.Hash(), PartSetHeader: thisParts.Header()}