Repository navigation
Closed
Description
Problem
decdn get names an openPool that may still mine on every exit, but no exit names a topUp that may still mine. A rerun can therefore escrow a second top-up beside the first.
UnconfirmedOpens holds an open from its submit until its receipt is read. The CLI reads opens.pending() on every exit:
name_unconfirmed_open(crates/cli/src/commands/interrupt.rs) turns anOkinto an error that names the tx.stop_exitrefusesEX_TEMPFAIL(75, "a rerun is safe") while an open is pending.- A second Ctrl-C prints each pending open before it exits.
A topUp gets none of this. RunFunding holds a TopUpUnconfirmed only after top_up returns it, which happens at the 3-minute receipt bound (#2433). Nothing in decdn-cli reads it. These exits drop an in-flight topUp future and say nothing about it:
- Give-up mid-wait. A recovery step's
topUpis waiting for its receipt when the no-progress limit fires (--give-up-after-secs). Recovery runs exactly when no bytes are verifying. The command exits 75 with "rerun to resume", and the rerun can send a secondtopUp. - Ctrl-C mid-wait. "interrupted; run the same command again to resume" names only pending opens.
- A bundle sibling dropped.
run_groups(crates/client/src/bundle/engine.rs) drops every other entry on the first command-scope fault, including a refill or recoverytopUpstill in flight. - After a successful fetch.
drain_buildswaitsBUILD_DRAIN(30 s), which is shorter thanRECEIPT_TIMEOUT. A late lane build whose refilltopUpis still waiting is dropped with a WARN that names no tx. The command exits 0.
top_up logs the tx hash at broadcast (topUp broadcast; awaiting its receipt), but only with tracing turned on. On main, this gap already existed for the unbounded wait.
Fix direction
- Mirror
UnconfirmedOpensfortopUp:- Hold
TopUpUnconfirmed { tx: None, nonce }before the send. - Set
txonce the hash is known. - Release the entry only when the receipt is read or the submit is rejected.
- Expose the held entries alongside
RunFunding::opens(), and onBundlePuller.
- Hold
- Feed the held entries to
name_unconfirmed_open, theInterruptwatcher andstop_exit, so that:- a pending
topUpturns anOkexit into an error that names the tx; - it rules out exit 75;
- a second Ctrl-C prints it.
- a pending
- Keep the in-run refusal from fix(cli,client,node)!: bound receipt waits so a dropped tx cannot hang #2490 (
escrow_top_up). It can then read the same held set.
Checks
- A give-up (paused clock) while a recovery step's
topUpwaits on a parked receipt exits with a non-75 code and names the tx. - A successful bundle pull with a late refill still in flight at
drain_buildsreports thetopUp. - A second Ctrl-C prints a pending
topUp.
Follow-up from the #2490 review.
Activity