diff --git a/beacon_node/beacon_chain/src/beacon_chain.rs b/beacon_node/beacon_chain/src/beacon_chain.rs index 76de2d431f..77011a6d59 100644 --- a/beacon_node/beacon_chain/src/beacon_chain.rs +++ b/beacon_node/beacon_chain/src/beacon_chain.rs @@ -726,7 +726,7 @@ impl BeaconChain { let mut state = self.state.read().clone(); - state.build_epoch_cache(RelativeEpoch::Current, &T::EthSpec::spec())?; + state.build_committee_cache(RelativeEpoch::Current, &T::EthSpec::spec())?; trace!("Finding attestations for new block..."); @@ -742,7 +742,7 @@ impl BeaconChain { slot: state.slot, previous_block_root, state_root: Hash256::zero(), // Updated after the state is calculated. - signature: T::EthSpec::spec().empty_signature.clone(), // To be completed by a validator. + signature: Signature::empty_signature(), // To be completed by a validator. body: BeaconBlockBody { randao_reveal, eth1_data: Eth1Data { diff --git a/beacon_node/http_server/src/metrics/local_metrics.rs b/beacon_node/http_server/src/metrics/local_metrics.rs index e2b0e6513b..cd7de90f6f 100644 --- a/beacon_node/http_server/src/metrics/local_metrics.rs +++ b/beacon_node/http_server/src/metrics/local_metrics.rs @@ -1,8 +1,8 @@ use beacon_chain::{BeaconChain, BeaconChainTypes}; use prometheus::{IntGauge, Opts, Registry}; use slot_clock::SlotClock; -use std::path::PathBuf; use std::fs::File; +use std::path::PathBuf; use types::Slot; // If set to `true` will iterate and sum the balances of all validators in the state for each @@ -79,11 +79,15 @@ impl LocalMetrics { self.present_slot.set(present_slot.as_u64() as i64); self.best_slot.set(state.slot.as_u64() as i64); - self.validator_count.set(state.validator_registry.len() as i64); - self.justified_epoch.set(state.current_justified_epoch.as_u64() as i64); - self.finalized_epoch.set(state.finalized_epoch.as_u64() as i64); + self.validator_count + .set(state.validator_registry.len() as i64); + self.justified_epoch + .set(state.current_justified_epoch.as_u64() as i64); + self.finalized_epoch + .set(state.finalized_epoch.as_u64() as i64); if SHOULD_SUM_VALIDATOR_BALANCES { - self.validator_balances_sum.set(state.validator_balances.iter().sum::() as i64); + self.validator_balances_sum + .set(state.balances.iter().sum::() as i64); } let db_size = File::open(db_path) .and_then(|f| f.metadata())