Repository navigation
fix(wallet-storage): restore Platform and Core from one wallet snapshot - #5782
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
Read Platform checkpoints, registrations and balances within the existing per-wallet SQLite transaction used for Core reconstruction. Publish both halves only after success, while preserving typed corruption handling, raw address counts and Strict/Recovery isolation. Cover an actual external SQLite writer deterministically, atomic omission of failed wallets, and unattributable corrupt wallet IDs. Account for the three targeted Platform reads in the bounded per-wallet query budget. <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> Co-Authored-By: Claude GPT-6 Astra <[email protected]>
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. |
6 of 15 tasks
Collaborator
|
🕓 Review not started yet because this PR is a draft.
Commit 1e407fc. Normal review starts when eligible; priority review starts as soon as a slot is available. |
4 tasks done
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: Restore each wallet's Platform balances and Core state from one consistent point in time, even when another process updates the wallet during startup.
Value: Startup returns matching balances, registrations and sync progress.
Risks: Three additional reads run within the existing per-wallet write reservation; concurrent writers wait or retry. No consensus or schema change.
User story
As a wallet user, I want startup to restore matching balances and sync progress, so that I do not see a mixture of old and new wallet data.
Scenario
Base flow
A wallet starts while another process writes an updated balance and sync progress to its database.
Actual behavior
Startup can combine an older Platform checkpoint with newer balances, account registrations and Core progress. A failed Core restore can also leave that wallet's Platform half in the returned result.
Expected behavior
Each restored wallet is internally consistent. If the wallet cannot be restored, neither half is returned.
Detailed discussion
Issue being fixed or feature implemented
Addresses 5150-10, the Platform snapshot review comment on #5150. This is a separate follow-up stacked on #5210, base
feat/sqlite-wallet-restore; the prerequisite is not claimed to be merged.What was done
Move Platform checkpoint, registration and address reads into the existing per-wallet SQLite IMMEDIATE transaction used for Core reconstruction. Publish both returned states only after successful reconstruction. Reuse typed decoders and preserve Strict/Recovery behavior, raw address counts including unregistered accounts, and rejection of unattributable corrupt wallet IDs.
The query budget increases by three targeted reads per wallet. Existing linear-cost and shared-overhead checks remain. No schema, dependency, financial-policy or public persister-contract changes.
How Has This Been Tested?
--all-features --all-targets -- --no-deps -D warnings), formatting and diff checks pass.Breaking Changes
None.
Checklist:
🤖 Co-authored by Claudius the Magnificent AI Agent