Bake in Altona (without genesis state) (#1295)
* Bake in Altona testnet (without genesis state) * Update config.yml * Fix eth2_testnet_config test * Update min genesis time
This commit is contained in:
parent
825aca0ef3
commit
69e15af0b2
1
common/eth2_testnet_config/.gitignore
vendored
1
common/eth2_testnet_config/.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
testnet*
|
testnet*
|
||||||
schlesi-*
|
schlesi-*
|
||||||
witti-*
|
witti-*
|
||||||
|
altona
|
||||||
|
@ -6,7 +6,7 @@ use std::fs::File;
|
|||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
const TESTNET_ID: &str = "witti-v0-11-3";
|
const TESTNET_ID: &str = "altona";
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
if !base_dir().exists() {
|
if !base_dir().exists() {
|
||||||
@ -31,14 +31,16 @@ pub fn get_all_files() -> Result<(), String> {
|
|||||||
get_file("config.yaml")?;
|
get_file("config.yaml")?;
|
||||||
get_file("deploy_block.txt")?;
|
get_file("deploy_block.txt")?;
|
||||||
get_file("deposit_contract.txt")?;
|
get_file("deposit_contract.txt")?;
|
||||||
get_file("genesis.ssz")?;
|
// TODO: add once we know the genesis state for Altona.
|
||||||
|
//
|
||||||
|
// get_file("genesis.ssz")?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_file(filename: &str) -> Result<(), String> {
|
pub fn get_file(filename: &str) -> Result<(), String> {
|
||||||
let url = format!(
|
let url = format!(
|
||||||
"https://raw.githubusercontent.com/sigp/witti/6d079b0f10f6bed75cd003e5f0ea5ecbe2044455/lighthouse/{}",
|
"https://raw.githubusercontent.com/sigp/witti/ff9ff43ba4f15fe50838d832daabd284ab1124df/altona/lighthouse/{}",
|
||||||
filename
|
filename
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -23,14 +23,15 @@ pub const YAML_CONFIG_FILE: &str = "config.yaml";
|
|||||||
/// The name of the testnet to hardcode.
|
/// The name of the testnet to hardcode.
|
||||||
///
|
///
|
||||||
/// Should be set to `None` when no existing testnet is compatible with the codebase.
|
/// Should be set to `None` when no existing testnet is compatible with the codebase.
|
||||||
pub const HARDCODED_TESTNET: Option<&str> = None;
|
pub const HARDCODED_TESTNET: Option<&str> = Some("altona");
|
||||||
|
|
||||||
pub const HARDCODED_YAML_CONFIG: &[u8] = include_bytes!("../witti-v0-11-3/config.yaml");
|
pub const HARDCODED_YAML_CONFIG: &[u8] = include_bytes!("../altona/config.yaml");
|
||||||
pub const HARDCODED_DEPLOY_BLOCK: &[u8] = include_bytes!("../witti-v0-11-3/deploy_block.txt");
|
pub const HARDCODED_DEPLOY_BLOCK: &[u8] = include_bytes!("../altona/deploy_block.txt");
|
||||||
pub const HARDCODED_DEPOSIT_CONTRACT: &[u8] =
|
pub const HARDCODED_DEPOSIT_CONTRACT: &[u8] = include_bytes!("../altona/deposit_contract.txt");
|
||||||
include_bytes!("../witti-v0-11-3/deposit_contract.txt");
|
// TODO: add once we know the genesis state for Altona.
|
||||||
pub const HARDCODED_GENESIS_STATE: &[u8] = include_bytes!("../witti-v0-11-3/genesis.ssz");
|
//
|
||||||
pub const HARDCODED_BOOT_ENR: &[u8] = include_bytes!("../witti-v0-11-3/boot_enr.yaml");
|
// pub const HARDCODED_GENESIS_STATE: &[u8] = include_bytes!("../altona/genesis.ssz");
|
||||||
|
pub const HARDCODED_BOOT_ENR: &[u8] = include_bytes!("../altona/boot_enr.yaml");
|
||||||
|
|
||||||
/// Specifies an Eth2 testnet.
|
/// Specifies an Eth2 testnet.
|
||||||
///
|
///
|
||||||
@ -61,10 +62,15 @@ impl<E: EthSpec> Eth2TestnetConfig<E> {
|
|||||||
serde_yaml::from_reader(HARDCODED_BOOT_ENR)
|
serde_yaml::from_reader(HARDCODED_BOOT_ENR)
|
||||||
.map_err(|e| format!("Unable to parse boot enr: {:?}", e))?,
|
.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(
|
genesis_state: Some(
|
||||||
BeaconState::from_ssz_bytes(HARDCODED_GENESIS_STATE)
|
BeaconState::from_ssz_bytes(HARDCODED_GENESIS_STATE)
|
||||||
.map_err(|e| format!("Unable to parse genesis state: {:?}", e))?,
|
.map_err(|e| format!("Unable to parse genesis state: {:?}", e))?,
|
||||||
),
|
),
|
||||||
|
*/
|
||||||
yaml_config: Some(
|
yaml_config: Some(
|
||||||
serde_yaml::from_reader(HARDCODED_YAML_CONFIG)
|
serde_yaml::from_reader(HARDCODED_YAML_CONFIG)
|
||||||
.map_err(|e| format!("Unable to parse genesis state: {:?}", e))?,
|
.map_err(|e| format!("Unable to parse genesis state: {:?}", e))?,
|
||||||
@ -221,7 +227,9 @@ mod tests {
|
|||||||
Eth2TestnetConfig::<E>::hard_coded().expect("should decode hard_coded params")
|
Eth2TestnetConfig::<E>::hard_coded().expect("should decode hard_coded params")
|
||||||
{
|
{
|
||||||
assert!(dir.boot_enr.is_some());
|
assert!(dir.boot_enr.is_some());
|
||||||
assert!(dir.genesis_state.is_some());
|
// TODO: add once we know the genesis state for Altona.
|
||||||
|
//
|
||||||
|
// assert!(dir.genesis_state.is_some());
|
||||||
assert!(dir.yaml_config.is_some());
|
assert!(dir.yaml_config.is_some());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ EPOCHS_PER_SLASHINGS_VECTOR: 8192
|
|||||||
HISTORICAL_ROOTS_LIMIT: 16777216
|
HISTORICAL_ROOTS_LIMIT: 16777216
|
||||||
VALIDATOR_REGISTRY_LIMIT: 1099511627776
|
VALIDATOR_REGISTRY_LIMIT: 1099511627776
|
||||||
MAX_PROPOSER_SLASHINGS: 16
|
MAX_PROPOSER_SLASHINGS: 16
|
||||||
MAX_ATTESTER_SLASHINGS: 1
|
MAX_ATTESTER_SLASHINGS: 2
|
||||||
MAX_ATTESTATIONS: 128
|
MAX_ATTESTATIONS: 128
|
||||||
MAX_DEPOSITS: 16
|
MAX_DEPOSITS: 16
|
||||||
MAX_VOLUNTARY_EXITS: 16
|
MAX_VOLUNTARY_EXITS: 16
|
||||||
@ -53,4 +53,4 @@ ETH1_FOLLOW_DISTANCE: 16
|
|||||||
TARGET_AGGREGATORS_PER_COMMITTEE: 0
|
TARGET_AGGREGATORS_PER_COMMITTEE: 0
|
||||||
RANDOM_SUBNETS_PER_VALIDATOR: 0
|
RANDOM_SUBNETS_PER_VALIDATOR: 0
|
||||||
EPOCHS_PER_RANDOM_SUBNET_SUBSCRIPTION: 0
|
EPOCHS_PER_RANDOM_SUBNET_SUBSCRIPTION: 0
|
||||||
SECONDS_PER_ETH1_BLOCK: 14
|
SECONDS_PER_ETH1_BLOCK: 14
|
||||||
|
Loading…
Reference in New Issue
Block a user