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: pool close/reclaim leave the local row on a pool that is no longer Open #2425
area:clidecdn binary: get, gateway, pool, publish, origin, setuparea:paymentsPools, vouchers, redeem, reclaim, staking (incentive crate and chain)kind:bugSomething does not behave as documented
After a closePool or reclaim mines, no CLI command clears the local buyer row if the first run did not. A later fetch can then reuse a pool that is closing or closed.
Case
What happens
reclaim mined, but forget_if_pool failed
forget_after_reclaim (crates/cli/src/commands/pool.rs) tells the operator to re-run decdn pool reclaim --pool X to clear the row. The re-run reads the pool as Closed. single_reclaim_gate bails at SkipClosed before the store is touched. reclaim --all prints "already reclaimed" and skips the store too.
reclaim send failed in transport or the receipt was unreadable, but the tx mined
Same dead end: the row survives, and every re-run stops at SkipClosed.
closePool send failed in transport or the receipt was unreadable, but the tx mined
forget_after_close runs only on a read receipt. A re-run of close --pool X bails "is not Open — nothing to close". close --all skips the pool as already closing. The row clears only on a later successful reclaim, or when fetch's funding recovery hits PoolNotOpen.
The comment on forget_after_reclaim names the result: a closed pool whose deposit still reads healthy, so fetch signs vouchers that redeemMany rejects. #2416 makes the second and third rows more visible but does not cause them.
Fix
Clear the local row wherever the CLI sees on-chain that a pool is no longer Open:
reclaim --pool, SkipClosed: clear the row, then report.
reclaim --all, SkipClosed: the same.
close --pool refusal and close --all skip on Closing: clear the row.
Use LocalBookkeeping so a daemon-owned store keeps its current "row untouched" report.
Checks
A test per site: a pool that reads Closed (reclaim) or Closing (close) clears the owner's row for that pool, and a row for another pool stays.
The forget_after_reclaim warning names a command that clears the row.
A related case, found in the review of #2430. It is in the same code, so it may fit this fix.
close --all: a landed close whose row-clear fails is counted as "failed to close".
close_and_forget (crates/cli/src/commands/pool.rs) runs store.forget_after_close(...)? after the closePool receipt shows Landed. If forget_if_pool returns Err, grade_local_forget turns it into an error. close_all then passes that error to BatchTally::record_error. The error carries no TxUnconfirmed, so it counts as failed:
Per-pool line: "failed to close pool X: pool X closed on-chain (tx …) but clearing it from the local store failed …". The line contradicts itself.
Summary: failed 1. Final error: "1 pool(s) failed to close".
The close did land. A re-run of close --all skips the pool as already closing, so with today's code the row survives. The Closing-skip row-clear in this issue's fix repairs the row on that re-run. The tally is still wrong on the first run.
Suggested addition: count a landed close with a faulted row-clear as acted, and print the row-clear fault as a warning, the way forget_after_reclaim does. The headline then does not say "failed to close" for a close that landed. Check: a close_all test with a store whose forget_if_pool fails → acted 1, failed 0, and the warning names the tx.
area:clidecdn binary: get, gateway, pool, publish, origin, setuparea:paymentsPools, vouchers, redeem, reclaim, staking (incentive crate and chain)kind:bugSomething does not behave as documented
Activity
thiras commentedon Oct 12, 2026
A related case, found in the review of #2430. It is in the same code, so it may fit this fix.
close --all: a landed close whose row-clear fails is counted as "failed to close".close_and_forget(crates/cli/src/commands/pool.rs) runsstore.forget_after_close(...)?after theclosePoolreceipt showsLanded. Ifforget_if_poolreturnsErr,grade_local_forgetturns it into an error.close_allthen passes that error toBatchTally::record_error. The error carries noTxUnconfirmed, so it counts asfailed:failed 1. Final error: "1 pool(s) failed to close".The close did land. A re-run of
close --allskips the pool as already closing, so with today's code the row survives. TheClosing-skip row-clear in this issue's fix repairs the row on that re-run. The tally is still wrong on the first run.Suggested addition: count a landed close with a faulted row-clear as
acted, and print the row-clear fault as a warning, the wayforget_after_reclaimdoes. The headline then does not say "failed to close" for a close that landed. Check: aclose_alltest with a store whoseforget_if_poolfails →acted 1,failed 0, and the warning names the tx.fix(cli): scope the pool row-clear to the deployment and keep refusals