Fix/unilateral exit preconfirmed tree sig#150
Closed
d4rp4t wants to merge 16 commits into
Closed
Conversation
…BatchFinalizedEvent" This reverts commit 63b514e.
…dress-match rejection
Subdust rejection one may fail when tx is recoverable
BroadcastPackageAsync now passes maxfeerate=0 and maxburnamount=21e6 to submitpackage so Ark P2A anchor outputs (non-zero value, non-standard SegWit v1 script) are not rejected by Bitcoin Core's default maxburnamount=0 check. The sequential fallback switches the parent broadcast from NBXplorer's HTTP API (which does not expose maxburnamount) to a direct RPC call via the same maxburnamount override. Also fix two E2E test regressions: - CollabExit_WithBoardingInput_IsRejected: used DockerHelper.Exec with the old -rpcwallet= pattern, which silently dropped the sendtoaddress call because connection flags were missing; replaced with BitcoinCli. - SubdustVtxo_SpendOffchain_IsRejected: mine a block before the spend attempt and retry up to 10× so the VTXO_RECOVERABLE window clears before the dust-rejection assertion runs. fix tests too
…scription API Replace the removed SubscribeForScriptsAsync/UnsubscribeForScriptsAsync/ GetVtxoSubscriptionStreamAsync forwards with the new OpenSubscriptionStreamAsync and UpdateSubscriptionScriptsAsync (latest arkd protobuf subscription model).
046a93f to
0fd9d01
Compare
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.
Stacks on top of #117
Problem
Starting a unilateral exit for a VTXO whose tree-tx isn't MuSig2-co-signed yet
(
PSBT_IN_TAP_KEY_SIGabsent) failed the exit session immediately:This happens for any VTXO that is still preconfirmed — arkd only co-signs the
tree during a batch round, so the signature is absent until the batch fires. The
SDK made it worse:
VtxoChainAutoFetchServicefetches the branch on the firstVtxosChangedevent (while the VTXO is preconfirmed, so the tree-tx PSBT isunsigned) and
VirtualTxService.FetchAndStoreBranchAsyncshort-circuits onHasBranchAsync, so the stale unsigned branch is never refreshed.Fix (SDK)
Mirror go-sdk's
ErrWaitingForConfirmationretry loop — wait for the tree to beco-signed instead of failing:
VirtualTxService.FetchAndStoreBranchAsyncgains aforceRefreshflag thatbypasses the
HasBranchAsyncshort-circuit, so a stale (unsigned) branch canbe re-pulled from the indexer.
UnilateralExitService.ParseVirtualTxnow throws a typed, transientTreeTxNotSignedExceptionfor the missing-signature case.UnilateralExitService.ProgressBroadcastingAsynccatches it, force-refreshesthe branch, and leaves the session in
Broadcastingto retry on the nextProgressExitsAsync— instead of moving it toFailed.No behaviour change for already-committed VTXOs.
Tests
Moves the two exit tests blocked by this gap out of #117 (
chore/e2e-coverage)to this branch, and un-ignores the preconfirmed one:
Mirror go-sdk's
ErrWaitingForConfirmationretry loop — wait for the tree to beco-signed instead of failing:
VirtualTxService.FetchAndStoreBranchAsyncgains aforceRefreshflag thatbypasses the
HasBranchAsyncshort-circuit, so a stale (unsigned) branch canbe re-pulled from the indexer.
UnilateralExitService.ParseVirtualTxnow throws a typed, transientTreeTxNotSignedExceptionfor the missing-signature case.UnilateralExitService.ProgressBroadcastingAsynccatches it, force-refreshesthe branch, and leaves the session in
Broadcastingto retry on the nextProgressExitsAsync— instead of moving it toFailed.No behaviour change for already-committed VTXOs.
Tests
Moves the two exit tests blocked by this gap out of #117 (
chore/e2e-coverage)to this branch, and un-ignores the preconfirmed one:
ProgressExits_WorksForOffchainFundedVtxoProgressExits_WorksForPreconfirmedVtxo(was[Ignore]d on the same blocker)Verified against the local regtest: the exit no longer fails on the missing
signature — it correctly detects the unsigned tree, refreshes the branch, and
waits (
Broadcasting, notFailed).