-
Notifications
You must be signed in to change notification settings - Fork 871
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
Download pruned blocks (like lnd) #7201
Comments
Mh at some point I think someone will propose something, but still looking for a well-tested plugin I am writing one https://github.com/coffee-tools/folgore with failure recovery too, but it is not so mature to run as a default plugin in cln. it is fetching also the block from the network with nakamoto. |
@nepet is working on integrating the recently added |
I'll let @nepet add color to this, and he will likely have more information on the progress and dependencies. |
uh this is interesting! Nice! |
Yeah, it's a new JSON-RPC call in |
Oh I see the @luke-jr is working on it in bitcoin/bitcoin#19463 maybe I will help to review it to move this forward Thanks for describing it btw |
LND's solution is to bypass the bitcoin backend by directly querying peers for a missing block. This involves peer management, serialisation, block validation and sanity checks, which is a bit of reinventing the wheel and introduces possible attack vectors if done incorrectly. The solution I am working on uses the Fixing these may well take some time, but in the meantime using In conclusion, this will be a multi-step improvement, where the first step that uses |
I have not seen a "maybe success" empty json yet, however calling I have three VPS nodes running my script on mainnet that trigger a I have them running for multiple days and they downloaded >10000 blocks, so far lightningd seems happy and works fine. Multiple parallel downloads of the same block from different peers handles bitcoind very well and just returns the block from whoever has finished fetching the block first. So, probabilty 100% with the retry mechanism at least on my side. |
lnd detects pruned nodes and downloads blocks, if bitcoind has them already pruned:
https://github.com/btcsuite/btcwallet/blob/5df09dd4335865dde2a9a6d94a26a7f5779af825/chain/bitcoind_conn.go#L474
Theoretically CLN supports pruned nodes as well, but when I tried it with ~60 GB block data, it usually doesn't take long until CLN asks bitcoind for blocks that have already been pruned.
In this case, CLN just retries to get the block every second without success:
I wrote a python script that downloads the blocks for CLN (https://github.com/martinneustein/pyBTCProxy), but I wonder if this might be a useful functionality to go into CLN.
The text was updated successfully, but these errors were encountered: