Commit graph

16756 commits

Author SHA1 Message Date
Oliver Gugger
1f3f954a02
lnwallet: add AddHeight and RemoveHeight funcs 2024-05-27 15:53:10 +02:00
Oliver Gugger
26e759423b
cmd/lncli: move commands and export
We want to export some of our CLI code to re-use in other projects. But
in Golang you cannot import code from a `main` package.
So we need to move the actual code into its own package and only have
the `func main()` in the `main` package.
2024-05-27 15:53:10 +02:00
Oliver Gugger
626a1b87fa
Merge pull request #8632 from lightningnetwork/aux-leaf-signing
[4/5]: lnwallet: add new AuxSigner interface to mirror SigPool
2024-05-27 15:46:24 +02:00
Oliver Gugger
652ff81461
Merge pull request #8622 from lightningnetwork/aux-funding
[3/5]: multi: add new AuxFundingController for custom external funding flows
2024-05-27 15:26:13 +02:00
Olaoluwa Osuntokun
ebf9856fac
lnwallet: 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-05-27 13:02:16 +02:00
Olaoluwa Osuntokun
9b869f95bf
lnwallet: add WithAuxSigner option to channel 2024-05-27 13:02:16 +02:00
Olaoluwa Osuntokun
d908e8c2f7
lnwallet: add new AuxSigner interface to mirror SigPool
In this commit, we add a new aux signer interface that's meant to mirror the SigPool. If present, this'll be used to (maybe) obtain signatures for second level HTLCs for certain classes of custom channels.
2024-05-27 13:02:16 +02:00
Oliver Gugger
a350ccd791
funding: inform aux controller about channel ready/finalize 2024-05-27 12:58:29 +02:00
Oliver Gugger
6b7849950a
multi: add tapscript root to gossip message 2024-05-27 12:58:29 +02:00
Olaoluwa Osuntokun
bf307d30d1
funding+lnwallet: finish hook up new aux funding flow
For the initiator, once we get the signal that the PSBT has been
finalized, we'll call into the aux funder to get the funding desc. For
the responder, once we receive the funding_created message, we'll do the
same.

We now also have local+remote aux leaves for the commitment transaction.

Some old TODO comments that in retrospect aren't required anymore are
removed as well.
2024-05-27 12:58:29 +02:00
Olaoluwa Osuntokun
26ab75852b
funding+lnwallet: only blind tapscript root early in funding flow
In this commit, we modify the aux funding work flow slightly. We won't
be able to generate the full AuxFundingDesc until both sides has
sent+received funding params. So we'll now only attempt to bind the
tapscript root as soon as we send+recv the open_channel message.

We'll now also make sure that we pass the tapscript root all the way
down into the musig2 session creation.
2024-05-27 12:58:29 +02:00
Olaoluwa Osuntokun
28cb4884ca
lnwallet: for PsbtIntent return the internal key in the POutput
We also add a new assertion to the itests to ensure the field is being properly set.
2024-05-27 12:58:28 +02:00
Olaoluwa Osuntokun
a841a9be30
lnwallet: add TaprootInternalKey method to ShimIntent
If this is a taproot channel, then we'll return the internal key which'll be useful to callers.
2024-05-27 12:58:28 +02:00
Olaoluwa Osuntokun
bb71c496f4
config+serer: add AuxFundingController as top level cfg option 2024-05-27 12:58:28 +02:00
Olaoluwa Osuntokun
2f6e7ef191
funding: create new AuxFundingController interface
In this commit, we make a new `AuxFundingController` interface capable of processing messages off the wire. In addition, we can use it to abstract away details w.r.t how we obtain a `AuxFundingDesc` for a given channel.

We'll now use this whenever we get a channel funding request, to make sure we pass along the custom state that a channel may require.
2024-05-27 12:58:28 +02:00
yyforyongyu
2e40a23146
lnrpc: fix linter 2024-05-25 13:37:16 +08:00
yyforyongyu
5e8452cc5d
sweep: make sure the full input is accounted
Fix the case where previously only the witness data is taken into
account when calculating the fees.
2024-05-25 13:37:16 +08:00
yyforyongyu
17a089c899
input+lnwallet: apply the new type lntypes.VByte 2024-05-25 13:37:16 +08:00
yyforyongyu
8da68bb7db
multi: apply the new type lntypes.WeightUnit 2024-05-25 13:37:13 +08:00
yyforyongyu
dc9a0b31c0
lntypes: add new units WeightUnit and VByte 2024-05-24 23:56:28 +08:00
yyforyongyu
634967c5c8
chainfee: add FeeForVByte on SatPerKWeight 2024-05-24 22:49:20 +08:00
Olaoluwa Osuntokun
bc6292f8bd
Merge pull request #8758 from feelancer21/preserve-inbound-fees
multi: Inbound fees are retained when not provided
2024-05-23 13:58:52 -07:00
Olaoluwa Osuntokun
4417229bc8
Merge pull request #8773 from lightningnetwork/0-18-rc3
build: bump verison to v0.18.0-beta.rc3
2024-05-22 13:19:13 -07:00
feelancer21
dc4ec45423
itest: add more tests related to inbound fees
Add tests for setting inbound fees in channel policies, including tests
where no inbound fees are set in the PolicyUpdateRequest.
2024-05-22 20:48:52 +02: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
Olaoluwa Osuntokun
74237f2c24
build: bump verison to v0.18.0-beta.rc3 2024-05-22 11:44:24 -07:00
Olaoluwa Osuntokun
54bbc25d9a
lnwallet: use AuxFundingDesc to populate all custom chan info
With this commit, we'll now populate all the custom channel information within the OpenChannel and ChannelCommitment structs.
2024-05-22 18:24:52 +02:00
Olaoluwa Osuntokun
f2c2a82744
lnwallet: add new AuxFundingDesc struct
This struct will house all the information we'll need to do a class of custom channels that relies primarily on adding additional items to the tapscript root of the HTLC/commitment/funding outputs.
2024-05-22 18:24:52 +02:00
Olaoluwa Osuntokun
dd357fb847
funding: use atomic.Uint64 for chanIDNonce
This lets us get rid of the mutex usage there. We also shift the algo slightly to increment by 1, then use that as the next value, which plays nicer with the atomics.
2024-05-22 18:24:52 +02:00
Olaoluwa Osuntokun
8ba3f3a317
funding: add new type alias for PendingChanID = [32]byte
This'll be useful for new interface definitions that use the contents of the package.
2024-05-22 18:24:51 +02:00
Olaoluwa Osuntokun
5866287aae
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-05-22 18:24:51 +02:00
Olaoluwa Osuntokun
371e0148dc
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-05-22 18:24:51 +02:00
Olaoluwa Osuntokun
e5e5da381d
log+protofsm: add new abstract message router
In this commit, we add a new abstract message router. Over time, the
goal is that this message router replaces the logic we currently have in
the readHandler (the giant switch for each message).

With this new abstraction, can reduce the responsibilities of the
readHandler to *just* reading messages off the wire and handing them off
to the msg router. The readHandler no longer needs to know *where* the
messages should go, or how they should be dispatched.

This will be used in tandem with the new `protofsm` module in an
upcoming PR implementing the new rbf-coop close.
2024-05-22 18:24:51 +02:00
Oliver Gugger
5d53431f59
Merge pull request #8665 from GeorgeTsagk/custom-sender-bandwidth-hint
routing: add TlvTrafficShaper to bandwidth hints
2024-05-22 18:24:08 +02:00
George Tsagkarelis
53e9f288ed
routing: use first hop records on path finding 2024-05-22 17:28:22 +02:00
George Tsagkarelis
a584b7585d
lnd: use impl cfg TlvTrafficShaper 2024-05-22 17:28:22 +02:00
George Tsagkarelis
37cbfea912
routing: add TlvTrafficShaper to bandwidth hints 2024-05-22 17:28:22 +02:00
George Tsagkarelis
ec7dc031c9
htlcswitch: expose custom channel blob from link 2024-05-22 17:28:22 +02:00
George Tsagkarelis
3c6d49775e
lnwallet: expose commitment blob from channel 2024-05-22 17:28:21 +02:00
Oliver Gugger
966f41f0c7
Merge pull request #8660 from GeorgeTsagk/interceptor-wire-records
Enhance `update_add_htlc` with remote peer's custom records
2024-05-22 17:27:50 +02:00
George Tsagkarelis
1b1969b9a3
itest: add interceptor wire records access test 2024-05-22 14:56:43 +02:00
George Tsagkarelis
a5fcf33082
lnrpc: add wire records fields to SendPayment & HtlcInterceptor 2024-05-22 14:45:43 +02:00
George Tsagkarelis
25b4066b17
multi: use wire records on payment and intercept flows 2024-05-22 14:44:18 +02: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
68ea8d5312
Merge pull request #8750 from Chinwendu20/fnd
fn: Added `HasDuplicates` function to slice
2024-05-21 17:08:05 +02: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
Olaoluwa Osuntokun
e1c5fe2f9e
Merge pull request #8751 from yyforyongyu/fix-sweeper-18
contractcourt+sweep: fix fee function and deadline issue
2024-05-20 18:11:26 -07:00