lnd/graph
Elle Mouton c89b616e7d
graph: refactor Builder network message handling
The exposed AddNode, AddEdge and UpdateEdge methods of the Builder are
currently synchronous since even though they pass messages to the
network handler which spins off the handling in a goroutine, the public
methods still wait for a response from the handling before returning.
The only part that is actually done asynchronously is the topology
notifications.

We previously tried to simplify things in [this
commit](d757b3bcfc)
but we soon realised that there was a reason for sending the messages to
the central/synchronous network handler first: it was to ensure
consistency for topology clients: ie, the ordering between when there is
a new topology client or if it is cancelled needs to be consistent and
handled synchronously with new network updates. So for example, if a new
update comes in right after a topology client cancels its subscription,
then it should _not_ be notified. Similariy for new subscriptions. So
this commit was reverted soon after.

We can, however, still simplify things as is done in this commit by
noting that _only topology subscriptions and notifications_ need to be
handled separately. The actual network updates do not need to. So that
is what is done here.

This refactor will make moving the topology subscription logic to a new
subsystem later on much easier.
2025-02-21 10:39:00 -03:00
..
db Merge pull request #9523 from ellemouton/graph9 2025-02-19 01:55:18 -06:00
testdata refactor: move various duties from ChannelRouter to graph.Builder 2024-07-15 15:56:33 +02:00
builder.go graph: refactor Builder network message handling 2025-02-21 10:39:00 -03:00
builder_test.go graph+discovery: move funding tx validation to gossiper 2025-02-12 15:48:08 +02:00
errors.go graph+discovery: move funding tx validation to gossiper 2025-02-12 15:48:08 +02:00
interfaces.go graph: update proof by ID 2025-02-18 11:05:28 -03:00
log.go multi: start updating various loggers to use the new v2 type 2024-10-22 17:03:55 +02:00
notifications.go multi: move LightningNode struct to models package 2024-11-28 13:36:32 +02:00
notifications_test.go graph+discovery: move funding tx validation to gossiper 2025-02-12 15:48:08 +02:00
setup_test.go refactor: move various duties from ChannelRouter to graph.Builder 2024-07-15 15:56:33 +02:00
stats.go graph: rename routerStats to builderStats 2025-02-07 13:01:39 +02:00