-
Notifications
You must be signed in to change notification settings - Fork 37
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: add max voting power per pool #191
Conversation
WalkthroughThe recent updates focus on introducing and integrating the 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.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
x/pool/types/params.pb.go
is excluded by!**/*.pb.go
Files selected for processing (11)
- app/upgrades/v1_5/upgrade.go (1 hunks)
- docs/static/openapi.yml (1 hunks)
- proto/kyve/pool/v1beta1/params.proto (1 hunks)
- x/bundles/keeper/abci_protocol_split_test.go (1 hunks)
- x/bundles/keeper/keeper_suite_inflation_splitting_test.go (12 hunks)
- x/bundles/keeper/logic_bundles.go (1 hunks)
- x/bundles/keeper/logic_bundles_test.go (3 hunks)
- x/bundles/types/errors.go (1 hunks)
- x/bundles/types/expected_keepers.go (1 hunks)
- x/pool/keeper/getters_params.go (1 hunks)
- x/pool/types/params.go (3 hunks)
Files skipped from review due to trivial changes (3)
- app/upgrades/v1_5/upgrade.go
- docs/static/openapi.yml
- x/bundles/types/errors.go
Additional comments not posted (21)
proto/kyve/pool/v1beta1/params.proto (1)
23-27
: The addition ofmax_voting_power_per_pool
is correctly implemented with appropriate protobuf annotations.x/pool/keeper/getters_params.go (1)
31-34
: The implementation ofGetMaxVotingPowerPerPool
follows the established pattern for getters and correctly retrieves the new parameter.x/pool/types/params.go (1)
14-16
: The additions related toMaxVotingPowerPerPool
in theParams
struct, including default value, constructor, and validation, are correctly implemented and follow best practices.Also applies to: 21-26, 35-35, 49-52
x/bundles/types/expected_keepers.go (1)
26-26
: The addition ofGetMaxVotingPowerPerPool
to thePoolKeeper
interface is correctly implemented, ensuring consistency across different implementations.x/bundles/keeper/abci_protocol_split_test.go (1)
33-36
: Refactoring the parameter setting to useDefaultParams
in the test setup improves maintainability and ensures that changes to default parameters are consistently reflected in tests.x/bundles/keeper/logic_bundles.go (1)
48-52
: The integration ofMaxVotingPowerPerPool
in theAssertPoolCanRun
method is correctly implemented, ensuring that the pool's voting power constraints are enforced based on the new parameter.x/bundles/keeper/logic_bundles_test.go (3)
22-24
: Ensure the new test cases cover all scenarios for theMaxVotingPowerPerPool
constraint.
255-316
: The test case correctly simulates a scenario where the voting power of one node is exactly 40%, and asserts that no error should occur. This aligns well with the newMaxVotingPowerPerPool
constraint.
318-383
: The test case effectively tests the scenario where a node's voting power exceeds the 40% limit, and correctly expects theErrVotingPowerTooHigh
error. This is a crucial test for validating the enforcement of theMaxVotingPowerPerPool
constraint.x/bundles/keeper/keeper_suite_inflation_splitting_test.go (12)
117-120
: Refactor to useDefaultParams
enhances consistency and maintainability.This change simplifies the parameter setup by using
DefaultParams
, which is beneficial for maintaining consistency across tests and simplifying future modifications.
197-200
: Refactor to useDefaultParams
enhances consistency and maintainability.This change simplifies the parameter setup by using
DefaultParams
, which is beneficial for maintaining consistency across tests and simplifying future modifications.
290-293
: Refactor to useDefaultParams
enhances consistency and maintainability.This change simplifies the parameter setup by using
DefaultParams
, which is beneficial for maintaining consistency across tests and simplifying future modifications.
383-386
: Refactor to useDefaultParams
enhances consistency and maintainability.This change simplifies the parameter setup by using
DefaultParams
, which is beneficial for maintaining consistency across tests and simplifying future modifications.
489-492
: Refactor to useDefaultParams
enhances consistency and maintainability.This change simplifies the parameter setup by using
DefaultParams
, which is beneficial for maintaining consistency across tests and simplifying future modifications.
596-599
: Refactor to useDefaultParams
enhances consistency and maintainability.This change simplifies the parameter setup by using
DefaultParams
, which is beneficial for maintaining consistency across tests and simplifying future modifications.
703-706
: Refactor to useDefaultParams
enhances consistency and maintainability.This change simplifies the parameter setup by using
DefaultParams
, which is beneficial for maintaining consistency across tests and simplifying future modifications.
808-811
: Refactor to useDefaultParams
enhances consistency and maintainability.This change simplifies the parameter setup by using
DefaultParams
, which is beneficial for maintaining consistency across tests and simplifying future modifications.
915-918
: Refactor to useDefaultParams
enhances consistency and maintainability.This change simplifies the parameter setup by using
DefaultParams
, which is beneficial for maintaining consistency across tests and simplifying future modifications.
1022-1025
: Refactor to useDefaultParams
enhances consistency and maintainability.This change simplifies the parameter setup by using
DefaultParams
, which is beneficial for maintaining consistency across tests and simplifying future modifications.
1127-1130
: Refactor to useDefaultParams
enhances consistency and maintainability.This change simplifies the parameter setup by using
DefaultParams
, which is beneficial for maintaining consistency across tests and simplifying future modifications.
1234-1237
: Refactor to useDefaultParams
enhances consistency and maintainability.This change simplifies the parameter setup by using
DefaultParams
, which is beneficial for maintaining consistency across tests and simplifying future modifications.
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.
Please also add the max voting per pool parameter in the x/bundles/keeper/msg_server_update_params_test.go
test 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.
Finally, add the new pool parameter to the x/pool/spec/05_params.md spec file, else everything looks good
You mean in |
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.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- x/pool/keeper/msg_server_update_params_test.go (9 hunks)
- x/pool/spec/05_params.md (1 hunks)
Files skipped from review due to trivial changes (1)
- x/pool/spec/05_params.md
Additional comments not posted (10)
x/pool/keeper/msg_server_update_params_test.go (10)
68-68
: Ensure the default value forMaxVotingPowerPerPool
is correctly set and tested.
138-138
: Verify that theMaxVotingPowerPerPool
parameter is correctly updated when all parameters are updated at once.
173-173
: Confirm that theMaxVotingPowerPerPool
remains unchanged when no parameters are updated.
204-204
: Check that theMaxVotingPowerPerPool
remains unaffected by an invalid formatted payload.
241-241
: Ensure that updating other parameters does not inadvertently affect theMaxVotingPowerPerPool
.
272-272
: Confirm that an invalid value for another parameter does not impact theMaxVotingPowerPerPool
.
309-309
: Check that theMaxVotingPowerPerPool
remains unchanged when updating another parameter.
340-340
: Ensure that theMaxVotingPowerPerPool
remains unchanged when an invalid value for another parameter is provided.
377-377
: Validate that theMaxVotingPowerPerPool
is correctly updated to a valid value.
408-408
: Confirm that an invalid value forMaxVotingPowerPerPool
is correctly handled and does not update the parameter.
Yep you're right, all good then |
Summary by CodeRabbit
New Features
MaxVotingPowerPerPool
to manage the maximum voting power per pool.Documentation
max_voting_power_per_pool
field.Bug Fixes
ErrVotingPowerTooHigh
to reflect the new voting power limits.Refactor
Tests
MaxVotingPowerPerPool
parameter.