Switch BDK persistence from file store to SQLite#87
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #87 +/- ##
==========================================
- Coverage 95.74% 95.73% -0.02%
==========================================
Files 23 23
Lines 12835 12818 -17
==========================================
- Hits 12289 12271 -18
- Misses 546 547 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thank you for this PR, we really appreciate the detailed explanation of the dependency and migration tradeoffs. |
rgb-libcurrently persists BDK wallet data withbdk_file_store, which upstream explicitly documents as unfit for production:This already caused breakage: the file store format changed in the BDK upgrade from 2.0 to 3.0, leaving existing databases unreadable. SQLite is the production-oriented, upgrade-migratable backend.
This PR moves BDK persistence to
bdk_sqlite(BDK'ssqlx-based SQLite store). Using it rather thanbdk_wallet's built-inrusqlitefeature also avoids a native-library conflict:rusqliteandrgb-lib's existingsea-orm/sqlxstack pull differentlibsqlite3-sysversions, and two crates linkingsqlite3can't coexist.bdk_sqlitesharessea-orm'ssqlx, so the dependency graph resolves cleanly.Note on existing wallets
This switch (like the BDK 2.0 to 3.0 upgrade before it) is not backwards compatible: existing BDK file-store databases are not read, so on first open the wallet creates a fresh SQLite store and repopulates via the normal scan. This is unavoidable when changing persistence backends and is the motivation for moving to a properly migratable one going forward.