Skip to content

Stale type name in selection.rs test comment: ReputationEngine::score() does not exist #1464

Closed

Description

@yigitdot

crates/node/src/selection.rs (in score_negative_reputation_clamps_to_floor) reads:

// Defensive: ReputationEngine::score() returns f32 in [0,1], but if a
// bug produces a negative we must still not panic and must clamp.

ReputationEngine exists nowhere in the workspace — that comment is its only occurrence (grep -rn ReputationEngine crates/ adr/). The real producer is LocalReputation::score (crates/reputation/src/local.rs:255), and it returns f64, not f32; the narrowing happens later at peer_reputation (crates/node/src/node_origin.rs:2293).

Noticed while reviewing #1461, which adds a sibling comment ~30 lines below that names the real type and return type — so the file now contradicts itself. Left out of that PR to keep its diff to the ceiling clamp.

Fix: // Defensive: LocalReputation::score() is in [0,1] by construction, but if a.

Activity

  1. added
    good first issue
    on Jul 25, 2026
  2. self-assigned this
    on Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

good first issue

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions