-
Notifications
You must be signed in to change notification settings - Fork 86
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
Wrap endblock #531
Wrap endblock #531
Conversation
…tential-panics-in-abci-methods
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.
Simple + elegant! Just 1 small detail to fix.
x/emissions/module/module.go
Outdated
sdkCtx := sdk.UnwrapSDKContext(ctx) | ||
if r := recover(); r != nil { | ||
err := fmt.Errorf("recovered from panic in EndBlocker: %v", r) | ||
sdkCtx.Logger().Error("Error Getting module params", err) |
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.
Wrong error message!
sdkCtx.Logger().Error("Error Getting module params", err) | ||
} | ||
}() | ||
|
||
err := EndBlocker(ctx, am) | ||
if err != nil { | ||
sdkCtx := sdk.UnwrapSDKContext(ctx) |
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.
can we fix this typo in this PR too: EnbBlocker
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.
(it's the line below this one, won't let me leave a comment on just that line)
I am confused how this PR works, is this just going to catch panics on unwrapping the sdk context? |
…tential-panics-in-abci-methods
…tential-panics-in-abci-methods
@relyt29 I can understand why you are confused on this change. I think it is because I got |
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 don't think the sdk context will be a real problem
Purpose of Changes and their Description
Implemented a wrapper function for EndBlocker to catch and handle any potential panics
Link(s) to Ticket(s) or Issue(s) resolved by this PR
Are these changes tested and documented?
Unreleased
section ofCHANGELOG.md
?Still Left Todo
Fill this out if this is a Draft PR so others can help.