From 580d7d39a26c9fbb72ed401a699e5eacbd030ac6 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Thu, 31 Aug 2023 14:43:34 +0800 Subject: [PATCH] reset gas meter after update cp --- baseapp/abci.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/baseapp/abci.go b/baseapp/abci.go index f90f6ce69bbe..af4408d578b8 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -202,6 +202,9 @@ func (app *BaseApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeg // write the consensus parameters in store to context if rsp.ConsensusParamsChanged { ctx = ctx.WithConsensusParams(app.GetConsensusParams(ctx)) + // GasMeter must be set after we get a context with updated consensus params. + gasMeter := app.getBlockGasMeter(ctx) + ctx = ctx.WithBlockGasMeter(gasMeter) app.deliverState.ctx = ctx } }