Skip to content

Conversation

@DocteurPing
Copy link
Contributor

No description provided.

@DocteurPing DocteurPing marked this pull request as ready for review January 14, 2025 06:11
@DocteurPing DocteurPing requested a review from sfffaaa January 14, 2025 06:12
@DocteurPing DocteurPing marked this pull request as draft January 14, 2025 10:01
@DocteurPing DocteurPing marked this pull request as ready for review January 15, 2025 08:01
@DocteurPing DocteurPing requested a review from sfffaaa January 17, 2025 04:52
@peaq-coolify
Copy link

peaq-coolify bot commented Jun 3, 2025

The preview deployment is ready. 🟢

Open Preview | Open Build Logs

Last updated at: 2025-06-25 09:40:31 CET

@DocteurPing DocteurPing requested a review from sfffaaa June 3, 2025 05:19
@DocteurPing DocteurPing requested a review from Copilot June 25, 2025 09:39
Copy link

Copilot AI left a 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),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants