Repository navigation
Description
Follow-up to #1530, which landed the reactive mid-pull deposit top-up on the daemon's node-to-node cache-miss buyer leg with loopback coverage only.
Why an e2e is warranted
The loopback tests in crates/node/tests/node_origin_pull.rs (a_pull_larger_than_the_initial_deposit_tops_up_once_and_completes, the_resumed_leg_does_not_re_pay_for_delivered_bytes, and siblings) drive a FundingOpener double whose top_up_channel just raises an in-memory cell. Three things they therefore cannot exercise:
- A real
topUpreceipt.decdn_client_pull::buyer_channel::top_upsubmits and waits onget_receipt(); Node reactive mid-pull top-up (node-to-node buyer leg) #1530 runs that on a detached task awaited through a oneshot precisely because the foreground pull future gets dropped atouter_pull_deadline. Nothing today proves the credit still lands when the caller goes away. - The upstream's chain-watcher lag. The settle wait is sized at two
blockchain.event_poll_interval_msintervals (14s at the 7s default), because the serving node refuses to serve until its watcher observesChannelToppedUp. The loopback fixture accepts the resumed open immediately, so the budget is never actually spent against a real watcher. - The seller-side pre-serve deposit gate (feat: enforce the seller-side deposit floor before serving, drop the on-chain minDeposit #1518), which is what collapses to a wire
NotFoundduring that window.
Shape
crates/e2e/tests/node_pull_topup.rs, mirroring crates/e2e/tests/cli_fetch_topup.rs::fetch_larger_than_initial_deposit_tops_up_and_completes but with the daemon's buyer leg instead of the CLI's:
ChainFixture+ twoNodeFixtures: a seeder holding the blob, and a cold node withnode_to_node_pull_through_enabled.- Reuse the
HIGH_RATE_PER_MBtrick from the CLI test (set the seeder's rate so a ~2 MiB blob outruns the cold node'sbuyer_initial_deposit_micro_usdc). - Request the blob from the cold node; assert it ends up holding it, that
decdn_node_pull_reactive_topup_totalis exactly 1, and that the on-chain deposit rose to the working target.
Note on existing coverage
crates/e2e has no node-to-node paid-pull e2e at all today. NodeFixture::launch_pull_through_cache exists but its only three call sites (crates/e2e/tests/origin_stream_while_store.rs) all pass discovery_peers = &[], i.e. a single node with no peers — so they exercise the local-origin stream-while-store tier, never a peer pull. This issue is the first one.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Projects
- StatusShow more project fieldsDone
Activity
alpergundogdu commentedon Aug 25, 2026
Pick-up note: e2e drafted, blocked on a daemon-side non-recovery (not merged)
I built the
crates/e2e/tests/node_pull_topup.rsjourney this issue asks for and got it to the point where the only thing standing between it and green is a persistent daemon-side non-recovery on the node's first upstream miss-pull, not test scaffolding. Capturing the full state here so whoever resumes starts from the blocker rather than re-deriving it. Nothing was pushed/merged.The blocker (this is where to pick up)
The server opens its buyer pool lazily on its first upstream pull and requests from the seeder within milliseconds. The seeder's cached
getPoolview refreshes onevent_poll_interval_ms, so that first request loses the race: the seeder can't yet verify the capability against the pool owner → drops the capability →stream request on unknown lane; refusing pre-serve→ the buyer classifies itTransientand negative-caches(seeder, hash)forREFUSAL_SUPPRESSION_TTL(30s). That first refusal is a clean pre-reservationNotFound(good — no floor dead-charge).The problem: after that one refusal the server never re-attempts the upstream pull. Across a 60s downstream retry loop (12 attempts, 5s apart, well past the 30s TTL and long past the pool-view resolving) there is exactly one
node_originline in the whole run, then 60s of local-origin-only misses (reactive local-origin pull-through found no source) and a finalNotFound. So the retry never gets the server back to the node-to-node tier even after suppression should have lifted and the seeder's view is warm.Suspected root cause to chase (didn't confirm): the first miss-pull to a peer during seller pool-view lag leaves the
(peer, hash)path stuck longer than the refusal-suppression TTL — either the negative-cache/suppression isn't clearing on the retry path, or the serve-miss orchestration isn't re-reachingopen_pull_legon a subsequent request for the same hash. Plausibly entangled with #1675 (ephemeral per-serve runtimes stranding connection drivers). This is daemon behavior, so closing it is beyond a test-only change — hence not shipping the e2e yet.Why the analogous paths are green but this one isn't
node_to_node_coalesce.rsdrives node-to-node pulls green using default rate/deposit and a node-to-node warm-up whose 250ms-cadence retry happens to catch the pool-view resolving before any long suppression sets in.node_origin_pull.rs::a_pull_larger_than_the_working_deposit_tops_up_once_and_completesand siblings) and by the CLI e2e (cli_fetch_topup.rs). This issue is specifically the node-to-node on-chain e2e, which is the first of its kind and where the harness fragility lives.Findings worth keeping (sizing + traps already solved)
open_session's 250ms retry through the pool-view lag, and each admitted-then-failed serve folds the server's own upstream stumble into the client pool's durable floor dead-charge (FloorReservationdrop path), locking the 10 USDC client pool out within seconds (observedheadroom=9000000 ceiling=500000yet refused, viapool_budget_covers_reserve). Seed the warm blob into the server's own fs origin so session set-up never rides the upstream leg.working − M = 3 USDCheadroom must hold several concurrent one-chunk floor reservations that the gap-driven pull's in-flight requests reserve on the seeder side, or the pull deadlocks against its own concurrency); blob ~10 MiB (~5.02 USDC wire) so it exceeds the working deposit by enough for exactly one reactive top-up.NodeFixture::set_buyer_working_deposit(micro_usdc)incrates/e2e/src/node.rs(config rewrite + restart, mirroringset_rate_per_mb, with arewrite_buyer_working_depositTOML round-trip guard). This is independently useful and can be salvaged even if the e2e itself waits.Suggested next step
Fix (or characterize) the upstream-pull non-recovery on the daemon side first — a node whose first miss-pull to a peer races the seller's pool-view lag should recover on a subsequent request once the view resolves, well inside the deploy budget. With that fixed, the journey above (own-origin warm-up + shrunk deposit + one-top-up sizing) should go green without the retry gymnastics, and the coarse downstream retry can drop back to a single fetch.
Generated by Claude Code
fix(node,e2e): don't dead-charge a client on a pre-spend miss refusal (…
fix(node,e2e): don't dead-charge a client on a pre-spend miss refusal (…
alpergundogdu commentedon Sep 1, 2026
Done in #1892 (merged): the node-to-node reactive mid-pull top-up e2e is authored at
crates/e2e/tests/node_pull_topup.rs, along with theNodeFixture::set_buyer_working_deposithelper — and the prerequisite daemon fix (the pre-spend-refusal dead-charge that previously locked the client out) landed with it.The test is currently
#[ignore]d because it surfaced a separate daemon issue — a high-rate node-to-node pull that fails deterministically — now tracked in #1893, which is the gate for dropping the#[ignore]and turning this into live coverage. Closing here; #1893 carries the remaining work.fix(node,client-pull): enforce max_blob_size on received bytes, not t…
feat(cli): add decdn node doctor diagnostic subcommand (#1598) (#1910)