Commit 8a655b8
committed
fix(platform-wallet): act on swept transactions at the persistence seam
Bumps the rust-dashcore pin to dev and projects the `TransactionsSwept`
event the bump brings with it. The two halves are one commit by
construction: `WalletEvent` is not `#[non_exhaustive]` and platform has
four exhaustive matches over it, so new-pin code cannot compile without
the arms — and arms that did nothing would be worse than none, because
upstream's removal is unconditional. The wallet drops the losing rows in
memory; a store that keeps them replays them at the next load and
re-creates the phantom balance the upstream fix exists to kill.
The projection is one `SweepBatch` per event, and a sweep-only round is
counted in `is_empty_no_records` so a round carrying nothing but a sweep
still reaches the persister.
The gate is what makes every intermediate host state safe. A backend
that has not attested `CORE_SWEEP_REMOVAL` is not known to have applied
the round's subtractive half, so its watermark is stripped BEFORE the
store and the wallet faults exactly as it would on a rejection —
reporting the height durable first and faulting after cannot retract a
height a legacy backend already committed. Such a host freezes its sync
watermark on the first sweep it meets instead of diverging: fail-closed,
funds-safe, and unfrozen the moment its persister ships.
A record arriving after a sweep of the same txid retracts that txid from
the folded sweep, since persisters write records before replaying sweeps
and would otherwise delete a row the wallet has brought back. The
asset-lock half mirrors it: a sweep removes the tracked entry its
funding transaction created, and `AssetLockChangeSet::merge` now cancels
a folded tombstone against a reinstating upsert (and vice versa), so no
store ever sees an upsert/tombstone pair for one outpoint whose outcome
depends on which it applies first.
The pin also carries rust-dashcore#981, which collapses BIP-39 parsing
onto one auto-detecting path. Platform's four hand-rolled
"try every wordlist" helpers are now that function, and the call sites
drop their `Language` argument. It is unrelated to sweeps and rides here
only because the sweep chain and the payload-finalization seam this
branch's base already depends on both sit above it on dev.
`spend_observer`'s two projections gain sweep arms that report no
observed spend: a sweep's released outpoints are coins that came back
free, and the inputs it kept spent are precisely the ones it does not
name, so the held set cannot be derived from the event at all.1 parent b7f2e47 commit 8a655b8
26 files changed
Lines changed: 1354 additions & 254 deletions
File tree
- packages
- rs-platform-wallet-ffi/src
- rs-platform-wallet/src
- changeset
- manager
- wallet
- asset_lock/sync
- core
- identity/network
- rs-sdk-ffi/src
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
35 | 22 | | |
36 | 23 | | |
37 | 24 | | |
| |||
Lines changed: 6 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
76 | 63 | | |
77 | 64 | | |
78 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7769 | 7769 | | |
7770 | 7770 | | |
7771 | 7771 | | |
7772 | | - | |
| 7772 | + | |
7773 | 7773 | | |
7774 | 7774 | | |
7775 | 7775 | | |
| |||
7918 | 7918 | | |
7919 | 7919 | | |
7920 | 7920 | | |
7921 | | - | |
7922 | 7921 | | |
7923 | 7922 | | |
7924 | 7923 | | |
| |||
7952 | 7951 | | |
7953 | 7952 | | |
7954 | 7953 | | |
7955 | | - | |
7956 | 7954 | | |
7957 | 7955 | | |
7958 | 7956 | | |
| |||
8068 | 8066 | | |
8069 | 8067 | | |
8070 | 8068 | | |
8071 | | - | |
8072 | 8069 | | |
8073 | 8070 | | |
8074 | 8071 | | |
| |||
8511 | 8508 | | |
8512 | 8509 | | |
8513 | 8510 | | |
8514 | | - | |
8515 | 8511 | | |
8516 | 8512 | | |
8517 | 8513 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
570 | 570 | | |
571 | 571 | | |
572 | 572 | | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
573 | 596 | | |
574 | 597 | | |
575 | 598 | | |
| |||
1329 | 1352 | | |
1330 | 1353 | | |
1331 | 1354 | | |
1332 | | - | |
1333 | | - | |
1334 | | - | |
1335 | | - | |
1336 | | - | |
1337 | | - | |
1338 | | - | |
1339 | | - | |
1340 | | - | |
1341 | | - | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
1342 | 1360 | | |
1343 | 1361 | | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
1344 | 1376 | | |
1345 | 1377 | | |
1346 | | - | |
1347 | | - | |
1348 | | - | |
1349 | | - | |
1350 | | - | |
1351 | | - | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
1352 | 1389 | | |
1353 | 1390 | | |
1354 | 1391 | | |
1355 | 1392 | | |
1356 | 1393 | | |
1357 | 1394 | | |
| 1395 | + | |
1358 | 1396 | | |
1359 | 1397 | | |
1360 | 1398 | | |
| |||
2329 | 2367 | | |
2330 | 2368 | | |
2331 | 2369 | | |
2332 | | - | |
| 2370 | + | |
| 2371 | + | |
| 2372 | + | |
| 2373 | + | |
2333 | 2374 | | |
2334 | 2375 | | |
2335 | 2376 | | |
| 2377 | + | |
| 2378 | + | |
| 2379 | + | |
| 2380 | + | |
| 2381 | + | |
| 2382 | + | |
| 2383 | + | |
| 2384 | + | |
| 2385 | + | |
| 2386 | + | |
| 2387 | + | |
| 2388 | + | |
| 2389 | + | |
| 2390 | + | |
| 2391 | + | |
| 2392 | + | |
| 2393 | + | |
| 2394 | + | |
| 2395 | + | |
| 2396 | + | |
| 2397 | + | |
| 2398 | + | |
| 2399 | + | |
| 2400 | + | |
| 2401 | + | |
2336 | 2402 | | |
2337 | 2403 | | |
2338 | 2404 | | |
| |||
0 commit comments