-
Notifications
You must be signed in to change notification settings - Fork 592
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
chain: PrunedBlockDispatcher bugfix. #903
chain: PrunedBlockDispatcher bugfix. #903
Conversation
f13e5df
to
3441fd7
Compare
2397f1f
to
1ef6e6c
Compare
842064b
to
577dd4a
Compare
577dd4a
to
b104af5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Left a comment about how we add the cancelChan
.
For future concerns, although GetBlock
may ask for the same block, we should treat each request independently. We can use something like a requestID
to handle sending back the corresponding response, to make sure one request doesn't interfere with others. On top of that we can think about optimizations such as caching a previous success block response for future requests. Then ofc there's the new RPC getblockfrompeer
we can use for pruned nodes.
Note that caching is currently done in lnd: |
Refined the peer selection logic, to not waste time connecting to inbound peers and as well sort by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🌹
f4361d8
to
5d82d84
Compare
5d82d84
to
c5fe5d3
Compare
c5fe5d3
to
e55c3f7
Compare
In case we fail the request via the neutriono block peer fetcher we make sure we fail all dependant `GetBlock` calls and remove this block request completely so that a new request for this same block hash can be made.
We discard inbound peers because we don't know their listen port and sort the peers by pingtime to select the fastest first.
e55c3f7
to
987fbac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 💣
…locksync Plus lightninglabs/neutrino#273 Author: Elle Mouton <[email protected]> Date: Mon May 22 15:53:49 2023 +0200 chain: PrunedBlockDispatcher bugfix.
…locksync Plus lightninglabs/neutrino#273 Author: Elle Mouton <[email protected]> Date: Mon May 22 15:53:49 2023 +0200 chain: PrunedBlockDispatcher bugfix.
This addresses #lightningnetwork/lnd#8250.
(Still need to update the unittests).
So this does not address the related time issue for now which is acutally the case why the requests where failing in the first place.
I would add the new timing logic and introduce the
getblockfrompeer
command for bitcoind >24 (iirc) in a followup PR.