From 3993bda07d4df15561b63f9034e237cd106e65e4 Mon Sep 17 00:00:00 2001 From: lodekeeper Date: Thu, 9 Jul 2026 15:44:28 +0000 Subject: [PATCH] docs(clock): trim verbose gossip-disparity doc comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Trim the over-explained `<=` / strict-`<` gossip-disparity doc comments on `currentSlotWithGossipDisparity` and `isCurrentSlotGivenGossipDisparity` down to the essential spec reference. Flagged during the lodestar-z clock port (ChainSafe/lodestar-z#463), where they were ported verbatim and read as noise. No code change. 🤖 Generated with AI assistance Co-Authored-By: Claude Opus 4.8 --- packages/beacon-node/src/util/clock.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/beacon-node/src/util/clock.ts b/packages/beacon-node/src/util/clock.ts index 52ade3e79079..2762e354a66e 100644 --- a/packages/beacon-node/src/util/clock.ts +++ b/packages/beacon-node/src/util/clock.ts @@ -94,10 +94,7 @@ export class Clock extends EventEmitter implements IClock { } /** * If it's too close to next slot given MAXIMUM_GOSSIP_CLOCK_DISPARITY, return currentSlot + 1. - * Otherwise return currentSlot - * - * Spec: phase0/p2p-interface.md - gossip validation uses `current_time + MAXIMUM_GOSSIP_CLOCK_DISPARITY < message_time` - * to reject future messages (strict `<`), so the boundary (exactly equal) is accepted, hence `<=` here. + * Spec: phase0/p2p-interface.md rejects future messages with strict `<`, hence `<=` here. */ get currentSlotWithGossipDisparity(): Slot { const currentSlot = this.currentSlot; @@ -123,9 +120,7 @@ export class Clock extends EventEmitter implements IClock { /** * Check if a slot is current slot given MAXIMUM_GOSSIP_CLOCK_DISPARITY. - * - * Uses `<=` for disparity checks because the spec rejects with strict `<` - * (phase0/p2p-interface.md), meaning the boundary (exactly equal) is accepted. + * Spec: phase0/p2p-interface.md rejects future messages with strict `<`, hence `<=`. */ isCurrentSlotGivenGossipDisparity(slot: Slot): boolean { const currentSlot = this.currentSlot;