From 997cbd51d1a8fedd4e992b4ba0c54e1256aa0fa0 Mon Sep 17 00:00:00 2001 From: codchen Date: Fri, 26 Apr 2024 18:51:21 +0800 Subject: [PATCH] Do not call `WriteStateToCommitAndGetWorkingHash` in FinalizeBlocker during replay (#1601) --- app/app.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/app.go b/app/app.go index f7b6585f5c..0eacd4282c 100644 --- a/app/app.go +++ b/app/app.go @@ -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 @@ -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