Repository navigation
Description
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_forgetandreclaim_and_forget(crates/cli/src/commands/pool.rs). Underclose --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 servesbond,unbond,register,deregister,update-region,update-multiaddrs,rotate-key,publish, andappeal.open_poolandtop_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 theopenPoolwait.
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: theTxUnconfirmed { tx: Some(hash) }error. A sweep counts it asunconfirmedand 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/TopUpUnconfirmedwithtx: 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 inpool.rsthe error downcasts toTxUnconfirmed { tx: Some(hash) }.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Projects
- StatusShow more project fieldsDone
Activity