Skip to content
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: correctly assign execModeSimulate to context for simulateTx (backport #20342) #20346

Merged
merged 12 commits into from May 17, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented May 10, 2024

Description

Correctly assigns context execMode when simulating txs to execModeSimulate.
Fixes out-of-gas errors propagated from relayers in ibc e2e tests in: cosmos/ibc-go#6278

Tested e2es locally by checking out release/v0.50.x and using go mod replace for cosmos-sdk with the diff in this PR.


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • reviewed "Files changed" and left comments if necessary
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • updated the relevant documentation or specification, including comments for documenting Go code
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

Summary by CodeRabbit

  • Enhancements
    • Improved context handling for transactions to better support simulation modes.

This is an automatic backport of pull request #20342 done by [Mergify](https://mergify.com).

@mergify mergify bot requested a review from a team as a code owner May 10, 2024 12:08

This comment has been minimized.

Comment on lines 675 to 681

if mode == execModeSimulate {
ctx, _ = ctx.CacheContext()
ctx = ctx.WithExecMode(sdk.ExecMode(execModeSimulate))
}

return ctx
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change potentially affects state.

Call sequence:

(*github.com/cosmos/cosmos-sdk/baseapp.BaseApp).getContextForTx (baseapp/baseapp.go:660)
(*github.com/cosmos/cosmos-sdk/baseapp.BaseApp).runTx (baseapp/baseapp.go:818)
(*github.com/cosmos/cosmos-sdk/baseapp.BaseApp).deliverTx (baseapp/baseapp.go:748)
(*github.com/cosmos/cosmos-sdk/baseapp.BaseApp).internalFinalizeBlock (baseapp/baseapp.go:692)
(*github.com/cosmos/cosmos-sdk/baseapp.BaseApp).FinalizeBlock (baseapp/baseapp.go:853)

@tac0turtle tac0turtle self-assigned this May 10, 2024
@tac0turtle tac0turtle enabled auto-merge (squash) May 10, 2024 13:12
Copy link
Member

@sontrinh16 sontrinh16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thou cant seem to make linter happy

@tac0turtle
Copy link
Member

lgtm, thou cant seem to make linter happy

haha okay I thought I was going insane haha

@sontrinh16
Copy link
Member

lgtm, thou cant seem to make linter happy

haha okay I thought I was going insane haha

seems like this has been a while for v0.50.x, we could just add nolint check here to work around this

@tac0turtle tac0turtle merged commit b99ca2c into release/v0.50.x May 17, 2024
42 of 44 checks passed
@tac0turtle tac0turtle deleted the mergify/bp/release/v0.50.x/pr-20342 branch May 17, 2024 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants