Commit Graph
100 Commits
Author SHA1 Message Date
Olaoluwa Osuntokun c65abf8b05 Merge pull request #6759 from yyforyongyu/1-new-itest
itest: start a scaffolding testing framework
2022-10-17 20:06:48 -07:00
Olaoluwa Osuntokun 609cc8b883 lnd: add SECURITY.MD to bolster security entry in README 2022-10-17 12:05:15 -07:00
Olaoluwa Osuntokun 2ac0fcb769 Merge pull request #6957 from Roasbeef/co-op-close-fee-estimation
lnwallet/chancloser: properly compute initial fee of cop close txn
2022-10-10 15:39:24 -07:00
Olaoluwa Osuntokun 30eb6770e5 lnwallet/chancloser: fix loop variable shadowing in TestMaxFeeBailOut 2022-10-10 14:50:51 -07:00
Olaoluwa Osuntokun 2482de9cab lnwallet/chancloser: properly compute initial fee of cop close txn
In this commit, we modify the way we compute the starting ideal fee for
the co-op close transaction. Before thsi commit, channel.CalcFee was
used, which'll compute the fee based on the commitment transaction
itself, rathern than the co-op close transaction. As the co-op close
transaction is potentailly bigger (two P2TR outputs) than the commitment
transaction, this can cause us to under estimate the fee, which can
result in the fee rate being too low to propagate.

To remedy this, we now compute a fee estimate from scratch, based on the
delivery fees of the two parties.

We also add a bug fix in the chancloser unit tests that wasn't caught
due to loop variable shadowing.

The wallet import itest has been updated as well, since we'll now pay
600 extra saothis to close the channel, since we're accounting for the
added weight of the P2TR outputs.

Fixes #6953
2022-10-10 14:50:45 -07:00
Olaoluwa Osuntokun 406fc86f38 Merge pull request #7004 from Roasbeef/witness-limit-hot-fix
build: update to version of btcd with wire parsing bug fix
2022-10-09 19:34:03 -07:00
Olaoluwa Osuntokun 1c884846e7 docs/release-notes: shift prior 0.15.2 release to 0.15.3
We also add an entry for the _new_ 0.15.2 hot fix release.
2022-10-09 18:39:40 -07:00
Olaoluwa Osuntokun b3dc56fd9e build: update to version of btcd with wire parsing bug fix
Fixes https://github.com/lightningnetwork/lnd/issues/7002
2022-10-09 18:39:34 -07:00
Olaoluwa Osuntokun ffa8ba8dfc Merge pull request #6998 from Crypt-iQ/6990_zeroconftimeout_noitest
funding: ignore maxWaitNumBlocksFundingConf for zero conf channels
2022-10-06 17:51:25 -07:00
Olaoluwa Osuntokun b2c78d9488 Merge pull request #6993 from lightningnetwork/pr-stats-please-work
build: add PR stats to github workflow
2022-10-06 17:44:09 -07:00
Olaoluwa Osuntokun 2f16997a98 build: add PR stats to github workflow
In this PR, we introduce a new Github work flow tool that should help us
keep better track fo reviewer load across the proejct. Ideally this can
also be used as a tool to help new PRs find a reviewer, and also for us
to better balance out review load, and keep track of how long it takes
to do PR turnaround.
2022-10-05 13:18:02 -07:00
Olaoluwa Osuntokun bc5638428e Merge pull request #6789 from Crypt-iQ/waitingclose
server+htlcswitch: check waiting-close fwdpkgs in reforwardResponses
2022-09-30 16:39:49 -07:00
Olaoluwa Osuntokun 94ab72363a Merge pull request #6914 from positiveblue/fix-6898
addinvoice: refactor hint hop selection algorithm
2022-09-30 11:57:54 -07:00
Olaoluwa Osuntokun d062a5263e build: update to latest version of btcwallet w/ taproot estimation fix
Fixes https://github.com/lightningnetwork/lnd/issues/6873
2022-09-27 11:24:39 -07:00
Olaoluwa Osuntokun 89ebd03ff8 Merge pull request #6899 from kaloudis/protos-remove-js-build-tag
lnrpc/gen_protos.sh: remove js build tag
2022-09-13 17:36:14 -07:00
Olaoluwa Osuntokun 2ad6b57f5e Merge pull request #6795 from Roasbeef/go1-19
build: make Go 1.18 the min version, update to Go 1.19
2022-08-24 15:33:37 -05:00
Olaoluwa Osuntokun b3998ddb5c lnrpc: re-compile protos w/ Go 1.19 2022-08-24 11:43:00 -05:00
Olaoluwa Osuntokun 65a5eeb24e build: make Go 1.18 the min version, update to Go 1.19
As usual, we keep with the last two Go versions, which means the last
year of Go release (they release every 6 months or so).

This change means we can now use the type params (generics) in the
project!
2022-08-23 10:54:13 -05:00
Olaoluwa Osuntokun f8615f9910 Merge pull request #6853 from yyforyongyu/fix-make-fmt
github: fix `make fmt` and add `make fmt-check`
2022-08-23 10:48:58 -05:00
Olaoluwa Osuntokun d0d4782c3e Merge pull request #6826 from Roasbeef/bitcoind-taproot-after-19
chainreg: update tapoort node awareness to account for bitcoind 19+
2022-08-12 16:22:04 -07:00
Olaoluwa Osuntokun 6d0b354a8f Merge pull request #6664 from Crypt-iQ/fl_chanupdate_order
funding: defer sending channel_update until received funding_locked
2022-08-12 16:01:23 -07:00
Olaoluwa Osuntokun 6b7abc3dbc chainreg: update tapoort node awareness to account for bitcoind 19+
Bitcoind 23 will use the new `getdeploymentinfo` while versions after 19
(but below 23) will use the `UnifiedSoftForks` field instead of the
`SoftForks UnifiedSoftForks` field.

With this PR the taproot gating logic has been tested on bitcoind
versions: 21, 22, and 23. 21 is when the taproot logic was first added.
2022-08-12 15:35:32 -07:00
Olaoluwa Osuntokun dc453f2c39 Merge pull request #6820 from Roasbeef/btcsuite-updates
build: update to latest versions of btec, btcutil, and btcutil/psbt
2022-08-12 14:40:20 -07:00
Olaoluwa Osuntokun 822822bb75 build: update to latest versions of btec, btcutil, and btcutil/psbt
Fixes #6668
2022-08-12 14:40:00 -07:00
Olaoluwa Osuntokun be5bc79444 Merge pull request #6716 from Crypt-iQ/zeroconfacceptor
multi: add zeroconfacceptor to default reject incoming channels
2022-08-12 14:20:11 -07:00
Olaoluwa Osuntokun d0996a9df8 Merge pull request #6810 from Roasbeef/taproot-errwhere
multi: use taproot errwhere applicable for change/delivery/tower addresses
2022-08-12 14:18:35 -07:00
Olaoluwa Osuntokun 67a6bb5ecf build: bump version to v0.15.99
We forgot to do this after 0.15 was tagged, but usually we use a x.99
version to indicate that the commits in master are between releases.
This might also make it easier to help identify exactly which version a
user is running in issue reports.

[skip-ci]
2022-08-11 17:36:43 -07:00
Olaoluwa Osuntokun 91bc4b540c docs/release-notes: add release notes entry 2022-08-11 17:26:28 -07:00
Olaoluwa Osuntokun 42549519ca lnwallet/chanfunding: assumes all change outputs are P2TR 2022-08-11 17:26:23 -07:00
Olaoluwa Osuntokun 322937a67e lnwallet: use P2TR addresses for change outputs for funding coin select 2022-08-11 17:26:21 -07:00
Olaoluwa Osuntokun bcff2f07de rpc: use P2TR addresses when sending funds back to wallet (anchor reserve) 2022-08-11 17:26:18 -07:00
Olaoluwa Osuntokun b711120dca sweep: change outputs are now P2TR 2022-08-11 17:26:16 -07:00
Olaoluwa Osuntokun dc16f5df53 watchtower: uses P2TR for sweep, delivery, and reward addresses
In this commit, we modify the watch tower to use P2TR addrs for just
about anything sweep related.

One eye sore in this diff are the changes to
`backup_task_internal_test.go`. All the values are hard coded, and now
either differ by a value of 48, or needed to be modified to account for
the new assumptions propagated to rewards values and fees.
2022-08-11 17:26:13 -07:00
Olaoluwa Osuntokun cd313eba24 contractcourt: the breach arb now uses P2TR outputs for sweep addrs 2022-08-11 17:26:10 -07:00
Olaoluwa Osuntokun 2cc75db6f8 server: default sweep addrs to P2TR
This change covers sweep addresses for: the breach arbitrator, and watch
tower clients.
2022-08-11 17:26:07 -07:00
Olaoluwa Osuntokun a1cd7734d8 Merge pull request #6633 from Roasbeef/segwit-any-shutdown
multi: send P2TR addrs by default for co-op close, add new `option_any_segwit` feature bit
2022-08-11 17:05:31 -07:00
Olaoluwa Osuntokun cd7c705db2 docs/release-notes: add release notes entry 2022-08-10 18:44:43 -07:00
Olaoluwa Osuntokun 3bf2790e21 lntest/itest: add new itest to cover taproot co-op close 2022-08-10 18:44:39 -07:00
Olaoluwa Osuntokun 89529fbb4f feature+lncfg: add config option to turn of anysegwit 2022-08-10 18:44:37 -07:00
Olaoluwa Osuntokun fffad49ad1 peer: send taproot addrs during co-op close based on new feature bit
If the ShutdownAnySegwitOptional option is active, then we can safely
send these newer addresses.
2022-08-10 18:44:35 -07:00
Olaoluwa Osuntokun 99d37f254e funding: send taproot addrs as upfront shutdown if ShutdownAnySegwitOptional is active 2022-08-10 18:44:33 -07:00
Olaoluwa Osuntokun a61b6c25b3 lnwallet/chanclose: update ProcessCloseMsg to check co-op close addrs
We only want to allow p2wkh, p2tr, and p2wsh addresses, so we'll utilize
the newly public wallet function to restrict this.
2022-08-10 18:44:31 -07:00
Olaoluwa Osuntokun c79ffc07ce lnwallet: export ValidateUpfrontShutdown and restrict allowed addrs
In this commit, we catch up our logic with the latest version of the
spec that removed support for normal p2kh and p2sh addresses for co-op
closes, in order to make dust calculations more uniform.
2022-08-10 18:44:29 -07:00
Olaoluwa Osuntokun 5f9c1b902f lnwire+feature: add awareness of option_shutdown_anysegwit
In this commit, we add awareness of the option_shutdown_anysegwit that
permits both sides to send newer segwit based addresses. This'll
eventually enable us to send taproot addresses for co-op close.
2022-08-10 18:44:26 -07:00
Olaoluwa Osuntokun 559160e95c Merge pull request #6734 from Crypt-iQ/alias_listchannels
rpc: add alias info to some rpcs
2022-08-10 18:38:18 -07:00
Olaoluwa Osuntokun 3263dbf96a Merge pull request #6816 from Crypt-iQ/zero-conf-doc
docs: add zero-conf channels doc
2022-08-10 18:37:51 -07:00
Olaoluwa Osuntokun 012c0d96f5 Merge pull request #6740 from Crypt-iQ/walletsweep
sweep: account for all script types in craftSweepTx
2022-08-08 18:15:15 -07:00
Olaoluwa Osuntokun e4b5aa94a3 Merge pull request #6770 from Roasbeef/co-op-close-with-more-spec-innit
lnwallet/chancloser: remove the commit fee clamp, introduce max fee
2022-08-08 18:14:22 -07:00
Olaoluwa Osuntokun ec7be963f9 Merge pull request #6798 from Roasbeef/backend-must-taproot
chainreg: shutdown if backend node doesn't support taproot
2022-08-08 15:27:43 -07:00
Olaoluwa Osuntokun b270bde935 Merge pull request #6809 from positiveblue/remove-feature-dependency
Remove `ScidAliasOptional` feature dependency on `ExplicitChannelTypeOptional`
2022-08-08 15:27:12 -07:00
Olaoluwa Osuntokun 492f8b6999 chainreg: shutdown if backend node doesn't support taproot
In this commit, we add a check during normal node construction to see if
the backend node supports Taproot. If it doesn't, then we want to
shutdown and force the user to take note.

To check if the node supports Taproot, we'll first try the normal
getblockchaininfo call. If this works, cool, then we can rely on the
value. If it doesn't, then we'll fall back to the getdeploymentinfo call
which was added in a recent version of bitcoind [1]. Newer versions of
bitcoind might also have this call, and the getblockchaininfo call, but
not actually populate the softforks field [2]. In this case, we'll fall
back, and we also account for the case when the getblockchaininfo RPC is
removed all together.

[1]: https://github.com/bitcoin/bitcoin/pull/23508
[2]: https://github.com/bitcoin/bitcoin/pull/25114

Fixes #6773
2022-08-05 17:23:31 -07:00
Olaoluwa Osuntokun 115b041874 Merge pull request #6469 from yyforyongyu/5388-migration
channeldb: add optional migration to prune revocation logs
2022-08-04 17:15:08 -07:00
Olaoluwa Osuntokun 4df0a22409 docs/release-notes: add release notes for 0.16 2022-08-02 17:02:59 -07:00
Olaoluwa Osuntokun 89dc75cd90 lntest/itest: add test case for conf ntfn w/ block
In this commit, we add a test case to exercise the fact that if we
request a confirmation notification with the raw block, then it includes
one. We add this to the existing test that uses the conf ntfn rpc call
for simplicity.
2022-08-01 19:59:33 -07:00
Olaoluwa Osuntokun cdb15e77d5 lnrpc/chainrpc: include the block in the conf ntfn if specified 2022-08-01 19:59:28 -07:00
Olaoluwa Osuntokun 08f1c2e93a chainntfns: add new option for conf notifications to send block
In this commit, we add a new option for the existing confirmation
notification system that optionally allows the caller to specify that a
block should be included as well.

The only quirk w/ the implementation here is the neutrino backend:
usually we get filtered blocks, we so need to first fetch the block
again so we can deliver the full block to the notifier. On the notifier
end, it'll only be checking for the transactions we care about, to
sending a full block doesn't affect the correctness.

We also extend the `testBatchConfirmationNotification` test to assert
that a block is only included if the caller specifies it.
2022-08-01 19:59:21 -07:00
Olaoluwa Osuntokun 046aa7fe4a docs/release-notes: add entry for 0.15.1 2022-07-26 17:23:21 -07:00
Olaoluwa Osuntokun 1e556aa189 multi: thread through the new max fee field for co-op close
In this commit, we parse the new max fee field, and pass it through the
switch, all the way to the peer where it's ultimately passed into the
chan closer state machine.
2022-07-26 17:23:16 -07:00
Olaoluwa Osuntokun c791b18cc0 lnrpc: add a new max_fee field to the CloseChannel RPC call
In this commit, we add a new max_fee field that we'll use to decide when
to bail out of a co-op close dance as the initiator.
2022-07-26 17:23:13 -07:00
Olaoluwa Osuntokun 9eb1e8721a lnwallet/chancloser: add tests for the new max fee behavior 2022-07-26 17:23:11 -07:00
Olaoluwa Osuntokun 106912b015 lnwallet/chancloser: remove raw state machine pointer, add channel interface
In this commit, we remove the raw channel state machine pointer from the
chan closer and instead replace that with an interface that captures
*just* the methods we need in order to do the co-op close dance.

This is a preparatory refactoring for some upcoming unit tests.
2022-07-26 17:23:08 -07:00
Olaoluwa Osuntokun 4a997bfdd2 lnwallet: add new AbsoluteThawHeight method
This lets callers get the thaw height without needing to first obtain a
snapshot of the channel state.
2022-07-26 17:23:05 -07:00
Olaoluwa Osuntokun c140da8f49 lnwallet/chancloser: remove the commit fee clamp, introduce max fee
In this commit, we stop clamping the ideal fee rate to the commitment
fee of the channel. This catches us up to this PR of the spec:
https://github.com/lightning/bolts/pull/847.

We also do away with the old 3x ideal fee "max fee", and replace that
with an explicit max fee. This new max fee will either be the default
multiplier of the ideal fee, or a new user specified max fee value.
2022-07-26 17:20:23 -07:00
Olaoluwa Osuntokun fec8fd9c63 Merge pull request #6754 from ellemouton/ensureRpcRegistrationOrder
multi: synchronous rpc middleware registration
2022-07-26 19:05:30 -05:00
Olaoluwa Osuntokun d9f4b36cb9 Merge pull request #6742 from Symphonic3/master
Fix typo in lncli abandonchannel description
2022-07-19 09:45:11 -07:00
Olaoluwa Osuntokun af47943f52 Merge pull request #6714 from guggero/remote-signer-fix
lnwallet: don't create BIP044 key scope by default
2022-07-13 17:17:56 -07:00
Olaoluwa Osuntokun 2a18263336 lntest: keep all failed payments by default for HarnessNode
In this commit, we fix a detected flake: we go to make a payment, and
then want to assert that 2 attempts we required. The existing logic
assumes that the success and the payment will still be on disk. With a
recent PR, we now delete failed payments by default, but after the fact,
in a non-atomic fashion.

We fix this issue simply by having all the nodes keep around failed
payments for the sake of all the old itests that assumed this
information would always be on disk.

Introduced in: https://github.com/lightningnetwork/lnd/pull/6438.

Fixes https://github.com/lightningnetwork/lnd/issues/6711.
2022-07-07 19:28:30 -07:00
Olaoluwa Osuntokun d9c79d874e Merge pull request #5955 from Crypt-iQ/zero-conf-alias-patch
multi: implement option_scid_alias, zero-conf w/ channel_type
2022-07-07 17:02:56 -07:00
Olaoluwa Osuntokun dc35f78ebc Merge pull request #6509 from Roasbeef/macaroons-rks
macaroons: futher abstract NewService from root key store impl
2022-07-06 19:00:49 -07:00
Olaoluwa Osuntokun e073b1d343 macaroons: futher abstract NewService from root key store impl
In this commit, we modify the `macaroons.NewService` consturctor to
accept the main interface rather than the raw DB. This allows us to use
other backends other than bolt or the kvdb interface to store the
macaroon root keys.

We also create a new ExtendedRootKeyStore interface that implements some
of the more advanced features we use such as macaroon encryption and
password rotation.
2022-07-06 18:59:50 -07:00
Olaoluwa Osuntokun 98ab9e3057 Merge pull request #6642 from Crypt-iQ/linkstopidx
htlcswitch: add linkStopIndex to cleanly shutdown ChannelLink
2022-06-30 17:01:07 -07:00
Olaoluwa Osuntokun 7b56b67f34 Merge pull request #6546 from carlaKC/bolts-950-warningmessage
lnwire/peer: add ability to read + log peer warning messages
2022-06-30 16:56:20 -07:00
Olaoluwa Osuntokun b96203a0eb Merge pull request #6655 from Crypt-iQ/disconnectpeerfix
server.go: replace call to removePeer with Disconnect in DisconnectPeer
2022-06-29 18:40:45 -07:00
Olaoluwa Osuntokun 3759b0f1ee Merge pull request #6577 from ziggie1984/hop-hints-opt-in-addholdinvoice
Hop hints opt in addholdinvoice
2022-06-28 15:38:48 -07:00
Olaoluwa Osuntokun f1717ea421 Merge pull request #6676 from guggero/fix-release-reproducibility
Fix release reproducibility
2022-06-28 15:08:01 -07:00
Olaoluwa Osuntokun 9988d392eb docs/release-notes: create release notes for 0.15.1
This commit also fixes the release notes of a recent PR that didn't
quite make it into 0.15: the entry should  now be in the 0.15.1 release
notes.
2022-06-24 15:47:35 -07:00
Olaoluwa Osuntokun a121f305b6 Merge pull request #6576 from ellemouton/paymentAddrBuildRouteFlag
lncli: add payment-addr flag to buildroute
2022-06-24 15:44:35 -07:00
Olaoluwa Osuntokun 5c36d96c9c build: bump version to v0.15.0-beta 2022-06-23 10:37:58 -07:00
Olaoluwa Osuntokun 39b522b878 build: bump version to v0.15.0-beta.rc6 2022-06-10 16:11:19 -05:00
Olaoluwa Osuntokun eb69f038f2 Merge pull request #6631 from Roasbeef/docker-container-update
build: update all Dockerfiles to build w/ Go 1.18.2
2022-06-10 14:02:17 -07:00
Olaoluwa Osuntokun 4d7ff6a73c Merge pull request #6632 from lightningnetwork/addr-type-taproot
walletkit+sweeper: add forgotten P2TR address type
2022-06-10 14:02:06 -07:00
Olaoluwa Osuntokun c0672b80c2 build: update all Dockerfiles to build w/ Go 1.18.2 2022-06-10 11:32:39 -07:00
Olaoluwa Osuntokun f66463bb05 build: bump version to v0.15.0-beta.rc5 2022-06-08 12:59:03 -07:00
Olaoluwa Osuntokun 69a2b32b1f Merge pull request #6627 from Roasbeef/btcwallet-btcd-neutrino-bump
build: bump btcd, btcwallet and neutrino to latest versions
2022-06-08 12:24:44 -07:00
Olaoluwa Osuntokun c69138e00d build: bump btcd, btcwallet and neutrino to latest versions 2022-06-08 11:40:50 -07:00
Olaoluwa Osuntokun 12eddae47a build: bump version to v0.15.0-beta.rc4 2022-06-02 14:47:18 -07:00
Olaoluwa Osuntokun 622c8402a0 Merge pull request #6611 from Roasbeef/psbt-validation-fix
lnrpc/walletrpc: reject PSBT packets w/o any UTXO input info
2022-06-02 14:44:59 -07:00
Olaoluwa Osuntokun a46ffe4299 Merge pull request #6612 from Roasbeef/tor-bump
build: bump tor version to v1.0.1
2022-06-02 14:44:38 -07:00
Olaoluwa Osuntokun 2298ef81ab lnrpc/walletrpc: reject PSBT packets w/o any UTXO input info
Fixes https://github.com/lightningnetwork/lnd/issues/6567
2022-06-02 13:05:58 -07:00
Olaoluwa Osuntokun 1017efe18b Merge pull request #6605 from Roasbeef/proper-sweep-lease-second-level-success
contractcourt: unify the lease specific HTLC sweeping logic
2022-06-02 13:03:10 -07:00
Olaoluwa Osuntokun 9b0718ae35 contractcourt: unify the lease specific HTLC sweeping logic
In this commit, we consolidate the _lease specific_ logic for the
success and timeout HTLC resolvers. We do this with the addition of a
new struct which is then composed via struct embedding with the two
existing structs. This fixes a flake in the integration tests by
ensuring the height is set up front, rather than eventually once the
height matches the lock time.
2022-06-01 16:42:33 -07:00
Olaoluwa Osuntokun 199f9d1139 Merge pull request #6600 from bhandras/invoiceregistry-deadlock
invoices: fix deadlock in the invoice registry
2022-06-01 14:59:55 -07:00
Olaoluwa Osuntokun fb119446c1 build: bump tor version to v1.0.1 2022-06-01 13:54:56 -07:00
Olaoluwa Osuntokun addbbc0e1a Merge pull request #6608 from Roasbeef/btcwallet-psbt-bip32-taproot-fix
build: upgrade to latest version of btcwallet
2022-06-01 13:49:50 -07:00
Olaoluwa Osuntokun 5d98635ab5 build: upgrade to latest version of btcwallet
This commit upgrades to the latest version of btcwallet that fixes an
issue that would cause us to not properly sign a validate populated PSBT
in certain scenarios.

Fixes https://github.com/lightningnetwork/lnd/issues/6579
2022-06-01 10:24:31 -07:00
Olaoluwa Osuntokun 5ba033bed8 Merge pull request #6594 from yyforyongyu/fix-data-race
channeldb: fix data race in TestSerializeRevocationLog
2022-05-31 16:07:51 -07:00
Olaoluwa Osuntokun 1e0d6ec0ad Merge pull request #6586 from Crypt-iQ/nil_htlcset
contractcourt: make empty htlcSets for closed channels
2022-05-28 19:59:25 -07:00
Olaoluwa Osuntokun 08e4e66574 build: bump version to v0.15.0-beta.rc3 2022-05-23 18:42:48 -07:00
Olaoluwa Osuntokun e98a739130 Merge pull request #6518 from Crypt-iQ/dupestone
htlcswitch: remove synchronous link handoff, special-case keystone err
2022-05-23 16:51:19 -07:00
Olaoluwa Osuntokun ab91f85d05 Merge pull request #6563 from yyforyongyu/export-chanstatus
multi: export channel status field in migration25
2022-05-23 11:26:53 -07:00