Skip to content

client-pull: pin the voucher-write terminal recovery on the gap-driven drive path #1995

Closed

Description

@yigitdot

Follow-up from #1994 (review finding).

UpstreamPull::next_chunk recovers a failed voucher write by reading one terminal message: a StreamEnd marks the stream ended and the chunk is still delivered, a StreamError surfaces as the typed rejection. The two loopback tests that cover it (client_completes_when_its_send_is_stopped_before_the_closing_voucher, client_surfaces_typed_rejection_when_its_send_is_stopped_before_the_closing_voucher) drive it through the test-util stream_fetch wrapper, whose completion is decoder-based.

On the production driver::drive / PeerSource path completion is payment-based (driver.rs reads ledger.committed()), and a failed voucher write leaves that voucher armed, not committed (ledger.rs settle-high rule). After the recovery returns Ok and the leg finishes, the driver may see a paid frontier short of the gap end and re-open a leg at that frontier — a re-pull/re-pay of the residual, or an AmountRegression → reseed cycle if the node did receive the armed voucher. Nothing pins whether this converges or double-pays.

Suggested test (in crates/node/tests/client_loopback.rs beside the STOP_SENDING pair, or node_origin_pull.rs): a raw stop-then-StreamEnd server like serve_stop_send_then_signal that accepts multiple connections and honours [byte_offset, byte_len); run drive with PeerSource + ClientRangedStore (or Origin::fetch via provisioned_origin). Assert the fetch completes with correct bytes, ledger.settlement().bytes <= wire(blob) + one residual voucher, and connections accepted <= 2. Whatever the intended semantics, the test pins them.

Activity

  1. added
    rust
    on Sep 11, 2026
  2. moved this from Backlog to In progress in deCDNon Sep 11, 2026
  3. moved this from In progress to Done in deCDNon Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

rust

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions