refactor(message_validator): delete the unused received_from plumbing and peer-keyed preference map - #1284
Conversation
PR sigp#1272 made role-8 duplicate-root classification peer-agnostic per SIP-94 s7, removing the only read of the stored propagation peer. Drop the received_from parameter from the five-signature validation chain and its one production call site, and narrow the per-kind signing-root budgets from HashMap<Hash256, Option<PeerId>> to HashSet<Hash256>. Collapse the tests whose only remaining distinction was the deliverer identity. Closes sigp#1273.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## epbs #1284 +/- ##
=======================================
Coverage ? 78.30%
=======================================
Files ? 175
Lines ? 38638
Branches ? 0
=======================================
Hits ? 30257
Misses ? 8381
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@claude, please take a look |
|
Claude finished @shane-moore's task in 2m 40s —— View job Review:
|
shane-moore
left a comment
There was a problem hiding this comment.
Reviewed at dc80d806.
No findings survived self-audit. The received_from value was write-only, and narrowing the root budgets from HashMap<Hash256, Option<PeerId>> to HashSet<Hash256> preserves membership, capacity, insertion, and per-kind budget semantics. The parameter removal is complete, while propagation_source remains available for the gossipsub outcome.
The surviving tests retain coverage of first-root acceptance, duplicate Ignore mapping, capacity and non-poisoning behavior, independent per-kind budgets, and ring retention. All 126 message_validator tests passed locally, message_receiver compiled, and current CI is green.
Ship-shaped.
Reviewed by gpt-5.6-sol max.
Problem, Evidence, and Context (Required)
received_fromis written into the per-kind root maps and read nowhere; passingSome(peer)orNoneproduces identical output at every observable boundary.Change Overview (Required)
received_from: Option<PeerId>from the five-signature validation chain (validate->validate_decoded_message->validate_ssv_message->validate_partial_signature_message->update_for_partial_signature) and its one production call site inmessage_receiver::manager.SigningRootBudgetsmaps fromHashMap<Hash256, Option<PeerId>>toHashSet<Hash256>; rewrite the two doc comments that described the stored deliverer.duty_state.rs(the only semantic hunks: set narrowing + enforcement site), thenlib.rs/partial_signature.rs/manager.rs(mechanical arity changes), then the test module.root_budgetmatch, the lazy boxed budget allocation, andmanager.rs's use ofpropagation_sourcefor the gossipsubOutcomereport.libp2pstays a dependency (MessageAcceptancere-export and conversions).Risks, Trade-offs, and Mitigations (Required)
RelayedDuplicateMessage -> Ignoremapping pin, the cap/poisoning/budget-independence tests, and the ring-collision test all survive.Validator::validateis a public signature, so this is a source-level API change; the single in-repo caller is updated in the same diff.Validation (Required)
cargo test -p message_validator: 126 passed, 0 failed.make lint,make cargo-fmt-check,make check-benches,cargo check -p message_receiver: clean.grep -rn received_from anchor/: zero hits.Rollback (Required for behavior or runtime changes; optional otherwise)
Blockers / Dependencies (Optional)