Skip to content

feat: add peer connection metrics - #48

Merged
MegaRedHand merged 10 commits into
mainfrom
peer-connection-metrics
Jan 23, 2026
Merged

MegaRedHand merged 10 commits into
mainfrom
peer-connection-metrics

Conversation

@MegaRedHand

Copy link
Copy Markdown
Collaborator

This PR adds the "Network Metrics" from leanMetrics:

  • lean_connected_peers
  • lean_peer_connection_events_total
  • lean_peer_disconnection_events_total

Add the following metrics from the leanMetrics specification:
- lean_connected_peers: Gauge with client label tracking connected peer count
- lean_peer_connection_events_total: Counter with direction and result labels
- lean_peer_disconnection_events_total: Counter with direction and reason labels

Connection events are tracked in the p2p event loop by handling
SwarmEvent::ConnectionEstablished, SwarmEvent::ConnectionClosed,
SwarmEvent::OutgoingConnectionError, and SwarmEvent::IncomingConnectionError.
@MegaRedHand
MegaRedHand merged commit 6192425 into main Jan 23, 2026
2 checks passed
@MegaRedHand
MegaRedHand deleted the peer-connection-metrics branch January 23, 2026 20:45
tcoratger pushed a commit to tcoratger/ethlambda that referenced this pull request Oct 30, 2026
…ot (lambdaclass#48)

hold_block_for_columns asked peers for the missing columns the moment it
held a block. A block's columns are published alongside it, so at that
moment the rest are almost always still in flight on gossip, and the
peers asked usually do not have them yet either: they answer empty and
the lookup burns its attempts. On the mainnet followers at the tip,
gossip completed every held block within 0.3 s (p99), and stored columns
equalled gossip-decoded columns, so the by-root fetch contributed
nothing while putting hundreds of mostly empty requests an hour on the
wire.

The per-slot re-drive already re-asks for every held block's missing
columns. Make it the only asker: a new hold waits for gossip, and the
first tick after it asks for whatever is still missing.
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.
tcoratger pushed a commit to tcoratger/ethlambda that referenced this pull request Oct 30, 2026
Brings in lambdaclass#48, lambdaclass#19, lambdaclass#47 and lambdaclass#49. Both conflicts were tests added on both
sides of gossip/mod.rs and gossip/test_support.rs: kept all of them and
merged the test_support module doc to name every module it serves.
tcoratger pushed a commit to tcoratger/ethlambda that referenced this pull request Oct 30, 2026
…justifications

Picks up beacon-chain-integration (lambdaclass#48, lambdaclass#19, lambdaclass#47, lambdaclass#49) through the base
branch. Clean merge.
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