Commit d961644
Test splice failure surfacing and recovery
A disconnect during the interactive negotiation fails the splice with
PeerDisconnected. The first test asserts that exactly one
SpliceNegotiationFailed reaches the user — carrying the reason and the
originating request's parameters — and that a new splice initiated
afterwards completes with a single funding payment. The window only
exists mid-negotiation: a contribution still queued at disconnect is
resumed by LDK itself on reconnect, and one awaiting signatures
survives re-establishment. The test therefore synchronizes on the
counterparty's splice_ack — logged by LDK's peer handler — and
stretches the negotiation by funding the splice from many small UTXOs,
each of which adds an interactive-tx round trip.
A splice dropped by a restart is recovered silently: startup
reconciliation releases what the wallet reserved and drops the record
without fabricating a failure event. What does reach the user is the
failure LDK persisted at shutdown and replays at startup — once, with
parameters only when it still matches a kept record. The restart tests
cover both cases: a dropped splice-out surfaces without parameters and
a further restart stays silent, while a dropped fee bump — whose record
reconciliation keeps, since LDK still holds the negotiated splice —
surfaces with the bump's parameters. In both, the application
re-initiates and the splice completes. A splice confirmed while its
node was offline keeps exactly one payment record under its splice-time
id regardless of whether wallet sync or classification sees the
confirmation first.
Three more cases: a second splice submitted right after a zero-conf
lock gets a record of its own rather than being folded into the record
of the splice that just locked; a queued splice the node stopped on,
which LDK fails as it shuts down, is reported at startup with its
parameters — its record, an intent that never became a payment, outlives
the pending splice's graduation, and reconciliation keeps it while LDK
still holds that splice; and a funding record left half-written by a stop
between the signing write's two stores is dropped at the next startup
instead of lingering as a payment nothing indexes.
Developed with assistance from Claude Code.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>1 parent 3da91d4 commit d961644
2 files changed
Lines changed: 728 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
201 | | - | |
202 | | - | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
203 | 205 | | |
204 | 206 | | |
205 | 207 | | |
206 | 208 | | |
207 | | - | |
208 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
209 | 213 | | |
210 | | - | |
| 214 | + | |
211 | 215 | | |
212 | 216 | | |
213 | 217 | | |
| |||
222 | 226 | | |
223 | 227 | | |
224 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
0 commit comments