From f94495d4072c4791df7756356c7800260a1afe7b Mon Sep 17 00:00:00 2001 From: Damilola Edwards Date: Wed, 19 Aug 2026 12:12:09 +0100 Subject: [PATCH] Remove dead Ready and lastEventTime fields Ready is only ever written, never read, and is not exposed on the Node interface so no consumer can reach it either. lastEventTime has the same shape: a dedicated mutex guarding a field nobody reads. Neither has any effect on behavior, they're just state nothing observes. No new test needed here since this removes unreachable state rather than changing behavior; the existing suite passing is the regression check. --- pkg/beacon/beacon.go | 24 +++++++++--------------- pkg/beacon/subscriptions.go | 4 ---- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/pkg/beacon/beacon.go b/pkg/beacon/beacon.go index 0b1eb83..c43e41c 100644 --- a/pkg/beacon/beacon.go +++ b/pkg/beacon/beacon.go @@ -182,24 +182,20 @@ type node struct { broker *emission.Emitter // Internal data stores - genesis *v1.Genesis - genesisMu sync.RWMutex - lastEventTime time.Time - lastEventTimeMu sync.RWMutex - nodeVersion string - nodeVersionMu sync.RWMutex - peers types.Peers - finality *v1.Finality - spec *state.Spec - specMu sync.RWMutex - wallclock *ethwallclock.EthereumBeaconChain + genesis *v1.Genesis + genesisMu sync.RWMutex + nodeVersion string + nodeVersionMu sync.RWMutex + peers types.Peers + finality *v1.Finality + spec *state.Spec + specMu sync.RWMutex + wallclock *ethwallclock.EthereumBeaconChain stat *Status metrics *Metrics - Ready bool - hasEmittedFirstTimeHealthy bool firstHealthyMutex sync.Mutex @@ -406,8 +402,6 @@ func (n *node) bootstrap(ctx context.Context) error { //nolint:errcheck // we dont care if this errors out since it runs indefinitely in a goroutine go n.ensureBeaconSubscription(ctx) - n.Ready = true - go n.publishReady(ctx) return nil diff --git a/pkg/beacon/subscriptions.go b/pkg/beacon/subscriptions.go index 538b3c4..1eecd39 100644 --- a/pkg/beacon/subscriptions.go +++ b/pkg/beacon/subscriptions.go @@ -60,10 +60,6 @@ func (n *node) subscribeToBeaconEvents(ctx context.Context) error { if err := provider.Events(ctx, &api.EventsOpts{ Topics: []string{topic}, Handler: func(event *v1.Event) { - n.lastEventTimeMu.Lock() - n.lastEventTime = time.Now() - n.lastEventTimeMu.Unlock() - if err := n.handleEvent(ctx, event); err != nil { n.log.Errorf("Failed to handle event: %v", err) }