You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(node): settle an unconfirmed topUp instead of freeing the top-up slot #2489
The node can send a second topUp while an earlier one may still mine. Both escrow into the same pool, and the local row credits only one.
Three paths reach this:
A failed receipt read frees the top-up slot.fund_pool (crates/node/src/buyer_pool.rs) runs inside the task that join_or_spawn_topup spawns, and that task holds topup_in_flight through a SlotGuard. When top_up returns TopUpUnconfirmed { tx: Some(..) } because the receipt read failed, fund_pool warns "topUp failed; pool not topped up" and returns. The slot frees, the row is not credited, and the next low-water spawn_refill_if_low sends a fresh topUp.
A joined top-up that failed unconfirmed is retried.retryable_join_error treats only Spawned and EscrowedUntracked as final. A recovery caller that joined a refill which failed with TopUpUnconfirmed sends its own topUp.
A submit that fails in transport (TopUpUnconfirmed { tx: None }) follows path 1 or 2.
#2433 kept the node's top_up receipt wait unbounded (receipt_timeout: None) so that a timeout cannot make path 1 routine. A dropped topUp therefore waits forever and holds the top-up slot, so node-wide funding stops until a restart.
The node's reclaim sweep (reclaim_once, crates/node/src/buyer_pool.rs) also awaits reclaim's receipt with no bound. One dropped reclaim stalls the sweep.
Fix direction
Settle an unconfirmed topUp the way settle_unconfirmed_open settles an open:
Keep the top-up slot held.
Re-poll by hash and nonce.
Credit the row from the mined receipt.
Re-send at the same nonce when the chain holds no transaction there.
After that, fund_pool can pass Some(RECEIPT_TIMEOUT).
Treat TopUpUnconfirmed as final in retryable_join_error.
Bound the reclaim sweep's receipt wait. A lapse only defers the reclaim to the next sweep, so it needs no settle step.
Checks
A paused-clock test on a ScriptedRpc transport whose topUp never mines:
the slot stays held after the bound;
a refill meanwhile sends no second topUp;
a receipt that arrives later credits the row once.
A joined recovery whose refill fails with TopUpUnconfirmed does not send its own topUp.
Activity
fix(cli,client,node)!: bound receipt waits so a dropped tx cannot hang (