Repository navigation
refactor(platform-wallet-storage)!: delete removed identities instead of tombstoning #4496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
403 commits
Select commit
Hold shift + click to select a range
33d18ac
test(platform-wallet-storage): adversarial recheck of #4113 union/con…
lklimek 7b56929
fix(platform-wallet-storage): reject conflicting keys at one node-key…
lklimek ad0164c
docs: design for asset-lock proof blob rehydration fix (#4133)
lklimek 8f9c5f7
fix(platform-wallet-storage): tighten secrets/ error diagnostics & lo…
lklimek 59f65e7
fix(platform-wallet-storage): log SqlitePersister open() and delete d…
lklimek 081d055
fix(platform-wallet): retry transient persister failures in register_…
lklimek f7ab81f
fix(platform-wallet-storage): surface provider node keys and guard xp…
lklimek 38ea7c9
fix(platform-wallet-storage): close error-handling gaps in sqlite sch…
lklimek da92ee9
docs(platform-wallet): make store()'s transient-failure retry contrac…
lklimek 8417dc8
fix(platform-wallet-storage): rehydrate asset-lock proof blobs via wi…
lklimek ae01482
fix(platform-wallet): release wallet-event adapter on failed load; ty…
lklimek bdc7bf5
fix(platform-wallet-storage): route third from_script site through Ad…
lklimek 95742a0
test(platform-wallet-storage): fully-populate both proof variants; dr…
lklimek 66cea08
revert(platform-wallet-storage): drop the V004 migration — no pre-rel…
lklimek 2878bd5
docs(dpp): pin the internally-tagged serde/bincode hazard at its defi…
lklimek 40c08c5
merge: fold in secrets/ error-handling-coverage fixes (PR #3968)
lklimek fde795b
merge: fold in sqlite/schema/ error-handling-coverage fixes (PR #3968)
lklimek ee2b5d7
merge: fold in persister/orchestration-layer error-handling-coverage …
lklimek d210cae
Merge branch 'feat/platform-wallet-storage-rehydration' of https://gi…
lklimek d18020f
test(platform-wallet,dpp): QA-002/003/004 — honest Drop-release seman…
lklimek c992523
Merge remote-tracking branch 'origin/v4.1-dev' into feat/platform-wal…
lklimek a111e37
fix(platform-wallet-storage): resolve v4.1-dev merge fallout
lklimek 1ce14ec
fix(platform-wallet-storage): resolve v4.1-dev merge fallout (content)
lklimek 884a6cd
Merge remote-tracking branch 'origin/feat/platform-wallet-storage-reh…
lklimek 77278e7
fix(platform-wallet-storage): lift provider node keys onto the persis…
lklimek fd26d4e
test(platform-wallet-storage): regenerate V001 fixture, fix remaining…
lklimek 3f2092c
fix(platform-wallet-storage): fail loud on unread FFI provider node keys
lklimek b7f3af9
Merge remote-tracking branch 'origin/feat/platform-wallet-storage-reh…
lklimek 7956bb8
style(platform-wallet-storage): fix rustfmt violation in sqlite_versi…
lklimek b361e11
fix(platform-wallet-storage): persist typed public keys on core addre…
lklimek a536a26
chore(platform-wallet): rustfmt reflow of changeset re-export list
lklimek 769deaf
docs(qa): mark qa-review-4113.md superseded by the #4127 pivot
lklimek 83a28f7
fix(platform-wallet-storage): reject conflicting typed pool-key writes
lklimek 3c26fc1
refactor(platform-wallet): share platform-node pool-insert logic
lklimek 42da594
fix(platform-wallet-storage): reject untyped/malformed typed pool-key…
lklimek 04c71e2
fix(platform-wallet): restore used platform-node pool bookkeeping on …
lklimek 25e50bb
Merge branch 'v4.1-dev' into feat/platform-wallet-storage-rehydration
lklimek 91cd3e3
fix(platform-wallet-storage): persist provider key accounts and platf…
Claudius-Maginificent 8eacd6b
merge: forward-port outstanding PR #4117 review-feedback fixes onto P…
claude 1980a10
build(deps): pin rust-dashcore to the dash-evo-tool integration branch
claude c01f74f
fix(wallet): migrate address pool state bookkeeping
lklimek 69b4803
fix(wallet): reserve platform receive addresses
lklimek f376d32
merge: reconcile with origin/feat/platform-wallet-storage-rehydration…
claude 1ce7be0
Merge remote-tracking branch 'origin/v4.1-dev' into merge-base/3968-v…
lklimek be76265
build(deps): refresh lockfile for rust-dashcore pin
lklimek fabcbf0
style(wallet): format merge resolutions
lklimek 267599d
fix(wallet-storage): remove stale merge import
lklimek 1662b3a
test(wallet): migrate payment checks to address state
lklimek 6304208
fix(platform-wallet-storage): persist AddressState::Reserved timestamp
lklimek fe71552
fix(platform-wallet): retry transient startup load, fix stale used-bo…
lklimek a864315
fix(platform-wallet-ffi): dedicated transient/fatal codes for persist…
lklimek 9fcee37
fix(platform-wallet-storage): parent-dir permission gate, shared id32…
lklimek 2c9996a
Merge branch 'fix/3968-wallet-review-findings' into fix/3968-storage-…
lklimek 154b696
Merge branch 'fix/3968-ffi-review-findings' into fix/3968-storage-rev…
lklimek 904e549
Merge remote-tracking branch 'origin/v4.1-dev' into fix/3968-storage-…
lklimek ebbd15c
Merge remote-tracking branch 'origin/v4.1-dev' into fix/3968-storage-…
lklimek 40fedf1
fix(platform-wallet-storage): gate identity BLOB columns before mater…
lklimek 74d4fee
docs(platform-wallet-storage): disclose vault-header corruption ambig…
lklimek ed74114
fix(platform-wallet-storage): make connection-mutex poisoning permane…
lklimek 032f791
test(platform-wallet-storage): exercise account-zero fallback through…
lklimek 9d7cfea
refactor(platform-wallet-storage): drop dead core_utxos.account_index…
lklimek 2830822
docs(platform-wallet-storage): fix stale capability rationale, disclo…
lklimek 5e20040
fix(platform-wallet-storage): require minimum passphrase length
lklimek 0cc257f
docs(platform-wallet-storage): clarify floor-target and passphrase-gu…
lklimek cb0f647
docs(platform-wallet-storage): resolve V001-mutability contradiction …
lklimek c19a4db
fix(platform-wallet-storage): correct CLI exit-code classification
lklimek e4bbd96
docs(platform-wallet-storage): strip ephemeral review-finding IDs fro…
lklimek 9964031
fix(platform-wallet-storage): exclude plain readers during restore, h…
lklimek 63e160b
feat(platform-wallet-storage): persist shielded viewing keys natively
lklimek e75f259
feat(platform-wallet): add delete_wallet to PlatformWalletPersistence…
lklimek be89caa
chore(deps): bump rust-dashcore pin to dash-evo-tool branch head (18c…
lklimek 4a1ba64
Merge remote-tracking branch 'origin/v4.1-dev' into merge/v4.1-dev-in…
lklimek e9c9b74
fix(platform): reconcile confirmed UTXO height after wallet restart (…
Claudius-Maginificent 3bd0cc5
Merge remote-tracking branch 'origin/v4.1-dev' into feat/platform-wal…
lklimek 0e644e8
Merge branch 'feat/platform-wallet-storage-rehydration' of https://gi…
lklimek 288a6ca
Merge remote-tracking branch 'origin/v4.1-dev' into feat/platform-wal…
lklimek 3636aff
Merge remote-tracking branch 'origin/v4.1-dev' into feat/platform-wal…
lklimek 0ed8b4d
Merge remote-tracking branch 'origin/v4.2-dev' into feat/platform-wal…
lklimek debf67b
Merge remote-tracking branch 'origin/v4.2-dev' into feat/platform-wal…
lklimek 4ca05f5
chore(deps): update rust-dashcore dash-evo-tool branch
lklimek a15b680
fix(platform-wallet): thread AssetLockFundingAccount/drain into build…
lklimek a18bd15
test(platform-wallet): scope broadcaster mutex guard to satisfy clipp…
lklimek 762c66c
fix(platform-wallet-storage): stop one bad script row from bricking a…
lklimek 65bdbb1
fix(platform-wallet-storage): park duplicate-index identities instead…
lklimek d78c4bd
docs(platform-wallet): document the parked-identity exception to the …
lklimek 3cab9f5
Revert "docs(platform-wallet): document the parked-identity exception…
lklimek a402a88
Revert "fix(platform-wallet-storage): park duplicate-index identities…
lklimek 6cb7f97
Revert "fix(platform-wallet-storage): stop one bad script row from br…
lklimek eec7c4d
fix(platform-wallet): derive spent UTXO scripts from the input's address
lklimek 8c5ca08
fix(platform-wallet-storage): name auto-backups after their source da…
lklimek 4b92230
fix(platform-wallet-storage): enforce key/identity co-ownership at th…
lklimek ae42330
fix(platform-wallet-storage): narrow identity_keys key to (identity_i…
lklimek 0b5e2e1
feat(platform-wallet-storage): allow NULL identity_keys.wallet_id, gu…
lklimek 3eb021a
feat(platform-wallet-storage): add load_unowned_identities accessor
lklimek c33807b
test(platform-wallet-storage): pin the unowned-scope guards nothing held
lklimek 5931df7
chore(deps): update rust-dashcore dash-evo-tool branch
lklimek 9d0dd5a
Merge remote-tracking branch 'origin/v4.2-dev' into feat/platform-wal…
lklimek 026b1cb
chore(platform-wallet-storage): drop changes outside the storage crate
lklimek c5ff761
fix(platform-wallet): make the Drop-backstop wait valid on a multi-th…
lklimek 69d21e3
test(platform-wallet): assert synchronous persister release on the gr…
lklimek 69ed03b
revert(platform-wallet): stop reserving in next_unused_receive_address
lklimek 125aff1
feat(platform-wallet-storage): add LoadPolicy, LoadCtx, and recovery-…
lklimek 16a93e3
feat(platform-wallet-storage): make a recovery-mode persister read-only
lklimek 9160fc4
refactor(platform-wallet-storage): thread &LoadCtx through the load r…
lklimek a5f054c
feat(platform-wallet-storage): fail closed on chain-lock and core-tx …
lklimek 6bc2c64
feat(platform-wallet-storage): fail closed on an undecodable shielded…
lklimek 7645953
feat(platform-wallet-storage): fail closed on orphaned identity rows
lklimek 0296a7b
feat(platform-wallet-storage): fail closed on rehydration derivation …
lklimek 386d1bb
feat(platform-wallet-storage): count the two ambiguous sites and prob…
lklimek 3690837
docs(platform-wallet-storage): document the load policy across rustdo…
lklimek 278b5c3
fix(platform-wallet-storage): stop inventing a derivation index for t…
lklimek d2e90d3
docs(platform-wallet-storage): state the load contract once, where it…
lklimek 984007a
docs(platform-wallet-storage): mark the gap-limit derivation site as …
lklimek 7fff2d3
fix(platform-wallet-storage): cap the implied work of a rehydration g…
lklimek 06a1408
docs(platform-wallet-storage): reunite the address-reuse regression t…
lklimek 92f6f04
refactor(platform-wallet-storage): split the stringly-typed rehydrati…
lklimek 90df897
fix(platform-wallet-storage): put the remedy in the message the user …
lklimek 1f411d9
fix(platform-wallet-storage): count tombstoned orphan rows one per row
lklimek c1fde0c
fix(platform-wallet-storage): make a tolerated site one joinable log …
lklimek 8f18e94
fix(platform-wallet-storage): make one incident greppable under one name
lklimek c73f44d
refactor(platform-wallet-storage): give LoadDegradation's invariants …
lklimek a9ef3b6
refactor(platform-wallet-storage): stop exporting a type no caller ca…
lklimek a416a86
test(platform-wallet-storage): pin the unimplemented-table probe to t…
lklimek 743b7ca
docs(platform-wallet-storage): say that a point read's tally is dropped
lklimek b4b540a
docs(platform-wallet-storage): mark the two unseedable sites NOTE, no…
lklimek 1958a27
fix(platform-wallet-storage): cost an empty address pool as empty
lklimek f3ac199
fix(platform-wallet-storage): count every address a degraded site aff…
lklimek 6bf10b8
test(platform-wallet-storage): pin the three snapshot promises nothin…
lklimek 72395da
fix(platform-wallet-storage): reject duplicate (wallet_id, identity_i…
Claudius-Maginificent 993584a
Merge branch 'v4.2-dev' into feat/platform-wallet-storage-rehydration
lklimek 05f6616
fix(platform-wallet-storage): let a store() own the flush of its own …
lklimek 616963e
fix(platform-wallet-storage): keep pending writes when a delete abort…
lklimek 7031fae
fix(platform-wallet-storage): judge identity slots on the state a cha…
lklimek 2148788
docs(platform-wallet-storage): document that store_flush_seam is not …
lklimek 86b4dd1
Merge remote-tracking branch 'origin/feat/platform-wallet-storage-reh…
lklimek 17c022a
fix(platform-wallet-storage): purge legacy empty-script spent UTXO rows
lklimek 4784de0
docs(platform-wallet): correct the derive_spent_utxos field notes
lklimek c86d237
Merge remote-tracking branch 'origin/v4.2-dev' into feat/platform-wal…
lklimek 53c3d2d
fix(platform-wallet): keep the shielded changeset slot in every featu…
lklimek 378d45a
fix(platform-wallet): surface unclean worker shutdown on rehydration …
lklimek 4f0fd09
fix(platform-wallet-storage): drop the stale wallet_meta module decla…
lklimek cfc5c10
fix(platform-wallet): use dash-spv's own acceptance timeout instead o…
lklimek 4dbf38f
Merge branch 'v4.2-dev' into feat/platform-wallet-storage-rehydration
lklimek 396977b
Merge branch 'fix/platform-wallet-broadcast-acceptance-timeout' into …
lklimek 92f9681
fix(platform-wallet-storage): resolve two silent regressions from the…
lklimek aaab997
Merge branch 'v4.2-dev' into feat/platform-wallet-storage-rehydration
lklimek e250391
fix(platform-wallet-storage): close six read-path and verification ga…
lklimek a844aec
docs(platform-wallet-storage): correct the duplicate-slot load claim
lklimek 1fc9b11
refactor(platform-wallet-storage)!: delete removed identities instead…
lklimek 21484ce
Merge branch 'feat/platform-wallet-storage-rehydration' into chore/pw…
lklimek 3f40708
fix(platform-wallet-storage): stop secret drop aborting on a shared l…
lklimek 082f203
fix(platform-wallet-storage)!: give every secret its own guarded page…
lklimek 62ee946
fix(platform-wallet-storage)!: close the memsec rework's review findings
lklimek 67d4ef3
feat(platform-wallet-storage): let SecretString be edited in place
lklimek 4a51102
Merge remote-tracking branch 'origin/v4.2-dev' into feat/platform-wal…
lklimek 707ade4
fix(platform-wallet): move Drop impl above the test module
lklimek 5ed3c58
fix(platform-wallet): retry a transient identity-scan verdict persist
lklimek 8c141ba
fix(platform-wallet-storage): clear four clippy denials in test code
lklimek 1931a76
feat(platform-wallet-storage): persist and restore the identity-scan …
lklimek a88b949
docs(rs-platform-wallet-ffi): fix non-ancestor merge SHAs in error-co…
lklimek 6bc43a8
docs(rs-platform-wallet-storage): reconcile SecretStoreError enumerat…
lklimek 7e1c9c4
docs(rs-platform-wallet-storage): fix identity_keys PK/FK/nullability…
lklimek 3a4e2c9
docs(rs-platform-wallet-storage): reconcile SCHEMA.md gap disclaimer,…
lklimek 0d88d9c
docs(rs-platform-wallet-storage): rename secret-serde to serde in SEC…
lklimek aa3b7fb
fix(platform-wallet-storage): refuse a host whose pages blow the lock…
lklimek 3df58dd
refactor(platform-wallet-storage)!: drop three redundant Cargo features
lklimek 135ebad
fix(platform-wallet): derive the shield-capacity regression fixture f…
lklimek efab0da
fix(platform-wallet-storage): raise the assumed page size to 16 KiB a…
lklimek 68cb256
docs(rs-platform-wallet-storage): restate the locked-memory budget at…
lklimek b51cddc
chore(platform-wallet-storage): trim PR to storage-crate-only scope
lklimek c34e707
chore(platform-wallet-storage): drop asset-lock size gate, now its ow…
lklimek ec90c66
Merge the trimmed 'feat/platform-wallet-storage-rehydration' into cho…
lklimek 8fc62e0
docs(platform-wallet-storage): correct SCHEMA/SECRETS/README against …
lklimek 1479d14
refactor(platform-wallet)!: drop delete_wallet from the persistence t…
lklimek ef32f6f
fix(platform-wallet-storage)!: rename retired Domain labels with a V0…
lklimek b9901bb
docs(platform-wallet-storage): state the database trust model and dro…
lklimek 31eb272
Merge branch 'fix/3968-domain-label-rename' into chore/3968-integrate
lklimek e8df5ba
Merge branch 'docs/3968-schema-doc-accuracy' into chore/3968-integrate
lklimek d338055
fix(platform-wallet-storage): reject foreign-owned vaults and make se…
lklimek 6ad7104
docs(platform-wallet-storage): fix the manifest feature wiring and st…
lklimek 2b36843
fix(platform-wallet-storage): stop URI filename smuggling and harden …
lklimek 07b1c1a
Merge branch 'fix/3968-secrets-hygiene' into chore/3968-integrate
lklimek 3e75327
Merge branch 'fix/3968-misc-hygiene' into chore/3968-integrate
lklimek 8c838bd
Merge branch 'docs/3968-schema-doc-accuracy' into chore/3968-integrate
lklimek 201eaf3
fix(platform-wallet-storage): separate the fused load sites and stop …
lklimek dd60d32
Merge branch 'fix/3968-load-policy-cluster' into chore/3968-integrate
lklimek e280ffa
fix(platform-wallet-storage): tolerate an undecodable provider-pool s…
lklimek add5926
Merge branch 'fix/3968-load-policy-cluster' into feat/platform-wallet…
lklimek 771a9e5
docs(platform-wallet-storage): correct apply_persisted_core_state cha…
lklimek cab6960
test(platform-wallet-storage): cover LoadSite::RehydrationMaintainGap…
lklimek 36dc213
refactor(platform-wallet-storage): move rehydration engine out of util
lklimek 2969cf7
refactor(platform-wallet-storage): wire up sqlite::rehydrate module
lklimek 90a232d
fix(platform-wallet-storage): expose LoadSite explanations and render…
lklimek 7e2698a
fix(platform-wallet-storage): wipe the Argon2 block matrix instead of…
lklimek bde4ce1
fix(platform-wallet-storage): pin the Tier-2 read ceiling to wire-sta…
lklimek 0c52823
fix(platform-wallet-storage): stop rekey silently downgrading a harde…
lklimek e92b951
style(platform-wallet-storage): rustfmt the rekey header-ratchet test
lklimek 122f167
fix(platform-wallet-storage): zeroize scheme-0 plaintext on every fai…
lklimek 144a962
fix(platform-wallet-storage): close the write-path gaps that make a w…
lklimek 7c5837e
merge: expose LoadSite explanations and render the CLI's full error c…
lklimek a6fb87c
merge: close the write-path gaps that make a wallet file un-loadable
lklimek 84b20ff
merge: correct the chainlock rustdoc, cover the gap-limit site, move …
lklimek acf4c77
merge: wipe the Argon2 matrix, decouple the read ceiling, stop rekey …
lklimek 35516cb
style(platform-wallet-storage): drop ephemeral review-finding IDs fro…
lklimek f7d7874
merge: bring feat/platform-wallet-storage-rehydration up to date with…
lklimek a32f408
fix(platform-wallet-storage): guard rehydration gap-limit input and e…
lklimek 155a017
Merge branch 'v4.2-dev' into feat/platform-wallet-storage-rehydration
lklimek 8b635ac
Merge branch 'v4.2-dev' into feat/platform-wallet-storage-rehydration
lklimek 25fa274
Merge remote-tracking branch 'origin/v4.2-dev' into feat/platform-wal…
lklimek eafcff3
fix(platform-wallet-storage): stop reusing published migration versions
lklimek b3bba39
fix(platform-wallet-storage): restore published migrations and append…
lklimek ed1d93e
fix(platform-wallet-storage): admit the pre-split standard label inst…
lklimek 894ac00
test(platform-wallet-storage): pin that a legacy standard row is not …
lklimek 68bc412
fix(platform-wallet-storage): reconcile the pre-split standard row in…
lklimek 9b32f1c
docs(platform-wallet-storage): state the reconciliation's real cost p…
lklimek 28837e3
fix(platform-wallet-storage): isolate a failed wallet from the rest o…
lklimek 9992476
fix(platform-wallet-storage): put the identity-key and contact reader…
lklimek 33fb59c
fix(platform-wallet-storage): count the tables load() abandons instea…
lklimek 095cf6d
fix(platform-wallet-storage): degrade balance-bearing rows by wallet,…
lklimek 27cc030
fix(platform-wallet-storage): re-arm the compile-time guard on the ac…
lklimek c9c40d3
docs(platform-wallet-storage): name the subsystem and the constants t…
lklimek 2cf9b46
test(platform-wallet-storage): name the colliding keys instead of dum…
lklimek 23399c3
fix(platform-wallet-storage): restore InstantSend locks at load inste…
lklimek ef89a2b
refactor(platform-wallet-storage): make the public surface match what…
lklimek 08252d1
fix(platform-wallet-storage): close four at-rest and open-path gaps i…
lklimek dbb8583
test(platform-wallet-storage): drop test-case IDs whose document the …
lklimek 4e3a774
Merge fix/3968-round5 (2cf9b46773) into fix/3968-round5-wave3
lklimek 5ec4761
Merge fix/3968-round5-wave3 into fix/3968-round5
lklimek 41a2b2b
fix(platform-wallet-storage): make the secure-delete guard check the …
lklimek a3722d8
Merge wave 3's secure-delete guard fix into fix/3968-round5
lklimek 64f763c
chore(ci): mark the dependency-audit gate as unreachable from pull re…
lklimek c887ef7
chore(platform-wallet-storage): merge v4.2-dev into rehydration branch
lklimek 5690a07
Merge branch 'v4.2-dev' into feat/platform-wallet-storage-rehydration
lklimek 84d5335
test(platform-wallet-storage): make lock refusal coverage deterministic
lklimek a1efa24
test(platform-wallet): move platform-node pool entry tests to a follo…
lklimek 4af855d
fix(wallet-storage): preserve legacy state during atomic migrations
lklimek c3cb94c
chore: merge latest PR branch into migration fixes
lklimek c01d229
refactor(wallet-storage): own provider rehydration helpers
lklimek 459e062
Merge branch 'v4.2-dev' into feat/platform-wallet-storage-rehydration
lklimek 8fab915
chore: cargo fmt
lklimek ec1e26f
fix(platform-wallet): align disabled shielded changeset traits
lklimek 827d759
fix(platform-wallet-storage): reject unknown pool account labels
lklimek ee41927
refactor(platform-wallet-storage): use Zeroizing for Argon2 memory
lklimek 31c8f94
chore(platform-wallet-storage): merge v4.2-dev persistence updates
lklimek 2deb2d4
chore(platform-wallet-storage): reconcile hard delete with updated st…
lklimek 7869aa3
chore(platform-wallet-storage): merge latest typed persistence base i…
lklimek 2ff29d1
Merge v4.2-dev after squash merge of #3968
lklimek be4f6c6
test(platform-wallet-storage): retain identity test rename after squa…
lklimek e8904f8
fix(platform-wallet-storage): preserve identity lifecycle boundaries
lklimek 9756bae
test(platform-wallet-storage): cover pragma-independent identity cleanup
lklimek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
75 changes: 75 additions & 0 deletions
75
packages/rs-platform-wallet-storage/migrations/V018__identity_hard_delete.rs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| //! Retire identity tombstoning: a removed identity is deleted outright. | ||
| //! | ||
| //! The `tombstoned` flag kept a logically-deleted row on disk so its | ||
| //! dependents were not wiped, at the cost of a permanent divergence: the | ||
| //! in-memory `IdentityManager` drops the whole `ManagedIdentity` on | ||
| //! removal, so a re-added identity was empty in memory while the next | ||
| //! `load()` handed it the removed one's keys back. | ||
| //! | ||
| //! Deleting the row instead needs a broom for the dependents no foreign | ||
| //! key reaches: | ||
| //! | ||
| //! - `identity_keys`' FK to `identities` is compound | ||
| //! (`wallet_id, identity_id`), and SQLite's MATCH SIMPLE skips FK | ||
| //! enforcement entirely once ANY child key column is NULL — so for an | ||
| //! out-of-wallet identity (`wallet_id IS NULL` on both sides) the | ||
| //! cascade is dormant and its keys would survive the delete. | ||
| //! - `contacts`, `ignored_senders`, and `pending_contact_crypto` carry | ||
| //! identity owners but no FK to `identities`. Orphan contacts fail a | ||
| //! strict load; orphan ignored-sender rows are omitted by the loader, | ||
| //! and the deferred-crypto queue has no production reader. | ||
| //! | ||
| //! `token_balances`, `dashpay_profiles` and `dashpay_payments_overlay` | ||
| //! need nothing new: their FK column is `identity_id NOT NULL`, so it is | ||
| //! never dormant. `meta_identity` / `meta_token` keep riding V001's | ||
| //! `cascade_meta_on_identity_delete`, which this migration leaves alone. | ||
| //! V017's `identity_scan_states` / `identity_scan_failed_indices` are | ||
| //! wallet-scoped (FK to `wallets`, no `identity_id`), so a scan verdict | ||
| //! outliving one identity is the intended reading: it records how far the | ||
| //! wallet's index space was probed, not which identities came back. | ||
|
|
||
| pub fn migration() -> String { | ||
| "\ | ||
| CREATE TRIGGER cascade_children_on_identity_delete | ||
| AFTER DELETE ON identities | ||
| FOR EACH ROW | ||
| BEGIN | ||
| DELETE FROM identity_keys WHERE identity_id = OLD.identity_id; | ||
| DELETE FROM contacts WHERE owner_id = OLD.identity_id; | ||
| DELETE FROM ignored_senders WHERE owner_id = OLD.identity_id; | ||
| DELETE FROM pending_contact_crypto WHERE owner_identity_id = OLD.identity_id; | ||
| END; | ||
|
|
||
| -- Owner columns follow wallet_id in these primary keys. Owner-leading | ||
| -- indexes avoid scanning each child table once per cascaded identity. | ||
| CREATE INDEX idx_contacts_owner ON contacts(owner_id); | ||
| CREATE INDEX idx_ignored_senders_owner ON ignored_senders(owner_id); | ||
| CREATE INDEX idx_pending_contact_crypto_owner ON pending_contact_crypto(owner_identity_id); | ||
|
|
||
| -- Purge what earlier schemas only flagged. Spelled out per table rather | ||
| -- than left to the cascade and the trigger above, so the outcome does | ||
| -- not depend on the migrating connection's `foreign_keys` pragma. | ||
| DELETE FROM identity_keys | ||
| WHERE identity_id IN (SELECT identity_id FROM identities WHERE tombstoned = 1); | ||
| DELETE FROM contacts | ||
| WHERE owner_id IN (SELECT identity_id FROM identities WHERE tombstoned = 1); | ||
| DELETE FROM ignored_senders | ||
| WHERE owner_id IN (SELECT identity_id FROM identities WHERE tombstoned = 1); | ||
| DELETE FROM pending_contact_crypto | ||
| WHERE owner_identity_id IN (SELECT identity_id FROM identities WHERE tombstoned = 1); | ||
| DELETE FROM token_balances | ||
| WHERE identity_id IN (SELECT identity_id FROM identities WHERE tombstoned = 1); | ||
| DELETE FROM dashpay_profiles | ||
| WHERE identity_id IN (SELECT identity_id FROM identities WHERE tombstoned = 1); | ||
| DELETE FROM dashpay_payments_overlay | ||
| WHERE identity_id IN (SELECT identity_id FROM identities WHERE tombstoned = 1); | ||
| DELETE FROM meta_identity | ||
| WHERE identity_id IN (SELECT identity_id FROM identities WHERE tombstoned = 1); | ||
| DELETE FROM meta_token | ||
| WHERE identity_id IN (SELECT identity_id FROM identities WHERE tombstoned = 1); | ||
| DELETE FROM identities WHERE tombstoned = 1; | ||
|
|
||
| ALTER TABLE identities DROP COLUMN tombstoned; | ||
| " | ||
| .to_string() | ||
| } | ||
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.