fix(baseapp): don't share global gas meter in tx execution (backport #19616) (#20050)

This commit is contained in:
mergify[bot]
2024-04-16 11:45:09 +02:00
committed by GitHub
parent dafcc78dfd
commit 994149877c
2 changed files with 3 additions and 1 deletions
+1
View File
@@ -56,6 +56,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (server) [#19884](https://github.com/cosmos/cosmos-sdk/pull/19884) Add start customizability to start command options.
* (x/gov) [#19853](https://github.com/cosmos/cosmos-sdk/pull/19853) Emit `depositor` in `EventTypeProposalDeposit`.
* (x/gov) [#19844](https://github.com/cosmos/cosmos-sdk/pull/19844) Emit the proposer of governance proposals.
* (baseapp) [#19616](https://github.com/cosmos/cosmos-sdk/pull/19616) Don't share gas meter in tx execution.
## Bug Fixes
+2 -1
View File
@@ -665,7 +665,8 @@ func (app *BaseApp) getContextForTx(mode execMode, txBytes []byte) sdk.Context {
panic(fmt.Sprintf("state is nil for mode %v", mode))
}
ctx := modeState.Context().
WithTxBytes(txBytes)
WithTxBytes(txBytes).
WithGasMeter(storetypes.NewInfiniteGasMeter())
// WithVoteInfos(app.voteInfos) // TODO: identify if this is needed
ctx = ctx.WithConsensusParams(app.GetConsensusParams(ctx))