-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Disable MsgCancelProposal
#1015
Conversation
WalkthroughThe recent modifications involve shifting Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files selected for processing (4)
- protocol/app/msgs/normal_msgs.go (1 hunks)
- protocol/app/msgs/normal_msgs_test.go (1 hunks)
- protocol/app/msgs/unsupported_msgs.go (2 hunks)
- protocol/app/msgs/unsupported_msgs_test.go (1 hunks)
Files skipped from review due to trivial changes (1)
- protocol/app/msgs/normal_msgs_test.go
Additional comments: 2
protocol/app/msgs/unsupported_msgs_test.go (1)
- 14-15: The addition of
"/cosmos.gov.v1.MsgCancelProposal"
and"/cosmos.gov.v1.MsgCancelProposalResponse"
to the expected message list inTestUnsupportedMsgSamples_Key
correctly reflects the PR's objective to mark these messages as unsupported. This change ensures that the test aligns with the updated protocol behavior.protocol/app/msgs/unsupported_msgs.go (1)
- 5-5: The import of the
gov
package fromgithub.heygears.com/cosmos/cosmos-sdk/x/gov/types/v1
is correctly added to support the declaration ofMsgCancelProposal
andMsgCancelProposalResponse
as unsupported messages. This change is necessary for the implementation of the PR's objectives.
// MsgCancelProposal is not allowed by protocol, due to it's potential for abuse. | ||
"/cosmos.gov.v1.MsgCancelProposal": &gov.MsgCancelProposal{}, | ||
"/cosmos.gov.v1.MsgCancelProposalResponse": nil, | ||
// These are deprecated/legacy msgs that we should not support. |
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.
The declarations for "/cosmos.gov.v1.MsgCancelProposal"
and "/cosmos.gov.v1.MsgCancelProposalResponse"
as unsupported messages are correctly implemented. This aligns with the PR's objective to disable these message types. However, setting the MsgCancelProposalResponse
to nil
might not be the best approach if the intention is to explicitly mark it as unsupported. Consider providing a stub or a specific unsupported message response to handle any potential calls to this message type more gracefully.
- "/cosmos.gov.v1.MsgCancelProposalResponse": nil,
+ "/cosmos.gov.v1.MsgCancelProposalResponse": &gov.MsgCancelProposalResponse{ /* fields if necessary */ },
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
// MsgCancelProposal is not allowed by protocol, due to it's potential for abuse. | |
"/cosmos.gov.v1.MsgCancelProposal": &gov.MsgCancelProposal{}, | |
"/cosmos.gov.v1.MsgCancelProposalResponse": nil, | |
// These are deprecated/legacy msgs that we should not support. | |
// MsgCancelProposal is not allowed by protocol, due to it's potential for abuse. | |
"/cosmos.gov.v1.MsgCancelProposal": &gov.MsgCancelProposal{}, | |
"/cosmos.gov.v1.MsgCancelProposalResponse": &gov.MsgCancelProposalResponse{ /* fields if necessary */ }, | |
// These are deprecated/legacy msgs that we should not support. |
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- protocol/lib/ante/unsupported_msgs.go (2 hunks)
Additional comments: 2
protocol/lib/ante/unsupported_msgs.go (2)
- 5-5: The addition of the
gov
package import fromgithub.heygears.com/cosmos/cosmos-sdk/x/gov/types/v1
is correctly aligned with the PR's objective to handleMsgCancelProposal
as an unsupported message. This change is necessary for the subsequent logic that checks forgov.MsgCancelProposal
type in theIsUnsupportedMsg
function.- 20-21: The modification to include
*gov.MsgCancelProposal
in theIsUnsupportedMsg
function's case statement effectively marksMsgCancelProposal
as unsupported, aligning with the PR's objectives. This change is straightforward and correctly implements the logic to identifyMsgCancelProposal
as an unsupported message type. However, ensure that all references and usages ofMsgCancelProposal
throughout the codebase have been updated to reflect this change.
Changelist
MsgCancelProposal
which was a new message introduced in Cosmos SDK 0.50 (Context here)Test Plan
Author/Reviewer Checklist
state-breaking
label.indexer-postgres-breaking
label.PrepareProposal
orProcessProposal
, manually add the labelproposal-breaking
.feature:[feature-name]
.backport/[branch-name]
.refactor
,chore
,bug
.