Commit Graph

1202 Commits

Author SHA1 Message Date
Jesse de Wit
7d9d100e94 localchans: add policy when missing 2024-11-14 11:42:22 +01:00
yyforyongyu
523ecc0653 multi: wait for rpcclients shutdown to complete
We need to call `WaitForShutdown` after stopping the rpc clients of the
chain backends.
2024-11-14 01:22:31 +08: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
yyforyongyu
227cc3a45c routing: fix missionControlStore blocks on shutting down 2024-11-08 01:23:33 +08:00
Elle Mouton
5370c90906 routing+migration32: update MC encoding to use pure TLV
In this commit, we update an existing migration which at the time of
writing has not been included in a release. We update it so that it
converts the format used for MissionControl result encoding to use pure
TLV instead. The 3 structs that have been updated are: `mcHop`,
`mcRoute` and `paymentResult`.
2024-11-01 12:28:06 +02:00
Elle Mouton
d9a073ad7e routing+channeldb: let Vertex implement tlv.RecordProducer
So that we can use it in TLV encoding.
Also add this to the codec for channeldb migration 32 since we will be
using it there in an upcoming adjustment commit.
2024-11-01 08:59:54 +02:00
Elle Mouton
9d0cd3ff4f multi: update more loggers to the v2 type 2024-10-22 17:03:56 +02:00
Elle Mouton
23602e017e multi: start updating various loggers to use the new v2 type 2024-10-22 17:03:55 +02:00
Olaoluwa Osuntokun
2d333178c3 Merge pull request #8960 from lightningnetwork/0-19-staging-rebased
[custom channels 5/5]: merge custom channel staging branch into master
2024-10-03 10:07:16 -07:00
George Tsagkarelis
d1a2dd6bd0 routing: add htlcAmt to PaymentBandwidth method of TlvTrafficShaper
This commit was added to the 0-19-staging branch recently and therefore
didn't make it into a previous part yet. So it's unrelated to the
changes in this part but is required for the whole custom channel saga.
2024-10-02 18:09:46 -07:00
Elle Mouton
8126930d6c routing: support multiple namespaced MissionControls 2024-10-01 14:11:05 +02:00
Elle Mouton
5eff056933 routing: prefix MC logs with namespace 2024-10-01 14:06:54 +02:00
Elle Mouton
f0f4f2df21 routing: separate MissionControl from MissionControlManager
This commit renames the previous MissionControl to MissionController and
the previous MissionController interface to MissionControlQuerier. This
is done because soon the (new) MissionController will back multiple
namespaced MissionControl instances.  For now, it just houses a single
MissionControl in the default namespace.

This commit also replaces the MissionControl's `now` function with a
`clock.Clock`.
2024-10-01 14:06:50 +02:00
Elle Mouton
28a828a11e routing: unexport MissionControl mutex
Only the MissionControl instance should use this variable and it should
not be accessible to users of MissionControl.
2024-10-01 13:50:50 +02:00
Elle Mouton
6b449a6633 routing: start writing and reading from namespaced MC
and invoke the associated mission control migration.
2024-10-01 13:50:50 +02:00
Elle Mouton
2dd9046622 routing: introduce missionControlDB abstraction
So that `missionControlStore` can be unaware of the backing DB structure
it is writing to. In an upcoming commit when we change mission control
to write to namespaced buckets instead, we then only need to update the
`namespacedDB` implementation.
2024-10-01 13:50:50 +02:00
Elle Mouton
383a6d274f routing+channeldb: migrate MC store to use minimal Route encoding
Add a new mcRoute type that houses the data about a route that MC
actually uses. Then add a migration (channeldb/migration32) that
migrates the existing store from its current serialisation to the new,
more minimal serialisation.
2024-09-30 11:40:25 +02:00
Elle Mouton
7dc86acb8c multi: update PaymentAddr to use fn.Option
Since it is allowed to not be set and so can lead to nil deref panics if
it is a pointer.
2024-09-25 11:14:35 +09:00
Elle Mouton
7bbf89625f multi: move ChannelUpdate validate methods to netann 2024-09-18 16:13:18 +02:00
Elle Mouton
60f331edb1 multi: rename ChannelUpdate to ChannelUpdate1
In preparation for adding a new ChannelUpdate2 message and a
ChannelUpdate interface, we rename the existing message to
ChannelUpdate1.
2024-09-18 16:13:17 +02:00
Matt Morehouse
8373cca43c routing: skip fuzzing when capacity is 0
probabilityFormula() is expected to return an error if capacity is 0, so
we should exclude that case from fuzzing.

Previously it was attempted to avoid this case by seeding the corpus
with an input that had capacity 1. That is not an effective solution
since the fuzzer can still generate an input with capacity 0.
2024-09-10 15:17:39 -05:00
Oliver Gugger
a895b1c6ca Merge pull request #9051 from calvinrzachman/export-routing-interface
routing: export dbMPPayment interface
2024-09-09 05:15:38 -06:00
George Tsagkarelis
aa17543d23 routing: use first hop records on path finding 2024-09-05 18:00:53 +02:00
Oliver Gugger
4804cbf139 channeldb+routing: persist first hop custom data for route 2024-09-05 18:00:53 +02:00
Olaoluwa Osuntokun
f04fa54622 routing: skip amtInRange for custom HTLCs
We might be trying to send an invoice amount that's greater than the size of the channel, but once you factor in the custom channel logic, an actual HTLC can be sent over the channel to pay that larger payment.

As a result, we'll skip over this check if a have a custom HTLC.
2024-09-05 18:00:52 +02:00
George Tsagkarelis
5b4de5f0d4 routing: add TlvTrafficShaper to bandwidth hints 2024-09-05 18:00:52 +02:00
Oliver Gugger
1b31835230 channeldb+routing: persist first hop custom records
With this commit we make sure the first hop custom records aren't lost
on restart/resume of a payment, so we persist it as part of the
PaymentCreationInfo struct.
2024-09-05 11:18:16 +02:00
George Tsagkarelis
42e358e3d3 lnrpc: add wire records fields to payment+interceptor RPCs 2024-09-05 11:18:16 +02:00
George Tsagkarelis
878f964a33 multi: use wire records on payment and intercept flows 2024-09-05 11:18:16 +02:00
Calvin Zachman
7547c234cc routing: export dbMPPayment interface
This will assist external programs attempting to re-use
ChannelRouter code and leverage the ControlTower's FetchPayment
method.
2024-08-27 19:00:58 -05:00
ziggie
25f7b1c362 blindedpath: minHTLC for blinded path change.
We will not add a buffer to the chan policy for blinded paths in case
the sender amount violates the minHTLC restriction in the first place.

Moreover we disgard a route fast if the payment amount is smaller than
the minHTLC along the route.
2024-08-22 19:09:43 +02:00
ziggie
73984964a8 blindedpath: fix log output. 2024-08-22 17:48:27 +02:00
ziggie
5d7113ac1d blindedpath: remove blockexpiry check.
Removes a check where we would NOT allow to create a blinded invoice
with an expiry (invoice expiry in seconds considered as block time)
lower than the min_final_ctlv_delta.
2024-08-22 17:45:45 +02:00
MPins
de495534e4 routing: Call the function to update routing config on main cfg
NewMissionControl propagate the callback function defined on server.go and
SetConfig call it to update the infos on main cfg.
2024-08-14 14:42:49 -03:00
Elle Mouton
ab28cde240 routing: correct initial finalPaddedSize
This purely affects logging. This makes sure that the `padStat`
finalPaddedSize field is initilised correctly with the given minSize.
2024-08-08 16:46:04 +02:00
Olaoluwa Osuntokun
459ee9b245 Merge pull request #8976 from ellemouton/rb-follow-ups
route blinding: follow ups
2024-08-07 17:54:31 -07:00
Elle Mouton
697f514d09 blindedpath: log chosen blinded paths
In this commit, we log selected blinded paths.
2024-08-07 17:03:12 +02:00
Elle Mouton
e4619afc08 multi: add node omission list for blinded paths 2024-08-07 17:03:11 +02:00
Elle Mouton
b490deefdf routing/blindedpath: dont error out unless all paths fail
In this commit, we adjust BuildBlindedPaymentPaths to only error out
completely if none of the paths it received from FindRoutes resulted in
a usable blinded path.
2024-08-07 17:02:56 +02:00
Elle Mouton
e47160d257 routing: fix MC probability order for blinded paths
Fix the blinded path probability sorting function.
Also fix the test assertion function.
2024-08-07 17:01:21 +02:00
yyforyongyu
bc31a8b36f routing: fix doc string 2024-08-07 22:19:23 +08:00
yyforyongyu
188aa9a4d4 routing+lnd: prepare closed channel SCIDs in server
The method `FetchClosedChannels` sometimes prematurely mark a pending
force closing channel as finalized, therefore we need to furthur check
`FetchPendingChannels` to make sure the channel is indeed finalized.
2024-08-07 22:19:23 +08:00
yyforyongyu
c2f7e6a66f routing: fail stale HTLC attempts during startup
This commit adds a check during router's startup and fails the inflight
HTLCs if they are routing using channels unknown to us. The channels are
unknown because they are already closed, usually long time ago.
2024-08-07 22:19:21 +08:00
yyforyongyu
b998ce11f1 routing+htlcswitch: add new interface method HasAttemptResult 2024-08-07 22:18:51 +08:00
yyforyongyu
bbf58ab444 routing: add new method resumePayments to handle payments during
startup
2024-08-07 22:18:49 +08:00
yyforyongyu
0928ba0149 routing: fix and enhance logging 2024-08-07 22:17:58 +08:00
Oliver Gugger
b63e5decad Merge pull request #8886 from bitromortac/buildroute-inbound-fees
routing: inbound fees support for BuildRoute
2024-08-07 08:11:17 -06:00
bitromortac
452db01ad7 lnrpc+routing: convert amt pointer to fn.Option 2024-08-07 14:24:56 +02:00
bitromortac
8b32e3e785 routing: add inbound fee support for BuildRoute 2024-08-07 14:23:54 +02:00