Skip to content

fix(client): bound the stream rate by the probe quote the node was selected on - #2859

Merged
thiras merged 2 commits into
mainfrom
fix/2840-probe-rate-ceiling
Nov 10, 2026
Merged

thiras merged 2 commits into
mainfrom
fix/2840-probe-rate-ceiling

Conversation

@yigitdot

@yigitdot yigitdot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

The daemon's node-to-node miss pull bounds the stream-signed rate by the probe rate (effective_rate_ceiling); the CLI and SDK lanes did not. lane_source passed the bare max_rate_per_mb (CLI default 0, and a 0 ceiling disables the stream-rate check entirely), while each candidate's signed probe rate was harvested into the peer store and never compared. A node that signs a low probe rate — the one decdn quote prints and selection ranks on — and a higher stream rate was paid the stream rate, up to MAX_RATE_PER_MB.

LaneSources now remembers each candidate's probed rate and builds every lane with effective_rate_ceiling(probe_rate, max_rate_per_mb), the same bound the daemon applies and the SDK docs already prescribe. Honest nodes sign one startup-fixed rate on both paths and are unaffected. The bundle engine and gateway build lanes through LaneSources, so they inherit the bound with no change. Pulls that harvest no probe (the peer-store fast path, a pinned node) keep the config bound only, as before.

Closes #2840

🤖 Generated with Claude Code

…lected on

LaneSources harvests each candidate's signed probe rate and builds every
lane with effective_rate_ceiling(probe_rate, max_rate_per_mb) in place of
the bare config value (CLI default 0, which disabled the stream-rate check
entirely), the same bound the daemon's node-to-node miss pull applies. A
late-joining holder's rate is captured too. Pulls that harvest no probe
(the peer-store fast path, a pinned --node-id) keep the config bound only.

Closes #2840

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 7, 2026 15:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@github-code-quality

github-code-quality Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Code coverage overview

Languages: Rust

Rust / code-coverage/cargo-llvm-cov

main a9fb9c7 fix/2840-probe-rate-... 8dfe41e +/-
77% 77% 0%
View coverage of the 7 most impacted files.
File main a9fb9c7 fix/2840-probe-rate-... 8dfe41e +/-
crates/client/s...undle/engine.rs 65% 65% 0%
crates/client/src/source.rs 94% 94% 0%
crates/client/src/targets.rs 66% 67% +1%
crates/protocol/src/framing.rs 92% 93% +1%
crates/client/src/funding.rs 86% 89% +3%
crates/client/s...lane_sources.rs 40% 62% +22%
crates/client/src/lanes.rs 65% 88% +23%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated November 07, 2026 18:37 UTC

Docs: the probe rate is the quote the node was selected on, not a rank key
(selection ranks on RTT only); the max_rate_per_mb knobs on LaneDeps and the
bundle builder are the absolute cap folded with the probed rate, not the only
ceiling; RateAboveCeiling and ADR 037/039 describe the probe-relative bound on
both built-in pull paths.

Tests: a lane built through LaneSources from a probed candidate carries the
probed rate as its PeerSource ceiling at config 0 (pins the build_fresh →
lane_source splice); the two-holder fixture's samples carry distinct rates so
a rate keyed to the wrong node fails; a re-probe overwrites a node's recorded
rate.

Co-Authored-By: Claude Fable 5 <[email protected]>
@yigitdot

yigitdot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

Review pass (code / tests / comments) applied in 8dfe41e:

  • Docs: the probe rate is "the quote the node was selected on", not a rank key (selection ranks on RTT only); LaneDeps::max_rate_per_mb and the bundle builder's knob now read as the absolute cap folded with the probed rate; RateAboveCeiling and ADR 037/039 describe the probe-relative bound on both built-in pull paths.
  • Tests: a_built_lane_carries_the_probed_rate_as_its_ceiling pins the splice the review flagged — a lane built through LaneSources from a probed candidate carries the probed rate as its PeerSource ceiling at config 0, so reverting lane_source to the bare config value fails the suite. The two-holder fixture's samples now carry distinct rates (key-swap detectable), and the rediscovery test asserts a re-probe overwrites a node's recorded rate.

Reviewers confirmed no behavioral issues: honest nodes pass (> not >=), a verified probe can't sign rate 0 (validate() rejects it), lock order is consistent, and every production lane build goes through build_fresh, so parked/bundle/gateway lanes all get the bound.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The review reports no active issues with the shared client lane rate-protection changes.

No open issues 🎉

Review effort: Balanced

@thiras
thiras merged commit c65424e into main Nov 10, 2026
39 checks passed
@thiras
thiras deleted the fix/2840-probe-rate-ceiling branch November 10, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

client: decdn get pays the stream-signed rate, with no bound to the probe quote it selected the node on

3 participants