Repository navigation
fix(wallet-storage): reconcile historical AssetUnlock identities - #5783
Draft
Claudius-Maginificent wants to merge 1 commit into
Draft
Claudius-Maginificent wants to merge 1 commit into
Claudius-Maginificent wants to merge 1 commit into
Conversation
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. |
12 of 15 tasks
Collaborator
|
🕓 Review not started yet because this PR is a draft.
Commit 3ca7b1f. Normal review starts when eligible; priority review starts as soon as a slot is available. |
5 of 7 tasks
6 of 18 tasks
Base automatically changed from
fix/sqlite-bulk-history-identity
to
v5.2-dev
November 23, 2026 14:42
lklimek
changed the base branch from
v5.2-dev
to
fix/funding-issuance-floor-across-reload
November 24, 2026 11:38
lklimek
force-pushed
the
fix/sqlite-asset-unlock-history-aliases
branch
from
November 24, 2026 11:57
d37d1e3 to
8f2e0b5
Compare
Preserve the final PR scope, including merge resolutions, on the updated native stack. Co-Authored-By: Codex <[email protected]>
lklimek
force-pushed
the
fix/sqlite-asset-unlock-history-aliases
branch
from
November 25, 2026 09:19
8f2e0b5 to
3ca7b1f
Compare
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Basic explanation
TL;DR: Keep one complete wallet history entry when an old withdrawal is delivered again after upgrading.
Value: Upgrades retain one complete history entry and the amounts of transactions spending its outputs.
Risks: Looking up an adopted old identifier returns the current identifier. Withdrawal identity lookups read wallet-scoped evidence once per load, write batch or lookup; no performance benchmark is claimed.
User story
As a wallet user, I want previously recorded withdrawals and their spending history to retain their amounts and details after an upgrade.
Scenario
Base flow
A wallet upgrades an old database and later receives the same withdrawal again.
Actual behavior
The changed transaction identifier can produce two history entries, split ownership details, and leave an older spending entry's amount unrepaired.
Expected behavior
History retains one complete entry and the correct spending amounts. Signed transaction bytes remain unchanged.
Detailed discussion
Issue being fixed or feature implemented
Follow-up to #5150, specifically canonical redelivery of historical AssetUnlock records. Addresses 5150-11, including the duplicate report. It builds on #5781 (merged), the bulk-validation prerequisite. Shared replay in #5220 remains a later integration gate.
What was done?
The normal exact-canonical upsert policy is unchanged. No FFI ABI, binding or dependency-pin changes. AssetUnlock alias families are indexed from wallet-scoped history/archive evidence once per load, write batch or outpoint lookup; canonical records without aliases need no further queries. No performance benchmark is claimed. A later #5220 integration must validate physical-record replay against these aliases; it is not part of this PR.
How Has This Been Tested?
platform-wallet-storage: 1141 tests passed (nextest, all features) at the current head, including 21 alias cases for migration→redelivery, pre-existing duplicates, multiple quorum instances, accounting repair, context promotion/conflict, rollback/retry, wallet isolation, immutable archives and Recovery behavior, plus query-count tests showing alias projection grows linearly and a write batch scans identity evidence once.--all-targets --all-features -D warnings) forplatform-walletandplatform-wallet-storageand the format check passed.v5.2-dev; its in-scope findings are addressed. No full workspace or network test claim.Breaking Changes
After canonical adoption, public history lookup by a legacy alias returns the canonical record and identifier. Legacy-only records keep their old identifiers until adoption.
WalletStorageErrorgainsHistoryAliasContextConflict; the enum is exhaustive, so downstream exhaustive matches must handle the new variant. No database-schema or FFI-ABI break, and no consensus change.Checklist:
No GroveDB structure, system contract schema, or shipped consensus generation changes.
🤖 Co-authored by Claudius the Magnificent AI Agent