Skip to content
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

Adds BlockNumberProvider in alliance, collective and identity pallets #6282

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

gupnik
Copy link
Contributor

@gupnik gupnik commented Oct 30, 2024

Step in #3268

Similar to #5723, This PR adds the ability for these pallets to specify their source of the block number. This is useful when these pallets are migrated from the relay chain to a parachain and vice versa.

This change is backwards compatible:

  1. If the BlockNumberProvider continues to use the system pallet's block number
  2. When a pallet deployed on the relay chain is moved to a parachain, but still uses the relay chain's block number

However, we would need migrations if the deployed pallets are upgraded on an existing parachain, and the BlockNumberProvider uses the relay chain block number.

@gupnik gupnik added the T1-FRAME This PR/Issue is related to core FRAME, the framework. label Oct 30, 2024
@gupnik gupnik requested a review from a team as a code owner October 30, 2024 04:31
@@ -308,6 +308,9 @@ pub mod pallet {
/// The number of blocks a member must wait between giving a retirement notice and retiring.
/// Supposed to be greater than time required to `kick_member`.
type RetirementPeriod: Get<BlockNumberFor<Self>>;

/// Provider for the block number. Normally this is the `frame_system` pallet.
type BlockNumberProvider: BlockNumberProvider<BlockNumber = BlockNumberFor<Self>>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as some other PR. I think this is fixing the BlockNumber to be the system block number. But there is no need for this.

The block number could be the one of the relay chain, in which case it doesn't need to be = BlockNumberFor<Self>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T1-FRAME This PR/Issue is related to core FRAME, the framework.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants