-
Notifications
You must be signed in to change notification settings - Fork 343
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: introduce cli commands for the upgrade module #2910
Conversation
WalkthroughWalkthroughThe changes across various files indicate an update to the upgrade module in a blockchain application, likely built on the Cosmos SDK. The updates include the addition of new RPC functions and message types for upgrade attempts, modifications to keeper logic and tallying of votes, and enhancements to testing suites to cover the new functionality. The changes suggest a shift towards a more dynamic and possibly governance-driven upgrade process. Changes
TipsChat with CodeRabbit Bot (
|
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.
dope!
do you think its worth it to run the msgs through the anti handlers in some way? perhaps we could just add them to
celestia-app/app/test/std_sdk_test.go
Line 74 in c5e1786
func (s *StandardSDKIntegrationTestSuite) TestStandardSDK() { |
it might be overly paranoid, but the reason being that we could remove the output to something like the getsigners method (or other critical piece) atm and all tests would pass.
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
x/upgrade/integration_test.go
Outdated
}) | ||
require.NoError(t, err) | ||
require.EqualValues(t, 1, res.VotingPower) | ||
require.EqualValues(t, 0, res.ThresholdPower) |
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.
[optional] this threshold power seems weird b/c it makes me think that no votes are needed to trigger an upgrade.
Is it possible for this test case to have a non-zero threshold power potentially by adding another validator with some voting power?
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.
So currently as it stands, there has to be strictly greater than the threshold power for the upgrade to occur. If we think it is better to present threshold as "greater or equal to" then I can increment this buy 1. Whatever we feel is more intuitive for users
Co-authored-by: Rootul P <[email protected]>
func CmdTryUpgrade() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "try-upgrade", | ||
Short: "Try to perform a software upgrade", | ||
Long: `This command will submit a TryUpgrade message to tally all | ||
the signal votes. If a quorum has been reached, the network will upgrade | ||
to the signalled version at the following height. | ||
`, |
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 CmdTryUpgrade
command's description provides information on the tallying of votes and the upgrade process. It would be beneficial to include additional details or output examples in the help text or documentation to guide users on what to expect after executing this command, especially regarding how they can confirm that an upgrade is in progress or will occur.
FYI: I've modified the meaning of threshold here from "strictly greater" to "greater than equal" which I think is more intuitive for users. I've added some test cases to make sure my math is right |
Yup! done |
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.
🚢 great work!
Addresses: #2875
This also adds an integration test to the upgrade module