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

Rust support for new chain parameters version. #589

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions rust-src/concordium_base/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ impl Deserial for ProtocolVersion {
pub struct ChainParameterVersion0;
pub struct ChainParameterVersion1;
pub struct ChainParameterVersion2;
pub struct ChainParameterVersion3;

/// Height of a block since chain genesis.
#[repr(transparent)]
Expand Down Expand Up @@ -1204,6 +1205,10 @@ impl MintDistributionFamily for ChainParameterVersion2 {
type Output = MintDistributionV1;
}

impl MintDistributionFamily for ChainParameterVersion3 {
type Output = MintDistributionV1;
}

/// Type family mapping a `ChainParameterVersion` to its corresponding type for
/// the `MintDistribution`.
pub type MintDistribution<CPV> = <CPV as MintDistributionFamily>::Output;
Expand All @@ -1225,6 +1230,10 @@ impl GASRewardsFamily for ChainParameterVersion2 {
type Output = GASRewardsV1;
}

impl GASRewardsFamily for ChainParameterVersion3 {
type Output = GASRewardsV1;
}

/// Type family mapping a `ChainParameterVersion` to its corresponding type for
/// the `GasRewards`.
pub type GASRewardsFor<CPV> = <CPV as GASRewardsFamily>::Output;
Expand Down
5 changes: 5 additions & 0 deletions rust-src/concordium_base/src/updates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,10 @@ impl AuthorizationsFamily for ChainParameterVersion2 {
type Output = AuthorizationsV1;
}

impl AuthorizationsFamily for ChainParameterVersion3 {
type Output = AuthorizationsV1;
}

/// A mapping of chain parameter versions to authorization versions.
pub type Authorizations<CPV> = <CPV as AuthorizationsFamily>::Output;

Expand Down Expand Up @@ -628,6 +632,7 @@ pub struct FinalizationCommitteeParameters {
}

#[derive(Debug, common::Serialize, Clone, Copy, SerdeSerialize, SerdeDeserialize)]
#[serde(rename_all = "camelCase")]
/// Validator score parameters. These parameters control the threshold of
/// maximal missed rounds before a validator gets suspended.
pub struct ValidatorScoreParameters {
Expand Down
Loading