mirror of
https://gitlab.com/pulsechaincom/lighthouse-pulse.git
synced 2024-12-25 13:07:18 +00:00
Change genesis fork for testnets (#750)
* Change genesis fork for testnets * Fix genesis fork in lcli
This commit is contained in:
parent
2dddbed7ce
commit
b0c8b2b700
@ -357,6 +357,13 @@ fn init_new_client<E: EthSpec>(
|
||||
|
||||
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 =
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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<T: EthSpec>(mut env: Environment<T>, matches: &ArgMatches) -> Result<
|
||||
let mut eth2_testnet_config: Eth2TestnetConfig<T> =
|
||||
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<T: EthSpec>(mut env: Environment<T>, 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();
|
||||
|
Loading…
Reference in New Issue
Block a user