diff --git a/beacon_node/src/config.rs b/beacon_node/src/config.rs index 6b700259f..6b9490a29 100644 --- a/beacon_node/src/config.rs +++ b/beacon_node/src/config.rs @@ -357,6 +357,13 @@ fn init_new_client( let spec = &mut eth2_config.spec; + // For now, assume that all networks will use the lighthouse genesis fork. + spec.genesis_fork = Fork { + previous_version: [0, 0, 0, 0], + current_version: [1, 3, 3, 7], + epoch: Epoch::new(0), + }; + client_config.eth1.deposit_contract_address = format!("{:?}", eth2_testnet_config.deposit_contract_address()?); client_config.eth1.deposit_contract_deploy_block = diff --git a/lcli/src/deploy_deposit_contract.rs b/lcli/src/deploy_deposit_contract.rs index 7ae0b3362..f40849c35 100644 --- a/lcli/src/deploy_deposit_contract.rs +++ b/lcli/src/deploy_deposit_contract.rs @@ -5,7 +5,7 @@ use eth2_testnet_config::Eth2TestnetConfig; use std::fs::File; use std::io::Read; use std::path::PathBuf; -use types::{ChainSpec, EthSpec, YamlConfig}; +use types::{ChainSpec, Epoch, EthSpec, Fork, YamlConfig}; use web3::{transports::Http, Web3}; pub const SECONDS_PER_ETH1_BLOCK: u64 = 15; @@ -130,6 +130,12 @@ pub fn lighthouse_testnet_spec(mut spec: ChainSpec) -> ChainSpec { // With a follow distance of 16, this is 40mins. spec.seconds_per_day = SECONDS_PER_ETH1_BLOCK * spec.eth1_follow_distance * 2 * 5; + spec.genesis_fork = Fork { + previous_version: [0, 0, 0, 0], + current_version: [1, 3, 3, 7], + epoch: Epoch::new(0), + }; + spec } diff --git a/lcli/src/eth1_genesis.rs b/lcli/src/eth1_genesis.rs index 4b06d2c11..576843ced 100644 --- a/lcli/src/eth1_genesis.rs +++ b/lcli/src/eth1_genesis.rs @@ -5,7 +5,7 @@ use futures::Future; use genesis::{Eth1Config, Eth1GenesisService}; use std::path::PathBuf; use std::time::Duration; -use types::EthSpec; +use types::{Epoch, EthSpec, Fork}; /// Interval between polling the eth1 node for genesis information. pub const ETH1_GENESIS_UPDATE_INTERVAL: Duration = Duration::from_millis(7_000); @@ -28,7 +28,7 @@ pub fn run(mut env: Environment, matches: &ArgMatches) -> Result< let mut eth2_testnet_config: Eth2TestnetConfig = Eth2TestnetConfig::load(testnet_dir.clone())?; - let spec = eth2_testnet_config + let mut spec = eth2_testnet_config .yaml_config .as_ref() .ok_or_else(|| "The testnet directory must contain a spec config".to_string())? @@ -40,6 +40,12 @@ pub fn run(mut env: Environment, matches: &ArgMatches) -> Result< ) })?; + spec.genesis_fork = Fork { + previous_version: [0, 0, 0, 0], + current_version: [1, 3, 3, 7], + epoch: Epoch::new(0), + }; + let mut config = Eth1Config::default(); config.endpoint = endpoint.to_string(); config.deposit_contract_address = eth2_testnet_config.deposit_contract_address.clone();