fix(payout): fail-closed on empty post-broadcast tx ids (Lightning, Cardano, BTC, Monero, Zano)#4204
Open
TaprootFreak wants to merge 2 commits into
Open
fix(payout): fail-closed on empty post-broadcast tx ids (Lightning, Cardano, BTC, Monero, Zano)#4204TaprootFreak wants to merge 2 commits into
TaprootFreak wants to merge 2 commits into
Conversation
…ardano, BTC, Monero, Zano) Follow-up to #4181 / closes residual double-payout class from #4194. After the on-chain send is reached, a missing/empty/unparseable transaction identifier is ambiguous (funds may already have moved). Returning a plain error caused handleBroadcastError to roll the order back to PREPARATION_CONFIRMED so the cron could broadcast again. - Lightning: map empty/missing payment_hash after LND send to TxBroadcastError for LN_URL, LND_HUB and LN_NID. Invoice retries fetch a NEW invoice, so payment_hash dedup does not protect a re-broadcast. In-band payment_error stays a plain Error (self-heal). PayoutLightningService fail-closes empty ids for all address types. - Cardano: empty txSubmit result -> TxBroadcastError. - Bitcoin sendMany / Monero / Zano: empty txid/tx_hash -> TxBroadcastError. - Replace the unsafe invoice-dedup unit test; add strategy regressions that prove PAYOUT_DESIGNATED is kept with no rebroadcast.
CI format:check failed on the empty-txid regression test added for the fail-closed sendMany guard.
Collaborator
Author
|
Ready for review after 1 review pass (0 defects). What landed before the review pass:
Verified: type-check, lint, focused payout/client tests, and CI (Build and test + CodeQL + review bot) green; commits GPG-signed ( |
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
Follow-up to #4181. Closes residual double-payout paths where a broadcast can succeed but an empty/missing transaction identifier is treated as a pre-broadcast failure, causing
handleBroadcastErrorto roll the order back toPREPARATION_CONFIRMEDso the payout cron rebroadcasts.Closes #4194.
Lightning (all address types)
payment_hashnow surfaces asTxBroadcastError→PayoutBroadcastException(fail-closed).LN_URL/LND_HUB) retry by fetching a new invoice, so LNDpayment_hashdedup does not protect a re-broadcast — the previous keysend-only guard was insufficient.payment_error(e.g. no route) remains a plain Error so invoice paths can still self-heal when the payment was provably not routed.Cardano
txSubmitresult throwsTxBroadcastErrorinside the broadcast boundary.Same residual class (Bitcoin / Monero / Zano)
sendManyemptytxid, Monero emptytx_hash, Zano emptytx_hashnow throwTxBroadcastErrorinstead of returning empty values that later roll back for rebroadcast.Tests
PayoutBroadcastExceptionleavesPAYOUT_DESIGNATED, no rollback, no second broadcast.Test plan
npm run type-checkgreen