Repository navigation
Description
Decision (2026-07 ADR simplification audit). Filed under the Protocol simplifications milestone — sibling to #1396, #1394, #1419. Verdict: DROP. A staler proxy than probe-RTT ranking (no on-chain consumer today) that creates a centralisation/herding pull toward incumbents.
Drop Settlement-Weighted Bootstrap Ranking (CapacityBond.recordSettlement on every settlement)
Status: proposal for discussion, not a decision.
Summary
FeeRouter.routeSettlement calls CapacityBond.recordSettlement(operator) on every settlement and every mid-channel withdraw. That call crosses a contract boundary and a role check (SETTLEMENT_REPORTER_ROLE) for one purpose: emit SettlementRecorded(operator) so clients could index the logs and bias bootstrap ordering toward "proven deliverers." This proposal drops that whole mechanism — the cross-contract call, the role, the event, and the ADR 016 §"Settlement-Weighted Bootstrap Ranking" section — and keeps peer ranking on the signals clients already use: the getActiveNodes seed list, gossip NodeAnnounce TTL liveness, and probe-RTT ordering.
The case is scale-independent. It rests on signal quality, not node count: a historical on-chain settlement log is a strictly staler proxy for "will this peer serve me now" than a live probe RTT, which the client already measures on every fetch. This does not get more useful as the network grows.
Verification note — the drop-case is even stronger than distilled. The distilled case says clients index SettlementRecorded and use it to rank. In the actual codebase, no Rust code consumes SettlementRecorded at all. The client's real bootstrap ranker (crates/client-pull/src/discovery.rs) reads getActiveNodes, orders region-first, probes the top-K for liveness + blob-holding, and ranks by probe result. The settlement-recency signal is emitted on the hottest on-chain path and read by nobody. It is pure write-side machinery with zero consumer today.
Motivation
-
It taxes the single hottest on-chain path for a nicety.
routeSettlementruns on every channel close, everysettleChannel, and — per ADR 003 § close/withdraw — every mid-channelwithdraw.FeeRouter.sol:232unconditionally appendscapacityBond.recordSettlement(operator)after the three USDC transfers. That is an externalCALL+onlyRolecheck +LOGon the most-executed mutating function in the system, to serve an ordering preference. Withdraw-heavy channels pay this repeatedly per channel. -
The signal it emits is stale by construction; the fresher signal already exists. ADR 016:474 states the plain truth: the registry "is a cold-start seed list, not a liveness oracle… Clients filter to live peers via gossip (
NodeAnnounceTTL) and probe RTT after bootstrap." ASettlementRecordedlog says "this operator settled a channel at some past block." A probe RTT says "this operator answered me 40ms ago and holds the blob." The probe strictly dominates for the actual decision — which peer to fetch from now. -
Nobody reads it. Grepping
crates/forSettlementRecordedreturns zero consumers. The client ranker (discovery.rs) never indexes these logs. So today the mechanism is 100% cost, 0% benefit: it changes on-chain gas and surface but influences no client behavior. -
The ADR itself already concedes cold-start nodes aren't excluded. ADR 016:494 says cold-start operators "sink to the bottom by recency but are not excluded — they get probed once early settlers are exhausted." So the ranking is a soft ordering hint, not an admission gate. Gossip + probe produce that same soft ordering from fresher data, without an on-chain event.
-
It is redundant with a signal the project deliberately kept fresh. Region and liveness already live in signed
NodeAnnouncegossip (ADR 016:492). The design principle "return raw signals, not policy" (ADR 016:491) is satisfied bygetActiveNodes+ gossip alone; settlement events are a third signal source for a decision the first two already make better.
What removal touches
Blast radius:
ADR 016 (canonical contract surface) — rewrites:
- Delete § "Settlement-Weighted Bootstrap Ranking" entirely (
016-contract-interactions.md:476-494), including its contract-surface table and design-principle 1 as it pertains to settlement events. - Class diagram: drop the
FeeRouter ..> CapacityBond : recordSettlementedge (line 84) and the comment block at 123-124. - Deployment/init: remove step 5 "Grant
SETTLEMENT_REPORTER_ROLEon CapacityBond to FeeRouter" and itsgrantRolesnippet (lines 339-345). - Cross-contract call graph: drop the
FR -->|recordSettlement(op)| CBONDedge (line 402) and its row in the call table (line 431); removerecordSettlementfrom the mutation list in the note at line 452. - Roles table (line 588), function-signature table (line 651): delete the
recordSettlement/SETTLEMENT_REPORTER_ROLErows. routeSettlementdescription (line 678): drop theCapacityBond.recordSettlement(operator)clause.CapacityBondintro surface list (line 238): removerecordSettlementfrom the enumerated surface.- Off-chain read API note (lines 484-487): the
getActiveNodes/firstBondedAtseed-list rows stay; only the settlement-event row goes.
ADR 003 — one clause:
003-payments.md:483(withdraw effects) and the analogouscloseChannel/settleChannelprose: delete the "As a side effect, eachwithdraw(viarouteSettlement) also callsCapacityBond.recordSettlement(operator)…" sentence. ThefirstBondedAtage-ramp andbondOfprobe-priority reads (ADR 003 § Admission and Priority) are unaffected — they are separate surfaces.
Contracts:
FeeRouter.sol:232— delete thecapacityBond.recordSettlement(operator);call. Fix: also drop the now-unusedcapacityBondimmutable/constructor wiring only if nothing else onFeeRouterreferences it (confirm — grep shows this is its only use; if so, remove the constructor arg and theDeployProtocolgrant).CapacityBond.sol— deleteSETTLEMENT_REPORTER_ROLEconstant (line 75), theSettlementRecordedevent (line 430), and therecordSettlementfunction (lines 1202-1205). Drop it from theICapacityBondinterface.- Deploy script (
DeployProtocol): remove thegrantRole(SETTLEMENT_REPORTER_ROLE, feeRouter)step.
Rust:
- No consumer to remove —
crates/client-pull/src/discovery.rsnever readSettlementRecorded. Client ranking (getActiveNodes seed → region → probe RTT) is untouched. This is the cheapest part of the blast radius, which is itself an argument for the drop.
Tests + gas snapshots:
contracts/test/FeeRouter.t.sol: the mockrecordSettlementoverride (line 30) and anySettlementRecordedvm.expectEmit; therouteSettlementdistribution/bytes tests keep passing but their gas numbers change.contracts/test/GovernanceLifecycle.t.sol:routeSettlementis called to populatebytesPerEpoch(lines 184+); still works, gas shifts.contracts/.gas-snapshot: regenerate —test_routeSettlement_*rows (430-433) drop by the cost of one external call +LOG+ role check. Fix:FOUNDRY_PROFILE=ci forge snapshot.- Any CapacityBond test asserting
SETTLEMENT_REPORTER_ROLEwiring: delete.
What we keep
The full bootstrap-and-rank pipeline survives intact, because none of it depends on settlement events:
getActiveNodes(offset, limit)seed list onCapacityBond— cold-start peer discovery, paginated (ADR 016:461, consumed bycrates/client-pull/src/discovery.rs,crates/node/src/dht/*). Unchanged.- Gossip
NodeAnnounceTTL liveness — the actual "is this peer alive right now" filter (ADR 016:474). Unchanged. - Probe-RTT ranking —
discovery.rsprobes top-K candidates and ranks by liveness + blob-holding + RTT. This is the fresher signal that already does the job. Unchanged. firstBondedAtage-ramp andbondOfprobe-acceptance priority (ADR 003 § Admission and Priority) — separate reads, not part of this mechanism. Unchanged.FeeRouter's governance-canonicalbytesPerEpoch/totalBytesPerEpochserved-bytes vote-weight accounting (ADR 036) — incremented inline inrouteSettlement, entirely independent of therecordSettlementcall. Unchanged.
Counter-argument (strongest keep-case) — [your call]
The honest keep-case is eclipse-resistant cold ranking for a fresh client with no gossip yet. Gossip TTL and probe RTT both require the client to have already reached peers. At the very first cold start — before any gossip mesh, before any probe — the client has only the getActiveNodes seed list, which is registration-ordered and includes staked-but-dead nodes. SettlementRecorded logs let a cold client, reading only chain state, rank that seed list by proven delivery before spending a single probe round-trip. Against an adversary who stakes many dead nodes to pad the seed list (Sybil-on-registry), settlement history is expensive to fake (real USDC from a real paying counterparty), so it's a genuinely harder-to-game pre-probe prior than registration order.
Weighing it: this is real but narrow, and it's a first-fetch probe-budget optimization, not a capability. The client still probes; settlement ranking only reorders which peers it probes first. The cost is a permanent tax on the hottest on-chain path plus a role and event on CapacityBond, for a one-time-per-cold-start ordering hint that today no client even reads. If the eclipse-prior turns out to matter, it can come back as a client-only feature: index Settled events already emitted by FeeRouter (line 234) and correlate to operators off-chain — no CapacityBond surface, no second event, no cross-contract call. That path gets the same anti-Sybil prior at zero added on-chain cost. [your call] whether the cold-start eclipse prior is worth keeping any on-chain surface for, given FeeRouter.Settled already carries the operator address.
Open questions
- Does
FeeRouter.Settled(operator, bytes, amount, epoch)(already emitted, line 234) fully substitute forSettlementRecordedas a client-side settlement-recency index? If yes, the counter-argument's keep-case costs zero on-chain surface and this drop is unambiguous. - Is
capacityBondreferenced anywhere else inFeeRouter.solbesides line 232? Grep says no — confirm before removing the immutable + constructor arg (and the deploy-time grant). - Was any off-chain indexer / dashboard (outside
crates/) planned to consumeSettlementRecorded? The ADR implies clients would; nothing in-repo does. Confirm no external tooling depends on it before deleting the event. - Does removing
SETTLEMENT_REPORTER_ROLEsimplify theDeployProtocolrole-grant matrix enough to be worth calling out as a secondary win (one fewer post-deploygrantRoleand one fewer cross-contract trust edge)?
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
altanoruc commentedon Jul 24, 2026
Automated implementation triage follow-up: dispatch stopped with no PR after current code contradicted the issue's premise that FeeRouter uses CapacityBond only for recordSettlement. FeeRouter's constructor also calls capacityBond_.epochLength() to enforce on-chain equality with the router epoch. Please choose explicitly: (A) retain a CapacityBond epoch-view constructor dependency solely for contract-enforced equality while removing settlement reporting, or (B) remove the dependency and move the equality check to BaseProtocolDeploy, which does not protect direct FeeRouter deployments. Both are defensible; once pinned, the remaining production/ADR diff is about 192 lines excluding tests and gas snapshots.
fix: address multi-agent review of the simplification batch