Skip to content

blocks_first_seen race metric may be inaccurate on CL→mump2p path #26

Description

@swarna1101

Context

trackedSlots in pkg/service/bootstrapper/beacon_block_measures.go is updated from two paths:

  • composeBlockTelemetry — sets EthSeenAtMs / MumSeenAtMs (block seen)
  • RecordMumPublishedAt — sets only MumPublishedAtMs (block published to mump2p on the CL path)

The blocks_first_seen_{mump2p,libp2p}_total counters (dashboard: "mump2p boost %") use map presence as "already seen":

firstForSlot := true
Upsert(slot, func(v) { firstForSlot = false; ... }, zeroVal)
if firstForSlot { IncBlocksFirstSeen(source) }

Problem

On the CL path, RecordMumPublishedAt runs synchronously after publish, while HandleBeaconBlockcomposeBlockTelemetry is async. The map entry can exist (with both seen fields still 0) before the libp2p seen timestamp is written. LibP2P may then miss first-seen credit even when it arrived first → possible undercount of libp2p-first / inflated mump2p boost %.

Open question: should an entry ever exist with both EthSeenAtMs == 0 and MumSeenAtMs == 0? Today it can, because RecordMumPublishedAt creates one.

Options

  1. Count first-seen when EthSeenAtMs == 0 && MumSeenAtMs == 0
  2. Store publish times separately so trackedSlots presence means seen
  3. Leave as-is if the race is negligible in practice

Note

An in-flight fix was reverted until we agree on intended semantics and validate dashboard impact.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions