-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(baseapp): don't share global gas meter in tx execution #19616
Changes from all commits
6a5158f
33b2d71
52e3e9b
692d646
45dfe41
3ae64e7
9de6ff3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -666,7 +666,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()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see you've added the backport tag, but is this really backportable? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess so, the gas meter will be replaced by ante handler, so whatever recorded in the initial gas meter is discarded there. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The root gas meter is an infinite gas meter. This change solves the race as the root gas meter is not shared anymore with the new context. Looks good for me |
||
// WithVoteInfos(app.voteInfos) // TODO: identify if this is needed | ||
|
||
ctx = ctx.WithIsSigverifyTx(app.sigverifyTx) | ||
Comment on lines
666
to
673
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change potentially affects state. Call sequence:
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changelog entry clearly documents the change made in PR #19616. Consider rephrasing for enhanced clarity:
Committable suggestion