Repository navigation
txconfirm: recover fee splits across daemon restarts - #1654
Conversation
|
/gateway review Trace the split journal and startup path across lost DB receipts, a lost first broadcast, daemon restart, a confirmed split, parent eviction and journal cleanup. Check that the same candidate is recovered, that owned inputs stay excluded, and that a backend or journal failure cannot promote an unconfirmed output. Evaluate the script-aware split sizing. Review the changes on top of #1652. Batch approval and the total fee cap are separate work. |
|
❌ gateway review failed: code-review skill failed across all auth modes: You've hit your org's monthly spend limit · ask your admin to raise it at https://claude.ai/admin-settings/usage · your weekly limit resets Nov 29, 6am (UTC) See workflow logs for details. |
|
Claude: Verdict: approve. No reachable blocker found. The split row is written before every publish. Restart restores the exact signed bytes. A failed save or clear is retried at block pace. I found one follow-up and two small nits. What I checked
Follow-up, not a blockerA split whose inputs were spent by something else now stays pending forever.
Treating missing-or-spent as ambiguous was already the behavior before this PR, while any parent was live. What this PR removes is the two escapes: last-parent eviction and restart. It is still unlikely. It needs a long unconfirmed split, an expired lease, and a wallet spend that picks that exact coin. The cost is delay, not lost funds: CPFP still works from any confirmed wallet UTXO, and only the split path stops. A proper fix is a spend watch on the split's inputs that clears the row when a conflicting spend confirms. That belongs in its own PR, not this one. Nits (optional)
Minimal necessary fixNone. |
8a131c3 to
f39051c
Compare
|
/gateway review Please review the current commit f39051c against its PR base. Focus on reachable ownership, confirmation gating, and wallet quote correctness within this layer. |
|
❌ gateway review failed: code-review skill failed across all auth modes: You've hit your org's monthly spend limit · ask your admin to raise it at https://claude.ai/admin-settings/usage · your weekly limit resets Nov 29, 6am (UTC) See workflow logs for details. |
|
Claude: No blocking issues at Durable split journal and migration 33 The table has one row (
Order before broadcast (
Restart
Output ownership after restart
Non-blocking
|
f39051c to
bb6e720
Compare
|
/gateway review Re-review bb6e720 against its immediate parent. Check confirmed-spender ownership and per-entry admission within the scope of this PR. Report concrete blockers and distinguish them from follow-ups. |
|
❌ gateway review failed: code-review skill failed across all auth modes: You've hit your org's monthly spend limit · ask your admin to raise it at https://claude.ai/admin-settings/usage · your weekly limit resets Nov 29, 6am (UTC) See workflow logs for details. |
bb6e720 to
08ab3a9
Compare
|
/gateway review Review 08ab3a9 against its immediate parent. Check confirmed-spender recovery and the wallet preview semantics in their respective PRs. |
|
❌ gateway review failed: code-review skill failed across all auth modes: You've hit your org's monthly spend limit · ask your admin to raise it at https://claude.ai/admin-settings/usage · your weekly limit resets Nov 29, 6am (UTC) See workflow logs for details. |
|
Claude: I approve 08ab3a9 (compared against f7ecd19). It has no reachable merge blockers in spend-watch registration ( Review of 08ab3a9 against f7ecd19: approved, no merge blockers Checked:
Not blocking:
|
Store the signed split and output assignments before submission. Restore the original inputs and confirmation watch before new exits can spend. Match output values to the child script type and reuse the candidate after lost storage or network receipts.
08ab3a9 to
e966e83
Compare
A wallet can split a confirmed coin to fund several recovery packages. If the daemon restarts after Bitcoin Core accepts the split, the original input may disappear from the wallet before the daemon learns which outputs to use. A lost publication reply can leave the same uncertainty.
Store the signed transaction, each output's assigned parent and a confirmation height hint in a single wallet row before submitting. Duplicate saves must match the recorded candidate. At startup the broadcaster restores its input exclusions, rejoins the split confirmation watch and watches each original wallet input for its confirmed spender from the saved height. A confirmed competing transaction releases the original candidate and its predicted outputs. Ambiguous broadcast errors retain the signed bytes. The wallet supplies the previous-output scripts from its transaction history, including after an input has been spent. A failed journal clear after confirmation is retried on a later block. The split outputs are available to fee children once confirmation arrives. Size the outputs for the wallet's child script family so that a taproot fee input can fund the package assigned to it.
This builds on #1652. Schema version 33 adds the wallet journal. The scope is the fee-output split. Durable batch approval and aggregate CPFP fee commitments are separate parts of #1651.
Verification included a database ownership test and a race-tested restart case with lost storage and publication receipts. On Bitcoin Core regtest with an LND wallet, a single confirmed funding output produced a four-output split. The daemon restarted before mining, the same txid confirmed, and three later v3 fee children spent distinct split outputs. All three exits completed.
Bitcoin Core regtest also confirmed a competing spend while the daemon was offline with each of the three wallet backends (LND, lwwallet and btcwallet). On restart the daemon built a different split from output zero of the confirmed competitor. At least two v3 fee children spent distinct outputs of that replacement in later blocks. The exits completed and the recovered wallet balance swept to the external destination.