Skip to content

Commit 6a5158f

Browse files
committed
fix: tx context gas meter is shared at the beginning
ref: #19613 Before the ante handler set the gas meter using tx gas-wanted, the gas meter in ctx remains a globally shared one, although it don't have bad effect right now, but it's a race condition when executing in parallel.
1 parent 3d59013 commit 6a5158f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

baseapp/baseapp.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,8 @@ func (app *BaseApp) getContextForTx(mode execMode, txBytes []byte) sdk.Context {
668668
panic(fmt.Sprintf("state is nil for mode %v", mode))
669669
}
670670
ctx := modeState.Context().
671-
WithTxBytes(txBytes)
671+
WithTxBytes(txBytes).
672+
WithGasMeter(storetypes.NewInfiniteGasMeter())
672673
// WithVoteInfos(app.voteInfos) // TODO: identify if this is needed
673674

674675
ctx = ctx.WithIsSigverifyTx(app.sigverifyTx)

0 commit comments

Comments
 (0)