Repository navigation
test(node): pin the stall-loop rank and credit stale proofs in the deposit-capped fixture - #2177
Merged
Merged
Conversation
…posit-capped fixture silent_upstreams_do_not_starve_the_candidate_loop ranked candidates by live probe. RTT is a multiplicative score term, so under load the honest node could rank ahead of a silent one and the stall count read 1 or 0. It now seeds the probe cache through build_origin_seeded_ranking, like its fallthrough sibling. concurrent_pulls_resume_at_their_own_frontier_not_the_channels wedged in the scripted upstream. Two pulls share one lane but pay on separate connections; when a sibling's higher reveal (or closing voucher) reached the server first, the overtaken proof did not advance the claim and settle_voucher waited for a proof the payer never sends, until the 60 s stall window. The fixture now credits a stale proof from lane headroom, as the node's credit_stale does, checks a reveal against its own stream's root, and holds the lane lock across evaluate and store. Closes #2174 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Code Coverage OverviewLanguages: Rust Rust / code-coverage/cargo-llvm-covThe overall line coverage in commit 82a80f3 in the Show a line coverage summary of the most impacted files.
Updated |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Three moderate fixture-correctness issues remain in sealed-voucher pricing, zero-root handling, and partial-credit accounting.
Review effort: Lite
Findings: 2
Open (2)
What changed in this PR
Test-only fixes stabilize node-origin pull fixtures by making ranking deterministic and modeling stale concurrent payment proofs.
Changes:
- Seeds probe rankings to remove RTT-dependent flakes.
- Adds shared-lane credit tracking, stream-root handling, and atomic settlement.
| File | Description |
|---|---|
crates/node/tests/node_origin_pull.rs |
Updates deterministic ranking and deposit-capped payment fixtures. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…e capped fixture A sealed voucher clears the stream anchor, as StreamAnchor::adopt does, and a reveal on an unanchored stream is refused UnanchoredPreimage. A metering voucher on a whole chunk credits nothing even when it advances the claim (voucher_credit_delta); the reveal after it settles the chunk. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…anchor A stale proof that lane headroom cannot pay is refused AmountRegression and changes nothing, as the node's credit_stale path does; only an accepted voucher re-anchors the stream. A voucher below the lane anchor is stale and no longer resets the lane's root and frontier. Co-Authored-By: Claude Opus 5.5 <[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.

Summary
Both #2174 flakes are fixture bugs, not node bugs. The fixes change tests only.
silent_upstreams_do_not_starve_the_candidate_loop: the rank depended on live-probe RTT. The test ranked candidates by live probe, and RTT multiplies the selection score. Under load, the honest node could rank ahead of a silent candidate, which gavestalled_total1 (A ranked 2nd; these runs end in about 6.5 s, one 5 s stall) or 0. The test now usesbuild_origin_seeded_ranking, the same fix its siblingnode_origin_pull_falls_through_a_stalled_candidatealready carries.concurrent_pulls_resume_at_their_own_frontier_not_the_channels: the scripted upstream deadlocked on a stale proof. The two pulls share one lane but pay on separate connections.settle_voucheraccepted a proof only if it advanced the lane claim. When a sibling's later proof reached the server first, the overtaken proof advanced nothing. The server then waited for a proof the payer never sends, until the 60 s stall window fired. The DIAG trails of failing runs onmainconfirm both shapes:topups=[]:P(idx=2) adv=true→P(idx=1) adv=false, and nothing more on that stream.topups=[(…, 4000)]: after the top-up, B's closingV(72,b3)arrives before A's resume voucherV(71,b3), and A's voucher is stale. It is the same bug, not a frontier overshoot.The fixture now mirrors the node's
credit_stale/voucher_credit_delta:Measurements
Stress repro from the issue (parallel copies of the test binary,
--test-threads 3):mainconcurrent_pullsalone, 8 copiesIn the 0/128 run the stale arm fired 9 times (8 stale reveals, 1 stale closing voucher), and every one of those runs passed.
Follow-up (not in this PR)
After a sibling pull's top-up, a pull keeps a stale
ctx.deposit(crates/client/src/driver.rs,Nonearm of the funding result). It can cause an extra top-up, not a stall. It is worth its own issue if it matters.Test plan
cargo nextest run -p decdn-node --test node_origin_pull: 76/76 passedconcurrent_pullsalone at 8 copies)cargo clippy --workspace --all-targets -- -D warnings,cargo fmt --check, pre-commitCloses #2174
🤖 Generated with Claude Code