Skip to content

Commit

Permalink
Merge pull request #221 from Concordium/genesis-tool-changes
Browse files Browse the repository at this point in the history
Support chain parameters for P8.
  • Loading branch information
td202 authored Jan 15, 2025
2 parents 61678e6 + 318dd80 commit d338c86
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
33 changes: 33 additions & 0 deletions src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2387,6 +2387,35 @@ pub struct ChainParametersV2 {
pub finalization_committee_parameters: FinalizationCommitteeParameters,
}

#[derive(common::Serialize, Debug)]
/// Values of chain parameters that can be updated via chain updates.
pub struct ChainParametersV3 {
/// Consensus protocol version 2 timeout parameters.
pub timeout_parameters: TimeoutParameters,
/// Minimum time interval between blocks.
pub min_block_time: Duration,
/// Maximum energy allowed per block.
pub block_energy_limit: Energy,
/// Euro per energy exchange rate.
pub euro_per_energy: ExchangeRate,
/// Micro ccd per euro exchange rate.
pub micro_ccd_per_euro: ExchangeRate,
pub cooldown_parameters: CooldownParameters,
pub time_parameters: TimeParameters,
/// The limit for the number of account creations in a block.
pub account_creation_limit: CredentialsPerBlockLimit,
/// Current reward parameters.
pub reward_parameters: RewardParameters<ChainParameterVersion2>,
/// Index of the foundation account.
pub foundation_account_index: AccountIndex,
/// Parameters for baker pools.
pub pool_parameters: PoolParameters,
/// The finalization committee parameters.
pub finalization_committee_parameters: FinalizationCommitteeParameters,
/// Parameter for determining when a validator is considered inactive.
pub validator_score_parameters: ValidatorScoreParameters,
}

pub trait ChainParametersFamily {
type Output: std::fmt::Debug;
}
Expand All @@ -2403,6 +2432,10 @@ impl ChainParametersFamily for ChainParameterVersion2 {
type Output = ChainParametersV2;
}

impl ChainParametersFamily for ChainParameterVersion3 {
type Output = ChainParametersV3;
}

pub type ChainParameters<CPV> = <CPV as ChainParametersFamily>::Output;

#[derive(Debug, SerdeSerialize, SerdeDeserialize)]
Expand Down

0 comments on commit d338c86

Please sign in to comment.