Description
Follow-up from the review of #1340.
Two gaps around spawn_reputation_tasks in crates/gossip/src/service.rs.
1. sink: None + ReportGate::Enforce is untested
Under subscribe_reputation = true the combined check has four input combinations:
sink |
gate | covered |
|---|---|---|
Some |
Enforce |
yes — reputation_tasks_spawn_and_drain |
Some |
Disabled |
yes — disabled_report_gate_spawns_no_reputation_tasks (#1340) |
None |
Enforce |
no |
None |
Disabled |
no |
Row 3 is the one that matters: the code comment justifying a single combined check cites exactly that case ("an Enforce gate with no sink has nowhere to put what it admits"). Line coverage is satisfied today, so a future split of the check — spawning the subscriber whenever the gate is Enforce and guarding the sink inside the task — would leave every existing test green. ~15 lines cloned from the existing Disabled test.
2. No end-to-end test drives a report through the enforcing subscriber
Nothing exercises spawn -> reputation_subscriber_task -> validate_reputation_envelope. Admission semantics are covered at the validator level (reputation.rs: happy_path, unstaked_reporter_rejected) and the constructor level (node/src/reputation_wiring.rs: report_staked_gate_enforces_over_the_live_set), but never through the spawned task.
The announce side has precisely this test — crates/node/tests/self_hosted_discovery.rs non_staked_announce_is_dropped_at_subscriber, using two real endpoints and a counting metric so it proves the reject fired rather than the weaker "the announce never arrived". The reputation subscriber is the one gate with no integration coverage at either polarity, and the harness already exists to copy.
Predates #1340; noted during its review.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
fix: batch seven review follow-ups (#1342, #1343, #1344, #1345, #1347, …
thiras commentedon Jul 21, 2026
Fixed in 71fe6a1 (#1358).