Skip to content

Label a beacon block published through the Beacon API as local, not gossip #846

Open

Description

@MegaRedHand

Problem. publish_beacon_block hands the block a validator client published to the chain actor as BlockSource::Gossip (crates/net/p2p/src/gossipsub/handler.rs:999-1004), though it never crossed the wire.

Its telemetry rows (#765) are therefore filed under source = 'gossip' with near-zero arrival latency, mixed into the arrival distribution every cross-client comparison reads. docs/telemetry.md ("Known gaps") lists this, with the workaround of filtering on the missing decode_end row. The same path already labels the block's custody columns local (handler.rs:985-992), so blocks and columns disagree.

Why not in #765. BlockSource is not a telemetry type. It is the chain actor's view of how a block arrived, and it feeds more than the rows: import metrics and timeliness bookkeeping, for instance. A new variant is a change to ethlambda-network-api and every match on it, to be checked for each reader rather than slipped into a telemetry PR.

Fix.

  • Add a BlockSource::Local variant, sent by publish_beacon_block.
  • Give it the label local in import_timing::source_label.
  • Check every other reader of BlockSource and keep its current behaviour for a local block where that behaviour is right. Fork choice's timeliness treats the node's own block as timely, as gossip does now.
  • Remove the known-gaps entry from docs/telemetry.md.
  • A test: a block handed over by publish_beacon_block writes its rows under local.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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