Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
63a7f8e
fix(platform-wallet-storage): skip unreadable records in history repair
lklimek Sep 29, 2026
740bbdd
fix(platform-wallet-storage): keep history repairs reversible
lklimek Sep 29, 2026
318d874
refactor(platform-wallet-storage): freeze the V019 history repair
lklimek Sep 29, 2026
283acf7
fix(platform-wallet-storage): restore unconfirmed spend reservations …
lklimek Sep 29, 2026
05ade4e
fix(platform-wallet-storage): replay load history without an async br…
lklimek Sep 29, 2026
bc16c17
fix(swift-sdk): classify repaired direction like the Rust repair
lklimek Sep 29, 2026
e5fc327
test(swift-sdk): model asset-lock burns as OP_RETURN outputs
lklimek Sep 29, 2026
4a30a5b
fix(swift-sdk): scope per-wallet transaction amounts
lklimek Sep 29, 2026
8e5bcff
fix(swift-sdk): keep asset-lock debits when no input is linked yet
lklimek Sep 29, 2026
ec8b945
fix(swift-sdk): never block wallet restore on load-time accounting
lklimek Sep 29, 2026
b71f35a
chore: address low-severity PR #5150 review findings
lklimek Sep 29, 2026
c81c3d0
Merge remote-tracking branch 'origin/fix/pr-5126' into feat/sqlite-wa…
lklimek Sep 29, 2026
3380678
fix(platform-wallet-storage): fail on corrupt history unless a resync…
lklimek Sep 29, 2026
907eb88
merge: reuse wallet history restoration from PR 5208
lklimek Sep 29, 2026
10b15c9
feat(wallet-storage): restore complete persisted Core wallet snapshots
lklimek Sep 29, 2026
36cff4e
Merge branch 'fix/sqlite-asset-lock-reconciliation' into feat/sqlite-…
lklimek Sep 30, 2026
b27eb83
Merge branch 'fix/sqlite-asset-lock-reconciliation' into feat/sqlite-…
lklimek Sep 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
## Unreleased

### Fixed

- **platform-wallet:** Allow reconciliation of already-loaded asset locks with atomic tracked-lock persistence without requiring unrelated wallet restore support; retain nonterminal recovery state and typed consumption errors.

- **platform-wallet-storage:** Restore confirmed Core spend and finality state on SQLite load so old funding transactions cannot make already-spent outputs selectable again.

## [4.2.0-beta.7](https://github.com/dashpay/platform/compare/v4.2.0-beta.6...v4.2.0-beta.7) (2026-09-29)


Expand Down
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions packages/rs-platform-wallet-storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ platform-wallet = { path = "../rs-platform-wallet", features = [
"eddsa",
], optional = true }
serde = { version = "1", features = ["derive"], optional = true }
dash-async = { path = "../rs-dash-async", optional = true }
key-wallet = { workspace = true, optional = true }
dashcore = { workspace = true, optional = true }
dpp = { path = "../rs-dpp", optional = true }
Expand Down Expand Up @@ -225,7 +224,6 @@ sqlite = [
"dep:platform-wallet",
"dep:serde",
"dep:key-wallet",
"dep:dash-async",
"dep:dashcore",
"dep:dpp",
"dep:dash-sdk",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! Index raw inputs so late output ownership can repair the spending history.
//! Index raw inputs so late output ownership can repair the spending history,
//! and keep each record's pre-repair blob so every repair stays reversible.

pub fn migration() -> String {
"CREATE TABLE core_transaction_inputs (
Expand All @@ -9,6 +10,13 @@ pub fn migration() -> String {
FOREIGN KEY (wallet_id, txid) REFERENCES core_transactions(wallet_id, txid) ON DELETE CASCADE
);
CREATE INDEX idx_core_transaction_inputs_outpoint
ON core_transaction_inputs(wallet_id, outpoint);"
ON core_transaction_inputs(wallet_id, outpoint);
CREATE TABLE core_transaction_record_originals (
wallet_id BLOB NOT NULL,
txid BLOB NOT NULL,
record_blob BLOB NOT NULL,
PRIMARY KEY (wallet_id, txid),
FOREIGN KEY (wallet_id) REFERENCES wallets(wallet_id) ON DELETE CASCADE
);"
.to_owned()
}
9 changes: 1 addition & 8 deletions packages/rs-platform-wallet-storage/src/sqlite/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ pub enum AutoBackupOperation {
/// Errors produced by the wallet-storage SQLite backend.
#[derive(Debug, thiserror::Error)]
pub enum WalletStorageError {
/// Confirmed Core history could not be replayed into the restored wallet.
#[error("could not restore confirmed Core history: {0}")]
CoreHistoryReplay(#[source] dash_async::AsyncError),

/// File-system I/O error reaching the database or backup files.
#[error("io error")]
Io(#[from] std::io::Error),
Expand Down Expand Up @@ -710,8 +706,7 @@ impl WalletStorageError {
// `ToSqlConversionFailure`, `InvalidColumnIndex`) — is a
// logic bug, not a contention failure.
Self::Sqlite(_) => false,
Self::CoreHistoryReplay(_)
| Self::Io(_)
Self::Io(_)
| Self::Migration(_)
| Self::IntegrityCheckFailed { .. }
| Self::IntegrityCheckRunFailed { .. }
Expand Down Expand Up @@ -876,7 +871,6 @@ impl WalletStorageError {
| Self::UnownedIdentityHasRegistrationIndex { .. }
| Self::EmptyUtxoScript { .. }
| Self::EmptyPoolAddressScript { .. }
| Self::CoreHistoryReplay(_)
| Self::DatabasePathIsSymlink { .. } => PersistenceErrorKind::Fatal,
}
}
Expand All @@ -897,7 +891,6 @@ impl WalletStorageError {
},
Self::Sqlite(_) => "sqlite_other",
Self::FlushRetryable { .. } => "flush_retryable",
Self::CoreHistoryReplay(_) => "core_history_replay",
Self::Io(_) => "io",
Self::Migration(_) => "migration",
Self::IntegrityCheckFailed { .. } => "integrity_check_failed",
Expand Down
3 changes: 2 additions & 1 deletion packages/rs-platform-wallet-storage/src/sqlite/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use crate::sqlite::error::WalletStorageError;
use refinery_core::error::WrapMigrationError;

mod legacy_v008;
mod legacy_v019;

// Generates a `migrations` module with `runner()`; path is relative to
// the crate root.
Expand Down Expand Up @@ -78,7 +79,7 @@ impl refinery_core::traits::sync::Transaction for MigrationTransaction<'_> {
} else if query == self.pool_sql {
legacy_v008::convert_pools(&self.tx)?;
} else if query == self.history_sql {
super::schema::core_history::migrate(&self.tx)?;
legacy_v019::repair_history(&self.tx)?;
}
count += 1;
}
Expand Down
Loading
Loading