Skip to content

fix: Ctrl-C during an openPool receipt wait loses the tx hash and re-opens on re-run #2418

Closed

Description

@thiras

Problem

decdn fetch runs its work inside tokio::select! against interrupt.wait() (crates/cli/src/commands/fetch.rs, ~L1880). The paid path can call decdn_client::buyer_pool::open_pool (fetch.rs ~L3186, ~L4188). decdn pool open (crates/cli/src/commands/pool.rs, ~L190) also calls it. A SIGINT kills that process.

open_pool waits for the openPool receipt without a bound. If the user presses Ctrl-C during that wait:

  1. The future is dropped. No error is returned, so no error names the tx.
  2. main prints "interrupted; run the same command again to resume".
  3. No pool row was recorded. The re-run opens a second pool.
  4. If the first tx mines, its deposit is escrowed but untracked.

open_pool logs openPool broadcast; awaiting its receipt with the tx at info before the wait (#2413). The CLI shows no logs unless -v, --log-level, or RUST_LOG is set, so the default user never sees the hash.

Fix options

  • Print the tx hash to stderr when the broadcast happens. This needs a way for open_pool to hand the hash to its caller before the wait. Examples: split it into broadcast and await steps, or take a callback.
  • On interrupt during an open, print the hash and a "check this tx before re-running" note instead of the generic resume message.
  • Before a CLI open, check getPools for an owner pool that the store does not track, and adopt it. This is the same idea as fix: daemon can escrow a second deposit after an openPool receipt failure #2415 for the daemon.

Related

#2413, #2415 (the daemon re-opens after an RpcError).

Checks

  • A test that drops open_pool after broadcast, and asserts that the caller can still report the hash.

Activity

  1. added
    kind:bug
    prio:medium
    on Oct 10, 2026
  2. self-assigned this
    on Oct 10, 2026
  3. added
    area:cli
    area:payments
    on Oct 10, 2026
  4. removed their assignment
    on Oct 10, 2026
  5. added
    good first issue
    on Oct 12, 2026
  6. self-assigned this
    on Oct 13, 2026
  7. moved this from Backlog to In progress in deCDNon Oct 13, 2026
  8. moved this from In progress to Done in deCDNon Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:cliarea:paymentsgood first issuekind:bugprio:medium

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions