Skip to content

Conversation

@jankun4
Copy link
Contributor

@jankun4 jankun4 commented Oct 28, 2025

Description

Adds third value to D-Param feature. Now it supports native stake (mNIGHT) validators to take part in the consensus.
link

Checklist

  • Commit sequence broadly makes sense and commits have useful messages.
  • The size limit of 400 LOC isn't needlessly exceeded
  • The PR refers to a JIRA ticket (if one exists)
  • New tests are added if needed and existing tests are updated.
  • New code is documented and existing documentation is updated.
  • Relevant logging and metrics added
  • Any changes are noted in the changelog.md for affected crate
  • Self-reviewed the diff

@jankun4 jankun4 force-pushed the native-stake-d-param branch 6 times, most recently from 9447854 to 775efeb Compare October 29, 2025 13:22
Copy link
Contributor

@AmbientTea AmbientTea left a 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.

Comment on lines 54 to +70
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,
Copy link
Contributor

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.

@jankun4 jankun4 force-pushed the native-stake-d-param branch 4 times, most recently from 4cc909e to f1e27f1 Compare November 5, 2025 12:18
@jankun4 jankun4 force-pushed the native-stake-d-param branch from f1e27f1 to b8eccce Compare December 2, 2025 22:23
@jankun4 jankun4 force-pushed the native-stake-d-param branch from b8eccce to c4b069f Compare December 22, 2025 12:49
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