Skip to content

Commit c0bed32

Browse files
committed
Do not log slot clock error prior to genesis (#4657)
## Issue Addressed #4654 ## Proposed Changes Only log error if we're unable to read slot clock after genesis. I thought about simply down grading the `error` to a `warn`, but feel like it's still unnecessary noise before genesis, and it would be good to retain error log if we're pass genesis. But I'd be ok with just downgrading the log level, too.
1 parent 14924db commit c0bed32

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

beacon_node/network/src/subnet_service/attestation_subnets.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,16 @@ impl<T: BeaconChainTypes> AttestationService<T> {
302302
/// Gets the long lived subnets the node should be subscribed to during the current epoch and
303303
/// the remaining duration for which they remain valid.
304304
fn recompute_long_lived_subnets_inner(&mut self) -> Result<Duration, ()> {
305-
let current_epoch = self.beacon_chain.epoch().map_err(
306-
|e| error!(self.log, "Failed to get the current epoch from clock"; "err" => ?e),
307-
)?;
305+
let current_epoch = self.beacon_chain.epoch().map_err(|e| {
306+
if !self
307+
.beacon_chain
308+
.slot_clock
309+
.is_prior_to_genesis()
310+
.unwrap_or(false)
311+
{
312+
error!(self.log, "Failed to get the current epoch from clock"; "err" => ?e)
313+
}
314+
})?;
308315

309316
let (subnets, next_subscription_epoch) = SubnetId::compute_subnets_for_epoch::<T::EthSpec>(
310317
self.node_id.raw().into(),

0 commit comments

Comments
 (0)