Commit Graph

32 Commits

Author SHA1 Message Date
Elle Mouton
e5fbca8299 multi: let ForEachNodeChannel take a reset param 2025-07-15 11:23:27 +02:00
Elle Mouton
85fda8b926 routing+server: let ForAllOutgoingChannels take a context
And so, remove a previously added context.TODO
2025-07-08 15:10:30 +02:00
Elle Mouton
2f2845dfc0 refactor+multi: use *lnwire.FeatureVector for ChannelEdgeInfo features
In this commit, we move the serialisation details of a channel's
features to the DB layer and change the `models` field to instead use a
more useful `*lnwire.FeatureVector` type.

This makes the features easier to work with and moves the serialisation
to where it is actually used.
2025-07-01 17:02:07 +02:00
Elle Mouton
91513623b5 routing: remove a context.TODO() 2025-06-19 14:49:32 +02:00
Elle Mouton
9890d74622 multi: set the InboundFee on ChannelEdgePolicy
In this commit, we make sure to set the new field wherever appropriate.
This will be any place where the ChannelEdgePolicy is constructed other
than its disk deserialisation.
2025-06-09 08:31:10 +02:00
ziggie
e008190a85 localchans: bugfix so that we always use the correct chanID 2025-01-14 08:14:02 +01:00
Keagan McClelland
ed2989ae33 multi: update to fn v2 2024-12-04 13:19:00 -07: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
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
Jesse de Wit
266531271b localchans: do error if an edge policy is missing 2024-11-21 10:57:54 +01:00
Jesse de Wit
7d9d100e94 localchans: add policy when missing 2024-11-14 11:42:22 +01:00
Jesse de Wit
5e5291d044 localchans: add test for createEdge and manager 2024-11-13 12:13:11 +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
Keagan McClelland
e3a9d0acbe multi: break ChannelConstraints into two sub-structures
This commit breaks the ChannelConstraints structure into two
sub-structures that reflect the fundamental differences in how
these parameters are used. On its face it may not seem necessary,
however the distinction introduced here is relevant for how we
will be implementing the Dynamic Commitments proposal.
2024-08-01 12:00:32 -07:00
feelancer21
f62c00fe34 multi: Inbound fees are retained when not provided
Fixes the problem that inbound base fee and fee rate are overwritten
with 0 if they are not specified in PolicyUpdateRequest. This ensures
backward compatibility with older rpc clients that do not yet support
the inbound feature.
2024-05-22 20:48:42 +02:00
Joost Jager
763787e08c routing+lnrpc: add inbound fee policy update 2024-03-31 16:49:19 +02:00
Elle Mouton
84cdcd6847 multi: move DB schemas to channeldb/models
This commit moves the ChannelEdgePolicy, ChannelEdgeInfo,
ChanelAuthProof and CachedEdgePolicy structs to the `channeldb/models`
package.
2023-11-08 14:50:35 +02:00
Oliver Gugger
d5c504c8de multi: use fwding policy from models pkg 2023-08-22 06:22:33 +08:00
Elle Mouton
7b186716a1 multi: populate both string and byte TXID in lnrpc.Outpoint
This commit adds a a new `MarshalOutPoint` helper in the `lnrpc` package
that can be used to convert a `wire.Outpoint` to an `lnrpc.Outpoint`.
By using this helper, we are less likely to forget to populate both the
string and byte form of the TXID.
2023-04-24 16:19:26 +02:00
bitromortac
dd5273c88c multi: rename due to required maxHTLC bit
We rename `ChanUpdateOptionMaxHtlc` to `ChanUpdateRequiredMaxHtlc`
as with the latest changes it is now required.

Similarly, rename `validateOptionalFields` to
`ValidateChannelUpdateFields`, export it to use it in a later commit.
2023-02-21 11:10:39 +01:00
Oliver Gugger
7dfe4018ce multi: use btcd's btcec/v2 and btcutil modules
This commit was previously split into the following parts to ease
review:
 - 2d746f68: replace imports
 - 4008f0fd: use ecdsa.Signature
 - 849e33d1: remove btcec.S256()
 - b8f6ebbd: use v2 library correctly
 - fa80bca9: bump go modules
2022-03-09 19:02:37 +01:00
Oliver Gugger
895a2e497b multi: formatting and comment fixes 2022-02-10 11:02:02 +01:00
Oliver Gugger
ffee7d1bcf multi: fix newly detected linter issues 2022-02-10 11:02:02 +01:00
Oliver Gugger
dfdc2bff8b multi: run gosimports 2022-02-10 11:02:01 +01:00
ErikEk
46e9481e6c routing: invalid channels updatechanpolicy call 2021-09-15 10:20:49 +02:00
Joost Jager
bd07b5f49e routing/localchans: fix nested db tx
This commit fixes a bug where a db tx is opened within another db tx.
2021-08-24 13:43:26 +02:00
Joost Jager
3f775778c3 channeldb+routing: add tx parameter
Adds an optional tx parameter to ForAllOutgoingChannels and FetchChannel
so that data can be queried within the context of an existing database
transaction.
2021-08-24 13:43:24 +02:00
Joost Jager
b6eb3a69ba routing+lnrpc+lncli: allow setting min htlc policy 2019-12-11 00:17:08 +01:00
Joost Jager
74c2df658e localchans: log policy update error 2019-12-11 00:17:06 +01:00
Joost Jager
ddb98fcc41 multi: distinguish between htlc in and out constraints 2019-12-11 00:16:57 +01:00
Valentine Wallace
9a52cb6dab multi: update internals to support updating max htlc
In this commit, we update the router and link to support users
updating the max HTLC policy for their channels. By updating these internal
systems before updating the RPC server and lncli, we protect users from
being shown an option that doesn't actually work.
2019-09-23 13:07:10 +02:00
Joost Jager
c80feeb4b3 routing+discovery: extract local channel manager
The policy update logic that resided part in the gossiper and
part in the rpc server is extracted into its own object.

This prepares for additional validation logic to be added for policy
updates that would otherwise make the gossiper heavier.

It is also a small first step towards separation of our own channel data
from the rest of the graph.
2019-09-23 13:07:08 +02:00