(WIP) Fix: Ensure wallet's metadata cache for offline use#1958
Draft
TheMhv wants to merge 3 commits into
Draft
Conversation
Populate the in-memory metadata cache from the database without HTTP requests, enabling offline scenarios and fast startup. load_from_mint calls load_from_db when cache is not yet populated so existing DB keys are skipped during HTTP fetch. Duplicated DB pre-load blocks removed from load_from_mint and load_auth.
load_from_mint holds fetch_lock then calls load_from_db which tries to acquire it again. Tokio Mutex is not reentrant so this deadlocks. Made load_from_db private and removed the lock since both callers already gate on is_populated.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1958 +/- ##
==========================================
- Coverage 65.14% 65.13% -0.01%
==========================================
Files 329 329
Lines 56742 56767 +25
==========================================
+ Hits 36965 36977 +12
- Misses 19777 19790 +13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
(Work In Progress)
Description
Ensure that the Wallet's can handle mint info and keysets on cache to being used when it is offline.
Notes to the reviewers
cdk-cli mint-infocommand without needing to specifyingmint_urlSuggested CHANGELOG Updates
CHANGED
cdk-cli mint-infocommandADDED
REMOVED
FIXED
Checklist
just quick-checkbefore committingcrates/cdk-ffi)