-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
tx committed successfully but return failure result #10769
Comments
@AmauryM AFAIK it is in both 0.42 and 0.44: (the issue was discovered on 0.44) |
a write up from @colin-axner: Summary of BugA tx being executed which causes the block gas limit to be reached will be persisted, but its response information will be wiped and replaced with a code 11 error: No events are emitted. How the bug was foundAn issue was reported of a IBC packet being relayed but no events existing for that packet sequence. Our state information indicated that the packet had been relayed. No associated transaction could be found by querying for events. After debugging the issue, the block the packet was relayed in was determined and the associated tx was found. The transaction had caused state changes, but all events were wiped from the response. The response might look something like:
I confirmed this issue by replicating my suspicions. I created 2 chains and set 1 chain to have a max block gas of 1. I sent a create client IBC tx and got the expected response. The client had been created, but no events existed in state for the transaction. Versionv0.44.3 Steps to Reproduce
Expected BehaviourThe tx should either by rejected (and the state changes discarded) or the tx should be accepted and the full response returned. |
Closes: cosmos#10769 Solution: - create `PersistTxMiddleware` - tx state change is reverted if any error happens Update x/auth/middleware/recovery.go Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com> snapshot middleware SimulateTx
Closes: cosmos#10769 Solution: - create a `WithBranchedStore` to handle state snapshot and revert - extract `ConsumeBlockGasMiddleware` out from `RecoveryTxMiddleware`. - order the middlewares properly. Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com> Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> Apply suggestions from code review Co-authored-by: Robert Zaremba <robert@zaremba.ch>
Closes: #10769 ## Description Solution: - create a `WithBranchedStore ` to handle state snapshot and revert - extract `ConsumeBlockGasMiddleware ` out from `RecoveryTxMiddleware`. - order the middlewares properly. --- ### 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](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] 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](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable)
When the last tx in a block exceeds the block gas limit, it returns an error result, but the tx is actually committed successfully.
Summary of Bug
Version
Steps to Reproduce
For Admin Use
The text was updated successfully, but these errors were encountered: