Skip to content

wallet cache provider#91

Closed
Crayon-Shin-chan-bitlightlabs wants to merge 4 commits intoBP-WG:masterfrom
Crayon-Shin-chan-bitlightlabs:master
Closed

wallet cache provider#91
Crayon-Shin-chan-bitlightlabs wants to merge 4 commits intoBP-WG:masterfrom
Crayon-Shin-chan-bitlightlabs:master

Conversation

@Crayon-Shin-chan-bitlightlabs
Copy link
Copy Markdown
Contributor

We have implemented our own wallet cache along with the corresponding synchronization mechanism. Therefore, we need to abstract the wallet cache interface, allowing us to separate the internal data structures from the wallet and, conversely, reconstruct the wallet from those data structures.

@codecov
Copy link
Copy Markdown

codecov bot commented Jun 24, 2025

Codecov Report

Attention: Patch coverage is 0% with 245 lines in your changes missing coverage. Please review.

Project coverage is 4.4%. Comparing base (a98b19b) to head (d3cb700).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/wallet.rs 0.0% 224 Missing ⚠️
src/data.rs 0.0% 10 Missing ⚠️
src/cli/command.rs 0.0% 9 Missing ⚠️
src/cli/args.rs 0.0% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #91     +/-   ##
=======================================
- Coverage     4.7%   4.4%   -0.3%     
=======================================
  Files          24     24             
  Lines        2341   2478    +137     
=======================================
  Hits          110    110             
- Misses       2231   2368    +137     
Flag Coverage Δ
rust 4.4% <0.0%> (-0.3%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

Comment thread src/rows.rs
pub layer2: Vec<L2>,
}

impl<L2: Layer2Cache> WalletCache<L2> {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we delete these whole block? I use it in my projects, and there may be other users

Copy link
Copy Markdown
Contributor Author

@Crayon-Shin-chan-bitlightlabs Crayon-Shin-chan-bitlightlabs Jun 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not delete these codes, there were move to WalletProvider trait as default methods

https://github.com/Crayon-Shin-chan-bitlightlabs/bp-wallet/blob/master/src/wallet.rs#L316-L389

@Crayon-Shin-chan-bitlightlabs Crayon-Shin-chan-bitlightlabs changed the title wallet cache provider & wallet unbind wallet cache provider Jun 24, 2025
@dr-orlovsky
Copy link
Copy Markdown
Member

The existing persistence provider for WalletCache allows custom storage of cache data, including databases etc. It is not clear why another provider is needed on top. What specifically have you changed in your cache implementation, which can't be done with a custom persistence provider?

@Crayon-Shin-chan-bitlightlabs
Copy link
Copy Markdown
Contributor Author

Crayon-Shin-chan-bitlightlabs commented Jun 25, 2025

The existing persistence provider for WalletCache allows custom storage of cache data, including databases etc. It is not clear why another provider is needed on top. What specifically have you changed in your cache implementation, which can't be done with a custom persistence provider?

1 because of we are use async to store , so we will store the wallet data structs our self
2, the current implementation load all transactions and UTXOs in memory, but we do not do that.
3. the register psbt will add temp UTXO to the cache, it just add to the default implementation of cache, we need a interface to add to ours cache
4. the persistence is just for storage, but he cache provider is providing functions for bp-wallet

In this PR, I’ve made an effort to preserve the original wallet cache interface and functionality, so it does not affect other libraries that depend on bp-wallet—or if it does, the impact is minimal, such as the small changes in rgb-runtime.

RGB-WG/rgb#306

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants