From f03f9ba68009514dc4da48759828c047c4c0b3dd Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Mon, 15 Aug 2022 01:30:59 +0000 Subject: [PATCH] Increase merge-readiness lookhead (#3463) ## Issue Addressed NA ## Proposed Changes Start issuing merge-readiness logs 2 weeks before the Bellatrix fork epoch. Additionally, if the Bellatrix epoch is specified and the use has configured an EL, always log merge readiness logs, this should benefit pro-active users. ### Lookahead Reasoning - Bellatrix fork is: - epoch 144896 - slot 4636672 - Unix timestamp: `1606824023 + (4636672 * 12) = 1662464087` - GMT: Tue Sep 06 2022 11:34:47 GMT+0000 - Warning start time is: - Unix timestamp: `1662464087 - 604800 * 2 = 1661254487` - GMT: Tue Aug 23 2022 11:34:47 GMT+0000 The [current expectation](https://discord.com/channels/595666850260713488/745077610685661265/1007445305198911569) is that EL and CL clients will releases out by Aug 22nd at the latest, then an EF announcement will go out on the 23rd. If all goes well, LH will start alerting users about merge-readiness just after the announcement. ## Additional Info NA --- beacon_node/beacon_chain/src/merge_readiness.rs | 16 +++++++++++----- beacon_node/client/src/notifier.rs | 1 + 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/beacon_node/beacon_chain/src/merge_readiness.rs b/beacon_node/beacon_chain/src/merge_readiness.rs index 4a7b38bdb..4ef2102fd 100644 --- a/beacon_node/beacon_chain/src/merge_readiness.rs +++ b/beacon_node/beacon_chain/src/merge_readiness.rs @@ -9,7 +9,7 @@ use types::*; /// The time before the Bellatrix fork when we will start issuing warnings about preparation. const SECONDS_IN_A_WEEK: u64 = 604800; -pub const MERGE_READINESS_PREPARATION_SECONDS: u64 = SECONDS_IN_A_WEEK; +pub const MERGE_READINESS_PREPARATION_SECONDS: u64 = SECONDS_IN_A_WEEK * 2; #[derive(Default, Debug, Serialize, Deserialize)] pub struct MergeConfig { @@ -130,16 +130,22 @@ impl fmt::Display for MergeReadiness { } impl BeaconChain { - /// Returns `true` if the Bellatrix fork has occurred or will occur within - /// `MERGE_READINESS_PREPARATION_SECONDS`. + /// Returns `true` if user has an EL configured, or if the Bellatrix fork has occurred or will + /// occur within `MERGE_READINESS_PREPARATION_SECONDS`. pub fn is_time_to_prepare_for_bellatrix(&self, current_slot: Slot) -> bool { if let Some(bellatrix_epoch) = self.spec.bellatrix_fork_epoch { let bellatrix_slot = bellatrix_epoch.start_slot(T::EthSpec::slots_per_epoch()); let merge_readiness_preparation_slots = MERGE_READINESS_PREPARATION_SECONDS / self.spec.seconds_per_slot; - // Return `true` if Bellatrix has happened or is within the preparation time. - current_slot + merge_readiness_preparation_slots > bellatrix_slot + if self.execution_layer.is_some() { + // The user has already configured an execution layer, start checking for readiness + // right away. + true + } else { + // Return `true` if Bellatrix has happened or is within the preparation time. + current_slot + merge_readiness_preparation_slots > bellatrix_slot + } } else { // The Bellatrix fork epoch has not been defined yet, no need to prepare. false diff --git a/beacon_node/client/src/notifier.rs b/beacon_node/client/src/notifier.rs index 9f82cd201..ae8f024b7 100644 --- a/beacon_node/client/src/notifier.rs +++ b/beacon_node/client/src/notifier.rs @@ -387,6 +387,7 @@ async fn merge_readiness_logging( log, "Not ready for merge"; "info" => %readiness, + "hint" => "try updating Lighthouse and/or the execution layer", ) } readiness @ MergeReadiness::NotSynced => warn!(