Skip to content

fix(client): a lane build that drains after an untracked escrow can send a second topUp #2506

Closed

Description

@thiras

Problem

A lane build that drains after an untracked escrow can send a second topUp for the same pool.

  1. Build A's topUp mines. store.add_deposit fails, so grade_deposit_credit returns EscrowUntracked. top_up already released its UnconfirmedEscrows entry when it read the receipt.
  2. The acquire loop returns that error as fatal (scheduler.rs:4098), then drains the builds still in connecting for up to 30 s (scheduler.rs:4182).
  3. Build B was parked behind A. In the drain it reads the same pool row, which has no credit for A's top-up, so it still looks low.
  4. escrow_top_up refuses a second topUp only while an earlier one is unconfirmed. A's entry is gone, so nothing refuses B, and refill_if_low escrows again.

The second escrow is exactly what EscrowUntracked is fatal to prevent: "a retry escrows again".

The drain can also start a fresh refill after a fetch that completed, for a lane that never runs. That escrow is recorded, but it is not needed.

Fix direction

  • Record on RunFunding that an untracked escrow happened in this run. escrow_top_up and the open path refuse while it is set, the same way they refuse while a topUp is unconfirmed.
  • Or: let the drain cancel builds that have not yet submitted a transaction, and await only those that have.

Checks

  • A build that drains after a sibling's EscrowUntracked on the same pool sends no topUp.
  • A build already past its submit when the fetch ends is still awaited, as today.

Found in the #2500 review (silent-failure pass). This behavior existed before #2500.

Activity

  1. added
    kind:bug
    rust
    area:payments
    on Oct 17, 2026
  2. self-assigned this
    on Oct 17, 2026
  3. added a commit that references this issue on Oct 17, 2026
    a198ac2
  4. moved this from Backlog to In progress in deCDNon Oct 17, 2026
  5. moved this from In progress to Done in deCDNon Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:paymentskind:bugrust

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions