911 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
c5d3d76c33
peer+server: downgrade to legacy coop close for taproot channels
In this commit, we implement logic to downgrade to the legacy coop close
for taproot channels. Before this commit, we wouldn't allow nodes to
start up with both the taproot flag and the rbf flag activated.

In the future, once we implement the spec updates, we'll add support for
this combo, and can revert parts of this commit.
2025-04-01 16:41:26 -07:00
yyforyongyu
b1e55f5fe5
lnd: don't abort the startup on subsystem errors
We want to make sure the node can start if non-fatal error is returned.
2025-03-26 14:15:52 +08:00
yyforyongyu
799ce9752a
lnd: skip ErrEdgeNotFound when iterating channels
We now skip another error when iterating the channels for our persistent
peers to unblock connecting to other peers.
2025-03-26 00:25:30 +08:00
yyforyongyu
dd8f2888a0
lnd: log errors during the startup flow
To aid us debugging startup issues.
2025-03-26 00:25:30 +08:00
Oliver Gugger
d1093cd3c3
Merge pull request #9642 from yyforyongyu/skip-blockbeat
lnd: skip setting `blockbeat` for `nochainbackend` mode
2025-03-25 08:20:34 -06:00
Oliver Gugger
af2f11edff
Merge pull request #9544 from lightningnetwork/elle-graphCacheBase
graph: move graph cache out of CRUD layer
2025-03-25 07:43:06 -06:00
yyforyongyu
ab9004492e
lnd: skip setting blockbeat for nochainbackend mode
If we are in `nochainbackend` mode, we need to skip fetching the best
block during startup, otherwise it will be blocked.
2025-03-25 20:57:51 +08:00
Olaoluwa Osuntokun
c7ed5d65c6
multi: add new config options to tune gossip msg allocated bandwidth
We go with the defaults of if no values are set.
2025-03-24 19:21:45 -07:00
Oliver Gugger
0aea482b51
multi: add testnet4 support 2025-03-24 11:53:23 -05:00
Elle Mouton
2221aaa889
graph/db: move Topology client management to ChannelGraph
We plan to later on add an option for a remote graph source which will
be managed from the ChannelGraph. In such a set-up, a node would rely on
the remote graph source for graph updates instead of from gossip sync.
In this scenario, however, our topology subscription logic should still
notify clients of all updates and so it makes more sense to have the
logic as part of the ChannelGraph so that we can send updates we receive
from the remote graph.
2025-03-24 15:05:48 +02:00
Elle Mouton
b497c4694e
multi: add Start and Stop methods for ChannelGraph
We do this in preparation for moving channel cache population logic out
of the constructor and into the Start method. We also will later on
(when topology subscription is moved to the ChannelGraph), have a
goroutine that will need to be kicked off and stopped.
2025-03-24 15:05:47 +02:00
Olaoluwa Osuntokun
3a18bf088c multi: enable RBF co-op bumps after reconnection
In this commit, we alter the existing co-op close flow to enable RBF
bumps after re connection. With the new RBF close flow, it's possible
that after a success round _and_ a re connection, either side wants to do
another fee bump. Typically we route these requests through the switch,
but in this case, the link no longer exists in the switch, so any
requests to fee bump again would find that the link doesn't exist.

In this commit, we implement a work around wherein if we have an RBF
chan closer active, and the link isn't in the switch, then we just route
the request directly to the chan closer via the peer. Once we have the
chan closer, we can use the exact same flow as prior.
2025-03-18 11:44:21 -05:00
Olaoluwa Osuntokun
429bbf33ef server: thread through new NoRbfCoopClose option
For now, we disallow the option to be used with the taproot chans
option, as the new flow hasn't yet been updated for nonce usage.
2025-03-18 11:44:20 -05:00
Olaoluwa Osuntokun
bf3007a2ce multi: thread thru RPC caller context from CloseChannel 2025-03-18 11:44:20 -05:00
Eugene Siegel
68ec766b61
funding+server.go: modify notifications to pass through server
This modifies the various channelnotifier notification functions
to instead hit the server and then call the notification routine.
This allows us to accurately modify the server's maps.
2025-03-11 20:42:35 -04:00
Eugene Siegel
6eb746fbba
server.go+accessman.go: introduce caches for access permissions
Here we introduce the access manager which has caches that will
determine the access control status of our peers. Peers that have
had their funding transaction confirm with us are protected. Peers
that only have pending-open channels with us are temporary access
and can have their access revoked. The rest of the peers are granted
restricted access.
2025-03-11 20:42:34 -04:00
Nishant Bansal
4569c07e08
multi: Add itest for funding timeout
This commit adds an integration test that
verifies the funding timeout behavior in the
funding manager, in dev/integration test.
Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
2025-03-07 21:32:38 +05:30
Elle Mouton
e004447da6
multi: remove the need for the graphsession package
In this commit, we add a `GraphSession` method to the `ChannelGraph`.
This method provides a caller with access to a `NodeTraverser`. This is
used by pathfinding to create a graph "session" overwhich to perform a
set of queries for a pathfinding attempt. With this refactor, we hide
details such as DB transaction creation and transaction commits from the
caller. So with this, pathfinding does not need to remember to "close
the graph session". With this commit, the `graphsession` package may be
completely removed.
2025-02-18 10:15:41 -03:00
Elle Mouton
8ec08fbfa4
multi: remove the need for NewRoutingGraph
The `graphsession.NewRoutingGraph` method was used to create a
RoutingGraph instance with no consistent read transaction across calls.
But now that the ChannelGraph directly implements this, we can remove
The NewRoutingGraph method.
2025-02-18 07:59:57 -03:00
Elle Mouton
22e391f055
discovery: add AssumeChannelValid config option
in preparation for later on when we need to know when to skip funding
transaction validation.
2025-02-12 13:15:54 +02:00
Abdullahi Yunus
84f039db45
lnd+chanbackup: add lnd config flag
In this commit, we add the --no-backup-archive with a default
as false. When set to true then previous channel backup file will
not be archived but replaced. We also modify TestUpdateAndSwap
test to make sure the new behaviour works as expected.
2025-01-24 10:56:15 +01:00
yyforyongyu
27a05694cb
multi: make ProofMatureDelta configurable
We add a new config option to set the `ProofMatureDelta` so the users
can tune their graphs based on their own preference over the num of
confs found in the announcement signatures.
2025-01-17 21:44:23 +08:00
yyforyongyu
8fc9154506
lnd: start blockbeatDispatcher and register consumers 2024-12-20 17:54:03 +08:00
yyforyongyu
16a8b623b3
lnd: add new method startLowLevelServices
In this commit we start to break up the starting process into smaller
pieces, which is needed in the following commit to initialize blockbeat
consumers.
2024-12-20 17:54:02 +08:00
yyforyongyu
545cea0546
multi: start consumers with a starting blockbeat
This is needed so the consumers have an initial state about the current
block.
2024-12-20 17:54:02 +08:00
Olaoluwa Osuntokun
fb429d658b
Merge pull request #9330 from ProofOfKeags/update/fn2
multi: update to fn v2
2024-12-09 12:56:23 +01:00
Oliver Gugger
86b3be71fe
multi: thread through and use AuxTrafficShaper 2024-12-05 12:39:34 +01:00
Keagan McClelland
ed2989ae33
multi: update to fn v2 2024-12-04 13:19:00 -07:00
Elle Mouton
ab7aae0708
multi: rename nolint:lll to nolint:ll
Find and replace all nolint instances refering to the `lll` linter and
replace with `ll` which is the name of our custom version of the `lll`
linter which can be used to ignore log lines during linting.

The next commit will do the configuration of the custom linter and
disable the default one.
2024-12-02 09:14:21 +02:00
Elle Mouton
4089fbcb44
multi: fix linter errors 2024-11-28 13:51:15 +02:00
Elle Mouton
adcaa8802f
multi: remove kvdb.Tx from ChannelGraphSource.ForAllOutgoingChannels
and the same for ChannelStateDB.FetchChannel. Most of the calls to these
methods provide a `nil` Tx anyways. The only place that currently
provides a non-nil tx is in the `localchans.Manager`. It takes the
transaction provided to the `ForAllOutgoingChannels` callback and passes
it to it's `updateEdge` method. Note, however, that the
`ForAllOutgoingChannels` call is a call to the graph db and the call to
`updateEdge` is a call to the `ChannelStateDB`. There is no reason that
these two calls need to happen under the same transaction as they are
reading from two completely disjoint databases. And so in the effort to
completely split untangle the relationship between the two databases, we
now dont use the same transaction for these two calls.
2024-11-28 13:49:41 +02:00
Elle Mouton
6e13898981
multi: move LightningNode struct to models package 2024-11-28 13:36:32 +02:00
Elle Mouton
ccb8f0eeb8
refactor: move graphsession pkg to graph package 2024-11-28 13:36:15 +02:00
Elle Mouton
b86980ec40
channeldb: remove graph db from channeldb
Now that the channel.DB no longer uses the ChannelGraph pointer, we can
completely remove it as a member of channeldb.DB.
2024-11-28 13:36:15 +02:00
Elle Mouton
2c083bc017
multi: let chan and graph db implement AddrSource
Then use both to construct a multiAddrSource AddrSource and use that
around the code-base.
2024-11-28 13:36:15 +02:00
Elle Mouton
083d3c9d7c
channeldb: define a single AddrSource interface
Our aim is to completely remove the `channeldb.DB`'s direct dependence
on the `graphdb.ChannelGraph` pointer. The only place where it still
depends on this pointer is in the `(DB).AddrsForNode(..)` method where
it queries both the channel DB and the graph db for the known addresses
for the node in question and then combines the results. So, to separate
these out, we will define an AddrsForNodes interface in this commit
which we will later let both the ChannelGraph and channeldb.DB both
implement and we will merge these results outside of the channeldb
package.

All this commit does is to unify the `AddrSource` interface since this
has been defined separately in a couple of places.
2024-11-28 13:36:15 +02:00
Elle Mouton
74a4b1922b
refactor: move graph related DB code to graph/db from channeldb
This is a pure refactor commit. It moves over all the graph related CRUD
code from `channeldb` to `graph/db`.
2024-11-28 13:36:13 +02:00
Elle Mouton
9f54ec90aa
multi+refactor: move models package to graph/db
All the structs defined in the `channeldb/models` package are graph
related. So once we move all the graph CRUD code to the graph package,
it makes sense to have the schema structs there too. So this just moves
the `models` package over to `graph/db/models`.
2024-11-28 13:34:33 +02:00
Keagan McClelland
111c9b05f3
htlcswitch+peer: allow the disabling of quiescence
Here we add a flag where we can disable quiescence. This will be used
in the case where the feature is not negotiated with our peer.
2024-11-26 14:13:39 -07:00
Elle
fbeab726e1
Merge pull request #8390 from carlaKC/7883-experimental-endorsement
Add Experimental Endorsement Signalling
2024-11-26 09:43:22 +02:00
Oliver Gugger
66940024ac
Merge pull request #9290 from w3irdrobot/broadcast-misspelling
docs: fix broadcast misspelling
2024-11-25 12:25:51 +01:00
w3irdrobot
d3bff47167
docs: fix broadcast misspelling 2024-11-22 16:20:02 -05:00
Carla Kirk-Cohen
f02bb58486
multi: add experimental endorsement feature bit and disable option 2024-11-22 09:16:58 -05:00
Carla Kirk-Cohen
774bfa740a
htlcswitch: relay experimental endorsement signal with update_add_htlc 2024-11-22 09:16:56 -05:00
Oliver Gugger
38ec1a1c64
Merge pull request #8805 from breez/jssdwt-insert-edge-when-not-found
localchans: recreate missing edge if not found
2024-11-22 08:42:51 +01:00
yyforyongyu
57084804d4
lnd: stop graphBuilder during shutdown 2024-11-21 15:37:49 +08:00
yyforyongyu
fe03aa0201
peer+lnd: fix peer blocking on node shutdown
This commit fixes a case where the peer blocks the shutdown process.
During the shutdown, the server will call `s.DisconnectPeer`, which
calls `peer.Disconnect`. Because the peer never enters `peer.Start` via
`s.peerInitializer`, the `startReady` chan will not be closed, causing
`peer.Disconnect` to hang forever. We now fix it by only block on
`startReady` when the peer is started.
2024-11-18 18:49:34 +08:00
Jesse de Wit
7d9d100e94
localchans: add policy when missing 2024-11-14 11:42:22 +01:00
Jesse de Wit
bb4d3db8bc
localchans: recreate missing edge if not found
If a node contains a channel, but doesn't have a corresponding edge in
the graph database, updating the channel policy would fail. In this
commit the edge is recreated if the channel exists. This ensures a node
can recover from a missing edge in the graph database by calling
updatechanpolicy.
2024-11-13 12:13:11 +01:00
Oliver Gugger
d8c920fa7a
chanbackup+rpcserver+server: return number of recovered channels 2024-11-06 15:30:23 +01:00