Commit Graph

13268 Commits

Author SHA1 Message Date
eugene
5ddad90a17
invoices: fix OOO notifications, use cancelChan instead of canceled
This commit fixes OOO notifications between backlog and non-backlog
events by having the non-backlog goroutines wait on a chan that
signals that backlog processing is complete.

This commit also replaces usage of the canceled atomic variable with
the cancelChan to signal that delivery of an event should no longer
occur. Atomics do not make perfect "sequence" points as the atomic
may be checked too early and the end-result of delivering to a stopped
ntfnQueue is the same. Using the cancelChan ensures that we do not
hang on sending to ntfnQueue.
2022-05-11 13:54:45 -04:00
eugene
93f87acb59
invoices: add client to map before delivering backlog notif
Prior to this change, if SubscribeSingleInvoice or
SubscribeNotifications was called, it was possible that a state
change would never be delivered to the client. The sequence of
events would be:
- delivery of backlog events with invoice in the Open state
- invoice goes to the Accepted state, no client to notify
- client added to map

This is fixed by adding the client to the map first. However, with
this change alone it then becomes possible for notifications to be
delivered out of order. This is addressed in a following commit.
2022-05-11 13:54:43 -04:00
eugene
d76278bc1e
invoices: properly set Preimage for settle resolutions
This fixes a nil-pointer-dereference that would occur if this was
called for a settled AMP invoice. Terms.PaymentPreimage is always
false for AMP invoices.
2022-05-11 13:51:12 -04:00
eugene
6dcec862aa
invoices: remove redundant code
HTLCSet already removes any HTLCs that are not in the desired state,
so doing it again on the same set is redundant.
2022-05-11 13:51:10 -04:00
eugene
c9a6c80be9
release-notes: update for 0.15.0 2022-05-11 13:50:40 -04:00
eugene
87a486f1f9
htlcswitch: remove synchronous link handoff, special-case keystone err
This allows Switch-initiated payments to be failed back if they don't
make it into a commitment. Prior to this commit, a Switch-initiated
HTLC could get "lost" meaning the circuit wouldn't get deleted except
if conditions were "right" and the network result store would never
be made aware of the HTLC's fate. Switch-initiated HTLC's are now
passed to the link's mailbox to ensure they can be failed back.

This change also special-cases the ErrDuplicateKeystone error from
OpenCircuits(...) so that callers of updateCommitTx() in the link
don't send an Error to the peer if they encounter the keystone error.
With the first async change, the keystone error should now always
be recoverable.
2022-05-11 13:49:37 -04:00
Evan Kaloudis
e0d6b2d924
docs: update release notes 0.15.0 - PR #6464 2022-05-11 13:21:27 -04:00
Evan Kaloudis
dea15d51f9
mobile/README: explain new API objects for sub-servers in LND v0.15+ 2022-05-11 13:18:50 -04:00
Evan Kaloudis
e9feefaba6
gen_bindings.sh: Mobile builds: expose main sub-servers by default 2022-05-11 13:18:33 -04:00
Evan Kaloudis
3e51a7a6fe
Makefile: Mobile builds: expose main sub-servers + set SUBSERVER_PREFIX flag by default 2022-05-11 13:18:17 -04:00
Oliver Gugger
c2adb03e38
Merge pull request #6450 from guggero/taproot-psbt
taproot: add PSBT signing support for Taproot, fix remote signing Taproot support
2022-05-11 11:16:51 +02:00
Oliver Gugger
8dbf78fbb6
Merge pull request #6523 from Roasbeef/hop-hints-opt-in
cmd/lncli: make hop hint inclusion opt-in for addinvoice
2022-05-11 10:08:30 +02:00
Oliver Gugger
9f4f0e94f5
multi: avoid direct use of dcrec/secp256k1 library
Because the original dcrec secp256k1 library that is used for the
Schnorr signature primitives uses different hash algorithms than the
btcd secp256k1 library. Therefore pulling in the wrong library can lead
to weird and unexpected errors. We try to make it harder to make the
mistake by not using the library directly in lnd in the first place.
Note that it is still indirectly needed by the btcd secp256k1 library,
therefore the module dependency is still expected to be there, just
moved to the indirect section.
2022-05-11 10:07:52 +02:00
Oliver Gugger
cc6e864639
docs: add release notes 2022-05-11 10:07:52 +02:00
Oliver Gugger
6c495c1bbe
itest: add Taproot PSBT signing tests 2022-05-11 10:07:51 +02:00
Oliver Gugger
fe30b9e987
itest: refactor PSBT signing itest 2022-05-11 10:07:51 +02:00
Oliver Gugger
d1a151010a
lntest+rpcwallet: support remote p2tr script spend signing 2022-05-11 10:07:51 +02:00
Oliver Gugger
7f4e977073
lntest+rpcwallet: support remote p2tr key spend signing 2022-05-11 10:07:50 +02:00
Oliver Gugger
35dd2d25ea
btcwallet: support taproot script signing in PSBT 2022-05-11 10:07:50 +02:00
Oliver Gugger
0f32a4456d
btcwallet: support taproot key spend signing in PSBT 2022-05-11 10:07:50 +02:00
Oliver Gugger
e4aa32fdf7
btcwallet: prepare for supporting new signing methods 2022-05-11 10:07:49 +02:00
Oliver Gugger
0e098ed9da
mod: update to btcd/btcutil/psbt v1.1.4 2022-05-11 10:07:49 +02:00
Olaoluwa Osuntokun
630fc36dcf
multi: introduce and use new TapTweak and SignMethod fields
In this commit, we add a new field `TapTweak` to be used for key path
spends. Before this commit, we'd overload the existing `WitnessScript`
field to pass this information to the signing context. This was
confusing as for tapscript spends, this was the leaf script, which
mirrors the other script based spending types.

With this new filed, users need to set this to the script root for
keypath spends where the output key commits to a real merkle root, and
nothing when bip 86 spending is being used.

To make the signing even more explicit, we also add a new field called
sign_method with an enum type that differentiates between the different
segwit v0 and v1 signing methods.

Fixes https://github.com/lightningnetwork/lnd/issues/6446.
2022-05-11 10:07:49 +02:00
Oliver Gugger
99cda74f6a
input: define new signing method constants 2022-05-11 10:07:48 +02:00
Oliver Gugger
5395a0fe6b
rpcwallet: attempt to locate UTXO information in prev output fetcher
Since we might now be given a whole list of UTXOs in the PrevOutputs
field of the SignOutputRaw RPC, the previous output fetcher might
contain the information we require for the remote signing case. So
instead of failing if our wallet doesn't know each input that's being
spent, we fall back to the UTXO information contained in the previous
outputs.
2022-05-11 10:07:48 +02:00
Oliver Gugger
0051e39078
Merge pull request #6345 from ellemouton/bitcoind-rpc-polling
multi: bitcoind rpc polling option
2022-05-11 10:04:37 +02:00
Elle Mouton
a4bd3892d2
docs: update release notes 2022-05-11 09:02:13 +02:00
Elle Mouton
e789107e1f
multi: new bitcoind rpcpolling backend for itests 2022-05-11 09:02:13 +02:00
Orbital
7509af1a70
multi: add rpcpolling config options 2022-05-11 09:02:13 +02:00
Elle Mouton
0459ccf542
chainntnfs: test both zmq and rpc bitcoind modes 2022-05-11 09:02:13 +02:00
Elle Mouton
f766268e8c
lnwallet/test: test against bitcoind-rpc-polling backend 2022-05-11 09:02:13 +02:00
Elle Mouton
33e1f9bfa4
routing/chainview: add bitcoind rpc polling test
Add a new chainview interface test that runds the chainview tests
against a bitcoind node that we are getting block and tx notifications
from using the rpc interface.
2022-05-11 09:02:13 +02:00
Elle Mouton
c76d04ef91
multi: make ZmqReadDeadline configurable
Make the Bitcoind ZMQReadDeadline option configurable.
2022-05-11 08:45:07 +02:00
Elle Mouton
5a08788a05
multi: update btcwallet to v0.15.0
Update go.mod to point to latest btcwallet version.
2022-05-11 08:45:06 +02:00
Olaoluwa Osuntokun
5e4d349ea6
cmd/lncli: make hop hint inclusion opt-in for addinvoice
Fixes #6484.
2022-05-10 17:56:57 -07:00
Oliver Gugger
ddeccf8fcc
Merge pull request #6521 from guggero/p2tr-open-channel
chanfunding: properly support p2tr inputs in funding TX
2022-05-10 21:33:15 +02:00
Oliver Gugger
066fe07de5
docs: add release notes 2022-05-10 20:35:28 +02:00
Oliver Gugger
4fd43b4afe
itest: add new funding test with all input types 2022-05-10 20:35:28 +02:00
Oliver Gugger
fd7fe2ae5a
itest: use SendCoinsUnconfirmed in funding test 2022-05-10 18:39:45 +02:00
Oliver Gugger
e27a9fec66
lntest: rename sendCoins to SendCoinsOfType 2022-05-10 18:31:18 +02:00
Oliver Gugger
18cf06ddd1
chanfunding: fix sighash type for p2tr inputs
This commit fixes the default sighash type for p2tr channel funding
transaction inputs.
2022-05-10 18:13:00 +02:00
Oliver Gugger
631b2af818
btcwallet: support p2tr input info type detection 2022-05-10 18:03:29 +02:00
Oliver Gugger
8980471d57
chanfunding: support p2tr input fee calculation
With this commit we support fee calculation in coin selection for p2tr
inputs. We assume that coins in our UTXO selection are only BIP0086
coins. Any other input types with different spend paths won't be
selected by the wallet assembler.
2022-05-10 18:01:14 +02:00
Oliver Gugger
10f7213998
Merge pull request #6472 from tvolk131/document_confirmation_height
Document that `confirmation_height` is unset
2022-05-09 10:55:31 +02:00
Tommy Volk
a99da35fb1 gitrelease-notes: update release notes for 0.15.0 2022-05-06 17:28:51 +00:00
Tommy Volk
a2db074eec lnrpc: remove confirmation_height from PendingOpenChannel proto 2022-05-06 17:28:43 +00:00
Oliver Gugger
5d8fba6810
Merge pull request #6502 from bhandras/musig-fix
signer: fix crash in `MuSig2Combine` when the final signature isn't ready
2022-05-06 13:24:27 +02:00
Andras Banki-Horvath
bbe953d70d
docs: update release notes 0.15.0 2022-05-06 12:29:38 +02:00
Andras Banki-Horvath
c4c188f6d9
signer: fix crash when musig combine doesn't have final sig 2022-05-06 12:29:38 +02:00
Andras Banki-Horvath
ddf0571031
itest: cover musig2 combine without all signatures ready 2022-05-06 12:29:32 +02:00