Skip to content
Permalink
Browse files

Merge pull request #354 from input-output-hk/kes-update-setting

Kes update setting
  • Loading branch information...
NicolasDP committed May 15, 2019
2 parents 1e8d83f + 38766c7 commit c3ef811efedb2d628bde86addf12aab7d2afc48a
@@ -59,6 +59,9 @@ blockchain_configuration:
coefficient: 1
certificate: 4

# The speed to update the KES Key in seconds
kes_update_speed: 43200 # 12hours

# The initial deposits present in the blockchain.
#
# It can be UTxO addresses or account (if allow_account_creation is set).
@@ -53,6 +53,7 @@ struct BlockchainConfiguration {
bft_slots_ratio: Option<SerdeAsString<Milli>>,
allow_account_creation: Option<bool>,
linear_fee: Option<InitialLinearFee>,
kes_update_speed: u32,
}

// FIXME: duplicates LinearFee, can we get rid of this?
@@ -272,6 +273,7 @@ impl BlockchainConfiguration {
let mut bft_slots_ratio = None;
let mut allow_account_creation = None;
let mut linear_fee = None;
let mut kes_update_speed = None;

for ent in ents.iter() {
match ent {
@@ -324,6 +326,9 @@ impl BlockchainConfiguration {
})
.map(|_| "LinearFee"),
ConfigParam::ProposalExpiration(_param) => unimplemented!(),
ConfigParam::KESUpdateSpeed(v) => {
kes_update_speed.replace(*v).map(|_| "KESUpdateSpeed")
}
}
.map(|param| panic!("Init message contains {} twice", param));
}
@@ -343,6 +348,7 @@ impl BlockchainConfiguration {
bft_slots_ratio,
allow_account_creation,
linear_fee,
kes_update_speed: kes_update_speed.expect(&format!("{}, KESUpdateSpeed", PREFIX)),
}
}

@@ -361,6 +367,7 @@ impl BlockchainConfiguration {
bft_slots_ratio,
allow_account_creation,
linear_fee,
kes_update_speed,
} = self;
let mut initial_ents = ConfigParams::new();
initial_ents.push(ConfigParam::Block0Date(Block0Date(
@@ -400,6 +407,7 @@ impl BlockchainConfiguration {
certificate: d.certificate,
}))
}
initial_ents.push(ConfigParam::KESUpdateSpeed(kes_update_speed));
initial_ents
}
}
@@ -445,6 +453,7 @@ blockchain_configuration:
coefficient: 1
constant: 2
certificate: 4
kes_update_speed: 43200
initial_funds:
- address: ta1svy0mwwm7mdwcuj308aapjw6ra4c3e6cygd0f333nvtjzxg8ahdvxlswdf0
value: 10000
@@ -32,9 +32,9 @@ pub enum Certificate {
pub enum NewArgs {
/// build a stake pool registration certificate
StakePoolRegistration(new_stake_pool_registration::StakePoolRegistration),
/// build a stake pool registration certificate
/// build a stake key registration certificate
StakeKeyRegistration(new_stake_key_registration::StakeKeyRegistration),
/// build a stake pool registration certificate
/// build a stake delegation certificate
StakeDelegation(new_stake_delegation::StakeDelegation),
}

@@ -20,6 +20,7 @@ pub struct BlockchainConfig {
pub consensus_genesis_praos_active_slot_coeff: String,
pub allow_account_creation: bool,
pub linear_fees: LinearFees,
pub kes_update_speed: u32,
}

#[derive(Debug, Serialize, Deserialize)]
@@ -105,6 +106,7 @@ impl GenesisYaml {
coefficient: 0,
certificate: 0,
},
kes_update_speed: 12 * 3600,
},
initial_funds: initial_funds,
legacy_funds: legacy_funds,

0 comments on commit c3ef811

Please sign in to comment.
You can’t perform that action at this time.