Skip to content

fix(core): renew over a send's change only once it is indexed - #63

Closed
aruokhai wants to merge 1 commit into
mainfrom
fix-send-renews-over-change
Closed

aruokhai wants to merge 1 commit into
mainfrom
fix-send-renews-over-change

Conversation

@aruokhai

Copy link
Copy Markdown
Contributor

After a send, the wallet renews its delegate and exits over what it holds, once the indexer reflects the send. The wait was finished as soon as the inputs were gone.

The bug. Between the inputs disappearing and the change being listed, the held set is empty, or short of the change. That counted as settled, so the renewal went over funds without the change:

  • the change got no exit;
  • after a last send, the wallet had no delegate at all.

This is the heldOnceIndexed race noted in #60. The e2e's "every renewal signs an exit for every VTXO it covers" and "board, settle, and three sends Alice to Bob" failed on it. On a busy machine they failed every time: both, in two runs out of two.

The fix. A send that leaves change now also waits for the change itself. It is arkTxid:1, since the cosigner orders an ark transaction's outputs recipient, change, anchor (SendSession::change_vtxo). This uses the arrived wait the boarding path already has.

Checked:

  • core's tests: 168 pass.
  • make e2e on this branch: 25 of 25, both of those tests included.

🤖 Generated with Claude Code

After a send, the delegate and the exits are renewed over what is held,
once the indexer reflects the send. That waited only for the inputs to
be gone: in between that and the change being listed, the held set is
empty or short of the change, counted as settled, and the renewal went
over it. The change then had no exit, and after a last send the wallet
had no delegate at all: the e2e's "every renewal signs an exit for every
VTXO it covers" and "three sends Alice to Bob" failed on it, on a busy
machine every time.

A send with change now also waits for it to arrive: arkTxid:1, as the
cosigner orders an ark transaction's outputs (recipient, change, anchor).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aruokhai

Copy link
Copy Markdown
Contributor Author

Already on main: this fix was cherry-picked into #62 (0e6c397), which is merged.

@aruokhai aruokhai closed this Oct 17, 2026
@aruokhai
aruokhai deleted the fix-send-renews-over-change branch October 17, 2026 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant