Skip to content

fix(deps): update Platform to 63cf57f with database compatibility - #981

Merged
lklimek merged 3 commits into
v1.0-devfrom
update-platform-pin
Sep 11, 2026
Merged

fix(deps): update Platform to 63cf57f with database compatibility#981
lklimek merged 3 commits into
v1.0-devfrom
update-platform-pin

Conversation

@lklimek

@lklimek lklimek commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

TL;DR: Update Platform while keeping existing wallets, identities and preferences readable, with retained backups for recovery.

User story

As a wallet user, I want to upgrade without losing my saved data or having to recreate my profile.

Scenario

Base flow

Open the updated application with a profile created by the previously pinned development version.

Actual behavior

A direct dependency update cannot open the old databases. An identity ownership change can also delete saved identity metadata.

Expected behavior

The application upgrades recognized old databases automatically, verifies their contents before committing, and preserves live identity metadata.

Detailed discussion

What was done

  • Pin all four Platform dependencies to 63cf57f40d0000bf3b2b26026c8fa1c71162852d (4.2.0-dev.8), including the pending contact-crypto/identity-removal serialization fix in fix(platform-wallet): serialize pending crypto writes with identity removal platform#4649.
  • Bridge the old feat(platform-wallet-storage): embeddable SQLite persistence backend with seedless rehydration platform#3968 database lineage for both app and network stores: exact schema/history recognition, named retained backups, staged strict loading, row comparison and atomic reconstruction. Keep the encrypted seed vault unchanged.
  • Preserve identity metadata during ownership promotion, adapt query/error APIs, remove swept transactions from displayed history, and enable the passing single-UTXO Max-send regression.
  • The new pin has the same migration history/schema as e3cd7cf; the existing destination schema guard remains valid.
  • Stabilize network-switch cancellation coverage with controlled startup and a separate fast-completion regression; synchronize UI removal assertions and password-prompt fixture setup with asynchronous completion.

Testing

  • cargo fmt --all
  • Library suite: 2521 passed; UI suite: 329 passed; E2E suites: 11 passed, 69 live-network tests ignored; doctests: 7 passed, 12 ignored.
  • cargo clippy --locked --all-features --all-targets -- -D warnings: passed.
  • Migration coverage includes populated old wallets, balances/identities, app preferences, backups, process interruption, rollback, WAL snapshots, writer exclusion and repeated open. Synthetic data only.

Remaining limitations

The contact-account scan-generation fix from dashpay/platform#4587 remains absent at this pin. The old FFI proof-size gate from dashpay/platform#4585 is also absent, though DET uses the Rust API. Hosts with memory pages larger than 16 KiB are unsupported by the new secret storage. Live-network and live-desktop GUI checks were not run; headless UI integration tests passed.

The dependency audit found the same five pre-existing advisories before and after the upgrade. See the compatibility review for details.

Attribution

🤖 Co-authored by Claudius the Magnificent AI Agent

Pin Platform v4.2-dev at e3cd7cf (4.2.0-dev.8) and adapt wallet APIs.
Automatically bridge the previous PR's database lineage for both app and
network stores with retained backups, strict staged loading and atomic
reconstruction. Preserve live identity metadata during ownership promotion.

Handle swept transaction events and enable the passing Max-send regression.
Document retained functionality, remaining upstream gaps and audit results.

Validation: cargo fmt --all; 2520 library tests passed; exact CI Clippy flags
--all-features --all-targets -- -D warnings passed.

Co-Authored-By: Codex <noreply@openai.com>

<sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub>
Include the pending contact-crypto persistence and identity-removal
serialization fix. Migration history and schema remain unchanged;
retain the verified database compatibility bridge and other lockfile
resolutions.

Validation: formatter, 2520 library tests, and CI Clippy flags passed
with the locked dependency graph.

Co-Authored-By: Codex <noreply@openai.com>

<sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub>
@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 42 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 40ec5601-8331-4622-9116-1c18c5dbaa3e

📥 Commits

Reviewing files that changed from the base of the PR and between e25438b and 4f5fc04.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (35)
  • CHANGELOG.md
  • Cargo.toml
  • docs/ai-design/2026-09-10-platform-pin/upgrade-notes.md
  • src/backend_task/contract.rs
  • src/backend_task/dashpay/contact_requests.rs
  • src/backend_task/document.rs
  • src/backend_task/error.rs
  • src/backend_task/identity/discover_identities.rs
  • src/backend_task/identity/load_identity.rs
  • src/backend_task/identity/load_identity_by_dpns_name.rs
  • src/backend_task/identity/load_identity_from_wallet.rs
  • src/backend_task/identity/refresh_loaded_identities_dpns_names.rs
  • src/backend_task/identity/register_dpns_name.rs
  • src/backend_task/mod.rs
  • src/backend_task/platform_info.rs
  • src/context/identity_db.rs
  • src/context/mod.rs
  • src/context/wallet_lifecycle/bootstrap.rs
  • src/context/wallet_lifecycle/tests.rs
  • src/ui/tokens/view_token_claims_screen.rs
  • src/wallet_backend/dashpay.rs
  • src/wallet_backend/event_bridge.rs
  • src/wallet_backend/identity_ops.rs
  • src/wallet_backend/mod.rs
  • src/wallet_backend/payments.rs
  • src/wallet_backend/platform_compatibility/engine.rs
  • src/wallet_backend/platform_compatibility/engine/tests.rs
  • src/wallet_backend/platform_compatibility/fixtures/67d4ef3.sql
  • src/wallet_backend/platform_compatibility/fixtures/README.md
  • src/wallet_backend/platform_compatibility/fixtures/e3cd7cf.sql
  • src/wallet_backend/platform_compatibility/fixtures/public-rows.sql
  • src/wallet_backend/platform_compatibility/mod.rs
  • src/wallet_backend/snapshot.rs
  • tests/kittest/masternode_tab.rs
  • tests/kittest/secret_prompt.rs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lklimek
lklimek marked this pull request as ready for review September 10, 2026 17:21
@thepastaclaw

thepastaclaw commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

🕓 Queued for automated review — 12th in line, estimated start in ~2.2 h (commit 4f5fc04)
Estimated review time once started: ~25 min (two-phase automated review; median of recent runs).

  • Request priority review — tick this box and the review moves to the front of the queue.

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final validation — Phase 2 only (queue backlog)

The compatibility migration is carefully scoped and includes durable backups, staged validation, rollback coverage, and identity metadata preservation. One in-scope architecture issue remains: validation failures erase their concrete error types behind a blanket trait object, weakening the typed error chain used by the application.

🟡 1 suggestion(s)

Review provenance

Source: reviewer 1: gpt-6-astra (agent: phase2-reviewer, role: general); reviewer 2: gpt-6-astra (agent: phase2-reviewer, role: rust-quality); final verifier: gpt-6-astra (agent: astra-verifier, role: final-verifier)

  • Triage: critical by gpt-6-astra (effort low) — The large, intricate diff directly changes storage migration and compatibility logic in src/wallet_backend/platform_compatibility/engine.rs and related context/database paths, a critical storage-migration surface that can affect preservation and recovery of wallet, identity, and preference data.
  • Phase 1 reviewers: not run (skipped for throughput: 12 PRs queued, above the 10 limit)
  • Fresh verifier: gpt-6-astra — final-verifier; agent astra-verifier
  • Phase 2 reviewers: gpt-6-astra — general (completed, effort xhigh); agent phase2-reviewer, gpt-6-astra — rust-quality (completed, effort xhigh); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `src/wallet_backend/platform_compatibility/engine.rs`:
- [SUGGESTION] src/wallet_backend/platform_compatibility/engine.rs:39-42: Preserve concrete validation error types instead of boxing dyn Error
  `TypedValidation` stores validation failures as `Box<dyn std::error::Error + Send + Sync>`. The caller in `platform_compatibility/mod.rs` wraps failures from staging the database, loading wallet data, and loading unowned identities into this variant, so downstream code can no longer structurally distinguish the originating storage or persistence error. This conflicts with the repository's typed-error convention and makes diagnostics and future error handling depend on downcasting a blanket trait object. Introduce a dedicated validation error enum with concrete source variants for each validation operation, then use that enum as the source of `UpgradeError::TypedValidation` while retaining the existing user-facing message.

Comment on lines +39 to +42
"The updated application could not read your wallet data. Keep your data folder and reopen the previous application version."
)]
TypedValidation(#[source] Box<dyn std::error::Error + Send + Sync>),
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Suggestion: Preserve concrete validation error types instead of boxing dyn Error

TypedValidation stores validation failures as Box<dyn std::error::Error + Send + Sync>. The caller in platform_compatibility/mod.rs wraps failures from staging the database, loading wallet data, and loading unowned identities into this variant, so downstream code can no longer structurally distinguish the originating storage or persistence error. This conflicts with the repository's typed-error convention and makes diagnostics and future error handling depend on downcasting a blanket trait object. Introduce a dedicated validation error enum with concrete source variants for each validation operation, then use that enum as the source of UpgradeError::TypedValidation while retaining the existing user-facing message.

source: gpt-6-astra (phase2-reviewer: rust-quality)

Control the SPV startup future in the cancellation test and separately
verify registration remains queued after a fast network switch. Preserve
the production network-switch behavior.

Wait for the masternode removal result before checking rendered cards,
and register the password-prompt fixture after storage preparation.

Validation: 2521 library tests, 329 UI tests, 11 E2E tests and 7 doctests
passed; formatter and Clippy passed. Network-dependent tests remain ignored.

Co-Authored-By: Codex <noreply@openai.com>

<sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub>
@lklimek
lklimek merged commit 768b920 into v1.0-dev Sep 11, 2026
5 checks passed
@lklimek
lklimek deleted the update-platform-pin branch September 11, 2026 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants