vtxo: prefer cooperative refresh when exit is infeasible - #1215
Merged
Conversation
A critical VTXO currently enters unilateral exit even when the backing wallet cannot fund its recovery package. That can leave automatic recovery retrying while a cooperative round remains available. Reuse the manual exit feasibility model for automatic expiry decisions. Keep or start cooperative refresh while exit is infeasible, reassess on each block, and retain direct unilateral exit for feasible or unassessed paths. Log the selected action and concrete reason, and cover the 187-block incident shape with a regression test.
Closed
Member
Author
|
Fable local review: vtxo: prefer cooperative refresh when exit is infeasible Head reviewed: Local: Verified
Notes (non-blocking)
FindingsBlockers: none. |
|
Successfully created backport PR for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
decisions.
execute the exit package.
package becomes viable.
outpoint.
Fixes #1212.
Why
The affected VTXO was first observed after restart with 187 blocks remaining.
That was inside its conservative 192-block unilateral-exit budget, so the old
FSM moved directly from
LivetoUnilateralExit.The exit package needed distinct wallet fee inputs for its recovery paths. The
backing wallet had none.
txconfirmtherefore kept retrying the first feeparent, while a cooperative round was still available.
Urgency and path viability are separate decisions. Entering the critical
window should trigger an assessment. It should not force an automatic exit
that the wallet cannot execute.
Behavior
LiveLivePendingForfeitPendingForfeitLiveorPendingForfeitManual exits, fraud-triggered exits, vHTLC recovery, and VTXOs already past the
forfeit-signature boundary are unchanged.
Observability
The decision now produces structured
Automatic expiry decisionlogs with:action=cooperative_refreshoraction=unilateral_exit;height,blocks_remaining, andoutpoint.This does not fully solve the user-facing status gap. A focused follow-up
should persist and expose:
txconfirmretry error for a materializing exit.The natural read surfaces are
GetVTXOExpiryInfobefore an exit andGetUnrollStatusafter one starts. That work crosses VTXO, unroll, txconfirm,protobuf, and CLI ownership, so it is intentionally not folded into this bug
fix.
Tests
go test ./...go test ./vtxo ./waved -count=1./vtxo ./waved: 0 issuesmake rpcmake fmtThe regression test pins the issue shape: 187 blocks remaining, infeasible exit
funding, cooperative refresh retained across the next block, and unilateral
fallback once the assessment becomes feasible.