Skip to content

gossip: coverage gaps on the reputation sink/gate branch and the Enforce subscriber path #1344

Closed

Description

@yigitdot

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.

Activity

  1. added
    kind:test
    rust
    prio:medium
    on Jul 21, 2026
  2. self-assigned this
    on Jul 21, 2026
  3. thiras commented on Jul 21, 2026

    @thiras
    Contributor

    Fixed in 71fe6a1 (#1358).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind:testprio:mediumrust

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions