Repository navigation
Description
Decision (2026-07 ADR simplification audit). Filed under the Protocol simplifications milestone — sibling to #1396, #1394, #1419. Verdict: DROP. Dead knob (default
0.0, no production consumer); thereputation^2amplification already de-prioritizes poor nodes.
Drop the minimum-reputation rejection floor (unwired selection knob)
Status: proposal for discussion, not a decision.
Summary
ADR 001 § Node Selection Algorithm describes a hard minimum-reputation rejection floor: a per-client threshold that removes candidates whose reputation is below it before scoring, so a cheap/close node can never win selection on price and RTT despite a poor reputation. In code (crates/node/src/selection.rs) this is a real, tested surface — DEFAULT_MIN_REPUTATION, apply_reputation_floor, rank_candidates_with_floor, top_n_with_floor — but it has no consumer. The one production caller ranks with the default 0.0, which disables filtering entirely; every non-zero-floor entry point is exercised only by tests. This is a knob built ahead of any consumer, sitting on top of two mechanisms that already de-prioritize bad nodes. Propose removing the floor from ADR 001 and collapsing the selection API back to the scoring path that ships today. Scale-independent: the floor is off in every real code path regardless of network size.
Motivation
-
No consumer, defaults to off. The only production call site is
node_origin.rs:1083,rank_candidates(candidates), which delegates torank_candidates_with_floor(candidates, DEFAULT_MIN_REPUTATION)withDEFAULT_MIN_REPUTATION = 0.0. The ADR itself concedes this: the floor "defaults to0.0, which disables filtering" and "per-client configuration wiring is deferred until the client fetch path that consumes the selection algorithm exists; the floor is currently exposed as a selection-API parameter." Nothing threads a non-zero floor from config or the client fetch path — the_with_floorvariants are called only from unit tests. -
Redundant with mechanisms we keep. Poor-reputation nodes are already pushed down twice by the scoring formula that ships and stays: the
reputation²amplification (a neutral 0.5 node scores 4× worse than a 1.0 node; the ADR's own table goes to 100× at the clamp) and themax(reputation, 0.1)denominator clamp (REPUTATION_FLOOR = 0.1). The floor's stated job — "price and RTT can never override a sub-floor reputation" — is a hard cutoff layered on a soft penalty that no one has shown to be insufficient. It solves a problem we have no evidence of. -
More speculative under local-only reputation. The project is moving reputation to local-EWMA-only (aggregated/network gossip reputation removed, refactor(reputation)!: drop the network/gossip tier, keep local-only scoring #1418/Drop aggregated reputation; make ADR 008 reputation local-only #1419). A hard pre-scoring cutoff keyed on a single node's private, locally-observed EWMA — with no shared/attested signal behind it — is a blunt instrument: it would let one bad local sample permanently exclude a peer from the candidate pool before scoring can weigh price and latency. The soft
reputation²penalty degrades gracefully where the floor does not. (Honest correction: in this worktree base — HEAD50e8306—NetworkReputationstill exists andcombined_reputationatnode_origin.rs:2243still blends local+network, so Drop aggregated reputation; make ADR 008 reputation local-only #1419 is project direction here, not yet merged. It does not change the verdict: the floor is dead in either regime.) -
Carrying cost with zero exercised behavior. The floor drags a public API surface (two
pub fnvariants + apub const), amin_reputationparameter threaded through four functions, and ~12 dedicated unit tests covering boundary/NaN/negative/fail-closed edge cases — all validating a code path no production call reaches. Every future refactor of the selection module pays to keep those invariants green for a feature nobody consumes.
What removal touches
Blast radius is contained; the floor is a leaf on the selection API.
- ADR 001 edit. Delete the "Minimum-reputation rejection floor" subsection (§ Node Selection Algorithm). Keep the selection-score formula, the
reputation²amplification table, and themax(reputation, 0.1)clamp paragraph intact — none of them depend on the floor. - Rust —
crates/node/src/selection.rs:- Remove
DEFAULT_MIN_REPUTATIONconst andapply_reputation_floor. - Remove the
_with_floorvariants:rank_candidates_with_floor,rank_candidates_with_floor_and_rng,top_n_with_floor, and themin_reputationparameter. rank_candidatescollapses to callrank_candidates_with_rngdirectly;top_ncollapses torank_candidates(...)+truncate(n). The sole production caller (node_origin.rs:1083,rank_candidates(candidates)) is unchanged — it already passes no floor.
- Remove
- Tests. Delete the floor-specific unit tests (
floor_drops_cheapest_subfloor_node,floor_boundary_is_inclusive,floor_drops_just_below,floor_all_below_returns_empty,floor_rejects_nan_reputation,top_n_with_floor_truncates_after_filtering,floor_preserves_survivor_ordering,negative_floor_disables_filtering_like_zero,floor_then_tiebreak_runs_deterministically,floor_above_domain_rejects_all,nan_floor_is_fail_closed, and the floor branch offloor_disable_branch-style coverage). Thescore_*_clamps_to_floortests stay — they cover theREPUTATION_FLOOR = 0.1denominator clamp, a different thing we keep.
No other crate imports the floor. grep for min_reputation / rank_candidates_with_floor / top_n_with_floor / DEFAULT_MIN_REPUTATION outside selection.rs returns nothing.
What we keep
Everything that actually de-prioritizes bad nodes stays:
- The
reputation²score amplification — the dominant lever: worse reputation raises the selection score super-linearly (4× at 0.5, up to 100× at the clamp), so poor nodes lose to comparable peers on merit. - The
max(reputation, 0.1)denominator clamp (REPUTATION_FLOOR = 0.1,compute_score) — prevents divide-by-zero and caps the worst-case multiplier at 100×. This is the "floor" we keep; it is orthogonal to the rejection floor being dropped. - The local EWMA reputation score feeding
Candidate.reputation(viacombined_reputation/ the reputation engine) — reputation still shapes selection, just as a graded penalty rather than a hard gate.
Net effect on shipped behavior: none. Every production path already runs with the floor disabled.
Counter-argument
[your call] The floor is the one place in selection where reputation acts as a veto rather than a weight. The reputation² penalty is soft: a sufficiently cheap and close node can still win despite a bad score (that is exactly the scenario the ADR wrote the floor for). If a future abuse pattern emerges — say a cluster of cheap nodes with genuinely poor local reputation crowding out honest peers — a hard cutoff is the natural mitigation, and it is cheaper to keep a tested, dormant knob than to re-derive its NaN/boundary/fail-closed semantics later. The rebuttal is that this is exactly the "knob ahead of consumer" pattern the project just rejected three times (#1396/#1394/#1419): the floor can be re-introduced in a focused PR with its client-config wiring the day a consumer exists, and the boundary tests are recoverable from git history. Keeping it now buys optionality at the cost of maintaining invariants for behavior no one runs.
Open questions
- Is there a near-term client-config story (a
min_reputationin client fetch config) concrete enough that wiring the existing floor is cheaper than removing-then-reintroducing it? If a PR for that is already scoped, this drop is premature. - If reputation lands as local-EWMA-only, do we ever want a hard exclusion keyed on a purely-local signal, or is the graded
reputation²penalty the intended ceiling on how much local reputation can influence selection? The answer decides whether the floor is "deferred" or "unwanted." - Should the ADR retain a one-line note that reputation acts only as a graded weight (no veto) after removal, so the design intent is explicit and the floor is not silently re-added later?
Metadata
Metadata
Labels
Type
Fields
Priority
Activity
fix: address review findings on the #1438/#1440 removal
docs(adr): keep reputation a graded weight after the floor removal
docs(adr): finish the reputation-floor removal in ADR 039 and the arc…
docs(adr): finish the reputation-floor removal and drop a dead attack…
docs(adr): finish the reputation-floor removal and drop a dead attack…