Commit graph

15498 commits

Author SHA1 Message Date
Keagan McClelland
74b30a71cb lnd: start the BestBlockTracker during server startup 2023-10-19 09:22:07 -07:00
Keagan McClelland
7c403b439c chainreg: Add BestBlockTracker to ChainControl
This commit takes the best block tracker and adds it to the
ChainControl objects and appropriately initializes it on
ChainControl creation
2023-10-19 09:22:07 -07:00
Keagan McClelland
405d4e5f73 chainntnfs: introduce system for chain state tracking and querying
This change adds a new subsystem that is responsible for providing
an up to date view of some global chainstate parameters.
2023-10-19 09:22:07 -07:00
Oliver Gugger
e1fb1e484a
Merge pull request #7967 from morehouse/fuzz_onion
htlcswitch: fuzz onion encoding/decoding
2023-10-19 15:30:03 +00:00
Oliver Gugger
812f4d9242
Merge pull request #8081 from bhandras/invoicedb-refactor
invoices: refactor `InvoiceDB` to eliminate `ScanInvoices`
2023-10-19 09:27:54 +00:00
Olaoluwa Osuntokun
9bdbd79bd2
Merge pull request #8094 from yyforyongyu/fix-rescan-race
gomod: update btcwallet re rescan race fix
2023-10-18 12:25:41 -07:00
Andras Banki-Horvath
bedafca49d
docs: update release notes for 0.18.0 2023-10-18 16:15:59 +02:00
Andras Banki-Horvath
8bf7503aa4
invoices: remove the now unused ScanInvoices method 2023-10-18 16:15:58 +02:00
Andras Banki-Horvath
d7d385f78f
invoices: refactor initial invoice scan when the registry starts
In this commit we change how we select invoices to follow or delete when
starting the InvoiceRegistry to instead of using the deperecated scan
func from channeldb, use specific functions to gather pending and delete
canceled invoices.
2023-10-18 16:15:58 +02:00
Andras Banki-Horvath
8ab267ad90
channeldb: add k/v implementation for InvoiceDB.DeleteCanceledInvoices method 2023-10-18 16:15:58 +02:00
Andras Banki-Horvath
1f8065de35
channeldb: add k/v implementation for InvoiceDB.FetchPendingInvoices 2023-10-18 16:15:57 +02:00
Oliver Gugger
91d910872d
Merge pull request #7715 from bshramin/http-client-timeout
lntest: set ReadHeaderTimeout for http client
2023-10-17 19:33:39 +00:00
yyforyongyu
59a20fe1d1
gomod: update btcwallet re rescan race fix 2023-10-18 01:31:27 +08:00
Amin Bashiri
0c64a183cf
lntest: add http header timeout to config 2023-10-17 11:25:06 -06:00
Oliver Gugger
82838e4a62
Merge pull request #8090 from ziggie1984/add-additional-log-chan-closure
Add more information when a co-op close is failing.
2023-10-17 10:27:21 +00:00
Oliver Gugger
b0bb853f77
Merge pull request #8092 from yyforyongyu/fix-peer-unit-test
multi: fix peer unit test and disable `paralleltest`
2023-10-17 10:18:27 +00:00
Oliver Gugger
e8d865aba5
Merge pull request #7824 from yyforyongyu/sweeper-unit-test
input+sweep: make sure input with no fee rate is not added to cluster
2023-10-17 06:36:21 +00:00
Oliver Gugger
a6f044b748
Merge pull request #8057 from Chinwendu20/tlv-bool
tlv: Added bool to primitive
2023-10-16 15:23:48 +00:00
Ononiwu Maureen
844a792251 docs: Added release note
Signed-off-by: Ononiwu Maureen <amaka013@gmail.com>
2023-10-16 14:21:36 +01:00
Ononiwu Maureen
206f773a9b tlv: Added bool to primitive
Signed-off-by: Ononiwu Maureen <amaka013@gmail.com>
2023-10-16 14:21:25 +01:00
Oliver Gugger
d6c7200bb4
Merge pull request #8086 from lightningnetwork/dependabot/go_modules/tor/golang.org/x/net-0.17.0
build(deps): bump golang.org/x/net from 0.10.0 to 0.17.0 in /tor
2023-10-16 11:00:19 +00:00
Oliver Gugger
55c5a33f6f
Merge pull request #8087 from lightningnetwork/dependabot/go_modules/kvdb/golang.org/x/net-0.17.0
build(deps): bump golang.org/x/net from 0.10.0 to 0.17.0 in /kvdb
2023-10-16 10:59:59 +00:00
dependabot[bot]
be9fb28ac1
build(deps): bump golang.org/x/net from 0.10.0 to 0.17.0 in /kvdb
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.10.0 to 0.17.0.
- [Commits](https://github.com/golang/net/compare/v0.10.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-16 10:45:31 +00:00
dependabot[bot]
aa95469b1f
build(deps): bump golang.org/x/net from 0.10.0 to 0.17.0 in /tor
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.10.0 to 0.17.0.
- [Commits](https://github.com/golang/net/compare/v0.10.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-16 10:45:20 +00:00
dependabot[bot]
cbb6e681a5
build(deps): bump github.com/btcsuite/btcd in /healthcheck (#8051)
Bumps [github.com/btcsuite/btcd](https://github.com/btcsuite/btcd) from 0.22.0-beta.0.20220207191057-4dc4ff7963b4 to 0.23.2.
- [Release notes](https://github.com/btcsuite/btcd/releases)
- [Changelog](https://github.com/btcsuite/btcd/blob/master/CHANGES)
- [Commits](https://github.com/btcsuite/btcd/commits/v0.23.2)

---
updated-dependencies:
- dependency-name: github.com/btcsuite/btcd
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-16 12:44:27 +02:00
Yong
6a80530fff
gomod: update btcwallet version (#8019) 2023-10-16 09:14:56 +02:00
guangwu
fad7d3fe81
chore: pkg import only once (#8093)
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
2023-10-16 09:02:05 +02:00
ziggie
e4dd911778
multi: clarify co-op closure failures. 2023-10-13 20:35:08 +02:00
yyforyongyu
d0edb47166
docs: update release notes 2023-10-13 17:00:53 +08:00
yyforyongyu
551102a0f3
sweep: fix make lint 2023-10-13 17:00:53 +08:00
yyforyongyu
34e0c7b5e0
input+sweep: make sure input with no fee rate is not added to cluster
This commit makes sure an input is only added to the cluster when it has
successfully estimated its fee rate. Previously, when an error is
returned from `feeRateForPreference`, we'd still add this input to the
cluster, resulting a **lower** fee rates being used because when
averaging the fee rates, we'd think this input has zero fee rate
specified.

An unit test is patched to make the method `clusterByLockTime` more
robust.
2023-10-13 17:00:53 +08:00
yyforyongyu
0532b82dd5
multi: add new method FeePerVByte to avoid manual conversion 2023-10-13 17:00:53 +08:00
yyforyongyu
a46168e669
sweep: remove redundant map inputFeeRates when creating cluster
This commit removes the map `inputFeeRates` inside `clusterByLockTime`
as the fee rate can already be access via `input.lastFeeRate`.
2023-10-13 17:00:53 +08:00
yyforyongyu
497f421009
sweep: patch unit test for feeRateForPreference 2023-10-13 17:00:53 +08:00
yyforyongyu
82053970ef
lnd+sweep: move DetermineFeePerKw into config
This commit makes `DetermineFeePerKw` configurable on sweeper so it's
easier to write unit tests for it.
2023-10-13 14:44:20 +08:00
yyforyongyu
22600b47f1
multi: disable linter paralleltest 2023-10-13 13:50:09 +08:00
yyforyongyu
839b6271e5
peer: fix unit test flake 2023-10-13 13:50:07 +08:00
Yong
939375f1a5
sweeper: relax anchor sweeping when there's no deadline pressure (#7965)
* sweep: use longer variable name for clarity in `addToState`

* sweeper: add more docs and debug logs

* sweep: prioritize smaller inputs when adding wallet UTXOs

This commit sorts wallet UTXOs by their values when using them for
sweeping inputs. This way we'd avoid locking large UTXOs when sweeping
inputs and also provide an opportunity to aggregate wallet UTXOs.

* contractcourt+itest: relax anchor sweeping for CPFP purpose

This commit changes from always sweeping anchor for a local force close
to only do so when there is an actual time pressure. After this change,
a forced anchor sweeping will only be attempted when the deadline is
less than 144 blocks.

* docs: update release notes

* itest: update test `testMultiHopHtlcLocalChainClaim` to skip CPFP

Since we now only perform CPFP when both the fee rate is higher and the
deadline is less than 144, we need to update the test to reflect that
Bob will not CPFP the force close tx for the channle Alice->Bob.

* itest: fix `testMultiHopRemoteForceCloseOnChainHtlcTimeout`

* itest: update related tests to reflect anchor sweeping

This commit updates all related tests to reflect the latest anchor
sweeping behavior. Previously, anchor sweeping is always attempted as
CPFP when a force close is broadcast, while now it only happens when the
deadline is less than 144. For non-CPFP purpose sweeping, it will happen
after one block is mined after the force close transaction is confirmed
as the anchor will be resent to the sweeper with a floor fee rate, hence
making it economical to sweep.
2023-10-12 17:18:59 +02:00
Yong
ca9cdacd5f
github: print debug logs for failed unit tests (#8083) 2023-10-12 12:50:11 +02:00
dependabot[bot]
3b933d5c5e
build(deps): bump golang.org/x/net from 0.10.0 to 0.17.0 in /healthcheck (#8085)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.10.0 to 0.17.0.
- [Commits](https://github.com/golang/net/compare/v0.10.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-12 10:46:07 +02:00
dependabot[bot]
3f67420722
build(deps): bump golang.org/x/net from 0.10.0 to 0.17.0 (#8084)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.10.0 to 0.17.0.
- [Commits](https://github.com/golang/net/compare/v0.10.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-12 10:45:45 +02:00
Amin Bashiri
039e9effe7
lnd: add http header timeout to config 2023-10-11 22:05:50 -06:00
András Bánki-Horváth
ad5cd9c8bb
multi: extend InvoiceDB methods with a context argument (#8066)
* multi: extend InvoiceDB methods with a context argument

This commit adds a context to InvoiceDB's methods. Along this refactor
we also extend InvoiceRegistry methods with contexts where it makes
sense. This change is essential to be able to provide kvdb and sqldb
implementations for InvoiceDB.

* channeldb: restrict invoice tests to only use an InvoiceDB instance

* docs: update release notes for 0.18.0
2023-10-11 13:42:59 +02:00
Eugene
9478b85e59
htlcswitch/hop: use InvalidOnionVersion for replayed packets (#7937)
* htlcswitch/hop: use InvalidOnionVersion for replayed packets

The link will send an update_fail_malformed_htlc, so we need to set
the BADONION bit. Since there isn't a replay-specific error, we
set the failure code to InvalidOnionVersion which has the BADONION bit.

* release-notes: update for 0.17.1
2023-10-11 10:08:43 +02:00
Oliver Gugger
abb1e3463f
scripts: kill lnd on windows to access log files (#8076)
For some reason lnd doesn't properly shut down on some windows itests,
and the process still running makes it impossible to access its log
files.
So for the Windows integration test, we attempt to kill the whole
process tree once the process indicates it is done.
2023-10-10 16:15:41 +02:00
Matt Morehouse
2d98dcf520
tlv: fuzz test encoding/decoding (#7889)
* tlv: fuzz tests for primitives

* tlv: fuzz tests for BigSize

We use a new harness to compare decoded values instead of encoded
values, since there may be some unparsed bytes in the original data.

* tlv: fuzz tests for truncated integers

These fuzz tests are identical to non-truncated integers, except that we
allow the fuzzer to choose decode lengths shorter than the length of
normal integers.

* tlv: fuzz tests for streams

* fixup! tlv: fuzz tests for truncated integers

loop over decode length

* fixup! tlv: fuzz tests for streams

better documentation
2023-10-10 14:01:41 +02:00
Olaoluwa Osuntokun
4f346060df
Merge pull request #8067 from lightningnetwork/0-18-staging-rebased
branch: merge 0.18 staging branch into master
2023-10-09 11:20:11 -07:00
Yong
ec2377db79
funding: remove dead code and sanity check pending chan ID (#7887)
* funding: remove unused field `newChanBarriers`

This commit removes the occurance of `newChanBarriers` as it's not used
anywhere.

* funding: rename method names to clear the funding flow

Slightly refactored the names so it's easier to see which side is
processing what messages.

* lnwallet: sanity check empty pending channel ID

This commit adds a sanity check to make sure an empty pending channel ID
will not be accepted.
2023-10-09 10:58:18 +02:00
Carla Kirk-Cohen
b994b6f9e0 docs: add release notes 2023-10-06 16:38:33 -07:00
Carla Kirk-Cohen
32ea77b96b lncli: add blinded route cli flags to query routes
Note: This commit can be dropped before merge, it's mostly added
to make the PR easier to manually test against other
implementations that have bolt 12 invoices implemented already!
2023-10-06 16:38:33 -07:00