Repository navigation
refactor(node,common)!: drop the seller-side rate-floor quote clamp - #2037
Merged
Merged
Conversation
The delivery floor is a redemption-time credit clamp, not a quote gate. `PaymentPool.redeem` already settles a sub-floor voucher in full and clamps only the byte count it credits toward ADR-036 vote weight, so a node that sells below the floor keeps its money and simply earns less vote weight. Raising the floor never obliges a node to raise its price. The node-side machinery that forced a node's own quote up to the floor before signing therefore protected nobody: no buyer checks the floor, and a node that wants to underprice just patches it out. It was redundant with the on-chain soft clamp and rested on the false premise that "a seller never wants to charge less". Cut it and the whole subsystem behind it: - delete `rate_bounds` (the shared clamp) and `rate_bounds_watcher` (the `RateBoundsUpdated` follower + hourly `getRateBounds()` re-read) - drop the startup `getRateBounds()` read; the node never reads the floor now - quote `payment.rate_per_mb` verbatim in `ProbeResponse` / `StreamResponse` - remove the `payment.delivery_floor` and `blockchain.rate_bounds_poll_interval_sec` config knobs, the `DECDN_DELIVERY_FLOOR` env var, and the `decdn_rate_bounds_*` metrics + their alert/dashboard/appendix rows The contract is unchanged: `deliveryFloor`, `getRateBounds()`, `setRateBounds`, `RateBoundsUpdated`, and the redemption credit clamp all stay. ADR 003 / 005 / 019 are reworded to describe the floor as a soft vote-weight credit clamp only, never a wire quote gate. Co-Authored-By: Claude Opus 4.8 <[email protected]>
There was a problem hiding this comment.
🔵 Needs a closer look
It removes a cross-cutting runtime/on-chain watcher subsystem and changes economic/wire semantics across node + config + ADRs, so it warrants final human review despite only minor nits found.
Pull request overview
This PR removes the node-side “rate floor” quote clamping subsystem and redefines the delivery floor as a redemption-time (vote-weight credit) clamp only, aligning node/client behavior with PaymentPool.redeem semantics and simplifying node runtime wiring and observability.
Changes:
- Deletes seller-side rate floor clamping (
rate_bounds, watcher, startup read) and quotespayment.rate_per_mbverbatim in probe and stream responses. - Removes related config knobs/env vars/metrics and updates monitoring artifacts accordingly.
- Updates ADRs and e2e/unit tests to drop “floor as quote gate” assumptions and remove the rate-bounds governance→daemon journey.
File summaries
| File | Description |
|---|---|
| monitoring/prometheus-alerts.yml | Removes the rate-bounds clamp alert tied to the deleted clamp metric. |
| monitoring/grafana-dashboard.json | Removes the rate-clamp panel query and updates the panel title accordingly. |
| crates/node/tests/support/mod.rs | Updates handler test wiring to no longer construct RateBounds. |
| crates/node/tests/sighup_signal.rs | Removes resolved-config fields that no longer exist (rate_bounds_poll_interval_sec, delivery_floor). |
| crates/node/tests/probe_warm_reconnect.rs | Updates probe handler construction to drop RateBounds. |
| crates/node/tests/probe_loopback.rs | Removes floor plumbing and deletes the probe “raised to floor” test. |
| crates/node/tests/node_origin_pull.rs | Updates node-origin config wiring to remove sell_rate_bounds. |
| crates/node/tests/client_loopback.rs | Updates floor-related comments and removes clamp-metric invariant tests. |
| crates/node/tests/anvil_bringup_shutdown_e2e.rs | Removes resolved-config fields that no longer exist (rate_bounds_poll_interval_sec, delivery_floor). |
| crates/node/src/runtime/reload.rs | Removes restart-required messaging and seed config fields for the deleted floor plumbing. |
| crates/node/src/runtime/mod.rs | Removes the on-chain getRateBounds() startup read and the rate-bounds watcher route; updates handler wiring. |
| crates/node/src/rate_bounds.rs | Deletes the RateBounds clamp implementation and its tests. |
| crates/node/src/rate_bounds_watcher.rs | Deletes the RateBoundsUpdated watcher and its route construction/tests. |
| crates/node/src/node_origin/mod.rs | Makes buy-side profitability gating use configured sell rate directly (no floor-derived sell rate). |
| crates/node/src/metrics.rs | Removes clamp/watcher metrics and recorders tied to rate-bounds. |
| crates/node/src/lib.rs | Drops module exports for the deleted rate-bounds components. |
| crates/node/src/handlers/probe.rs | Stops raising rate_per_mb to a floor before signing probe responses. |
| crates/node/src/handlers/client/wire.rs | Removes clamped_rate() and updates refusal-rate documentation to match new semantics. |
| crates/node/src/handlers/client/voucher.rs | Updates comments to reflect that the floor is not checked on the node wire path. |
| crates/node/src/handlers/client/mod.rs | Removes rate_bounds from handler deps/struct and updates test harness wiring. |
| crates/node/src/handlers/client/dispatch.rs | Prices requests with the configured rate_per_mb directly (no clamp). |
| crates/node/src/fee_shares.rs | Updates module docs after removing the “mirrors rate_bounds” reference. |
| crates/node/src/fee_shares_watcher.rs | Adjusts comments that previously referenced rate-bounds watcher behavior. |
| crates/incentive/src/payment_pool.rs | Updates binding/docs for getRateBounds()/RateBoundsUpdated to describe floor as redemption-time state. |
| crates/e2e/tests/smoke.rs | Removes the deleted rate-bounds governance journey from the smoke-test overview. |
| crates/e2e/tests/g_node_01_onboarding.rs | Updates onboarding journey commentary around probe quoting vs the floor. |
| crates/e2e/tests/g_gov_02_rate_bounds.rs | Deletes the governance→daemon repricing journey now that the daemon no longer follows the floor. |
| crates/e2e/src/timeout.rs | Updates heavy-tier documentation after removing the long poll ladder from the deleted journey. |
| crates/common/src/config/types.rs | Removes config fields for rate-bounds polling and payment delivery-floor seed; updates related docs. |
| crates/common/src/config/resolved.rs | Removes resolved-config fields for rate-bounds polling and delivery-floor seed; updates docs. |
| crates/common/src/config/mod.rs | Removes defaults/validation for deleted config knobs and updates resolver plumbing/tests. |
| crates/common/src/cli/run.rs | Removes the --delivery-floor CLI flag / env var. |
| crates/cli/tests/config_validate.rs | Updates CLI config validation fixtures to match the new resolved config shape. |
| crates/cli/src/commands/config.rs | Removes printing of deleted config values and updates default config comments/tests. |
| adr/architecture.md | Removes rate-bounds clamp metric from the architecture observability vocabulary. |
| adr/appendix-observability.md | Removes clamp metric and readiness field references from observability appendix. |
| adr/019-node-onboarding.md | Removes floor-fetch step and re-numbers phase steps; updates rate configuration semantics. |
| adr/012-client.md | Updates cross-reference to renumbered onboarding step. |
| adr/005-protocol.md | Replaces “rate bounds validation” with “rate bounds” semantics describing no wire quote gating. |
| adr/003-payments.md | Removes rate-bounds refresh mechanism section and redefines floor as redemption-time clamp only. |
Review details
Suppressed comments (1)
crates/node/src/runtime/mod.rs:1074
- This comment still references a “rate-bounds read”, but the rate-bounds startup read and watcher were removed in this PR. That makes the explanation confusing/misleading for future readers.
// Live operator fee-share seed (ADR 041 / ADR 016 § Tunable Economics).
// A fail-fast on-chain self-check at startup — `PaymentPool.feeRouter()`
// resolves the router address, then `FeeRouter.getShares()` reads the current
// 3-way split, narrowed to the operator's bps. Unlike the rate-bounds read,
// NO leg of this chain is fatal to boot: an RPC failure or an unnarrowable
// split falls back to `FEE_ROUTER_OPERATOR_BPS_FLOOR` and the node still comes
- Files reviewed: 40/40 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Coverage reportTotal: 82.95% (was 82.79%, ▲ +0.15%) — 79525/95876 lines
History
|
alpergundogdu
added a commit
that referenced
this pull request
Sep 15, 2026
Resolve ADR 003/005 rate-floor conflicts: keep #2037's no-seller-clamp behavior (floor is redemption-time only, node reads it for no wire decision) and fold in #2036's MAX_RATE_PER_MB=1000 value + the vote-weight-suppression rationale. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The delivery floor is a redemption-time credit clamp, not a quote gate.
PaymentPool.redeemalready settles a sub-floor voucher in full and clamps only the byte count it credits toward ADR-036 vote weight. So a node that sells below the floor keeps its money and simply earns less vote weight — raising the floor never obliges a node to raise its price.The node-side machinery that forced a node's own quote up to the floor before signing therefore protected nobody:
rate == 0and rates above the buyer's own ceiling — a cheap quote is welcome.Its only real effect was, during a governance floor-raise, to charge an operator's clients more than the operator configured — overriding their price on a premise that isn't true.
What changed
Cut the clamp and the whole subsystem behind it:
rate_bounds(the shared clamp handle) andrate_bounds_watcher(theRateBoundsUpdatedfollower + hourlygetRateBounds()re-read)getRateBounds()read — the node no longer reads the floor at allpayment.rate_per_mbverbatim inProbeResponse/StreamResponsepayment.delivery_floorandblockchain.rate_bounds_poll_interval_secconfig knobs, theDECDN_DELIVERY_FLOORenv var, and thedecdn_rate_bounds_*metrics + their Prometheus alert / Grafana panel / observability-appendix rowsg_gov_02_rate_bounds(it validated the deleted governance→daemon reprice)What is deliberately unchanged
The contract:
deliveryFloor,getRateBounds(),setRateBounds,RateBoundsUpdated, and theredeemcredit clamp all stay, along with the[MIN_RATE_FLOOR, MAX_RATE_PER_MB]bound. TheMAX_RATE_PER_MBwire ceiling and the buyer-sidemax_rate_per_mbceiling are untouched.Verification
cargo build --workspace --all-targets,cargo clippy --workspace --all-targets --all-features(clean),cargo fmt --check,RUSTDOCFLAGS=-D warnings cargo doc,cargo nextest run(common/node/cli/incentive green), andcargo test --no-run -p decdn-e2e --features anvil-e2eall pass. Net −1979 / +92 lines.🤖 Generated with Claude Code