diff --git a/common/eth2_testnet_config/.gitignore b/common/eth2_testnet_config/.gitignore index e7c8e1add..e3b2b30d1 100644 --- a/common/eth2_testnet_config/.gitignore +++ b/common/eth2_testnet_config/.gitignore @@ -1,4 +1,4 @@ testnet* schlesi-* witti-* -altona +altona* diff --git a/common/eth2_testnet_config/build.rs b/common/eth2_testnet_config/build.rs index 91ab57960..3d4902393 100644 --- a/common/eth2_testnet_config/build.rs +++ b/common/eth2_testnet_config/build.rs @@ -6,7 +6,7 @@ use std::fs::File; use std::io::Write; use std::path::PathBuf; -const TESTNET_ID: &str = "altona"; +const TESTNET_ID: &str = "altona-v2"; fn main() { if !base_dir().exists() { @@ -32,16 +32,14 @@ pub fn get_all_files() -> Result<(), String> { get_file("config.yaml")?; get_file("deploy_block.txt")?; get_file("deposit_contract.txt")?; - // TODO: add once we know the genesis state for Altona. - // - // get_file("genesis.ssz")?; + get_file("genesis.ssz")?; Ok(()) } pub fn get_file(filename: &str) -> Result<(), String> { let url = format!( - "https://raw.githubusercontent.com/sigp/witti/a48ea2d68a87db93aa7fd482461418496ed4347d/altona/lighthouse/{}", + "https://raw.githubusercontent.com/sigp/witti/2bab01c2c18aea9f571e79d646acfd34704cbfde/altona/lighthouse/{}", filename ); diff --git a/common/eth2_testnet_config/src/lib.rs b/common/eth2_testnet_config/src/lib.rs index bbbb227eb..95d1379e1 100644 --- a/common/eth2_testnet_config/src/lib.rs +++ b/common/eth2_testnet_config/src/lib.rs @@ -23,15 +23,13 @@ pub const YAML_CONFIG_FILE: &str = "config.yaml"; /// The name of the testnet to hardcode. /// /// Should be set to `None` when no existing testnet is compatible with the codebase. -pub const HARDCODED_TESTNET: Option<&str> = Some("altona"); +pub const HARDCODED_TESTNET: Option<&str> = Some("altona-v2"); -pub const HARDCODED_YAML_CONFIG: &[u8] = include_bytes!("../altona/config.yaml"); -pub const HARDCODED_DEPLOY_BLOCK: &[u8] = include_bytes!("../altona/deploy_block.txt"); -pub const HARDCODED_DEPOSIT_CONTRACT: &[u8] = include_bytes!("../altona/deposit_contract.txt"); -// TODO: add once we know the genesis state for Altona. -// -// pub const HARDCODED_GENESIS_STATE: &[u8] = include_bytes!("../altona/genesis.ssz"); -pub const HARDCODED_BOOT_ENR: &[u8] = include_bytes!("../altona/boot_enr.yaml"); +pub const HARDCODED_YAML_CONFIG: &[u8] = include_bytes!("../altona-v2/config.yaml"); +pub const HARDCODED_DEPLOY_BLOCK: &[u8] = include_bytes!("../altona-v2/deploy_block.txt"); +pub const HARDCODED_DEPOSIT_CONTRACT: &[u8] = include_bytes!("../altona-v2/deposit_contract.txt"); +pub const HARDCODED_GENESIS_STATE: &[u8] = include_bytes!("../altona-v2/genesis.ssz"); +pub const HARDCODED_BOOT_ENR: &[u8] = include_bytes!("../altona-v2/boot_enr.yaml"); /// Specifies an Eth2 testnet. /// @@ -62,15 +60,10 @@ impl Eth2TestnetConfig { serde_yaml::from_reader(HARDCODED_BOOT_ENR) .map_err(|e| format!("Unable to parse boot enr: {:?}", e))?, ), - genesis_state: None, - /* - * TODO: add once we know the genesis state for Altona. - * genesis_state: Some( BeaconState::from_ssz_bytes(HARDCODED_GENESIS_STATE) .map_err(|e| format!("Unable to parse genesis state: {:?}", e))?, ), - */ yaml_config: Some( serde_yaml::from_reader(HARDCODED_YAML_CONFIG) .map_err(|e| format!("Unable to parse genesis state: {:?}", e))?, @@ -227,9 +220,7 @@ mod tests { Eth2TestnetConfig::::hard_coded().expect("should decode hard_coded params") { assert!(dir.boot_enr.is_some()); - // TODO: add once we know the genesis state for Altona. - // - // assert!(dir.genesis_state.is_some()); + assert!(dir.genesis_state.is_some()); assert!(dir.yaml_config.is_some()); } }