diff --git a/beacon_node/beacon_chain/src/beacon_chain.rs b/beacon_node/beacon_chain/src/beacon_chain.rs index edf17cdf099..25964ed2165 100644 --- a/beacon_node/beacon_chain/src/beacon_chain.rs +++ b/beacon_node/beacon_chain/src/beacon_chain.rs @@ -2942,7 +2942,6 @@ impl BeaconChain { // Optimistically imported blocks are not added to the cache since the cache is only useful // for a small window of time and the complexity of keeping track of the optimistic status // is not worth it. - let mut block_time_applied_to_early_attester_cache = None; if !payload_verification_status.is_optimistic() && block.slot() + EARLY_ATTESTER_CACHE_HISTORIC_SLOTS >= current_slot { @@ -2964,12 +2963,6 @@ impl BeaconChain { "error" => ?e ); } - debug!( - self.log, - "Inserted block into early attester cache"; - "root" => ?block_root - ); - block_time_applied_to_early_attester_cache = Some(timestamp_now()); } else { warn!( self.log, @@ -3423,15 +3416,11 @@ impl BeaconChain { // the cache during sync. if block_delay_total < self.slot_clock.slot_duration() * 64 { // Store the timestamp of the block being imported into the cache. - let mut block_times_cache = self.block_times_cache.write(); - block_times_cache.set_time_imported(block_root, current_slot, block_time_imported); - if let Some(time) = block_time_applied_to_early_attester_cache { - block_times_cache.set_time_applied_to_early_attester_cache( - block_root, - current_slot, - time, - ); - } + self.block_times_cache.write().set_time_imported( + block_root, + current_slot, + block_time_imported, + ); } // Do not store metrics if the block was > 4 slots old, this helps prevent noise during @@ -3451,12 +3440,6 @@ impl BeaconChain { .imported .unwrap_or_else(|| Duration::from_secs(0)), ); - if let Some(delay) = block_delays.applied_to_early_attester_cache { - metrics::observe_duration( - &metrics::BEACON_BLOCK_EARLY_ATTESTER_OBSERVED_DELAY_TIME, - delay, - ); - } } if let Some(event_handler) = self.event_handler.as_ref() { diff --git a/beacon_node/beacon_chain/src/block_times_cache.rs b/beacon_node/beacon_chain/src/block_times_cache.rs index 868d6406e4e..484de841de5 100644 --- a/beacon_node/beacon_chain/src/block_times_cache.rs +++ b/beacon_node/beacon_chain/src/block_times_cache.rs @@ -20,7 +20,6 @@ pub struct Timestamps { pub observed: Option, pub imported: Option, pub set_as_head: Option, - pub applied_to_early_attester_cache: Option, } // Helps arrange delay data so it is more relevant to metrics. @@ -29,7 +28,6 @@ pub struct BlockDelays { pub observed: Option, pub imported: Option, pub set_as_head: Option, - pub applied_to_early_attester_cache: Option, } impl BlockDelays { @@ -43,17 +41,10 @@ impl BlockDelays { let set_as_head = times .set_as_head .and_then(|set_as_head_time| set_as_head_time.checked_sub(times.imported?)); - let applied_to_early_attester_cache = - times - .applied_to_early_attester_cache - .and_then(|applied_to_early_attester_cache| { - applied_to_early_attester_cache.checked_sub(times.observed?) - }); BlockDelays { observed, imported, set_as_head, - applied_to_early_attester_cache, } } } @@ -124,19 +115,6 @@ impl BlockTimesCache { block_times.timestamps.set_as_head = Some(timestamp); } - pub fn set_time_applied_to_early_attester_cache( - &mut self, - block_root: BlockRoot, - slot: Slot, - timestamp: Duration, - ) { - let block_times = self - .cache - .entry(block_root) - .or_insert_with(|| BlockTimesCacheValue::new(slot)); - block_times.timestamps.applied_to_early_attester_cache = Some(timestamp); - } - pub fn get_block_delays( &self, block_root: BlockRoot, diff --git a/beacon_node/beacon_chain/src/metrics.rs b/beacon_node/beacon_chain/src/metrics.rs index 44a97f4d691..dff663ded0f 100644 --- a/beacon_node/beacon_chain/src/metrics.rs +++ b/beacon_node/beacon_chain/src/metrics.rs @@ -835,12 +835,6 @@ lazy_static! { // [0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5] decimal_buckets(-2,-1) ); - pub static ref BEACON_BLOCK_EARLY_ATTESTER_OBSERVED_DELAY_TIME: Result = try_create_histogram_with_buckets( - "beacon_block_early_attester_observed_delay_time", - "Duration between the time the block was observed and the time when it was applied to the early attester cache.", - // [0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5] - decimal_buckets(-2,0) - ); pub static ref BEACON_BLOCK_HEAD_SLOT_START_DELAY_TIME: Result = try_create_histogram_with_buckets( "beacon_block_head_slot_start_delay_time", "Duration between the start of the block's slot and the time when it was set as head.",