forked from lightningnetwork/lnd
-
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
Shuffle #159
Closed
Closed
Shuffle #159
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Simplify the ChannelGraphSource interface by removing this unused method.
For consistency in the graphsessoin.graph interface, we let the FetchNodeFeatures method take a read transaction just like the ForEachNodeDirectedChannel. This is nice because then all calls in the same pathfinding transaction use the same read transaction.
Pull reviewers statsStats of the last 30 days for lnd:
|
ellemouton
force-pushed
the
shuffle
branch
2 times, most recently
from
November 12, 2024 05:56
be70659
to
ef79c56
Compare
This commit adds a new GraphSources interface that LND requires for graph related read-only queries. As of this commit, the interface is empty but it will be populated over the next couple of commits. We add an implementation of this interface backec by a pointer to a graphdb.ChannelGraph. The infrustructure is put into place so that the GraphSoure provided to LND can be overridden by a caller of the lnd.Main function. By default, LND will satisfy the interface itself via the new `ChanGraphSource` struct.
In this commit, we take the existing graphsession.ReadyOnlyGraph interface and remove its usage of a kvdb.RTx and replace it with a more abstract `RTx` interface type. The new GraphSource interface is expanded to include the graphsession.ReadOnlyGraph interface and the implementation of it, ChanGraphSource, is expanded to include the new methods. It converts the given RTx to the underlying kvdb read transaction where needed.
Since the GraphSource interface may be satisfied by an RPC connection, it is best practice to pass a context through to any call in the interface. The ChanGraphSource implementation, which uses a kvdb backend, does not make use of the ctx. Any call-sites are for now given a `context.TODO()` which will all be addressed in follow up commits.
Define a new GraphSource interface required by the invoicerpc server and remove its access to the graphdb.ChannelGraph pointer. Add the new invoicesrpc.GraphSource interface to the main lnd.GraphSource interface and let ChanGraphSource implement it.
And let ChanGraphSource implement it.
ellemouton
force-pushed
the
shuffle
branch
2 times, most recently
from
November 12, 2024 07:17
198a66c
to
a838699
Compare
In this commit, we add a bunch of graph methods to the GraphSource, let ChanGraphSource implement it and then we use the graph source for these methods for the GetNodeInfo, VerifyMessage, DescribeGraph, GetNodeMetrics, GetChanInfo and GetNodeInfo RPC calls along with peer alias lookup.
We will later implement this interface with a backing RPC connection and so it makes sense to pass a context through for cancellation.
So that LND can use a different GraphSource for network bootstrapping and does not need to rely on its local graph db.
so that the external graph source can be used to query network information rather than depending on the local graph DB.
So that the calcuation is abstracted behind the interface and not necessarily dependent on LND's local channel graph.
We'll make use of this field later when implementing the rpc version of the IsPublic method of the GraphSource interface.
This will be used later on when we are mux-ing two GraphSources and want to exclude stats from one that have been accounted for by the other.
When set, LND will not advertise the gossip queries feature bit and it will not initiate gossip syncing with any peer.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.