-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
feat!: return errors in module manager ABCI methods #14847
Conversation
var err error | ||
res, err = app.beginBlocker(app.deliverState.ctx, req) | ||
if err != nil { | ||
panic(err) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods
var err error | ||
res, err = app.endBlocker(app.deliverState.ctx, req) | ||
if err != nil { | ||
panic(err) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods
@@ -656,7 +669,7 @@ | |||
// only one module will update the validator set | |||
if len(moduleValUpdates) > 0 { | |||
if len(validatorUpdates) > 0 { | |||
panic("validator EndBlock updates already set by a previous module") | |||
return abci.ResponseEndBlock{}, errors.New("validator EndBlock updates already set by a previous module") |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods
Not sure how helpful this is given that it's moving the panics to baseapp |
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.
need some changelog, but unfortunate we have to panic elsewhere here. Nothing we can do, but at least if we get the panics in one place it will be cleaner
@@ -559,12 +560,12 @@ func (app *SimApp) setPostHandler() { | |||
func (app *SimApp) Name() string { return app.BaseApp.Name() } | |||
|
|||
// BeginBlocker application updates every begin block | |||
func (app *SimApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock { | |||
func (app *SimApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) (abci.ResponseBeginBlock, error) { |
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.
need a changelog and upgrade entry for this
…/refactor-modulemanager-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.
lgtm.
tiny nit: update the code example here
Line 48 in 25e7f9b
func (app *myApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock { |
Description
Closes: #14836
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...
!
to the type prefix if API or client breaking changeCHANGELOG.md
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...
!
in the type prefix if API or client breaking change