From 318dd806413bc78d4f3be5f870294955d4537ff0 Mon Sep 17 00:00:00 2001 From: Thomas Dinsdale-Young Date: Fri, 10 Jan 2025 11:12:13 +0100 Subject: [PATCH] Support chain parameters for P8. --- concordium-base | 2 +- src/types/mod.rs | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/concordium-base b/concordium-base index 23f2746ee..34b32efbf 160000 --- a/concordium-base +++ b/concordium-base @@ -1 +1 @@ -Subproject commit 23f2746ee611d755e8249b9c9f9a09a52f5d6c4b +Subproject commit 34b32efbf9699d4df0070f5405d703d7028703f2 diff --git a/src/types/mod.rs b/src/types/mod.rs index 77f034786..dcfacca4e 100644 --- a/src/types/mod.rs +++ b/src/types/mod.rs @@ -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, + /// 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; } @@ -2403,6 +2432,10 @@ impl ChainParametersFamily for ChainParameterVersion2 { type Output = ChainParametersV2; } +impl ChainParametersFamily for ChainParameterVersion3 { + type Output = ChainParametersV3; +} + pub type ChainParameters = ::Output; #[derive(Debug, SerdeSerialize, SerdeDeserialize)]