-
Notifications
You must be signed in to change notification settings - Fork 23
add native stake to d-param #1072
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: master
Are you sure you want to change the base?
Conversation
9447854 to
775efeb
Compare
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.
We need to make the d-param and selection pallet versioned for this to be backwards compatible. Let me know if you need support with this.
| pub num_permissioned_candidates: u16, | ||
| /// The number of registered candidates | ||
| pub num_registered_candidates: u16, | ||
| /// The number of native stake validators |
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.
| /// The number of native stake validators | |
| /// The number of native stake candidates |
toolkit/sidechain/domain/src/lib.rs
Outdated
| )] | ||
| #[cfg_attr(feature = "serde", derive(Serialize))] | ||
| /// Parameter controlling the number and proportion of registered and permissioned candidates | ||
| /// Parameter controlling the number and proportion of registered, permissioned candidates and native stake validators |
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.
| /// Parameter controlling the number and proportion of registered, permissioned candidates and native stake validators | |
| /// Parameter controlling the number and proportion of registered, permissioned, and native stake candidates |
toolkit/sidechain/domain/src/lib.rs
Outdated
| pub num_permissioned_candidates: u16, | ||
| /// Expected number of registered candidates selected for a committee | ||
| pub num_registered_candidates: u16, | ||
| /// Expected number of native stake validators selected for a committee |
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.
| /// Expected number of native stake validators selected for a committee | |
| /// Expected number of native stake candidates selected for a committee |
| /// Number of registered candidates | ||
| registered_candidates_count: u16, | ||
| #[arg(long)] | ||
| /// Number of native stake validators |
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.
| /// Number of native stake validators | |
| /// Number of native stake candidates |
| impl From<DParamDatum> for sidechain_domain::DParameter { | ||
| fn from(datum: DParamDatum) -> Self { | ||
| match datum { | ||
| DParamDatum::V0 { num_permissioned_candidates, num_registered_candidates } => { | ||
| Self { num_permissioned_candidates, num_registered_candidates } | ||
| DParamDatum::V0 { num_permissioned_candidates, num_registered_candidates } => Self { | ||
| num_permissioned_candidates, | ||
| num_registered_candidates, | ||
| num_native_stake_candidates: 0, | ||
| }, | ||
| DParamDatum::V1 { | ||
| num_permissioned_candidates, | ||
| num_registered_candidates, | ||
| num_native_stake_candidates, | ||
| } => Self { | ||
| num_permissioned_candidates, | ||
| num_registered_candidates, | ||
| num_native_stake_candidates, |
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.
Have you tested upgrading a chain to this version? I'm pretty sure this will break existing chains that use the current 2-value d-param. We need to introduce DParameterV2, bump the selection pallet's version, and modify the Ariadne IDP to be version-aware so it knows what schema of inputs it should provide to the pallet.
775efeb to
ba9b7aa
Compare
ba9b7aa to
ad992c8
Compare
Description
Adds third value to D-Param feature. Now it supports native stake (mNIGHT) validators to take part in the consensus.
link
Checklist
changelog.mdfor affected crate