Serve block_gossip events for gossip publication requests - #248
Conversation
ec947ff to
79dbcfc
Compare
| msg_hash: MessageId, | ||
| recv_ts: Nanos, | ||
| protobuf: TCacheRead, | ||
| block: Option<GossipBlock>, |
There was a problem hiding this comment.
don't like this! we should not have some extra data relating to one message type on a general message like this.
I realise I advocated using this event but I thought you actually wanted to send the block and not the block root and slot.
I think the stream should use the BeaconStateEvent::PersistBlock as its trigger
There was a problem hiding this comment.
this also has the upside of not requiring any beacon state tile changes
There was a problem hiding this comment.
based on the discussion Friday and the fact that there are multiple streams on the 'gossip' trigger, lets keep it simple and continue to use the SendGossip event but lets include the ssz TCacheRead in the event, not values needed for 1 or 2 beacon apis - and just recalculate the block root in the api tile. If that turns out to be problematic we can think again.
Attach GossipBlock { slot, block_root } to existing SendGossip requests
at both block relay sites. RPC retains its empty callback, and other
topics carry no block record.
This prepares SSE publication without a new block stage or second
spine notification. Relay selection, import receipts, and networking
behaviour remain unchanged.
Eight block_relay tests cover metadata in both sync modes, RPC and
replay silence, staging, missing-parent retry, rejected imports, bad
signatures, and disabled relay. They require ef_tests, enabled by
just nextest. Fixture slots come from the decoded blocks.
Existing producer tests check absent metadata for nine non-block
topic families. The proposer-lookahead test checks eligibility in
both sync modes while bypassing signature verification.
A Controller test injects opaque payloads through the spine and
enters loop_body. With metadata absent and present, forwarding
preserves bytes and recipient selection, and IWANT service works.
The peer-manager test retains sender and IDONTWANT exclusions.
Fixture limits: gossip tests reuse SSZ handles as unread protobuf
handles. DA completion enters its handler without running the
columns tile. No fixture covers the full Gloas AwaitParentPayload
retry; the relay-disabled test checks its handler flag directly.
Validation, all exit zero:
- just fmt-check
- just clippy
- just nextest
- git diff --check
1,357 tests passed; 5 skipped.
Assisted-by: Codex:gpt-6-astra
Publish block_gossip from block metadata on existing SendGossip requests.
The boundary consumes PeerEvent outside the engine capacity gate.
It selects the metadata without reading the gossip payload.
This deliberately narrows the Beacon API's validation contract.
RPC imports remain silent because they do not request gossip publication.
A publication request does not guarantee delivery to peers.
Keep block tied to Applied receipts. Repeated publication requests
produce repeated events, and late subscribers receive no event replay.
The two spine queues establish no shared ordering.
Wire event: block_gossip
Data: {"slot":"<decimal>","block":"0x<64 lowercase hex>"}
Amend ADR-0004 with the publication contract and its exclusions.
Subscribers to both topics can reach the existing send cap sooner.
Message layouts and the peer_events ring are unchanged.
Extend topic parsing coverage with standalone and mixed subscriptions.
Check the renderer's required fields as parsed JSON.
Socket tests enter through the boundary's loop_body with spine inputs.
One scenario checks separate and mixed subscriptions, repeated requests,
and isolation from unrelated publications and block imports.
Trailing events keep unwanted publications within the events read.
The existing block test retains its receipt-stage coverage.
A late subscriber connects after an earlier subscriber receives an event.
Another test serves gossip notifications with unanswered FCU requests
occupying engine capacity. Startup requests receive responses.
Opaque payload bytes avoid coupling these fixtures to block serialization.
The test client decodes HTTP and SSE before checking event names and
required JSON fields. It permits additional fields and does not require
an ordering between the two topics.
A temporary renderer with reordered keys, extra whitespace, and an
additional nested field passed all 1,361 tests.
Two fault controls each failed one test, with just nextest exiting 100:
- Publishing Applied imports on both topics failed block_subscriptions_select_imports_and_preserve_repeated_relay_requests.
- Gating the peer-event consumer on engine capacity failed a_gossip_event_is_served_while_the_engine_pool_is_saturated.
All controls were restored. Final validation, each exiting zero:
- just fmt-check
- just clippy
- just nextest: 1,361 passed, 5 skipped
- git diff --check
Assisted-by: Codex:gpt-6-astra
79dbcfc to
7194762
Compare
Add
block_gossipto/eth/v1/events. The promise is: these events correspond to what we publish on gossip. An event reports silver's publication request, not successful delivery to a peer.This deliberately narrows the Beacon API's validation event. Upstream covers blocks received through P2P or API after gossip validation, without requiring publication. Silver additionally requires a relay request, so validated RPC imports and disk replay produce no
block_gossipevent.A request precedes payload notification, state transition, and import; a later import failure does not retract it. The existing
blocktopic remains tied toAppliedreceipts. Repeated requests are not deduplicated, and late subscribers receive no replay. The two queues establish no shared ordering; subscribing to both topics can reach the existing send cap sooner.This PR targets
main;bronek/sse_data_column_sidecar_v2follows. Neither PR depends on PR #231 or its head topics.The ADR-0004 amendment records the publication contract and deliberate divergence. P2P conformance gaps remain tracked separately.
Message sizes and ring capacities are unchanged.
Coverage limits: no Gloas fixture exercises the full
AwaitParentPayloadretry with its envelope. The proposer-lookahead test bypasses signatures. Relay tests requireef_tests, enabled byjust nextest.