From 39bf05e3e50a17e6c233326a0d4f70336844787e Mon Sep 17 00:00:00 2001 From: Michael Sproul Date: Thu, 11 Jun 2020 10:07:10 +1000 Subject: [PATCH] Update v0.12.0 to v0.12.1 (#1259) --- beacon_node/genesis/src/eth1_genesis_service.rs | 4 ++-- book/src/http/spec.md | 4 ++-- consensus/state_processing/src/genesis.rs | 4 +--- consensus/types/src/chain_spec.rs | 12 ++++++------ lcli/src/main.rs | 4 ++-- lcli/src/new_testnet.rs | 2 +- .../environment/tests/minimal_spec/eth2-spec.toml | 2 +- lighthouse/environment/tests/testnet_dir/config.yaml | 2 +- testing/ef_tests/Makefile | 3 +-- testing/simulator/src/eth1_sim.rs | 2 +- testing/simulator/src/no_eth1_sim.rs | 2 +- testing/simulator/src/sync_sim.rs | 2 +- 12 files changed, 20 insertions(+), 23 deletions(-) diff --git a/beacon_node/genesis/src/eth1_genesis_service.rs b/beacon_node/genesis/src/eth1_genesis_service.rs index b86559909..9e874d8b6 100644 --- a/beacon_node/genesis/src/eth1_genesis_service.rs +++ b/beacon_node/genesis/src/eth1_genesis_service.rs @@ -213,7 +213,7 @@ impl Eth1GenesisService { info!( log, "Waiting for adequate eth1 timestamp"; - "ming_genesis_delay" => spec.min_genesis_delay, + "genesis_delay" => spec.genesis_delay, "genesis_time" => spec.min_genesis_time, "latest_eth1_timestamp" => latest_timestamp, ); @@ -279,7 +279,7 @@ impl Eth1GenesisService { trace!( log, "Insufficient block timestamp"; - "min_genesis_delay" => spec.min_genesis_delay, + "genesis_delay" => spec.genesis_delay, "min_genesis_time" => spec.min_genesis_time, "eth1_block_timestamp" => block.timestamp, "eth1_block_number" => block.number, diff --git a/book/src/http/spec.md b/book/src/http/spec.md index 3f222c960..619a1d4e3 100644 --- a/book/src/http/spec.md +++ b/book/src/http/spec.md @@ -44,7 +44,7 @@ Typical Responses | 200 "effective_balance_increment": 1000000000, "genesis_fork_version": "0x00000000", "bls_withdrawal_prefix_byte": "0x00", - "min_genesis_delay": 86400, + "genesis_delay": 172800, "milliseconds_per_slot": 12000, "min_attestation_inclusion_delay": 1, "min_seed_lookahead": 1, @@ -106,7 +106,7 @@ Typical Responses | 200 "effective_balance_increment": 1000000000, "genesis_fork_version": "0x00000000", "bls_withdrawal_prefix_byte": "0x00", - "min_genesis_delay": 86400, + "genesis_delay": 172800, "milliseconds_per_slot": 12000, "min_attestation_inclusion_delay": 1, "min_seed_lookahead": 1, diff --git a/consensus/state_processing/src/genesis.rs b/consensus/state_processing/src/genesis.rs index d219b9090..ba3373442 100644 --- a/consensus/state_processing/src/genesis.rs +++ b/consensus/state_processing/src/genesis.rs @@ -84,7 +84,5 @@ pub fn process_activations( /// /// Spec v0.11.1 pub fn eth2_genesis_time(eth1_timestamp: u64, spec: &ChainSpec) -> Result { - eth1_timestamp - .safe_sub(eth1_timestamp.safe_rem(spec.min_genesis_delay)?)? - .safe_add(2.safe_mul(spec.min_genesis_delay)?) + eth1_timestamp.safe_add(spec.genesis_delay) } diff --git a/consensus/types/src/chain_spec.rs b/consensus/types/src/chain_spec.rs index 0075d3bdd..23237bb56 100644 --- a/consensus/types/src/chain_spec.rs +++ b/consensus/types/src/chain_spec.rs @@ -75,7 +75,7 @@ pub struct ChainSpec { /* * Time parameters */ - pub min_genesis_delay: u64, + pub genesis_delay: u64, pub milliseconds_per_slot: u64, pub min_attestation_inclusion_delay: u64, pub min_seed_lookahead: Epoch, @@ -285,7 +285,7 @@ impl ChainSpec { /* * Time parameters */ - min_genesis_delay: 86400, // 1 day + genesis_delay: 172800, // 2 days milliseconds_per_slot: 12_000, min_attestation_inclusion_delay: 1, min_seed_lookahead: Epoch::new(1), @@ -354,7 +354,7 @@ impl ChainSpec { eth1_follow_distance: 16, genesis_fork_version: [0x00, 0x00, 0x00, 0x01], shard_committee_period: 64, - min_genesis_delay: 300, + genesis_delay: 300, milliseconds_per_slot: 6_000, safe_slots_to_update_justified: 2, network_id: 2, // lighthouse testnet network id @@ -459,7 +459,7 @@ pub struct YamlConfig { shuffle_round_count: u8, min_genesis_active_validator_count: u64, min_genesis_time: u64, - min_genesis_delay: u64, + genesis_delay: u64, min_deposit_amount: u64, max_effective_balance: u64, ejection_balance: u64, @@ -576,7 +576,7 @@ impl YamlConfig { shuffle_round_count: spec.shuffle_round_count, min_genesis_active_validator_count: spec.min_genesis_active_validator_count, min_genesis_time: spec.min_genesis_time, - min_genesis_delay: spec.min_genesis_delay, + genesis_delay: spec.genesis_delay, min_deposit_amount: spec.min_deposit_amount, max_effective_balance: spec.max_effective_balance, ejection_balance: spec.ejection_balance, @@ -674,7 +674,7 @@ impl YamlConfig { min_genesis_active_validator_count: self.min_genesis_active_validator_count, min_genesis_time: self.min_genesis_time, min_deposit_amount: self.min_deposit_amount, - min_genesis_delay: self.min_genesis_delay, + genesis_delay: self.genesis_delay, max_effective_balance: self.max_effective_balance, hysteresis_quotient: self.hysteresis_quotient, hysteresis_downward_multiplier: self.hysteresis_downward_multiplier, diff --git a/lcli/src/main.rs b/lcli/src/main.rs index 4a72e10e4..3a396a20a 100644 --- a/lcli/src/main.rs +++ b/lcli/src/main.rs @@ -313,8 +313,8 @@ fn main() { .help("The number of validators required to trigger eth2 genesis."), ) .arg( - Arg::with_name("min-genesis-delay") - .long("min-genesis-delay") + Arg::with_name("genesis-delay") + .long("genesis-delay") .value_name("SECONDS") .takes_value(true) .help("The delay between sufficient eth1 deposits and eth2 genesis."), diff --git a/lcli/src/new_testnet.rs b/lcli/src/new_testnet.rs index 674080af7..a3d1e2d22 100644 --- a/lcli/src/new_testnet.rs +++ b/lcli/src/new_testnet.rs @@ -47,7 +47,7 @@ pub fn run(matches: &ArgMatches) -> Result<(), String> { maybe_update!("effective-balance-increment", effective_balance_increment); maybe_update!("ejection-balance", ejection_balance); maybe_update!("eth1-follow-distance", eth1_follow_distance); - maybe_update!("min-genesis-delay", min_genesis_delay); + maybe_update!("genesis-delay", genesis_delay); if let Some(v) = parse_ssz_optional(matches, "genesis-fork-version")? { spec.genesis_fork_version = v; diff --git a/lighthouse/environment/tests/minimal_spec/eth2-spec.toml b/lighthouse/environment/tests/minimal_spec/eth2-spec.toml index 3ef104612..f8e401901 100644 --- a/lighthouse/environment/tests/minimal_spec/eth2-spec.toml +++ b/lighthouse/environment/tests/minimal_spec/eth2-spec.toml @@ -17,7 +17,7 @@ ejection_balance = 16000000000 effective_balance_increment = 1000000000 genesis_fork_version = "0x00000000" bls_withdrawal_prefix_byte = "0x00" -min_genesis_delay = 86400 +genesis_delay = 300 milliseconds_per_slot = 12000 min_attestation_inclusion_delay = 1 min_seed_lookahead = 1 diff --git a/lighthouse/environment/tests/testnet_dir/config.yaml b/lighthouse/environment/tests/testnet_dir/config.yaml index 9e004661b..f0b3d35af 100644 --- a/lighthouse/environment/tests/testnet_dir/config.yaml +++ b/lighthouse/environment/tests/testnet_dir/config.yaml @@ -8,7 +8,7 @@ CHURN_LIMIT_QUOTIENT: 65536 SHUFFLE_ROUND_COUNT: 90 MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: 4096 MIN_GENESIS_TIME: 0 -MIN_GENESIS_DELAY: 3600 +GENESIS_DELAY: 3600 MIN_DEPOSIT_AMOUNT: 10000000 MAX_EFFECTIVE_BALANCE: 3200000000 EJECTION_BALANCE: 1600000000 diff --git a/testing/ef_tests/Makefile b/testing/ef_tests/Makefile index 562cc886e..0b9752b60 100644 --- a/testing/ef_tests/Makefile +++ b/testing/ef_tests/Makefile @@ -1,5 +1,4 @@ -# Bump the test tag here and in .gitlab-ci.yml and CI will take care of updating the cached tarballs -TESTS_TAG := v0.12.0 +TESTS_TAG := v0.12.1 TESTS = general minimal mainnet TARBALLS = $(patsubst %,%-$(TESTS_TAG).tar.gz,$(TESTS)) diff --git a/testing/simulator/src/eth1_sim.rs b/testing/simulator/src/eth1_sim.rs index 2841bc3ba..4c69b9312 100644 --- a/testing/simulator/src/eth1_sim.rs +++ b/testing/simulator/src/eth1_sim.rs @@ -56,7 +56,7 @@ pub fn run_eth1_sim(matches: &ArgMatches) -> Result<(), String> { spec.milliseconds_per_slot /= speed_up_factor; spec.eth1_follow_distance = 16; - spec.min_genesis_delay = eth1_block_time.as_secs() * spec.eth1_follow_distance * 2; + spec.genesis_delay = eth1_block_time.as_secs() * spec.eth1_follow_distance * 2; spec.min_genesis_time = 0; spec.min_genesis_active_validator_count = 64; spec.seconds_per_eth1_block = 1; diff --git a/testing/simulator/src/no_eth1_sim.rs b/testing/simulator/src/no_eth1_sim.rs index 02140bc94..22a2d0015 100644 --- a/testing/simulator/src/no_eth1_sim.rs +++ b/testing/simulator/src/no_eth1_sim.rs @@ -56,7 +56,7 @@ pub fn run_no_eth1_sim(matches: &ArgMatches) -> Result<(), String> { spec.milliseconds_per_slot /= speed_up_factor; spec.eth1_follow_distance = 16; - spec.min_genesis_delay = eth1_block_time.as_secs() * spec.eth1_follow_distance * 2; + spec.genesis_delay = eth1_block_time.as_secs() * spec.eth1_follow_distance * 2; spec.min_genesis_time = 0; spec.min_genesis_active_validator_count = 64; spec.seconds_per_eth1_block = 1; diff --git a/testing/simulator/src/sync_sim.rs b/testing/simulator/src/sync_sim.rs index 5f0ab69ab..68d7aa1b0 100644 --- a/testing/simulator/src/sync_sim.rs +++ b/testing/simulator/src/sync_sim.rs @@ -55,7 +55,7 @@ fn syncing_sim( spec.milliseconds_per_slot /= speed_up_factor; spec.eth1_follow_distance = 16; - spec.min_genesis_delay = eth1_block_time.as_secs() * spec.eth1_follow_distance * 2; + spec.genesis_delay = eth1_block_time.as_secs() * spec.eth1_follow_distance * 2; spec.min_genesis_time = 0; spec.min_genesis_active_validator_count = 64; spec.seconds_per_eth1_block = 1;