Skip to content

chore(deps): bump platform pin to PR #3968 tip (fix empty-script UTXO wallet-brick) - #953

Merged
lklimek merged 1 commit into
v1.0-devfrom
chore/bump-platform-pin-pr3968-utxo-fix
Jul 31, 2026
Merged

chore(deps): bump platform pin to PR #3968 tip (fix empty-script UTXO wallet-brick)#953
lklimek merged 1 commit into
v1.0-devfrom
chore/bump-platform-pin-pr3968-utxo-fix

Conversation

@Claudius-Maginificent

@Claudius-Maginificent Claudius-Maginificent commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

TL;DR: Pull in an upstream fix so a single damaged payment record can no longer make an entire wallet file — every wallet in it — refuse to open.

User story

As a Dash Evo Tool user, I want one unreadable internal record to never take down my whole wallet file, so a wallet that was working keeps working after a restart.

Scenario

Base flow

DET keeps all of a user's wallets in one on-disk file. Normal use — syncing, migrating from an older install, topping up an identity — can produce internal bookkeeping records for spent payments the wallet never had full details for.

Actual behavior

One such record could end up with no readable script attached. On the next launch, DET tries to read every record in the file to build its address-reuse safeguard, hits the unreadable one, and — because that check historically failed the entire file's load rather than skipping the one bad record — rejects every wallet in it. A real user hit this: one bad record out of 668 locked all 12 of their wallets, reporting "Saved wallet data appears damaged and cannot be loaded. Restore the wallet from its recovery phrase to keep using it." — even though nothing about their actual funds or keys was damaged.

Expected behavior

An unreadable record is skipped, with the rest of the wallet loading normally. The record that caused this is no longer written in the first place going forward.

Detailed discussion

What was done

Bumps the pinned dashpay/platform git dependency (dash-sdk, rs-sdk-trusted-context-provider, platform-wallet, platform-wallet-storage — all four share one revision by necessity, since splitting them would resolve two git sources for one repo and duplicate every shared platform type) from a18bd158 to 762c66cf, the current tip of upstream PR dashpay/platform#3968.

762c66cf (fix(platform-wallet-storage): stop one bad script row from bricking a wallet file) is a direct child of the previous pin, touching only rs-platform-wallet-storage. It stops manufacturing a placeholder record with no script for a spent payment the wallet has no prior record of, and makes the address-reuse-guard readers skip and warn on an unreadable record instead of failing the whole load. The balance-bearing load path stays deliberately fail-hard — it only ever reads confirmed-unspent records, so a genuinely corrupt balance-affecting record still refuses to open rather than silently under-reporting funds.

No DET-side code change was needed: load_used_addresses and AddressDecode (the upstream types involved) don't appear anywhere in this repository, and every Address::from_script call site here already tolerates a decode failure and never touches the affected persisted-record path — verified by grep, not assumed.

Root cause was originally traced against a real user's broken database (a full investigation, separately documented) and led to two other, unrelated fixes already in #951 (a duplicate-identity-index guard and a top-up-account persistence fix) — those are real, independently confirmed bugs, but this PR is what actually fixes that user's specific incident.

Testing

  • cargo clippy --locked --all-features --all-targets -- -D warnings — clean (this is also the build check; a superset of compilation).
  • cargo test --locked --all-features --lib wallet (covers wallet_backend::{loader,hydration,single_key,snapshot,wallet_seed_store,wallet_meta} and context::wallet_lifecycle::tests, the load/rehydration surface this touches) — 722 passed, 0 failed, 1 pre-existing ignored.
  • cargo fmt --all — no source reformatted.
  • Cargo.lock rewritten as a targeted rev substitution (28 platform source = lines only) rather than a plain cargo update, which would have also re-pointed unrelated dependencies (prost-build, prost-derive, winapi-util) onto older already-present versions for no reason. Both verification runs used --locked, which hard-fails on any lock/manifest mismatch.
  • Full workspace suite left to CI per this repo's own CI policy.

Breaking changes

None. Dependency bump only; no public API changed upstream, no DET code changed.

Checklist

  • Upstream fix verified against the actual commit (single-parent child of current pin, scoped diff, own test coverage)
  • DET-side dependency on old behavior checked and confirmed absent
  • cargo fmt --all, clippy --all-features --all-targets -- -D warnings clean
  • CHANGELOG entry added (UnreleasedFixed, Everyday User voice)
  • CI full suite green

Prior work

  • #951 — two independent, real identity/account hardening fixes found during the same investigation; does not fix this specific incident, complementary to this PR.
  • Upstream: dashpay/platform#3968, tip commit 762c66cf.

Attribution

🤖 Co-authored by Claudius the Magnificent AI Agent

Summary by CodeRabbit

  • Bug Fixes

    • Wallets can now remain loadable when individual payment records are unreadable.
    • Records containing balance information continue to block loading when they cannot be read, preventing wallet totals from being understated.
  • Documentation

    • Added changelog documentation describing the updated handling of unreadable payment records and its effect on wallet loading.

… wallet-brick)

Moves all four dashpay/platform git dependencies -- dash-sdk,
rs-sdk-trusted-context-provider, platform-wallet, platform-wallet-storage --
from a18bd158 to 762c66cf, the tip of PR #3968
(feat/platform-wallet-storage-rehydration). The four share one rev by
necessity: splitting them would resolve two git sources for one repo and
duplicate every shared platform type.

762c66cf is "fix(platform-wallet-storage): stop one bad script row from
bricking a wallet file", a direct child of the previous pin touching only
rs-platform-wallet-storage (core_state.rs, core_pool.rs, and a test). A single
core_utxos row with an empty script made an entire persisted wallet file
unloadable -- one fabricated row out of 668 locked 12 wallets in a real user
database. Upstream stops manufacturing the row on write and makes both
reuse-guard readers of load_used_addresses skip-and-warn per row. load_state
stays fail-hard by design: it reads only spent = 0 rows and is the balance
source, so a corrupt balance-bearing row still aborts loudly rather than
under-report a balance.

No DET-side change is required. load_used_addresses and AddressDecode appear
nowhere in this repository, and all seven Address::from_script call sites here
decode asset-lock credit outputs or withdrawal documents, already tolerate a
decode failure, and never touch the persisted-UTXO path. The user-facing string
this fix stops triggering is TaskError's "Saved wallet data appears damaged",
which is a Display message rather than a behavioural dependency.

Cargo.lock carries only the 28 platform source lines. A plain
cargo update -p also re-pointed prost-build, prost-derive and winapi-util onto
already-present older copies of itertools and windows-sys; the package version
set was identical either way, so that churn was dropped in favour of a rev
rewrite verified by building with --locked.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 22b10ac3-1209-4189-8c26-9735152b5929

📥 Commits

Reviewing files that changed from the base of the PR and between 2ee9fa6 and be46a17.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • CHANGELOG.md
  • Cargo.toml

📝 Walkthrough

Walkthrough

The update advances Dash Platform Git dependencies to a shared revision and adds a changelog entry for resilient wallet-file loading. Unreadable payment records are skipped, while records with balances still prevent loading.

Changes

Wallet loading resilience

Layer / File(s) Summary
Dependency alignment and loading behavior documentation
Cargo.toml, CHANGELOG.md
Dash Platform Git dependencies use revision 762c66cf7716b9b3264868a49e8d29991c643c7e. The changelog documents skipping unreadable payment records and rejecting records with balances.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: lklimek

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the dependency pin update and the upstream fix for empty-script UTXO wallet failures.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/bump-platform-pin-pr3968-utxo-fix

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.

@thepastaclaw

thepastaclaw commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

✅ Final review complete — no blockers (commit be46a17)

@lklimek
lklimek enabled auto-merge (squash) July 31, 2026 17:04
@lklimek
lklimek merged commit 39b3992 into v1.0-dev Jul 31, 2026
4 checks passed
@lklimek
lklimek deleted the chore/bump-platform-pin-pr3968-utxo-fix branch July 31, 2026 17:08
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.

3 participants