You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
node: buyer voucher progress is never persisted (record_progress has zero production callers) — every reused buyer channel signs stale vouchers and repeat pulls fail #852
Severity: HIGH — from the 2026-06-10 full-repository review (#834 surface). Two independent reviewers converged on this finding.
Location
crates/node/src/buyer_channel.rs:450 — record_progress exists but is called from nowhere in production (grep: only tests/anvil_settlement_e2e.rs:815)
crates/node/src/node_origin.rs:382-405 — pull_from_candidate calls stream_fetch and returns the bytes on success without recording voucher totals
crates/node/src/client_requester.rs:291,304-347 — self_pay advances nonce/bytes/amount only in locals; stream_fetch returns only Bytes, discarding them
Scenario
First cache-miss pull to provider X opens a channel (prior_* = 0), pays vouchers nonce=1..N; the upstream advances its accepted-voucher watermark to those totals. The buyer's persisted BuyerChannelState.last_* stays at the open-time zeros. The channel is reused per-provider (~90 days, try_reuse_live fast-path). The next pull rebuilds ChannelContext::for_buyer_channel from the stale stored state and re-signs nonce=1 with regressed cumulative bytes_delivered → upstream rejects (StaleNonce/BytesRegression) → delivery aborts at the first voucher boundary. Same shape after a node restart.
Over time every previously-used provider becomes permanently unusable for this buyer until channel expiry — the headline #834 feature works exactly once per provider. (top_up is likewise uncalled, so deposit exhaustion has the same terminal shape.)
Knock-on: each self-inflicted rejection is recorded as a negative reputation observation against the honest provider (filed separately).
Not a duplicate
#838 is a read-modify-write race betweentop_up and record_progress calls; this is that record_progress is never called at all. #763 is the unpersisted-open orphan deposit. #746 (closed) is the integration test ask.
Fix direction
Have stream_fetch report the final signed (nonce, bytes_delivered, amount) (return value or progress callback), and have pull_from_candidate call record_progress after every stream — including failed streams that sent ≥1 acked voucher. Expose it on the ChannelOpener seam.
record_progress has exactly zero production callers (only anvil_settlement_e2e.rs:815 in tests). Consequently, BuyerChannelState.last_* is never updated after a stream, so every channel reuse re-signs from nonce=1 with regressed cumulative bytes — the upstream provider rejects with StaleNonce/BytesRegression and the channel becomes permanently unusable until expiry. The #834 payment-channel feature effectively works once per provider. A secondary knock-on is that each self-inflicted rejection produces a false negative reputation event against the honest provider (tracked separately).
📊 Assessment
Dimension
Value
Reasoning
Type
Bug
Missing call site causes systematic data loss and feature failure
Core channel reuse broken; PoC can't ship with payment channels working only once per provider
Coding agent
Suitable
Precise file:line anchors, concrete fix direction, self-contained scope; main complexity is safely threading final voucher state out of stream_fetch without regressing the API
Root cause in one sentence:stream_fetch returns only Bytes and discards the final signed voucher state; pull_from_candidate and self_pay never see the final (nonce, bytes_delivered, amount) to persist.
Fix checklist:
Change stream_fetch return type (or add a progress callback) to surface the final signed (nonce, bytes_delivered, amount) after each successful or partially-acknowledged stream
Have pull_from_candidate (node_origin.rs:382-405) call record_progress on the channel after the stream, including failure paths where ≥1 voucher was already acked (look for the partial-ack completion signal)
Have self_pay (client_requester.rs:291,304-347) do the same — it advances nonce/bytes/amount in locals only today
Expose the final voucher state on the ChannelOpener seam so callers outside the channel-service boundary can invoke record_progress without holding the service's internal lock
Wire top_up call site (also currently uncalled) in the same pass — deposit-exhaustion failure has the same terminal shape
Add a regression test: open channel, stream, restart node (or re-load from store), stream again to the same provider — assert second stream succeeds and the persisted watermark matches
Interaction with #838: fixing #838's RMW race is a prerequisite for safe concurrent record_progress + top_up calls once both are wired; sequence the fixes accordingly or land them together.
Reputation damage: the false-negative reputation events against honest providers caused by self-inflicted StaleNonce rejections should be verified fixed or tracked as a follow-up once this is resolved.
Activity
github-actions commentedon Jun 10, 2026
🎯 Triage report
record_progresshas exactly zero production callers (onlyanvil_settlement_e2e.rs:815in tests). Consequently,BuyerChannelState.last_*is never updated after a stream, so every channel reuse re-signs fromnonce=1with regressed cumulative bytes — the upstream provider rejects withStaleNonce/BytesRegressionand the channel becomes permanently unusable until expiry. The #834 payment-channel feature effectively works once per provider. A secondary knock-on is that each self-inflicted rejection produces a false negative reputation event against the honest provider (tracked separately).📊 Assessment
technical,poc-blockingadded (existingbug,high,rustretained)stream_fetchwithout regressing the API🔗 Similar issues
top_upandrecord_progress; assumes both are called; orthogonal to the missing-call-site problem here, but shares the buyer-row persistence domain — should be fixed togetherbuyer_channel.rssurface, different failure mode (no persisted channel row vs. stale voucher watermark)💡 Notes and suggestions
Root cause in one sentence:
stream_fetchreturns onlyBytesand discards the final signed voucher state;pull_from_candidateandself_paynever see the final(nonce, bytes_delivered, amount)to persist.Fix checklist:
stream_fetchreturn type (or add a progress callback) to surface the final signed(nonce, bytes_delivered, amount)after each successful or partially-acknowledged streampull_from_candidate(node_origin.rs:382-405) callrecord_progresson the channel after the stream, including failure paths where ≥1 voucher was already acked (look for the partial-ack completion signal)self_pay(client_requester.rs:291,304-347) do the same — it advancesnonce/bytes/amountin locals only todayChannelOpenerseam so callers outside the channel-service boundary can invokerecord_progresswithout holding the service's internal locktop_upcall site (also currently uncalled) in the same pass — deposit-exhaustion failure has the same terminal shapeInteraction with #838: fixing #838's RMW race is a prerequisite for safe concurrent
record_progress+top_upcalls once both are wired; sequence the fixes accordingly or land them together.Reputation damage: the false-negative reputation events against honest providers caused by self-inflicted
StaleNoncerejections should be verified fixed or tracked as a follow-up once this is resolved.Add this agentic workflows to your repo
To install this agentic workflow, run
fix(node): persist buyer voucher progress after pull-through (#852)
fix(node): persist buyer voucher progress after pull-through (#852) (#…
docs(node): drop redundant (#852) ref from record_pulled comment
docs(node): restore issue-number refs (#852, #858, #831) in comments
fix(node): feed RegionAccountant on delivered node→node pulls (#858) (#…
feat(node): wire live DHT prefetch acquisition + ledger feedback (#820)…
perf(node): last-out serve-miss observer joins the pull, freeing a fi…