-
Notifications
You must be signed in to change notification settings - Fork 45
Add delay and maximum change rate for commission #327
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
base: dev
Are you sure you want to change the base?
Conversation
…udo user able to change it
…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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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),
No description provided.