Skip to content

fix(node): count a skipped mid-stream pool re-check and test the serve-miss PoolExhausted stop - #2789

Merged
thiras merged 3 commits into
mainfrom
fix/2630-pool-recheck-telemetry
Oct 31, 2026
Merged

thiras merged 3 commits into
mainfrom
fix/2630-pool-recheck-telemetry

Conversation

@yigitdot

@yigitdot yigitdot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Follow-ups for the mid-stream pool-solvency re-check (#2630).

  • Serve-miss loop test. drained_pool_stops_a_serve_miss_stream_after_its_floor_is_repaid drives an own-origin, outboard-backed miss through serve_via_backend_origin and the serve_leg loop, drains the pool, and asserts the in-band PoolExhausted stop, the clean FIN and decdn_serve_stream_midstream_pool_exhausted_total. It proves the route with decdn_local_outboard_serves_total == 1 and no buffered origin fetch, and it fails when the serve_leg.rs re-check is deleted. The fs-origin-with-outboard setup is now a shared helper.
  • Skipped re-check is visible. When a pool view is wired but holds no status for the pool, pool_view_status_cached counts decdn_serve_pool_recheck_skipped_total and logs a throttled warn! naming the pool, signer and hash. In production the view drops a pool only once it is closed, so a nonzero value means a pool closed under a live stream: the stream fails open, and redeemMany reverts on a closed pool, so the node is not paid for those bytes. The metric has an ADR registry row that says so.
  • Skip path tested in both loops. forgotten_pool_recheck_is_counted_and_a_{cache_hit,serve_miss}_stream_completes admit on a funded view whose cached status is gone: admission counts nothing, each skip counts, and the stream runs to StreamEnd. Both fail when a loop bypasses the helper.
  • Loopback test hygiene. The PoolExhausted tests assert a clean FIN (a reset now fails them), the cache-hit drained-pool test waits for the stop to be metered before reading the counter, and the 16 MiB interval counts are corrected.
  • Meter before the write (item 3): already fixed by fix(node): attribute every inbound stream failure to one reason counter #2166. write_reject tolerates a departed peer, so the stop is still returned and metered (a_departed_peer_does_not_fail_a_decided_end).
  • Zero-rate edge (optional item): not changed. pool_funds_committed documents the caveat, and nothing billable is at stake at rate 0.

Follow-ups: #2805 (stop a stream whose pool closes mid-stream, including Closing past the dispute deadline) and #2806 (re-check on a stale projection).

Closes #2630

🤖 Generated with Claude Code

…e-miss PoolExhausted stop

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 30, 2026 22:46

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 Oct 30, 2026 •

Copy link
Copy Markdown

Code coverage overview

Languages: Rust

Rust / code-coverage/cargo-llvm-cov

main 4037280 fix/2630-pool-rechec... 7c6d4a9 +/-
77% 77% 0%
View coverage of the 3 most impacted files.
File main 4037280 fix/2630-pool-rechec... 7c6d4a9 +/-
crates/node/src...s/client/mod.rs 91% 91% 0%
crates/protocol/src/framing.rs 92% 93% +1%
crates/node/src...nt/serve_leg.rs 90% 92% +2%

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


Updated October 31, 2026 15:26 UTC

…osed mid-stream

The pool view drops a pool only once it is closed, so a skipped mid-stream
re-check means a pool closed under a live stream, where redeemMany reverts.
Say so in the helper, metric, ADR row and CHANGELOG, and replace the debug!
with a throttled warn! that names the pool, signer and hash.

Test the skip path inside a live stream in both loops: admission counts
nothing, each skip counts, and the stream fails open to StreamEnd. In
client_loopback.rs, assert a clean FIN rather than any read error, wait for
the stop to be metered in the cache-hit drained-pool test, and correct the
16 MiB interval counts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown

Gas snapshot

No gas changes vs base.

@yigitdot
yigitdot requested a review from thiras October 31, 2026 16:13
@thiras
thiras requested a balanced review from Copilot October 31, 2026 22:41

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

No active review issues remain for the pool-solvency telemetry and test-coverage changes.

No open issues 🎉

Review effort: Balanced

@thiras
thiras merged commit 1c67719 into main Oct 31, 2026
40 checks passed
@thiras
thiras deleted the fix/2630-pool-recheck-telemetry branch October 31, 2026 23:06
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.

node: harden tests and telemetry around the mid-stream pool-solvency re-check

3 participants