Skip to content

feat: add rest of fork choice metrics - #52

Merged
MegaRedHand merged 2 commits into
mainfrom
add-forkchoice-metrics
Jan 26, 2026
Merged

MegaRedHand merged 2 commits into
mainfrom
add-forkchoice-metrics

Conversation

@MegaRedHand

@MegaRedHand MegaRedHand commented Jan 26, 2026 •

Copy link
Copy Markdown
Collaborator

This PR adds some more metrics from leanMetrics:

  • lean_attestations_valid_total
  • lean_attestations_invalid_total
  • lean_fork_choice_reorgs_total

Add Group 3 metrics from the leanMetrics specification:
- lean_attestations_valid_total: Count of valid attestations with source label (block/gossip)
- lean_attestations_invalid_total: Count of invalid attestations with source label (block/gossip)
- lean_fork_choice_reorgs_total: Count of fork choice reorganizations

Attestation counting is added to on_gossip_attestation (gossip source)
and on_block (block source). Reorg detection is added to update_head by
checking if the new head is not a direct child of the previous head.
@MegaRedHand
MegaRedHand merged commit 88edf2f into main Jan 26, 2026
2 checks passed
@MegaRedHand
MegaRedHand deleted the add-forkchoice-metrics branch January 26, 2026 18:15
tcoratger pushed a commit to tcoratger/ethlambda that referenced this pull request Oct 30, 2026
…next slot (lambdaclass#52)

lambdaclass#48 left every held block's columns to gossip until the next slot's
redrive, because at the tip gossip completes a held block within a fraction
of a second and an immediate by-root ask only raced it. A block that is
already older than the current slot has no gossip left to wait for: its
columns went out long before this node held it.

Range-synced catch-up is exactly that case. After a fresh checkpoint sync on
a mainnet follower, the 72 blocks from before the restart were each held
missing every custody column and each waited out a redrive, so the follower
imported about one block per slot and its lag stayed flat for eight minutes.

A block held at a slot older than the current one now asks by root at hold
time. A block at or ahead of the current slot keeps lambdaclass#48's behavior. The
condition is the block's age rather than its source, since age is what
decides whether gossip can still deliver the columns. Repeated holds of one
block cost nothing extra: the p2p side merges a repeat ask into the lookup
already in flight for that root.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant