Skip to content

fix: CLI tx paths wait for a receipt with no timeout #2433

Closed

Description

@thiras

Problem

Several CLI transaction paths wait for a receipt with no bound. alloy's PendingTransactionBuilder::get_receipt has no default timeout (PendingTxConfig { timeout: None }). If a broadcast tx is dropped from the mempool (replaced, evicted, or never propagated), the wait never ends.

Unbounded sites:

  • close_and_forget and reclaim_and_forget (crates/cli/src/commands/pool.rs). Under close --all / reclaim --all, one stuck pool also blocks every pool after it, and the summary never prints.
  • tx::send_for_receipt (crates/incentive/src/tx.rs). It serves bond, unbond, register, deregister, update-region, update-multiaddrs, rotate-key, publish, and appeal.
  • open_pool and top_up (crates/client/src/buyer_pool.rs). fix: Ctrl-C during an openPool receipt wait loses the tx hash and re-opens on re-run #2418 covers Ctrl-C during the openPool wait.

Bounded sites, which set the pattern: approve uses tokio::time::timeout(APPROVE_RECEIPT_TIMEOUT, pending.get_receipt()) (3 min, crates/client/src/buyer_pool.rs), and the node's onchain_tx takes an optional timeout (crates/node/src/onchain_tx.rs).

Fix

Bound each CLI receipt wait with a timeout like APPROVE_RECEIPT_TIMEOUT. A timeout keeps the tx hash and lands in the existing "receipt could not be read" outcome, so the operator is told the tx may still mine:

  • pool.rs: the TxUnconfirmed { tx: Some(hash) } error. A sweep counts it as unconfirmed and moves on to the next pool.
  • tx::send_for_receipt: SendOutcome::InFlight(hash) with an error that names the hash.
  • open_pool / top_up: OpenUnconfirmed / TopUpUnconfirmed with tx: Some(hash).

Use one shared constant, or one helper in decdn-incentive, so the sites cannot drift.

Checks

  • A mocked-provider test per helper: the send returns a hash, and every receipt poll returns null. Use a paused tokio clock. The call returns within the bound with the hash in the error, and in pool.rs the error downcasts to TxUnconfirmed { tx: Some(hash) }.

Activity

  1. added
    kind:bug
    area:cli
    prio:low
    area:payments
    on Oct 12, 2026
  2. assigned and unassigned on Oct 12, 2026
  3. moved this from Backlog to In progress in deCDNon Oct 16, 2026
  4. 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

No one assigned

    Labels

    area:cliarea:paymentskind:bugprio:low

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions