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 39 commits into
base: master
Choose a base branch
from
Open

Graph abstract 1 #172

wants to merge 39 commits into from

Conversation

ellemouton
Copy link
Owner

No description provided.

Roasbeef and others added 13 commits December 12, 2024 16:57
In this commit, we add a rapid derived fuzz test for the HtlcAuxBlob
test. This uses the rapid (randomized property testing) into Go's built
in fuzzer. This wrapper will use the fuzz stream, and pass that into
rapid where the stream is used to make structured test inputs which are
tested against the existing properties.

This can be done more widely in the codebase, we pick a simple example
to port first before tackling others.
Make sure WgWait() doesn't block.
Removed 'cancel' argument, because it is called only in case the context has
already expired and the only action that cancel function did was cancelling the
context.
If ContextGuard lives for some time after Quit method is called, the map won't
be collected by GC. Optimization.
Simplifies context cancellation handling by using context.AfterFunc instead of a
goroutine to wait for context cancellation. This approach avoids the overhead of
a goroutine during the waiting period.

For ctxQuitUnsafe, since g.quit is closed only in the Quit method (which also
cancels all associated contexts), waiting on context cancellation ensures the
same behavior without unnecessary dependency on g.quit.

Added a test to ensure that the Create method does not launch any goroutines.
Signed-off-by: peicuiping <[email protected]>
Copy link

Pull reviewers stats

Stats of the last 30 days for lnd:

User Total reviews Time to review Total comments

@coveralls
Copy link

coveralls commented Jan 10, 2025

Pull Request Test Coverage Report for Build 12782803960

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 226 of 249 (90.76%) changed or added relevant lines in 33 files are covered.
  • 75 unchanged lines in 21 files lost coverage.
  • Overall coverage increased (+0.05%) to 58.718%

Changes Missing Coverage Covered Lines Changed/Added Lines %
build/version.go 0 1 0.0%
lnd.go 6 8 75.0%
routing/localchans/manager.go 5 7 71.43%
graph/sources/chan_graph.go 29 32 90.63%
htlcswitch/link.go 49 55 89.09%
protofsm/state_machine.go 54 63 85.71%
Files with Coverage Reduction New Missed Lines %
htlcswitch/mock.go 1 73.79%
queue/gc_queue.go 2 96.51%
watchtower/wtclient/session_negotiator.go 2 79.68%
invoices/invoiceregistry.go 2 84.83%
channeldb/forwarding_package.go 2 75.76%
htlcswitch/mailbox.go 2 93.55%
fn/v2/list.go 2 98.74%
htlcswitch/switch.go 2 82.75%
graph/notifications.go 2 84.62%
channeldb/channel.go 2 77.99%
Totals Coverage Status
Change from base Build 12442824783: 0.05%
Covered Lines: 135361
Relevant Lines: 230526

💛 - Coveralls

guggero and others added 15 commits January 10, 2025 09:17
…tifactAction

.github: bump upload-artifact action to v4
scripts/keys: update pub key for ellemouton
This bump includes a fix which prevents attribute value quoting if the
value string contains a newline character. This is so that if we call
spew.DumpS(), the output will stay nicely formatted.

The update also includes a couple more Hex helpers which we can make use
of now.
Update to use the latest version of the GoroutineManager which takes a
context via the `Go` method instead of the constructor.
So that we dont have to remember to add the `FSM(%v)` prefix each time
we write a log line.
protofsm: update GR Manager usage and start using structured logging
This commit updates the fn dep to the version containing the updates to
the ContextGuard implementation. Only the htlcswitch/link uses the guard
at the moment so this is updated to make use of the new implementation.
…ntextGuard

htlcswitch+go.mod: use updated fn.ContextGuard
…gisterToRegisteredInStartingDebugLogs

chore: change 'register' to 'registered' in lnrpc starting debug logs [skip ci]
guggero and others added 7 commits January 13, 2025 03:13
chainntnfs: fix test `testSingleConfirmationNotification`
…c-blobs

contractcourt: add rapid derived fuzz test for HtlcAuxBlob
The sweeper subsystem uses now also the configured budget values for HTLCs
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.
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.

10 participants