You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gossip: drop ReportGate's vestigial <S> generic and dead Clone/Copy derives #1342
Follow-up from the review of #1340 (which closed #1338).
ReportGate<S> in crates/gossip/src/reputation.rs was given the same generic shape as its sibling AnnounceGate<S>, but the two are not in the same position:
Copy can never apply. It derives as impl<S: Copy> Copy. The only instantiation anywhere is Arc<dyn StakedNodeSet>, which is not Copy.
Clone has zero call sites. The gate is moved once, destructured out of ReputationWiring in spawn_reputation_tasks.
No borrowed form is possible.AnnounceGate earns its generic because validate_envelope takes AnnounceGate<&dyn StakedNodeSet> and as_gate() bridges the two. The reputation path has no counterpart: validate_reputation_envelope takes a bare &dyn StakedNodeSet, and the gate is resolved once at spawn and never re-checked per message.
AnnounceGate documents its conditional Copy in a four-line caveat (validation.rs:30-33) that was not carried over — so a reader following the cross-reference from the annotated sibling to the unannotated one may reasonably assume the same rationale holds. It does not.
Proposed: make it non-generic and delete the OwnedReportGate alias, removing the export churn across lib.rs, service.rs, and node/src/reputation_wiring.rs.
Counterargument to weigh: shape-parity with AnnounceGate is the stated point of #1338, and a reader comparing them side by side benefits from identical shapes. The counter-counter is that the symmetry lives in the variant names, and a shape difference signals "these are not interchangeable" — which is the actual hazard. Minimum acceptable outcome is dropping Copy.
Activity