Repository navigation
Hold a Waggle peer to one aggregate per slot and aggregator - #987
Conversation
EIP-8529's draft added a rule (b541c27f85): a message naming a second AggregateID with the slot and aggregator of one the sender already sent is dropped, and its sender penalized. The service now remembers the first aggregate each peer sent a message about, per slot and aggregator, by peer rather than by connection and for as long as the slot is tracked. A message of that peer about another one is dropped before the header of another aggregate we may hold is looked at, as the EIP orders it. The peer is penalized for the first such message only (waggle_second_aggregate_id): a peer on an earlier draft breaks the rule in every announcement when an aggregator signed two headers. The node keeps to the rule itself. Once it holds the header of an aggregate, by a peer's header passing or by publishing its own, it sends nothing about it to the peers that sent it another aggregate of the slot and aggregator: it may have requested chunks of theirs from them. A published aggregate is now held before it is pushed, for that reason. The rule replaces bound_headerless_aggregates, which let a peer count for the aggregate it named last: a peer can no longer name a second one.
The sender of a second AggregateID for a slot and aggregator was penalized for the first such message only. The EIP's REJECT penalizes the sender of each, so each is penalized now.
|
/review |
AI security review: 1 finding(s) to checkReviewed by GPT, Kimi, DeepSeek. A judge model checked every one of the findings against the code.
DetailsM1. A peer that first names the other aggregate after a header is already held still receives the held aggregate later (low, logic)
Cost of this review: ~$0.84 of a $30 budget (estimated from token counts). |
…uild Both are from the AI security review of this pull request. A peer whose first message of a slot and aggregator named another aggregate after we held a header was recorded but not kept out of the aggregate we hold: only on_header_held marked such peers, and it had already run. note_received_id now marks the peer too, so it is sent nothing more about the held aggregate. A message of a peer's previous connection that was delivered after we heard of its new one was dropped before its ID was recorded, so the peer could name another aggregate on the new connection. The message is still ignored, but its ID is received like any other. The docs build failed on `_[REJECT]_`, which the link checker reads as a link without a target.
|
/review |
AI security review: 0 finding(s) to checkReviewed by GPT, Kimi, DeepSeek. No findings to check. Cost of this review: ~$0.66 of a $30 budget (estimated from token counts). |
…-and-pull) (#988) The same commit as #987, cherry-picked onto the announce-and-pull branch. The two branches differ only in `PUSH_PHASE` / `REQUEST_DELAY` and one `CLAUDE.md` sentence, and the diff between the two PR heads is exactly that. Tests were run again on this branch with its constants. ## What EIP-8529's draft gained a validation rule on 04.12 (ethereum/EIPs#12792, commit `b541c27f85`): > _[REJECT]_ No other `AggregateID` with the same `slot` and `aggregator_index` has been received from the sender. The node has received such an `AggregateID` when a previous message carrying it passed the checks above. This implements it in the Waggle dissemination service, in both directions. **Receiving.** The service remembers the first aggregate each peer sent a message about, per slot and aggregator. A message from that peer about another one is dropped, before the header of another aggregate we may hold is looked at, as the EIP orders the checks. The record is kept by peer, not by connection, so reconnecting does not reset it, and is dropped with the slot's tracking window. **Sending.** Once the node holds the header of an aggregate (a peer's header passed, or it publishes its own), it sends nothing about that aggregate to the peers that sent it another one of the slot and aggregator. It may have requested chunks of theirs from them, and they would drop and penalize the second ID. Those peers have no use for it: a peer only sends messages about an aggregate it holds the header of, or to peers that announced it. A published aggregate is now held before it is pushed, for the same reason. `bound_headerless_aggregates` is removed: it let a peer count for the aggregate it named last, and a peer can no longer name a second one. ## Penalty Each such message is dropped and its sender penalized (`MidTolerance`, `waggle_second_aggregate_id`), as the EIP's _[REJECT]_ says, and counted in `lean_beacon_aggregate_dissemination_second_ids_rejected_total`. A node on an earlier draft breaks the rule when an aggregator signs two headers (it requests the one a peer announced, then announces the other to every peer), so such nodes are penalized by this one in that case. ## Tests - `a_peer_sends_one_aggregate_per_slot_and_aggregator`: second IDs are dropped with their chunk and header, the peer is penalized for each, other peers and other aggregators are unaffected, reconnecting does not reset the record, and the record goes with the tracking window. - `a_peer_is_sent_one_aggregate_per_slot_and_aggregator` and `a_published_aggregate_is_not_sent_to_a_peer_that_named_another`: the send side. - `one_header_is_held_per_slot_and_aggregator`: a peer whose first message is dropped because another header is held is still held to that ID. Each of the three new tests fails when its half of the change is disabled. `cargo test -p ethlambda-p2p -p ethlambda-telemetry`, `cargo fmt --check` and `make lint` pass. Not run on a devnet. ## Review follow-up The AI security review found two gaps, both closed in the last commit: - A peer whose first message of a slot and aggregator names another aggregate *after* the node holds a header was recorded but still sent the held aggregate. It is now kept out of it from that message on. - A message of a peer's previous connection, delivered after the node heard of the new one, was dropped before its ID was recorded, so the peer could name another aggregate on the new connection. The message is still ignored, but its ID is recorded (and a second one penalized) like any other. The same commit fixes the docs build, which failed on `_[REJECT]_` in `docs/beacon_pq.md`.
What
EIP-8529's draft gained a validation rule on 04.12 (ethereum/EIPs#12792, commit
b541c27f85):This implements it in the Waggle dissemination service, in both directions.
Receiving. The service remembers the first aggregate each peer sent a message about, per slot and aggregator. A message from that peer about another one is dropped, before the header of another aggregate we may hold is looked at, as the EIP orders the checks. The record is kept by peer, not by connection, so reconnecting does not reset it, and is dropped with the slot's tracking window.
Sending. Once the node holds the header of an aggregate (a peer's header passed, or it publishes its own), it sends nothing about that aggregate to the peers that sent it another one of the slot and aggregator. It may have requested chunks of theirs from them, and they would drop and penalize the second ID. Those peers have no use for it: a peer only sends messages about an aggregate it holds the header of, or to peers that announced it. A published aggregate is now held before it is pushed, for the same reason.
bound_headerless_aggregatesis removed: it let a peer count for the aggregate it named last, and a peer can no longer name a second one.Penalty
Each such message is dropped and its sender penalized (
MidTolerance,waggle_second_aggregate_id), as the EIP's [REJECT] says, and counted inlean_beacon_aggregate_dissemination_second_ids_rejected_total. A node on an earlier draft breaks the rule when an aggregator signs two headers (it requests the one a peer announced, then announces the other to every peer), so such nodes are penalized by this one in that case.Tests
a_peer_sends_one_aggregate_per_slot_and_aggregator: second IDs are dropped with their chunk and header, the peer is penalized for each, other peers and other aggregators are unaffected, reconnecting does not reset the record, and the record goes with the tracking window.a_peer_is_sent_one_aggregate_per_slot_and_aggregatoranda_published_aggregate_is_not_sent_to_a_peer_that_named_another: the send side.one_header_is_held_per_slot_and_aggregator: a peer whose first message is dropped because another header is held is still held to that ID.Each of the three new tests fails when its half of the change is disabled.
cargo test -p ethlambda-p2p -p ethlambda-telemetry,cargo fmt --checkandmake lintpass. Not run on a devnet.Review follow-up
The AI security review found two gaps, both closed in the last commit:
The same commit fixes the docs build, which failed on
_[REJECT]_indocs/beacon_pq.md.