Add delay and maximum change rate for commission#327
Open
DocteurPing wants to merge 16 commits intodevfrom
Open
Add delay and maximum change rate for commission#327DocteurPing wants to merge 16 commits intodevfrom
DocteurPing wants to merge 16 commits intodevfrom
Conversation
sfffaaa
reviewed
Jan 15, 2025
…udo user able to change it
sfffaaa
approved these changes
May 30, 2025
…ission change from a sudo account
|
The preview deployment is ready. 🟢 Open Preview | Open Build Logs Last updated at: 2025-06-25 09:40:31 CET |
There was a problem hiding this comment.
Pull Request Overview
This PR adds functionality to limit how frequently and by how much a collator can update their commission rate.
- Introduces new storage items and genesis configuration fields: max_commission_change and min_commission_change_interval.
- Adds weight functions and dispatchable calls to update these parameters.
- Updates chain specifications, migration code, and tests to support commission change rate limitations.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| precompiles/parachain-staking/src/mock.rs | Updates genesis config with max_commission_change and interval. |
| pallets/parachain-staking/src/weights.rs | Adds weight functions for new commission change settings. |
| pallets/parachain-staking/src/weightinfo.rs | Extends trait with new weight functions. |
| pallets/parachain-staking/src/tests.rs | Adds tests for commission change timing and limits. |
| pallets/parachain-staking/src/mock.rs | Updates genesis config for the staking pallet with new parameters. |
| pallets/parachain-staking/src/migrations.rs | Migrates storage and initializes new commission change settings. |
| pallets/parachain-staking/src/lib.rs | Introduces new errors, events, and dispatchable calls for commission settings. |
| node/src/parachain/peaq_chain_spec.rs | Updates chain spec to include the new commission change settings. |
| node/src/parachain/krest_chain_spec.rs | Updates chain spec to include the new commission change settings. |
| node/src/parachain/dev_chain_spec.rs | Updates genesis configuration for the staking module with new fields. |
Comments suppressed due to low confidence (2)
pallets/parachain-staking/src/lib.rs:2027
- Consider adding a validation to ensure that the new commission value does not exceed 100% overall. Currently, only the magnitude of the change is checked, which might allow the commission to go beyond the intended maximum.
ensure!(change <= max_change, Error::<T>::CommissionChangeTooHigh);
pallets/parachain-staking/src/mock.rs:285
- Verify that the maximum commission change value is consistent across all genesis configurations. While some modules use 100% as the default, this mock configuration uses 10%, which could lead to inconsistencies.
max_commission_change: Permill::from_percent(10),
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.