Repository navigation
feat(rpc): emit single_attestation on /eth/v1/events - #757
Draft
MegaRedHand wants to merge 2 commits into
Draft
MegaRedHand wants to merge 2 commits into
MegaRedHand wants to merge 2 commits into
Conversation
…tions ethPandaOps' contributoor subscribes to single_attestation and never to attestation, and ethlambda accepted that topic without ever sending it, so the lab showed no attestation data for our nodes. Subnet attestations are validated in ethlambda-p2p and never reach the chain actor, so p2p reports an accepted one through the GossipEventSink that #748 added, and the event bus maps it to a ChainEvent on Topic::SingleAttestation. It is the highest-rate event the node has (every attestation on its backbone subnets), so the attestation is cloned only when a client is subscribed, and the payload is boxed to keep the broadcast ring sized for the smaller variants. The payload is the existing electra SingleAttestation container, so its JSON form is the specification's.
This is the specification's "(from P2P or API)" half of single_attestation: POST /eth/v2/beacon/pool/attestations now reports each attestation that passed validation and was handed to the network actor, the way the other API handlers report what a validator client or builder submits. It is a separate commit because emitting our own validators' attestations, with near-zero propagation time, can link validator indices to this node, which is why contributoor makes the topic opt-in. Dropping this commit leaves the gossip-accepted events alone; docs/spec_deviations.md would then need a line saying API submissions are not reported.
MegaRedHand
added a commit
that referenced
this pull request
Nov 2, 2026
feat(rpc): emit single_attestation for gossip-accepted subnet attestations ethPandaOps' contributoor subscribes to single_attestation and never to attestation, and ethlambda accepted that topic without ever sending it, so the lab showed no attestation data for our nodes. Subnet attestations are validated in ethlambda-p2p and never reach the chain actor, so p2p reports an accepted one through the GossipEventSink that #748 added, and the event bus maps it to a ChainEvent on Topic::SingleAttestation. It is the highest-rate event the node has (every attestation on its backbone subnets), so the attestation is cloned only when a client is subscribed, and the payload is boxed to keep the broadcast ring sized for the smaller variants. The payload is the existing electra SingleAttestation container, so its JSON form is the specification's. Second commit: feat(rpc): emit single_attestation for API-submitted attestations This is the specification's "(from P2P or API)" half of single_attestation: POST /eth/v2/beacon/pool/attestations now reports each attestation that passed validation and was handed to the network actor, the way the other API handlers report what a validator client or builder submits. It is a separate commit because emitting our own validators' attestations, with near-zero propagation time, can link validator indices to this node, which is why contributoor makes the topic opt-in. Dropping this commit leaves the gossip-accepted events alone; docs/spec_deviations.md would then need a line saying API submissions are not reported. Cherry-picked from feat/beacon-single-attestation-event at 6a62106. Adapted onto #749: events.rs keeps both the BeaconFastConfirmation and SingleAttestation variants and topic arms.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
ethPandaOps' contributoor (the xatu sentry behind lab.ethpandaops.io) subscribes to
single_attestationand never toattestation. ethlambda accepted asingle_attestationsubscription but never sent anything on it, so the lab shows no attestation data for our nodes, while Lighthouse nodes running the same contributoor config do send it.Stacked on #748, whose
GossipEventSinkthis reuses.Description
Two commits, so the second can be dropped on its own:
feat(rpc): emit single_attestation for gossip-accepted subnet attestations): subnet attestations are validated inethlambda-p2pand never reach the chain actor, sopublish_gossip_event(p2p/src/beacon/verdict.rs) reports an accepted one asGossipEvent::SingleAttestation, which the event bus maps toChainEvent::SingleAttestationonTopic::SingleAttestation. This is the highest-rate event the node has, so the attestation is cloned only when a client is subscribed, and the payload is boxed. The payload is the existing electraSingleAttestationcontainer, so the JSON is the spec's.feat(rpc): emit single_attestation for API-submitted attestations):POST /eth/v2/beacon/pool/attestationsreports each attestation that passed validation and was handed to the network actor, the spec's "(from P2P or API)" half. Kept separate because emitting our own validators' attestations, with near-zero propagation time, can link validator indices to the node (why contributoor makes the topic opt-in). Dropping it would need a line indocs/spec_deviations.md.docs/rpc.mdmovessingle_attestationfrom "never emitted" to the emitted table.Note for the lab: contributoor derives the subnet as
committee_index % 64, which only equals the real subnet with 64 committees per slot. On Sepolia (1 committee per slot) it drops every attestation, so this shows up on mainnet and Hoodi only.How to test
cargo test -p ethlambda-blockchain --lib events(spec example JSON shape, gossip event to topic mapping)cargo test -p ethlambda-p2p --lib(accepted attestation reaches the sink only onAcceptand only when subscribed)cargo test -p ethlambda-rpc --lib(an accepted API attestation reaches the bus, a refused one does not)curl -N 'localhost:5052/eth/v1/events?topics=single_attestation'on a beacon node.