Skip to content

Commit

Permalink
Do not call WriteStateToCommitAndGetWorkingHash in FinalizeBlocker …
Browse files Browse the repository at this point in the history
…during replay (sei-protocol#1601)
  • Loading branch information
codchen authored Apr 26, 2024
1 parent 3c6e9f6 commit 997cbd5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -1119,6 +1119,9 @@ func (app *App) FinalizeBlocker(ctx sdk.Context, req *abci.RequestFinalizeBlock)
if !app.optimisticProcessingInfo.Aborted && bytes.Equal(app.optimisticProcessingInfo.Hash, req.Hash) {
metrics.IncrementOptimisticProcessingCounter(true)
app.SetProcessProposalStateToCommit()
if app.EvmKeeper.EthReplayConfig.Enabled || app.EvmKeeper.EthBlockTestConfig.Enabled {
return &abci.ResponseFinalizeBlock{}, nil
}
appHash := app.WriteStateToCommitAndGetWorkingHash()
resp := app.getFinalizeBlockResponse(appHash, app.optimisticProcessingInfo.Events, app.optimisticProcessingInfo.TxRes, app.optimisticProcessingInfo.EndBlockResp)
return &resp, nil
Expand All @@ -1131,6 +1134,9 @@ func (app *App) FinalizeBlocker(ctx sdk.Context, req *abci.RequestFinalizeBlock)
events, txResults, endBlockResp, _ := app.ProcessBlock(ctx, req.Txs, req, req.DecidedLastCommit)

app.SetDeliverStateToCommit()
if app.EvmKeeper.EthReplayConfig.Enabled || app.EvmKeeper.EthBlockTestConfig.Enabled {
return &abci.ResponseFinalizeBlock{}, nil
}
appHash := app.WriteStateToCommitAndGetWorkingHash()
resp := app.getFinalizeBlockResponse(appHash, events, txResults, endBlockResp)
return &resp, nil
Expand Down

0 comments on commit 997cbd5

Please sign in to comment.