multi: unroll + round-finality/sweep/fraud reorg safety#897
Conversation
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
d7576db to
4a5959f
Compare
05246b9 to
b82e3b1
Compare
4a5959f to
94b2927
Compare
b82e3b1 to
2a2127e
Compare
94b2927 to
11c74f1
Compare
2a2127e to
a972e8c
Compare
11c74f1 to
4a2b582
Compare
a972e8c to
9ba3e02
Compare
|
@claude review this |
|
Claude finished @ellemouton's task in 3m 5s —— View job Review: PR #897 — unroll + round-finality/sweep/fraud reorg safetyI read the full diff against Overall this is a careful, well-documented change. The reconcile-vs-live symmetry ( 1. Boarding-sweep reorg leaves the store row permanently stale (
|
9ba3e02 to
e973b64
Compare
|
@claude review this — pushed fixes addressing the prior review comments. |
|
Claude finished @ellemouton's task in 5m 21s —— View job Re-review: PR #897 — fixes for prior review commentsI re-read the current tip against
✅ #1 — Boarding-sweep reorg roll-back — addressed
The one residual gap — a reorged-out external spender leaving a row
|
|
@claude review this — addressed your 3 follow-ups (stale unroll doc-comment rewritten, external-spend phase mapping made explicit + documented, dead GetStateRequest branch removed). |
|
Claude finished @ellemouton's task in 1m 6s —— View job Re-review: PR #897 — 3 follow-up fixes verifiedRead the fix commit (
✅ #2 — stale doc-comment rewritten (
|
588a5b6 to
4e321b4
Compare
7254db1 to
531d440
Compare
e2a235a to
d6dec4e
Compare
Squashed for the btcd v2 port. Reorg-safe unroll: reversible external-spend detection, sweep/target/proof-node rollback on TxReorged, PhaseCompleted provisional until sweep finality, and a ChainReconciler for restart reconciliation. Persisted in the checkpoint so a mid-finality-window restart rehydrates.
Squashed for the btcd v2 port. Interim reorg-safety extras: round commitment-tx terminal transition gated on finality, boarding-sweep spend watch extended to the reorg-aware lifecycle, fraud ancestor spend-watch reorg invariants, and reorg-aware lifecycle systests.
The reorg-safe unilateral-exit subsystem adds a parked, non-terminal unroll.PhaseExternalSpendObserved. Handle it in the vhtlc recovery coordinator's exhaustive phase switch -- the recovery job holds its current state while the external spend is unfinalized, mirroring the actor being parked. Fixes the exhaustive lint failure surfaced after rebasing onto a main that switches over unroll.Phase. Also fix a data race in TestExitCostTellFailureDefersTerminalHandoff: the test swapped the actor's cfg.LedgerSink from the test goroutine while the actor goroutine could still be reading it during a deferred terminal handoff. Add a synchronizing Ask after the finalize so the read happens-before the swap; production never swaps the sink.
Three review follow-ups, all documentation/dead-code with no behavior change: - unroll: rewrite the stale notifyRegistryIfTerminal doc-comment. It claimed production may retain the unroll child indefinitely after a sweep confirms (a Phase 7 follow-up), but the stack now wires FinalityDepth = ResolveReorgSafetyDepth() so txconfirm emits TxFinalized off chainsource's height-based Done synthesis for every backend, and the child IS evicted at the reorg-safety depth. - multi: make the PhaseExternalSpendObserved status mapping explicit in both statusForPhase (db_store.go) and unrollPhaseToProto (rpc_server.go) with a comment documenting the intentional collapse onto MATERIALIZING, so an operator status query is not silently misleading and a future reader knows a dedicated status can be added. - unroll: drop the unreachable GetStateRequest case in dispatch. Receive short-circuits it before dispatch, so the branch was dead; a comment now records why it is intentionally absent.
531d440 to
837276d
Compare
Part 3 of 3 of the condensed reorg-safety client stack (epic
lightninglabs/darepo#454). This is the subsystem act-on-reorg layer.
diff is against
reorg-canonicality-gates.Makes the unilateral-exit and round subsystems reorg-safe:
eligibility, reorg-aware reconciliation, snapshot handling.
fraud invariants.
Commits (unchanged, re-grouped):
unroll: Reorg-safe unilateral-exit subsystemmulti: Reorg-safety extras (round finality gate, sweep, fraud)Supersedes #410, #558 (condensed here).
This is the full-stack tip; the server PR (lightninglabs/darepo#626) pins its
client submodule at this commit so the server itests/systests exercise the
entire client + server reorg-safety behavior together.
Stack: