Skip to content

(WIP) Fix: Ensure wallet's metadata cache for offline use#1958

Draft
TheMhv wants to merge 3 commits into
cashubtc:mainfrom
TheMhv:wallet_offline
Draft

(WIP) Fix: Ensure wallet's metadata cache for offline use#1958
TheMhv wants to merge 3 commits into
cashubtc:mainfrom
TheMhv:wallet_offline

Conversation

@TheMhv
Copy link
Copy Markdown
Contributor

@TheMhv TheMhv commented May 10, 2026

(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

  • b95482a: Get mint info from wallets on cdk-cli mint-info command without needing to specifying mint_url

Suggested CHANGELOG Updates

CHANGED

  • cdk-cli mint-info command

ADDED

REMOVED

FIXED


Checklist

  • I followed the code style guidelines
  • I ran just quick-check before committing
  • If the Wallet API was modified (added/removed/changed), I have reflected those changes in the FFI bindings (crates/cdk-ffi)

crodas and others added 3 commits May 8, 2026 14:50
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.
@github-project-automation github-project-automation Bot moved this to Backlog in CDK May 10, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 10, 2026

Codecov Report

❌ Patch coverage is 70.00000% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.13%. Comparing base (e35d15d) to head (b95482a).

Files with missing lines Patch % Lines
crates/cdk/src/wallet/mint_metadata_cache.rs 70.00% 12 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Review the wallet's metadata cache for offline use

2 participants