From 3f160d3b995f848c035f1ab7c5d46da3dcc208c2 Mon Sep 17 00:00:00 2001 From: Age Manning Date: Mon, 1 Apr 2019 16:29:11 +1100 Subject: [PATCH] Correct bootnodes cli parameter --- beacon_node/client/src/client_config.rs | 4 ++-- beacon_node/src/main.rs | 2 +- .../src/test_utils/testing_beacon_state_builder.rs | 11 ++++++++--- validator_client/src/service.rs | 12 +++++++----- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/beacon_node/client/src/client_config.rs b/beacon_node/client/src/client_config.rs index f7a257a3a9..407171ff58 100644 --- a/beacon_node/client/src/client_config.rs +++ b/beacon_node/client/src/client_config.rs @@ -77,7 +77,7 @@ impl ClientConfig { } // Custom listening address ipv4/ipv6 // TODO: Handle list of addresses - if let Some(listen_address_str) = args.value_of("listen_address") { + if let Some(listen_address_str) = args.value_of("listen-address") { if let Ok(listen_address) = listen_address_str.parse::() { let multiaddr = SocketAddr::new(listen_address, config.net_conf.listen_port) .to_multiaddr() @@ -91,7 +91,7 @@ impl ClientConfig { // Custom bootnodes // TODO: Handle list of addresses - if let Some(boot_addresses_str) = args.value_of("boot_nodes") { + if let Some(boot_addresses_str) = args.value_of("boot-nodes") { if let Ok(boot_address) = boot_addresses_str.parse::() { config.net_conf.boot_nodes.append(&mut vec![boot_address]); } else { diff --git a/beacon_node/src/main.rs b/beacon_node/src/main.rs index a4e1ee1308..45aafb3ce5 100644 --- a/beacon_node/src/main.rs +++ b/beacon_node/src/main.rs @@ -26,7 +26,7 @@ fn main() { ) // network related arguments .arg( - Arg::with_name("listen_address") + Arg::with_name("listen-address") .long("listen-address") .value_name("Listen Address") .help("The Network address to listen for p2p connections.") diff --git a/eth2/types/src/test_utils/testing_beacon_state_builder.rs b/eth2/types/src/test_utils/testing_beacon_state_builder.rs index def58b0d74..445debae7c 100644 --- a/eth2/types/src/test_utils/testing_beacon_state_builder.rs +++ b/eth2/types/src/test_utils/testing_beacon_state_builder.rs @@ -122,12 +122,17 @@ impl TestingBeaconStateBuilder { }) .collect(); + // TODO: Testing only. Burn with fire later. + // set genesis to the last 30 minute block. + // this is used for testing only. Allows multiple nodes to connect within a 30min window + // and agree on a genesis let now = SystemTime::now() .duration_since(SystemTime::UNIX_EPOCH) .unwrap() - .as_secs() - - 30; - let genesis_time = now; // arbitrary + .as_secs(); + let secs_after_last_period = now.checked_rem(30 * 60).unwrap_or(0); + // genesis is now the last 30 minute block. + let genesis_time = now - secs_after_last_period; let mut state = BeaconState::genesis( genesis_time, diff --git a/validator_client/src/service.rs b/validator_client/src/service.rs index 38883e68fa..ce19c23e93 100644 --- a/validator_client/src/service.rs +++ b/validator_client/src/service.rs @@ -292,11 +292,13 @@ impl Service { let current_epoch = self.current_slot.epoch(self.spec.slots_per_epoch); // spawn a new thread separate to the runtime // TODO: Handle thread termination/timeout - std::thread::spawn(move || { - // the return value is a future which returns ready. - // built to be compatible with the tokio runtime. - let _empty = cloned_manager.run_update(current_epoch, cloned_log.clone()); - }); + // TODO: Add duties thread back in, with channel to process duties in duty change. + // leave sequential for now. + //std::thread::spawn(move || { + // the return value is a future which returns ready. + // built to be compatible with the tokio runtime. + let _empty = cloned_manager.run_update(current_epoch, cloned_log.clone()); + //}); } /// If there are any duties to process, spawn a separate thread and perform required actions.