-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add compact block filters blockchain feature using the Nakamoto client #207
Conversation
Making progress! This is the error I get when attempting to sync a testnet wallet on an Android emulator:
|
Oh darn it worked! Took about 3-4 minutes and the wallet is displaying the correct balance for the descriptor. 🔥 🔥 🔥 |
Ok so so far here is what is happening:
The odd thing is that these two libraries are pretty much duplicates of each other. So the issue is definitely coming from something on Android, and most likely not from the FFI layer or uniffi-rs. I could try testing with Python and see what happens, but I suspect it will work just as well as with the jvm library. @cloudhead @rajarshimaitra any ideas? I tried looking through the Nakamoto codebase but couldn't quite pick out the |
Thanks @thunderbiscuit .. Thats super progress.. Although I am as clueless about the Is that something that happens on android? Does it require special consideration for spawning threads? |
This is likely what's going on. |
Ok good stuff guys, thanks for chiming in. I'll need to dig a bit more into this. It means that somehow the connection between the native binary and the glue code is handled differently on Android than it is server-side, and I don't know that we have encountered that before. My next step will be to make sure it works in the unit tests (which run on the dev machine and not in the emulator/device). Side note, I tested with the Python library and it worked right off the bat. |
Folks it looks like we have liftoff! The issue was that I had given a default value of On Android however, the process is not started from a place where you have write permission (and I haven't quite figured out where this default path leads to the attempted directory creation but it doesn't really matter for now), and so that default path simply doesn't create the val path: String = applicationContext.filesDir.toString()
val nakamotoConfig = CbfConfig(
Network.TESTNET,
"$path/bdk-nakamoto",
) I suspect the easiest way to deal with this in the short run is to make the A few notes for myself/future reference:
|
Great work! In terms of catching the error, is there something nakamoto could have done better? I suspect there would have been an error logged, though I recently reworked all the logging because there were some issues in 0.3.0. On your notes:
|
I tried to get CBF working in python, and was successfull on mainnet (and regtest) ( see diff on my branch https://github.com/andreasgriffin/bdk-ffi/commits/compact_filters2 ) Even better: It safes the latest tip and does not redownload everything again |
I really like CBF because it has good privacy, while also offering great speed. @thunderbiscuit : Does it makes sense to develop https://github.com/andreasgriffin/bdk-ffi/commits/compact_filters2 into a PR right now, even though bdk has a major restructuring ahead? |
Hey thanks for taking a look! Instead of making a new PR on this repo directly, I think it might make sense to keep this PR up to date (it's quite old at this point) so that it's easier to review and keep up to date in the future. Would you mind making your PR on my fork instead? Your contributions will still be shown because your commits will actually show up on this PR once I merge your PR on my branch. I'll rebase this (it's about 500 commits behind) and everything will break, but would you be interested in opening a PR on my cbf branch with your working implementation? To be transparent with you I will not actually consider merging this in the FFI layer until the 1.0 release of BDK, which will impact significantly how sync is done (and so you can expect sizeable changes to the compact block filter crate as well). But for anyone who would like to experiment with it and for testing the advances made by the Rust BDK team on CBF it would be great to have this PR fairly up-to-date and ready to play with. |
5b1f9b6
to
427e12b
Compare
Ok I've rebased the changes. If you PR on my CBF branch I'll take the time to review and merge there, so we can get this PR in working order! |
I'm closing this in favour or #379. |
Work in Progress.
Fixes #118.
Description
This PR adds the compact block filters blockchain option.
Notes to the reviewers
Not ready for merge yet. Lots to be tested still.
Questions I still want to answer:
Changelog notice
Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingNew Features: