1681 Commits

Author SHA1 Message Date
Oliver Gugger
b811f3e6c9
multi: remove custom data from openchannel RPC 2024-05-14 09:03:47 +02:00
Oliver Gugger
8a4531fc96
multi: fix up custom records 2024-05-07 21:54:11 +02:00
Oliver Gugger
17a05186d3
multi: fixes to tlv traffic shaper 2024-05-03 17:33:45 +02:00
George Tsagkarelis
44427a7467
htlcswitch+lnwallet: persist peer custom records 2024-05-02 20:32:36 +02:00
Olaoluwa Osuntokun
82a969bba5 multi: hook up protofsm to logging 2024-05-01 23:30:56 -05:00
Olaoluwa Osuntokun
1bac89dda7 lnwallet: copy over the HTLC extra data in commit diff 2024-05-01 00:41:43 -05:00
Oliver Gugger
8d5d15904b
lnwallet: don't flip local/remote leaves 2024-04-29 21:28:05 +02:00
Oliver Gugger
0af8ce4c54
lnwallet: set NextHeight in HtlcView 2024-04-29 19:13:51 +02:00
Olaoluwa Osuntokun
9795a7856b lnwallet: add NextHeight to HtlcView 2024-04-27 18:14:17 -07:00
Oliver Gugger
cf965f04ad
lnwallet: add Tree() method, fix formatting 2024-04-24 17:04:06 +02:00
Oliver Gugger
91579829f2
lnwallet: export GenTaprootHtlcScript 2024-04-24 17:03:43 +02:00
Oliver Gugger
8f73c014ad
lnwallet: export AnchorSize 2024-04-24 17:03:20 +02:00
Oliver Gugger
95f931309e
lnwallet: add AddHeight and RemoveHeight funcs 2024-04-24 17:02:56 +02:00
Oliver Gugger
b4731b3d2d
cmd/lncli: move commands and export 2024-04-24 17:02:32 +02:00
Olaoluwa Osuntokun
c0c511c686
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-04-24 17:01:49 +02:00
Olaoluwa Osuntokun
e9e10cc32f
lnwallet: add WithAuxSigner option to channel 2024-04-24 16:59:03 +02:00
Olaoluwa Osuntokun
a6b56daef9
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-04-24 16:59:02 +02:00
Olaoluwa Osuntokun
17e9758ee7
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.
2024-04-24 16:58:58 +02:00
Olaoluwa Osuntokun
73aa617d9b
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-04-24 16:49:29 +02:00
Olaoluwa Osuntokun
63566c7614
lnwallet+input: update unit tests for compilation 2024-04-24 16:49:20 +02:00
Olaoluwa Osuntokun
036a5a946c
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-04-24 16:48:53 +02:00
Olaoluwa Osuntokun
50f0e1d03e
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-04-24 16:48:26 +02:00
Olaoluwa Osuntokun
f2ef2b4774
lnwallet: update GenTaprootFundingScript to also return the taproot internal key 2024-04-24 16:47:37 +02:00
Olaoluwa Osuntokun
2ef9b377a6
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-04-24 16:46:35 +02:00
Olaoluwa Osuntokun
7d86894634
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-04-24 16:45:42 +02:00
Olaoluwa Osuntokun
9f4677d197
lnwallet: thread thru input.AuxTapleaf to all relevant areas
In this commit, we start to thread thru the new aux tap leaf structures to all relevant areas. This includes: commitment outputs, resolution creation, breach handling, and also HTLC scripts.

Given the aux leaf store, and a struct that describes the current commitment, we can obtain the CommitAuxLeaves struct, then use that to derive the aux leaves for the commitment outputs and also HTLCs as well.

When restoring commitments and pay descs from disk, we'll store the aux leaves as custom TLV blobs on disk, then use the aux leaf store to map back to the concrete aux leaves when needed.
2024-04-24 16:43:41 +02:00
Olaoluwa Osuntokun
b199e9b783
lnwallet: add incoming+outgoing aux leaves to CommitAuxLeaves
In addition to the leaves for the commitment outputs, we'll also need to interact with leaves for all the HTLC outputs as well.
2024-04-24 16:43:14 +02:00
Olaoluwa Osuntokun
6d831eafa3
lnwallet: add TLV blob to PaymentDescriptor + htlc add
In this commit, we add a TLV blob to the PaymentDescriptor struct. We also now thread through this value from the UpdateAddHTLC message to the PaymentDescriptor mapping, and the other way around.
2024-04-24 16:43:11 +02:00
Olaoluwa Osuntokun
ceaab9f99f
channeldb: add custom blobs to RevocationLog+HTLCEntry
This'll be useful for custom channel types that want to store extra information that'll be useful to help handle channel revocation cases.
2024-04-24 16:39:07 +02:00
Olaoluwa Osuntokun
9d1926b7f1
channeldb: convert RevocationLog to use RecordT 2024-04-24 16:37:57 +02:00
Olaoluwa Osuntokun
d9709b8bf6
channeldb: convert HTLCEntry to use tlv.RecordT 2024-04-24 16:36:46 +02:00
Olaoluwa Osuntokun
59f73c77e5
lnwallet+channeldb: add new AuxLeafStore for dynamic aux leaves
In this commit, we add a new AuxLeafStore which can be used to dynamically fetch the latest aux leaves for a given state. This is useful for custom channel types that will store some extra information in the form of a custom blob, then will use that information to derive the new leaf tapscript leaves that may be attached to reach state.
2024-04-24 14:58:31 +02:00
Olaoluwa Osuntokun
9cc8fa4196
lnwallet: add custom tlv blob to internal commitment struct
In this commit, we also add the custom TLV blob to the internal commitment struct that we use within the in-memory commitment linked list.

This'll be useful to ensure that we're tracking the current blob for our in memory commitment for when we need to write it to disk.
2024-04-24 13:54:03 +02:00
Olaoluwa Osuntokun
b68195a6dd
lnwallet: export the HtlcView struct
We'll need this later on to ensure we can always interact with the new aux blobs at all stages of commitment transaction construction.
2024-04-24 13:48:39 +02:00
Olaoluwa Osuntokun
002787f229
input+lnwallet: update taproot scripts to accept optional aux leaf
In this commit, we update all the taproot scripts to also accept an
optional aux leaf. This aux leaf can be used to add more redemption
paths for advanced channels, or just as an extra commitment space.
2024-04-24 13:25:26 +02:00
Olaoluwa Osuntokun
08a6c9c738
lnwallet: add initial unit tests for musig2+tapscript root chans 2024-04-24 11:36:03 +02:00
Olaoluwa Osuntokun
64aed86880
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-04-24 11:36:03 +02:00
Olaoluwa Osuntokun
4cb351b53e
lnwallet: update internal funding flow w/ tapscript root
This isn't hooked up yet to the funding manager, but with this commit, we can now start to write internal unit tests that handle musig2 channels with a tapscript root.
2024-04-24 11:36:03 +02:00
Olaoluwa Osuntokun
ebeb3afb04
multi: update GenTaprootFundingScript to pass tapscript root
In most cases, we won't yet be passing a root. The option usage helps us keep the control flow mostly unchanged.
2024-04-24 11:34:29 +02:00
Olaoluwa Osuntokun
64ec9523a0
lnwallet/chanfunding: add optional tapscript root 2024-04-24 11:34:28 +02:00
Olaoluwa Osuntokun
6f4ebe7d0a
lnwallet/chanfunding: remote assembler.go to interface.go
In this commit, we rename the files as assembler.go houses the primary
interfaces/abstractions of the package. In the rest of the codebase,
this file is near uniformly called interface.go, so we rename the file
to make the repo more digestible at a scan.
2024-04-24 10:37:22 +02:00
yyforyongyu
0fc5301d12
lnwallet+sweep: cap conf target used in fee estimator 2024-04-19 21:33:31 +08:00
yyforyongyu
ecd471ac75
lnwallet+sweep: calculate max allowed feerate on BumpResult
This commit adds the method `MaxFeeRateAllowed` to calculate the max fee
rate. The caller may specify a large MaxFeeRate value, which cannot be
cover by the budget. In that case, we default to use the max feerate
calculated using `budget/weight`.
2024-04-19 21:33:29 +08:00
yyforyongyu
f85661d94a
lnwallet+sweep: add new method CheckMempoolAcceptance 2024-04-19 21:33:28 +08:00
yyforyongyu
6ff6c86155
multi: merge DetermineFeePerKw and Estimate
This commit moves `DetermineFeePerKw` into the `Estimate` method on
`FeePreference`. A few callsites previously calling `DetermineFeePerKw`
without the max fee rate is now also temporarily fixed by forcing them
to use `Estimate` with the default sweeper max fee rate.
2024-04-19 21:33:21 +08:00
Oliver Gugger
648fb22f63
multi: wrap all errors 2024-04-11 15:04:03 +02:00
Carla Kirk-Cohen
7fd9c2a7f8
multi: use some record for payment descriptor blinding point 2024-04-02 15:44:05 -04:00
Mohamed Awnallah
1a2d50d385
multi: add coin selection strategy option to all on-chain rpcs
In this commit, we add the coin selection strategy option to the following
on-chain RPCs `fundpsbt`, `batchopenchannel`, `estimatefee`, `sendcoins`,
`sendmany`, and `sendoutputs`.
2024-04-01 19:08:22 +02:00
Carla Kirk-Cohen
f090a64142
multi: add blinding point to payment descriptor and persist
This commit adds an optional blinding point to payment descriptors and
persists them in our HTLC's extra data. A get/set pattern is used to
populate the ExtraData on our disk representation of the HTLC so that
callers do not need to worry about the underlying storage detail.
2024-03-27 09:38:56 -04:00
Carla Kirk-Cohen
e4f90ec593
lnwire: add blinding point to update_add_htlc TLVs
Add blinding points to update_add_htlc. This TLV will be set for
nodes that are relaying payments in blinded routes that are _not_
the introduction node.
2024-03-27 09:38:50 -04:00