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

Graph abstract 1 #172

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Graph abstract 1 #172

wants to merge 6 commits into from

Conversation

ellemouton
Copy link
Owner

No description provided.

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.
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 backed 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 `graphsource.DBSource`
struct.
And completely remove the need for the graph/session package. Now that
we have a `DBSource` implementation of the `GraphSource`, we can now use
that to hide the details of the underlying transaction that is started
in a pathfinding session.
In preparation for having a GraphSource implementation backed by either
different DB sources (sqlite/postgres which will take a context) or a
remote source over RPC, we update these methods to take a context and
start threading through context to the call sites. The next commit will
aim to remove all the context.TODO()s added in this commit.
And remove all the context.TODO()s from the previous commit.
Copy link

Pull reviewers stats

Stats of the last 30 days for lnd:

User Total reviews Time to review Total comments

@coveralls
Copy link

Pull Request Test Coverage Report for Build 12706566268

Details

  • 90 of 96 (93.75%) changed or added relevant lines in 17 files are covered.
  • 26961 unchanged lines in 434 files lost coverage.
  • Overall coverage decreased (-9.3%) to 49.364%

Changes Missing Coverage Covered Lines Changed/Added Lines %
graph/db/graph.go 2 3 66.67%
lnd.go 6 8 75.0%
graph/sources/chan_graph.go 29 32 90.63%
Files with Coverage Reduction New Missed Lines %
graph/errors.go 1 94.74%
lnwire/typed_fee.go 2 66.67%
channeldb/forwarding_policy.go 2 85.14%
routing/chainview/queue.go 2 94.29%
record/hop.go 2 93.33%
lnwire/short_channel_id.go 2 89.74%
lnwallet/sigpool.go 2 65.63%
netann/sign.go 2 70.0%
watchtower/blob/justice_kit.go 2 76.43%
contractcourt/htlc_incoming_contest_resolver.go 2 81.17%
Totals Coverage Status
Change from base Build 12442824783: -9.3%
Covered Lines: 100487
Relevant Lines: 203562

💛 - Coveralls

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.

2 participants