Skip to content
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
wants to merge 23 commits into from
Closed

Shuffle #159

wants to merge 23 commits into from

Conversation

ellemouton
Copy link
Owner

No description provided.

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.
Copy link

Pull reviewers stats

Stats of the last 30 days for lnd:

User Total reviews Time to review Total comments

@ellemouton ellemouton force-pushed the shuffle branch 2 times, most recently from be70659 to ef79c56 Compare November 12, 2024 05:56
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.
@ellemouton ellemouton force-pushed the shuffle branch 2 times, most recently from 198a66c to a838699 Compare November 12, 2024 07:17
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant