From e5d9d6179f1411398358bd38e6e91ecc8f359d93 Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Sat, 25 Jul 2020 04:44:10 +0000 Subject: [PATCH] Add info about valid deposit count to logs (#1391) ## Issue Addressed NA ## Proposed Changes Adds a `valid_deposits` field to the logs whilst waiting for genesis: ``` Jul 25 11:02:25.631 INFO Waiting for more deposits valid_deposits: 3085, total_deposits: 3188, min_genesis_active_validators: 16384, service: beacon ``` In this example we can see there are `3188` deposits, but only `3085` have valid signatures. ## Additional Info NA --- beacon_node/eth1/src/service.rs | 9 +++++++++ beacon_node/genesis/src/eth1_genesis_service.rs | 1 + 2 files changed, 10 insertions(+) diff --git a/beacon_node/eth1/src/service.rs b/beacon_node/eth1/src/service.rs index 221d0a49df..bf3c1940aa 100644 --- a/beacon_node/eth1/src/service.rs +++ b/beacon_node/eth1/src/service.rs @@ -227,6 +227,15 @@ impl Service { .get_valid_signature_count(self.highest_safe_block()?) } + /// Returns the number of deposits with valid signatures that have been observed, without + /// respecting the `highest_safe_block`. + pub fn get_raw_valid_signature_count(&self) -> Option { + let deposits = self.deposits().read(); + deposits + .cache + .get_valid_signature_count(deposits.cache.latest_block_number()?) + } + /// Returns the number of deposits with valid signatures that have been observed up to and /// including the block at `block_number`. /// diff --git a/beacon_node/genesis/src/eth1_genesis_service.rs b/beacon_node/genesis/src/eth1_genesis_service.rs index a1f6658502..4aa60da7a6 100644 --- a/beacon_node/genesis/src/eth1_genesis_service.rs +++ b/beacon_node/genesis/src/eth1_genesis_service.rs @@ -146,6 +146,7 @@ impl Eth1GenesisService { "Waiting for more deposits"; "min_genesis_active_validators" => spec.min_genesis_active_validator_count, "total_deposits" => eth1_service.deposit_cache_len(), + "valid_deposits" => eth1_service.get_raw_valid_signature_count(), ); delay_for(update_interval).await;