Repository navigation
feat(platform-wallet-ffi)!: let hosts reset an outbound contact account's pool and keep its request digest - #5589
Draft
romchornyi wants to merge 1 commit into
Draft
romchornyi wants to merge 1 commit into
romchornyi wants to merge 1 commit into
Conversation
…l and keep its request digest Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WYhtAUUCkvoBmp19LA8Z31
6 of 9 tasks
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. Comment |
6 of 9 tasks
Collaborator
|
🕓 Review not started yet because this PR is a draft.
Commit 1a414b6. Normal review starts when eligible; priority review starts as soon as a slot is available. |
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
What this does: This lets the iOS host store the two things #5587 introduced:
It adds three optional FFI callbacks, implements them in the Swift persistence handler, and adds one SwiftData property.
Value:
Risks: Low to medium.
schema-releases.jsondoes not list, so it is unpublished. A development store already written as 4.0.0 will not open under the new model; that is the documented policy for unpublished shapes.Stack (review and merge in order):
Issue being fixed or feature implemented
Part 2 of the stack started in #5587. The problems on the iOS host:
PersistentCoreAddressrows by address. When a contact rotated, it kept the previous xpub's rows beside the new ones under the same account, and they were restored as one pool.What was done?
platform-wallet-ffi (
persistence.rs,manager.rs)New
PersistenceCallbacksExtensionslots:on_reset_account_address_pools_fn;on_persist_account_xpub_digest_fn(a null digest clears the stored one);on_load_account_xpub_digest_fn.AccountSpecFFIis unchanged.Store order is registrations → digest → reset → pools.
The digest is written only on vtables with begin/end, where rounds are atomic.
A host that persists pools without the reset slot fails a replacement round rather than keep stale rows.
A failed digest read hands over an empty digest instead of failing the load. Rust treats it as "not confirmed".
swift-sdk
PersistentAccount.encryptedXpubDigest.PersistentCoreAddressrows. It first unlinks their TXOs, becausetxoscascades, and registers those TXOs in the round index.How Has This Been Tested?
cargo test -p platform-wallet-ffi --all-features(476). The new tests cover call order, the missing-slot outcomes, non-atomic hosts, null clears and tolerant reads; the extension layout pin is extended. Clippy is clean.swift test(afterbuild_ios.sh --target tests):OutboundAccountReplacementPersistenceTests. The reset keeps TXOs; the digest survives a store reopen and can be cleared.AssetLockOperationPersistenceTestsandAddressPoolBulkFetchTestsstill pass. SwiftExampleApp builds.Breaking Changes
on_reset_account_address_pools_fn, or replacement rounds fail.Checklist:
structure.rs, regeneratedgrovedb-structure.json, and checked the structure viewer link posted on this pull requestFor repository code-owners and collaborators only
🤖 Generated with Claude Code