Commit graph

16124 commits

Author SHA1 Message Date
ProofOfKeags
56f17afeeb
Merge pull request #8517 from ProofOfKeags/cleanup/link-weeds
htlcswitch+peer+lnwire: pull weeds
2024-03-06 16:05:44 -07:00
Keagan McClelland
59700892b7 lnwire: make LinkUpdater a subclass of Message
Conceptually, all messages that are capable of identifying the
channel_id on which they operate are themselves messages. Here we
codify this.
2024-03-06 11:59:19 -08:00
Keagan McClelland
f5f0286e34 peer+lnwire: move LinkUpdater to lnwire
The purpose of this interface is to distinguish messages that are
bound to a particular channel_id from those that are not. There is
no reason this ought to be a property of the peer package as it is
entirely determined by the contents of the message itself. Therefore
we move it to the lnwire package so it can be used without having
import cycles elsewhere in the codebase.
2024-03-06 11:59:19 -08:00
Keagan McClelland
3761912680 htlcswitch: avoid leaking peer interface from link
Here we notice that the only use of the Peer call on the link is
to find out what the peer's pubkey is. To avoid leaking handles to
IO actions outside the interface we reduce the surface area to
just return the peer's public key.
2024-03-06 11:59:09 -08:00
Oliver Gugger
5f89a8b832
Merge pull request #8523 from guggero/linter-use-cache
make: use Golang build and module cache for linter
2024-03-06 07:28:10 -06:00
Oliver Gugger
834371c995
make: use Golang build and module cache for linter
This commit gives the linter container access to the local machine's
build and module cache, drastically decreasing the run time of
subsequent linter runs (no difference on first run with this change).
2024-03-06 13:38:51 +01:00
Keagan McClelland
be69b022d9 htlcswitch: remove Switch reference from channelLink 2024-03-05 16:43:29 -08:00
Oliver Gugger
6cef367336
Merge pull request #8136 from hieblmi/fee-estimation-probe
Probing for more reliable route fee estimation
2024-03-05 11:35:57 -06:00
Slyghtning
fba6fdaf94
docs: update release notes 2024-03-05 09:24:27 +01:00
Slyghtning
814e1a79a6
lncli: add estimateroutefee command 2024-03-05 09:24:27 +01:00
Slyghtning
e79b8b2986
itest: estimate route fee tests 2024-03-05 09:24:27 +01:00
Slyghtning
ef069b658d
itest: preparatory fee estimation changes 2024-03-05 09:24:27 +01:00
Slyghtning
7d9589ecbf
routerrpc+zpay32: EstimateRouteFee overhaul
In this commit the mission control based fee estimation
is supplemented with a payment probe estimation which can
lead to more accurate estimation results. The probing
utilizes a hop-hint heurisic to detect routes through LSPs
in order to manually estimate fees to destinations behind
an LSP that would otherwise block the payment probe.
2024-03-05 09:24:27 +01:00
Slyghtning
24080c51f9
multi: fee estimation timeout parameters
conf: fee estimation timeout in sample config
2024-03-05 09:24:27 +01:00
Slyghtning
721038d1a4
routerrpc: overhaul RouteFeeRequest with probing parameters. 2024-03-05 09:24:25 +01:00
Olaoluwa Osuntokun
f61761277f
Merge pull request #8513 from lightningnetwork/lnd-master-version-17-99
build: bump version to v0.17.99
2024-03-01 13:58:48 -06:00
Oliver Gugger
10a6861bc9
build: bump version to v0.17.99
In this commit, we bump the version of the master branch to v0.17.99.
This reflects the fact that master will be a super set of all the minor
releases until v0.18, and will also include changes towards v0.18.
2024-03-01 10:29:04 +01:00
Olaoluwa Osuntokun
e623263b7f
Merge pull request #8499 from Roasbeef/taproot-nonce-tlv-t
multi: upgrade new taproot TLVs to use tlv.OptionalRecordT
2024-02-29 16:00:09 -06:00
Olaoluwa Osuntokun
cac779b69e
funding: send warning to remote peer if chan nonce missing on reest 2024-02-29 11:32:31 -06:00
Olaoluwa Osuntokun
7feb8b21e1
multi: upgrade new taproot TLVs to use tlv.OptionalRecordT
In this commit, we update new Taproot related TLVs (nonces, partial sig,
sig with nonce, etc). Along the way we were able to get rid of some
boiler plate, but most importantly, we're able to better protect against
API misuse (using a nonce that isn't initialized, etc) with the new
options API. In some areas this introduces a bit of extra boiler plate,
and where applicable I used some new helper functions to help cut down
on the noise.

Note to reviewers: this is done as a single commit, as changing the API
breaks all callers, so if we want things to compile it needs to be in a
wumbo commit.
2024-02-29 11:32:26 -06:00
Olaoluwa Osuntokun
6bd556d38c
build: bump tlv version to v1.2.3 2024-02-29 11:32:20 -06:00
Keagan McClelland
38db17b8cc htlcswitch: remove redundant field from channelLink 2024-02-27 17:06:35 -08:00
Olaoluwa Osuntokun
72764b1473
Merge pull request #8100 from bhandras/updateinvoice-refactor
channeldb: refactor `UpdateInvoice` to make it simpler to create SQL specific implementation
2024-02-27 16:50:02 -08:00
Oliver Gugger
48a3d56335
Merge pull request #8503 from ffranr/fix-err-wrap
Correct `fmt.Errorf` error wrapping instances
2024-02-27 12:20:16 -06:00
ffranr
e0358df39e
doc: update release notes 2024-02-27 17:08:02 +00:00
ffranr
b308895583
lncli: unit test makes use of error wrapping during comparison
This commit modifies a unit test such that it inspects a wrapped error
rather than comparing errors by string.
2024-02-27 17:08:01 +00:00
ffranr
cd566eb097
multi: fix fmt.Errorf error wrapping
Refactor fmt.Errorf usage to correctly wrap errors instead of using
non-wrapping format verbs.
2024-02-27 11:13:40 +00:00
ffranr
581c16d72f
lint: ensure the linter checks fmt.Errorf error wrapping 2024-02-27 11:12:28 +00:00
Olaoluwa Osuntokun
b234658945
Merge pull request #8501 from Roasbeef/tlv-fn-ergonomics
tlv: add UnwrapOrErrV+UnwrapOrFailV+Zero to OptionalRecord
2024-02-26 17:03:37 -08:00
Olaoluwa Osuntokun
3dd01cdc78
tlv: add Zero() method for OptionalRecordT
Most of the time with wire messages, we'll have the wrapped record, so
this is useful when decoding into a blank instance of the record's
value.
2024-02-26 16:12:55 -08:00
Olaoluwa Osuntokun
afde7162c6
tlv: add UnwrapOrErrV and UnwrapOrFailV
These two methods mirror the recently added `fn.Option` methods but
allow us to unwrap on level deeper into the underlying value of the
Record.
2024-02-26 16:12:49 -08:00
Olaoluwa Osuntokun
d69e1111ba
build: update to fn/v1.0.4 2024-02-26 16:12:47 -08:00
Olaoluwa Osuntokun
6d8f40cb27
Merge pull request #8500 from Roasbeef/fn-option-ergonomics
fn: add UnwrapOrErr and UnwrapOrFail to Option
2024-02-26 16:06:17 -08:00
Olaoluwa Osuntokun
5a960269f2
Merge pull request #8378 from guggero/fundpsbt-coin-select
walletrpc: unify coin selection, allow coin selection for PSBT with pre-defined inputs
2024-02-26 16:05:07 -08:00
Oliver Gugger
c307d1eeda
docs: document fundtemplate sub command, add release notes 2024-02-26 11:06:26 +01:00
Oliver Gugger
6dea39c23a
itest: add new test for FundPsbt with coin selection 2024-02-26 11:06:22 +01:00
Oliver Gugger
f333581d6c
cmd/lncli: add 'wallet psbt fundtemplate' command
This commit adds a new sub command to the wallet that allows using the
new funding option from a template.
Creating a new command is way easier for the user to understand than
adding multiple flags that are only valid in certain combinations.
2024-02-26 11:05:19 +01:00
Oliver Gugger
54fa5805c2
lnwallet+lnrpc: add address index to ListAddresses
For the itest in the next commit we'll need to be able to fetch the
input information for an address over RPC. The only piece missing is the
address' index, which we add in this commit. Everything else should be
derivable from the ListAddresses and ListAccounts calls.
2024-02-26 11:05:19 +01:00
Oliver Gugger
fb20cd598e
lnwallet+lnrpc: add derivation info for P2TR change addrs
In some situations (for example in Taproot Assets), we need to be able
to prove that an address is a bare BIP-0086 address that doesn't commit
to any script. We can do that by providing the BIP-0032 derivation info
and internal key.
2024-02-26 11:05:18 +01:00
Olaoluwa Osuntokun
166b2fdb97 fn: add UnwrapOrErr and UnwrapOrFail to Option
In this commit, we add two new methods that simplify usage of an
handling a value wrapped in an Option. Thes methods allow a caller to
force the nil/None check up front, and either obtain the value, or fail
the current execution or test.

This should replace most usages of `UnsafeFromSome` where ever used
today.
2024-02-24 17:21:37 -08:00
Oliver Gugger
094fdbfa72
walletrpc: implement third PSBT funding option
And now we finally implement the new funding option: Allowing coin
selection with pre-defined inputs and outputs.
2024-02-23 08:58:10 +01:00
Oliver Gugger
0f6c25a773
walletrpc: add PsbtCoinSelect option to FundPsbt 2024-02-23 08:58:10 +01:00
Oliver Gugger
446152e1a5
walletrpc: refactor to prepare for third funding option
In the following commits we'll add a new, third, funding option for
funding PSBTs: It will allow users to specify pre-selected inputs but
still request the wallet to perform coin selection up to the total
output sum amount.
2024-02-23 08:58:10 +01:00
Oliver Gugger
17645cd196
multi: add DecorateInputs to WalletController interface
This commit adds the new DecorateInputs method of the base wallet to the
WalletController interface.
2024-02-23 08:58:10 +01:00
Oliver Gugger
90c2926fdf
input: add AddOutput method to TxWeightEstimator
This commit adds a helper method to estimate the weight of an output by
the given pkScript.
2024-02-23 08:58:10 +01:00
Oliver Gugger
6773d6a6f6
btcwallet: add EstimateInputWeight helper function
This is a helper function that we will need to accurately determine the
weight of inputs specified in a PSBT.
Due to the nature of P2WSH and script-spend P2TR inputs, we can only
accurately estimate their weights if the full witness is already known.
So this helper function rejects inputs that use a script spend path but
don't fully specify the complete witness stack.
2024-02-23 08:58:09 +01:00
Oliver Gugger
7aa3662ea2
chanfunding: export change amount calculation
We want to re-use the logic that determines what change amount is left
over depending on whether we add or don't add a change output to a
transaction, respecting the change output's dust limit.
2024-02-23 08:58:09 +01:00
Oliver Gugger
2619c03d7d
chanfunding: allow using existing change output
We'll want to be able to tell the coin selection algorithm that we
intend to add any change to an existing output instead of assuming that
a change output is always created.
If we add any left over change to an existing output, we can skip the
dust amount check as we assume the selected existing output already has
a non-dust amount requested (responsibility of the caller to assert).
2024-02-23 08:58:09 +01:00
Oliver Gugger
4c82fb6cbb
chanfunding: make coin selection generic
Before this commit the coin selection logic in the chanfunding package
would always assume that there is a P2WSH funding output and potentially
a P2TR change output. But because we want to re-use the coin selection
for things other than just channel funding, we make the logic more
generic by allowing us to specify both the existing weight of the
transaction (the already known, static parts of the TX) as well as the
type of the potential change output we would use.
2024-02-23 08:58:09 +01:00
Oliver Gugger
9bdddbcc56
mod+chanfunding: use coin selection strategy for channel funding
The wallet assembler is now aware of the node config level coin
selection strategy, so we can use it when creating new channels.
2024-02-23 08:58:09 +01:00