separate extended commit save

This commit is contained in:
William Banfield
2022-05-17 20:37:59 -04:00
parent c3686fea00
commit 588a310049
10 changed files with 147 additions and 16 deletions
+5 -1
View File
@@ -601,7 +601,11 @@ func (r *Reactor) poolRoutine(ctx context.Context, stateSynced bool, blockSyncCh
r.pool.PopRequest()
// TODO: batch saves so we do not persist to disk every block
r.store.SaveBlock(first, firstParts, extCommit)
if state.ConsensusParams.ABCI.VoteExtensionsEnabled(state.LastBlockHeight) {
r.store.SaveBlockWithExtendedCommit(first, firstParts, extCommit)
} else {
r.store.SaveBlock(first, firstParts, extCommit.ToCommit())
}
// TODO: Same thing for app - but we would need a way to get the hash
// without persisting the state.
+1 -1
View File
@@ -183,7 +183,7 @@ func (rts *reactorTestSuite) addNode(
state, err = blockExec.ApplyBlock(ctx, state, blockID, thisBlock)
require.NoError(t, err)
blockStore.SaveBlock(thisBlock, thisParts, seenExtCommit)
blockStore.SaveBlockWithExtendedCommit(thisBlock, thisParts, seenExtCommit)
}
rts.peerChans[nodeID] = make(chan p2p.PeerUpdate)