[v0.1.x-branch] Backport #1171: swaps: cover issue 881 settlement replay - #1175
Open
github-actions[bot] wants to merge 3 commits into
Open
[v0.1.x-branch] Backport #1171: swaps: cover issue 881 settlement replay#1175github-actions[bot] wants to merge 3 commits into
github-actions[bot] wants to merge 3 commits into
Conversation
Extend the lost-response regression through authoritative claim observation and terminal restart. Assert the recovered payment completes once without duplicate funding or recovery side effects. Also replay an authoritative funding miss after restart to prove the negative control remains terminal. (cherry picked from commit 739de3f)
Project the reported incident shape through the real activity store and daemon balance adapter. Assert a completed pay produces one terminal event, the activity amount matches the VTXO debit, and a failed negative control does not alter balance. (cherry picked from commit 7687a18)
Exercise activity replay through the startup backfill and remove a fake balance comparison that only restated its fixture. Bound terminal reload waits and use txid-shaped identities. (cherry picked from commit 76e0c14)
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.
Backport of #1171
What this changes
The production bug was fixed by #1061. This PR adds the incident-shaped regression that was still missing.
TestPaySessionFundingReplayAfterLostResponsethrough authoritative claim observation, durable completion, and a second daemon restart.There is no production-code change.
Incident path
VHTLCFunded.FundingInitiatedaction kept polling after changing its own state. The live-vHTLC lookup then emittedOnVHTLCFundedagain.VHTLCFunded -> OnVHTLCFunded, so the pay row became FAILED even though the server later claimed the vHTLC.VHTLCFunded. The FSM advances toWaitingForClaim, observes the indexed preimage, and persistsCompleted.The attached #881 daemon log records the separate OOR accounting boundary: the 3,000-sat input was spent and replaced by a 1,999-sat live change VTXO for the 1,001-sat send. The activity mismatch came from the pay FSM's incorrect terminal state, not from a missing VTXO debit.
The wallet regression does not feed a fake balance into the assertion. The incident log is the authoritative evidence for the debit; the test covers the activity projection that was wrong.
Tests
go test ./sdk/swaps -count=1go test -tags='wavewalletrpc swapruntime' ./swapwallet -count=1make lint-changed-local base=origin/mainmake fmt-changed-check base=origin/mainmake tidy-module-checkmake sqlc-checkmake doc-check schema-check sample-conf-checkmake commitmsg-lint range=origin/main..HEADRelated to #881. Production fix: #1061.