Skip to content

node: a recovery topUp that loses its nonce to the redeemer fails the fetch instead of retrying #2721

Closed

Description

@thiras

crates/e2e/tests/node_pull_topup.rs: node_pull_larger_than_working_deposit_tops_up_once_and_completes fails with deposit-exhausting node-to-node fetch. It needed a retry in 5 of the last 12 green ci.yml runs (for example run 40746379201).

Every failure has the same node log:

WARN decdn_node::buyer_pool: buyer top-up: topUp failed; pool not topped up ... error=the topUp nonce 10 is spent at block 298 and the pool's deposit there (8000) is not above the row's (8000), so the topUp escrowed nothing: topUp submit (nonce 10) returned no tx hash ... nonce too low
WARN decdn_node::node_origin: node-origin: the funding recovery step failed ...

Cause

The server node is a buyer to the provider and a seller to the client. Its seller redeemer (redeemMany, crates/node/src/payment_settlement.rs) and its buyer topUp (crates/client/src/buyer_pool.rs send_top_up) sign with one key. The redeemer is hinted on every accepted voucher, so it sends often during the fetch.

  1. send_top_up reads the pending nonce N.
  2. A redeemMany mines at N.
  3. The topUp gets nonce too low.
  4. TopUpSettling::spent (crates/node/src/buyer_pool.rs) proves from chain state that nothing escrowed, but returns an untyped error.
  5. fund_pool treats it as final. The recovery step fails and the fetch ends.

#2563 removed the old nonce-collision retry. It guarded against a double escrow, but the settle now proves that no copy at nonce N can escrow. So a retry at a fresh nonce is safe.

Fix

Mark the escrowed-nothing result with a typed error. Retry the top-up in fund_pool on that marker, with a small bound.

Activity

  1. added
    kind:bug
    prio:high
    kind:test
    area:node
    area:payments
    on Oct 28, 2026
  2. moved this from Backlog to In progress in deCDNon Oct 28, 2026
  3. moved this from In progress to Done in deCDNon Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:nodearea:paymentskind:bugkind:testprio:high

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions