Add scheduler config to genesis

Anything that affects how the ledger is interpreted needs to be
in the genesis block or someplace on the ledger before later
parts of the ledger are interpreted. We currently don't have an
on-chain program for cluster parameters, so that leaves only
the genesis block option.
This commit is contained in:
Greg Fitzgerald
2019-02-21 17:01:10 -07:00
committed by Grimes
parent 3e8d96a95b
commit f0f55af35b
4 changed files with 30 additions and 39 deletions

View File

@ -3,6 +3,7 @@
use crate::hash::{hash, Hash};
use crate::pubkey::Pubkey;
use crate::signature::{Keypair, KeypairUtil};
use crate::timing::{DEFAULT_SLOTS_PER_EPOCH, DEFAULT_TICKS_PER_SLOT};
use std::fs::File;
use std::io::Write;
use std::path::Path;
@ -19,6 +20,9 @@ pub struct GenesisBlock {
pub bootstrap_leader_vote_account_id: Pubkey,
pub mint_id: Pubkey,
pub tokens: u64,
pub ticks_per_slot: u64,
pub slots_per_epoch: u64,
pub leader_schedule_slot_offset: u64,
}
impl GenesisBlock {
@ -44,6 +48,9 @@ impl GenesisBlock {
bootstrap_leader_vote_account_id: bootstrap_leader_vote_account_keypair.pubkey(),
mint_id: mint_keypair.pubkey(),
tokens,
ticks_per_slot: DEFAULT_TICKS_PER_SLOT,
slots_per_epoch: DEFAULT_SLOTS_PER_EPOCH,
leader_schedule_slot_offset: DEFAULT_SLOTS_PER_EPOCH,
},
mint_keypair,
)