-
Notifications
You must be signed in to change notification settings - Fork 612
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(callbacks)!: SendPacket validation bypass and erroneous event emission are fixed #4568
Conversation
if callbackData.AllowRetry() { | ||
panic(storetypes.ErrorOutOfGas{Descriptor: fmt.Sprintf("ibc %s callback out of gas; commitGasLimit: %d", callbackType, callbackData.CommitGasLimit)}) | ||
} | ||
err = errorsmod.Wrapf(types.ErrCallbackOutOfGas, "ibc %s callback out of gas", callbackType) |
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.
I guess we are okay overwriting the returned error if the cached context runs of gas?
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.
I guess we have an order of precedence now:
regularErr < panicErr < pastLimitErr
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.
I'm okay with that since the panics are likely due to out of gas error anyways
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.
Could we update godoc with this order of precedence and behaviour?
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.
Added godocs.
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.
Changes LGTM, a little more documentation could be useful. Thank you @srdtrk for the attention to detail! This is a state machine breaking change so will require a v0.2.0 when we backport
if callbackData.AllowRetry() { | ||
panic(storetypes.ErrorOutOfGas{Descriptor: fmt.Sprintf("ibc %s callback out of gas; commitGasLimit: %d", callbackType, callbackData.CommitGasLimit)}) | ||
} | ||
err = errorsmod.Wrapf(types.ErrCallbackOutOfGas, "ibc %s callback out of gas", callbackType) |
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.
Could we update godoc with this order of precedence and behaviour?
…ssion are fixed (#4568) * fix: fixed callbacks out of gas handling * fix: fixed panics and oog errors not showing up on events * docs(callbacks): added godocs for error precedence --------- Co-authored-by: Carlos Rodriguez <[email protected]> (cherry picked from commit e192899) # Conflicts: # modules/apps/callbacks/ibc_middleware.go
…ssion are fixed (cosmos#4568) * fix: fixed callbacks out of gas handling * fix: fixed panics and oog errors not showing up on events * docs(callbacks): added godocs for error precedence --------- Co-authored-by: Carlos Rodriguez <[email protected]>
…ssion are fixed (#4568) * fix: fixed callbacks out of gas handling * fix: fixed panics and oog errors not showing up on events * docs(callbacks): added godocs for error precedence --------- Co-authored-by: Carlos Rodriguez <[email protected]> (cherry picked from commit e192899) # Conflicts: # modules/apps/callbacks/ibc_middleware.go
…ssion are fixed (backport #4568) (#5881) * fix(callbacks)!: SendPacket validation bypass and erroneous event emission are fixed (#4568) * fix: fixed callbacks out of gas handling * fix: fixed panics and oog errors not showing up on events * docs(callbacks): added godocs for error precedence --------- Co-authored-by: Carlos Rodriguez <[email protected]> (cherry picked from commit e192899) # Conflicts: # modules/apps/callbacks/ibc_middleware.go * fix conflicts * fix import --------- Co-authored-by: srdtrk <[email protected]> Co-authored-by: Carlos Rodriguez <[email protected]>
Description
closes: #4566, #4567
Commit Message / Changelog Entry
see the guidelines for commit messages. (view raw markdown for examples)
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
) or specification (x/<module>/spec/
).godoc
comments.Files changed
in the Github PR explorer.Codecov Report
in the comment section below once CI passes.