-
Notifications
You must be signed in to change notification settings - Fork 70
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
Stop executing the handler when proposal is sumbmitted #534
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #534 +/- ##
==========================================
- Coverage 54.84% 54.84% -0.01%
==========================================
Files 631 631
Lines 54791 54806 +15
==========================================
+ Hits 30050 30058 +8
- Misses 22589 22597 +8
+ Partials 2152 2151 -1
|
Can you please fill up the context of this change? Why do we actually wanna remove that logic? |
cacheCtx, _ := ctx.CacheContext() | ||
handler := keeper.router.GetRoute(content.ProposalRoute()) | ||
if err := handler(cacheCtx, content); err != nil { | ||
return types.Proposal{}, sdkerrors.Wrap(types.ErrInvalidProposalContent, err.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.
does this have the side effect of allowing users to submit invalid props?
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.
yes
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.
Is it possible to fix the underline issue other than removing this handler? What does the upstream tendermint do here?
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.
We could mark ctx
with some flag saying that handler is executed in the "submit" scope and then act accordingly in the handler. But it means that we have to be careful about every handler in the system.
The current cosmos sdk stopped executing the handlers: https://github.com/cosmos/cosmos-sdk/blob/release/v0.50.x/x/gov/keeper/proposal.go#L72
They do it only for legacy types for backward compatibility, but no one uses those legacy proposals anymore.
Oops, button-mashed and updated this branch. |
Describe your changes and provide context
Testing performed to validate your change
CI will test it