-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[3/3] Graph RIP: multi: RPC GraphSource #9265
base: elle-graphSourceAbstraction
Are you sure you want to change the base?
[3/3] Graph RIP: multi: RPC GraphSource #9265
Conversation
Important Review skippedAuto reviews are limited to specific labels. 🏷️ Labels to auto review (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
f07ff32
to
7df213e
Compare
2dc2543
to
eea9022
Compare
cda85de
to
d37f234
Compare
afc8a84
to
a087692
Compare
2 follow ups to address (potentially in a separate PR):
|
@ellemouton, remember to re-request review from reviewers when ready |
!lightninglabs-deploy mute |
These should be addressed in a refactor PR.
Before we continue to add more implementations of the GraphSource interface, we need to make sure that all implementations behave the same way if a resource (node or channel) is not found. Either no error should be returned or it should be clearly defined in the method comment which error to expect if the resource is not found. This will be important later when we want to address both a local and remote graph source so that we can handle the cases where a resource is not found in one source and then address the other source rather than erroring out.
for when the node in question is not found. This is consistent with other methods such as GetNodeInfo. This will allow us later on to switch out a grpc NotFound error with the expected error we implement the GraphSource interface with a grpc client.
This field is only ever written to and never read from. We remove it so that later on when we want to convert NetAddress into and from a protobuf message, we don't need to encode the ChainHash uneccessarily. This was included in NetAddress when the plan was still to have LND cater for different blockchains.
We'll make use of this field later when implementing the rpc version of the IsPublic method of the GraphSource interface.
We'll make use of this field later when implementing the rpc version of the GraphSource interface.
This commit mostly consists of boilerplate code that adds the new graphrpc server and provides it with the config it needs. The server is then implemented by graphrpc.Server.
So that we can import it in other packages without causing a circular dependency.
In this commit, a grpc version of the GraphSource interface is implemented. It does so by connecting to server that serves both the lnrpc.LightningClient service along with the graphrpc.GraphClient service. Each method on the GraphSource interface is implemented and tested.
Mux multiplexes the results from a local node GraphSource (likely backed by a ChannelGraph) and a remote graph source (likely backed by a graphrpc.Client) to form a new implementation of GraphSource that can be used by LND for graph queries.
When set, LND will not advertise the gossip queries feature bit and it will not initiate gossip syncing with any peer.
We already set `nobootstrap` in the default node flags for itest nodes, so we can remove this check now. This will allow us to later test bootstrapping in an itest.
259b811
to
15c2161
Compare
a087692
to
76141ab
Compare
Depends on #9243
With this PR, an LND node can be be given an external
GraphSource
to rely on.A
grpc
implementation ofGraphSource
is added which purely relies on a remote graph source.A
Mux
impl ofGraphSource
is also added which uses a combination of a remoteGraphSource
along with the localGraphSource
to provide a more complete & efficientGraphSource
implementation.A new
--gossip.no-sync
config option is added which results in the gossipqueries feature bit not being advertised and also means that we dont send
any gossip queries. The result is that we dont populate our local graph DB
with any info other than our own channels/channel peers. If an external graph
source is provided as the
GraphSource
, then it makes sense to use the newconfigoption since we will use the external source for gossip data.
See the itest for how to test this on regtest :)