Skip to content

gossip/node: naming + visibility cleanups around the two staked-membership gates #1345

Closed

Description

@yigitdot

Follow-up from the review of #1340. Three small items, grouped because they all touch the same seam.

1. Rename ReputationWiring.staked -> report_gate

crates/gossip/src/service.rs. The field holds an OwnedReportGate, not a set, but kept the name it had when it was Option<Arc<dyn StakedNodeSet>>. Consequences: staked: ReportGate::Disabled reads oddly at every construction site, and the field doc has to open with "Staked-reporter admission gate" purely to undo the name. The announce side already calls its spawn parameter gate.

2. Narrow NodeStakedNodeSet from pub

crates/node/src/reputation_wiring.rs. After #1340 the runtime no longer constructs it directly — both announce_staked_gate and report_staked_gate wrap it, and those are described as "the unit-tested guarantee" that the runtime never fails open (or, for the report gate, silently closed). Leaving the type pub keeps the un-gated raw seam available to callers and weakens that claim. pub(crate) looks sufficient.

3. Soften the fail-OPEN overstatement in AnnounceGate's doc

crates/gossip/src/validation.rs: "accept any signature-valid announce". With AnnounceGate::Disabled, validate_envelope still rejects on version byte, trailing bytes, payload variant, region allowlist, and 60 s clock skew — Disabled skips only the staked-membership check. The twin copy of this phrasing in reputation.rs was fixed in #1340; this one was left alone to keep that PR scoped, so the two now differ slightly and should be reconciled.

Activity

  1. added
    rust
    prio:low
    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

prio:lowrust

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions