-
Notifications
You must be signed in to change notification settings - Fork 0
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
wip try to implement scanblocks rpc to speed up full wallet scans #2
base: implement_rpc_wallet
Are you sure you want to change the base?
wip try to implement scanblocks rpc to speed up full wallet scans #2
Conversation
Hey @chrisguida --
I imagine both of these return an error if what you're doing is contradictory. |
d97875b
to
4fbfabb
Compare
4fbfabb
to
fad6f94
Compare
Hi @LLFourn , thanks for the message! Apologies for the delay, I've been traveling for the last week. I think your solution in 3-4 seems reasonable, though I'm still unsure of all the implications. @vladimirfomene Do you plan to implement this in your PR? If not, do you mind if I start? I think maybe it would be best if a few of us could get on a call and figure out a strategy. Would love to have something working here in the next week or two so I can use this downstream by EOY. cc @evanlinjin |
@chrisguida I don't mind you going ahead with it. I'm a little bit held up at the afrobitcoin conference here in Accra. |
eb77c8c
to
e2c732a
Compare
@vladimirfomene your force push from a couple of weeks ago doesn't build, so I made a new branch with the original commits bitcoindevkit/bdk@master...chrisguida:bdk:old/rpcwallet-scanblocks Will update again once it builds. Or maybe I should split this procedure out into its own example? |
@LLFourn I believe my new branch's updates to the Can you go more into detail about why we need your 4th suggestion? LocalChain doesn't seem to mind if there are only 3 blocks in the chain, at very distant heights, with this code. |
(4) is just what you had in mind where |
I'll respond to the conversations here by the end of the week. This problem has been on my mind. However I've only been working part-time for the past two weeks. |
a494e27
to
7f773de
Compare
4c451d7
to
438e0bf
Compare
f9d07fa
to
db58b8a
Compare
db58b8a
to
8ec65f0
Compare
Description
This PR uses the
scanblocks
RPC, which uses bitcoind's internal block filter index to find block hashes relevant to a descriptor wallet. This boosts the performance of wallet rescans by several orders of magnitude, especially when scanning from genesis to tip. I can scan mainnet wallets in about 2 minutes using this code, whereas the prior version of the code takes (probably?) several hours.However, I didn't find a way to "connect" the blocks to the wallet once fetched, as this error is thrown when attempting to do so:
Error: CannotConnectError { try_include_height: 450 }
According to @evanlinjin this is because:
"In LocalChain, we represent blocks as checkpoints (height, blockhash). When we update the LocalChain with a Block, this creates an update with two checkpoints: (prev_height, prev_block_hash), (height, block_hash). Either prev_block_hash or block_hash needs to exist in the LocalChain for it to "connect"."
So we either need to download the full header chain in order to start connecting blocks, or we need to change the structures to allow connecting blocks without downloading the full header chain first.
Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingNew Features:
CHANGELOG.md
Bugfixes: