Commit Graph

222 Commits

Author SHA1 Message Date
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
49275e1d46
Merge pull request #9197 from guggero/aux-signer-batching-fixes
[custom channels]: Aux signer batching fixes
2024-10-21 17:49:15 -07:00
Boris Nagaev
04a2003f3b
peer: fix logging (missing argument) [skip ci]
Previously, LND log used to have such records:
[WRN] PEER: Peer(...): Link=%!v(MISSING) is not active

Now the short channel ID is printed there instead of "%!v(MISSING)".
2024-10-18 12:09:44 -03:00
Jonathan Harvey-Buschel
b3f953b1c4
multi: allow mock aux signer to customize sig jobs 2024-10-17 17:33:14 +02:00
Olaoluwa Osuntokun
9a181105e2
multi: hook up new aux interfaces 2024-10-02 18:10:00 -07:00
Olaoluwa Osuntokun
e0ced8e629
lnwallet+peer: move internalKeyForAddr to lnwallet package
This way we can re-use it. We also make it slightly more generalized.
2024-10-02 18:09:52 -07:00
Oliver Gugger
e0b4601fb9
multi: add co-op close custom data to close update
With this commit we populate additional information about the close
outputs (including potential custom channel data) in the close update
RPC message.
This will allow custom channels to find out how the additional close
outputs look like on chain and what data they might commit to.

We also hook up the aux custom data formatter, so it can format the
custom channel data to JSON.
2024-09-19 10:18:41 +02:00
Olaoluwa Osuntokun
8dee76a1b8
peer: decorate delivery addr w/ internal key
In this commit, we move to add the internal key to the delivery addr. This way, we give the aux chan closer the extra information it may need to properly augment the normal co-op close process.
2024-09-19 10:18:41 +02:00
Olaoluwa Osuntokun
44ab7e6b10
server+peer: init peer struct w/ AuxChanCloser if present 2024-09-19 10:18:41 +02:00
Oliver Gugger
cdad5d988d
Merge pull request #9072 from lightningnetwork/extract-part3-from-staging-branch
[custom channels 3/5]: Extract PART3 from mega staging branch
2024-09-19 01:20:55 -06:00
Olaoluwa Osuntokun
83fdbda2fa
multi: obtain+verify aux sigs for all second level HTLCs
In this commit, we start to use the new AuxSigner to obtain+verify aux sigs for all second level HTLCs. This is similar to the existing SigPool, but we'll only attempt to do this if the AuxSigner is present (won't be for most channels).
2024-09-18 19:04:53 +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
Elle Mouton
bb44efa21f
multi: rename ChannelAnnouncement to ChannelAnnouncment1
In preparation for adding the new ChannelAnnouncement2 message along
with a ChannelAnnouncement interface, we rename the existing message to
ChannelAnnouncement1.
2024-09-18 16:13:17 +02:00
Elle Mouton
05d76b696d
multi: rename AnnounceSignatures to AnnounceSignatures1
In preparation for adding a new message, AnnounceSignatures2 along with
an AnnounceSignatures interface, we rename the existing message to
AnnounceSignatures1.
2024-09-18 16:13:16 +02:00
ffranr
8d1059f41c
lnwire: add custom records field to type UpdateFulfillHtlc
- Introduce the field `CustomRecords` to the type `UpdateFulfillHtlc`.
- Encode and decode the new field into the `ExtraData` field of the
`update_fulfill_htlc` wire message.
- Empty `ExtraData` field is set to `nil`.
2024-09-05 11:18:15 +02:00
ffranr
81f6a8060f
lnwire: add custom records field to type UpdateAddHtlc
- Introduce the field `CustomRecords` to the type `UpdateAddHtlc`.
- Encode and decode the new field into the `ExtraData` field of
  the `update_add_htlc` wire message.
2024-09-05 11:18:15 +02:00
George Tsagkarelis
ea92d0aecc
multi: refresh htlcswitch aliases on aliasmgr update 2024-09-05 08:44:32 +02:00
Oliver Gugger
b45d72fe59
multi: thread thru the AuxLeafStore everywhere 2024-08-28 13:26:14 +02:00
Olaoluwa Osuntokun
82ba5bf0bf
lnwallet+peer: add tapscript root awareness to musig2 sessions
With this commit, the channel is now aware of if it's a musig2 channel, that also has a tapscript root. We'll need to always pass in the tapscript root each time we: make the funding output, sign a new state, and also verify a new state.
2024-08-28 11:52:31 +02:00
Olaoluwa Osuntokun
f09c517bc6 peer: don't stop global msg router
In this commit, we fix a bug that would cause a global message router to
be stopped anytime a peer disconnected. The global msg router only
allows `Start` to be called once, so afterwards, no messages would
properly be routed.
2024-08-14 19:23:02 -07:00
Olaoluwa Osuntokun
b028af1836 multi: make MsgRouter available in the ImplementationCfg
With this commit, we allow the `MsgRouter` to be available in the
`ImplementationCfg`. With this, programs outside of lnd itself are able
to now hook into the message processing flow to direct handle custom
messages, and even normal wire messages.
2024-08-14 19:23:02 -07:00
Olaoluwa Osuntokun
927aa84b5f peer: update readHandler to dispatch to msgRouter if set
Over time with this, we should be able to significantly reduce the size
of the peer.Brontide struct as we only need all those deps as the peer
needs to recognize and handle each incoming wire message itself.
2024-08-14 19:23:02 -07:00
Olaoluwa Osuntokun
9acad37f57
peer: always send channel update on reconnect
We have existing logic to attempt to reliably send a channel update to
the remote peer. In the wild, we've seen this fail, as it's possible
right when we send the update the peer disconnects.

In this commit, we implement a simple fix which is just to send the chan
update each time we connect to the remote party.

Fixes https://github.com/lightningnetwork/lnd/issues/6870.
2024-08-07 17:48:50 -07:00
Keagan McClelland
2ddc3db5f8
peer: add message summary for Stfu 2024-08-05 17:23:19 -07: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
Keagan McClelland
1d65f5bd12
peer: refactor createChanCloser to use ChannelParty 2024-07-31 14:50:27 -07:00
Keagan McClelland
0996e4f163
multi: refactor lnwallet/channel.go to use ChannelParty in select places
We also include changes to contractcourt, htlcswitch and peer to stitch the
boundaries together.
2024-07-31 14:50:26 -07:00
Eugene Siegel
d6001d033b
htlcswitch+lnwallet: calculate fee exposure as commit fees + dust
This commit expands the definition of the dust limit to take into
account commitment fees as well as dust HTLCs. The dust limit is now
known as a fee exposure threshold. Dust HTLCs are fees anyways so it
makes sense to account for commitment fees as well. The link has
been modified slightly to calculate dust. In the future, the switch
dust calculations can be removed.
2024-07-29 14:13:21 -04:00
yyforyongyu
d992cf94d6
multi: add SpewLogClosure to avoid code repetition 2024-07-25 22:18:49 +08:00
yyforyongyu
b6049ff94b
multi: add NewLogClosure in lnutils to avoid repetition
And replaces all usage of `logClosure` with `lnutils.LogClosure`.
2024-07-25 21:25:23 +08:00
yyforyongyu
e61cba8d22
multi: return verbose errors when fetching edges 2024-06-10 08:40:18 +08:00
yyforyongyu
78cc1619d7
multi: fix complaints from IDE and linter
Fixed unused param and nilness cond.
2024-06-07 00:45:15 +08:00
Olaoluwa Osuntokun
64639fb771
Merge pull request #8762 from ProofOfKeags/bugfix/ping-stability
Adjust ping parameters to improve tor stability
2024-05-21 19:34:57 -07:00
Keagan McClelland
1148e572bf peer: triple timeout parameters to give tor more grace 2024-05-21 13:36:46 -07:00
Keagan McClelland
61191a576d peer: make PingManager.Stop infallible 2024-05-21 13:29:31 -07:00
Keagan McClelland
94a9baefeb peer: reduce upper bound of pong bytes to ease bandwidth load 2024-05-21 13:27:56 -07:00
Oliver Gugger
01e3ac61d8
Merge pull request #8631 from Chinwendu20/brontidetest
[code-health]: reduce duplication in brontide test.
2024-05-21 12:46:16 +02:00
Ononiwu Maureen
b741132a81
peer: Add startPeer test function
Signed-off-by: Ononiwu Maureen <maureen.ononiwu@outlook.com>
2024-05-10 10:23:31 +01:00
Ononiwu Maureen
2ec0fe0717
peer: Add new function to create test peer.
Signed-off-by: Ononiwu Maureen <maureen.ononiwu@outlook.com>
2024-05-08 13:17:14 +01:00
Ononiwu Maureen
8f76c5eeef
peer: Create mockswitch, publTx, notifier in ..
test_utils

Signed-off-by: Ononiwu Maureen <maureen.ononiwu@outlook.com>
2024-05-08 12:04:30 +01:00
Ononiwu Maureen
536c69b793
peer: createTestPeerWithChannel returns a struct
The `createTestPeerWithChannel` function is made to return this newly
created struct and error.

This is useful because upcoming commits would require us returning more
objects from the function.

Signed-off-by: Ononiwu Maureen <maureen.ononiwu@outlook.com>
2024-05-08 11:59:08 +01:00
Ononiwu Maureen
389ecb535b
peer: Change createTestPeer name.
In this function `createTestPeer` is changed to
`createTestPeerWithChannel`. This is useful in coming commits where we
decouple the process of creating test peer from the function.

Signed-off-by: Ononiwu Maureen <maureen.ononiwu@outlook.com>
2024-05-08 11:57:15 +01:00
Tom Kirkpatrick
3837c3f12e
lnwallet: add configurable cache for web fee estimator
Add fee.min-update-timeout and fee.max-update-timeout config options to
allow configuration of the web fee estimator cache.
2024-05-04 14:41:41 +08:00
Oliver Gugger
648fb22f63
multi: wrap all errors 2024-04-11 15:04:03 +02:00
Oliver Gugger
6377f98536
Merge pull request #8615 from ProofOfKeags/bugfix/revert-compulsory-gossip-queries
Revert "feature: make gossip queries compulsory"
2024-04-05 06:57:39 +00:00
Keagan McClelland
dd2da29cba peer: re-add AuthGossiper nil check 2024-04-03 15:47:50 -07:00
Carla Kirk-Cohen
040fcb0f92
multi: add option to disable route blinding, rejecting at link
Add an option to disable route blinding, failing back any HTLC with
a blinding point set when we haven't got the feature enabled.

Note that this commit only handles the case where we're chosen as the
relaying node (where the blinding point is in update_add_htlc), we'll
add handling for the introduction node case once we get to handling of
blinded payloads).
2024-04-03 08:35:41 -04:00
Keagan McClelland
dad53b3f9a Revert "feature: make gossip queries compulsory"
This reverts commit 717facc202.

It turns out that we can't do this since it would result in
incompatibility with LDK. The spec has been updated to reallow
optional gossip queries so we revert this commit.
2024-04-02 16:43:27 -07:00
Joost Jager
e8c97deaef htlcswitch: add receiver-side inbound fee support 2024-03-31 16:49:19 +02:00