Commit Graph
100 Commits
Author SHA1 Message Date
Olaoluwa Osuntokun 42ca9b171e Merge pull request #6342 from bhandras/leader_election_ttl
cluster: configurable session TTL for the leader elector
2022-03-22 18:47:17 -07:00
Olaoluwa Osuntokun 3a040174aa Merge pull request #6274 from Roasbeef/anchor-utxos-unconf
lnrpc+sweep: properly remove any unconfirmed descendant chains a to-be-swept input is spent
2022-03-17 16:47:55 -07:00
Olaoluwa Osuntokun d16430792e docs/release-notes: add entry for 3rd party anchor sweep fix 2022-03-17 16:36:54 -07:00
Olaoluwa Osuntokun e5625878e9 lntest/itest: add new itest for 3rd party anchor spends
In this commit, we add a new integration tests to exercise the fix
introduced in the prior commit. In this test, we reconstruct a scenario
for a 3rd party to sweep an anchor spend after force closing, causing a
prior spend we had to be invalidated. Without the prior commit, this test
fails as the original anchor sweep is still found in the wallet.
2022-03-17 16:36:49 -07:00
Olaoluwa Osuntokun e1e9de24df sweep: remove all unconfirmed descendant transactions when a sweep conflicts
Before this commit, we we were trying to sweep an anchor output, and
that output was spent by someone else (not the sweeper), then we would
report this back to the original resolver (allowing it to be cleaned
up), and also remove the set of inputs spent by that transaction from
the set we need to sweep.

However, it's possible that if a user is spending unconfirmed outputs,
then the wallet is holding onto an invalid transaction, as the outputs
that were used as inputs have been double spent elsewhere.

In this commit, we fix this issue by recursively removing all descendant
transactions of our past sweeps that have an intersecting input set as
the spending transaction. In cases where a user spent an unconfirmed
output to funding a channel, and that output was a descendant of the now
swept anchor output, the funds will now properly be marked as available.

Fixes #6241
2022-03-17 16:36:47 -07:00
Olaoluwa Osuntokun 4ecd153be2 lnrpc: add new locked balance field for WalletBalance
In this commit, we add a new field to the WalletBalance call that
permits users to account for the set of outputs that may be locked due
to a pending transaction. Without this field any time users locked
outputs for things like PSBT signing, then they disappear from the
WalletBalance call, which may cause a panic.
2022-03-17 16:36:44 -07:00
Olaoluwa Osuntokun f13399bc49 Merge pull request #6190 from ErikEk/listunspent-deafult-values
walletrpc: add default values to listunspent
2022-03-16 16:16:45 -07:00
Olaoluwa Osuntokun 1eefa2863c Merge pull request #6325 from thinkmassive/daily-build-tag
github: daily builds use a unique tag
2022-03-10 16:04:30 -08:00
Olaoluwa Osuntokun 791411cdb8 Merge pull request #6237 from sangaman/lncli-state-desc
lncli: update `lncli state` description
2022-03-02 17:08:22 -08:00
Olaoluwa Osuntokun 8b18c6c69d Merge pull request #6220 from Crypt-iQ/batch_ticker_clamp
config: clamp channel-commit-interval to reasonable time
2022-03-02 17:07:35 -08:00
Olaoluwa Osuntokun a47da0a990 Merge pull request #6246 from Crypt-iQ/settle_pipeline_check
htlcswitch: only pipeline settle if add is locked-in
2022-03-02 17:07:14 -08:00
Olaoluwa Osuntokun 28389fe38c Merge pull request #6295 from Roasbeef/strfmt-update
build: update go-pretty v6
2022-03-01 15:03:04 -08:00
Olaoluwa Osuntokun 4a15de05aa build: update go-pretty v6 [skip ci]
In this commit we update go-pretty to use the latest v6 version of the
library. The existing version we used had a reported vulnerability.
Updating to this newest version also helped to shrink our set of
indirect dependencies.

In the future we can use
https://github.com/lightningnetwork/lnd/pull/5870 to detect/flag these
issues automatically.

Fixes #6293
2022-03-01 15:02:23 -08:00
Olaoluwa Osuntokun 4d9a05c2f4 Merge pull request #6221 from Crypt-iQ/link_handoff
multi: reliable hand-off from htlcswitch to contractcourt
2022-02-24 17:01:36 -08:00
Olaoluwa Osuntokun 10fba3d859 Merge pull request #6214 from yyforyongyu/server-start-order
server: start htlcswitch early in the pipeline
2022-02-24 15:32:46 -08:00
Olaoluwa Osuntokun 9a50cc95b7 Merge pull request #6224 from Roasbeef/prometheus-latency-histograms
monitoring+cfg: add new option to export gRPC perf metrics
2022-02-16 16:38:51 -08:00
Olaoluwa Osuntokun 1fd8a78537 docs/release-notes: add entry for gRPC perf flag 2022-02-16 16:20:38 -08:00
Olaoluwa Osuntokun 5084d2a4e5 Merge pull request #6236 from carlaKC/6225-hophintlimit
invoicesrpc: limit first pass of hop hint selection
2022-02-07 10:46:45 -08:00
Olaoluwa Osuntokun f6ba5be351 Merge pull request #6234 from Roasbeef/increase-legacy-api-fee-limit
lnwallet: increase legacy fee limit threshold to 1k sats
2022-02-03 12:17:20 -08:00
Olaoluwa Osuntokun 80e304573c lnwallet: increase legacy fee limit threshold to 1k sats
In this commit, we increase the legacy fee limit threshold (the amount
below which we'll allow 100% of funds to go to fees for the non-v2 RPC
calls) from 50 sats to 1k sats.
2022-02-03 11:54:01 -08:00
Olaoluwa Osuntokun 5891643269 Merge pull request #6226 from guggero/fee-limit-fix
Fix default value for fee limit
2022-02-02 12:53:11 -08:00
Olaoluwa Osuntokun 5a827dd19b Merge pull request #6177 from bottlepay/interceptor-failures
htlcswitch: add htlc interceptor failure control
2022-02-01 17:00:07 -08:00
Olaoluwa Osuntokun 10c5d6c0bd monitoring+cfg: add new option to export gRPC perf metrics
In this commit, we expose a new monitoring option to allow users to
export gRPC performance metrics. These metrics can be used to see how
long certain calls are taking, the total amount of time spent handling
calls, broken down by service and also call.

This option consumes additional memory and disk space for the Prometheus
server, which is why we're opting to make it an optional flag.
2022-02-01 15:55:26 -08:00
Olaoluwa Osuntokun a05b85686f docs/release-notes: add roasbeef to 0.14.2 notes [skip-ci] 2022-01-26 14:18:29 -08:00
Olaoluwa Osuntokun 8c66e59eaa Merge pull request #6200 from Roasbeef/routing-fee-fix
lnrpc: fix the existing routing fee inaccuracy
2022-01-25 16:46:01 -08:00
Olaoluwa Osuntokun a57c650f96 Merge pull request #6158 from Crypt-iQ/breach_resolver_cancel
server+contractcourt: create breachResolver to ensure htlc's are failed back
2022-01-25 16:03:08 -08:00
Olaoluwa Osuntokun 40dd146358 docs/release-notes: add entry for fee rate bug fix and rpc change 2022-01-25 16:01:31 -08:00
Olaoluwa Osuntokun 234fdc6c9c Merge pull request #6185 from sangaman/rpc-middleware-custom-caveat
rpcperms: set CustomCaveatCondition on middleware req
2022-01-24 15:45:49 -08:00
Olaoluwa Osuntokun d67e6d5414 Merge pull request #6111 from bottlepay/cache-loading
kvdb+channeldb: speed up graph cache
2022-01-20 17:35:04 -08:00
Olaoluwa Osuntokun 408e40fd64 Merge pull request #6180 from bhandras/force-import-mc
routing: add option to force Mission Control pair history import
2022-01-20 17:04:00 -08:00
Olaoluwa Osuntokun 2e42476f29 Merge pull request #6151 from C-Otto/force-close-logging
contractcourt: use "info" log level for messages leading to force-clo…
2022-01-20 16:59:26 -08:00
Olaoluwa Osuntokun 3829385073 Merge pull request #6159 from Roasbeef/fix-historical-migration
contractcourt: catch error when no historical bucket exists
2022-01-18 15:52:23 -08:00
Olaoluwa Osuntokun 957a0a5138 docs/release-notes: add entry for historical chan bucket check 2022-01-18 09:11:21 -08:00
Olaoluwa Osuntokun 91f32ad270 contractcourt: catch error when no historical bucket exists
For older nodes, this bucket was never created, so we'll get an error if
we try and query it. In this commit, we catch this error like we do when
a given channel doesn't have the information (but the bucket actually
exists).

Fixes #6155
2022-01-18 09:11:13 -08:00
Olaoluwa Osuntokun 2682ca3e22 Merge pull request #6144 from Roasbeef/peer-block-epoch-defer
peer: always defer clean up of the block epoch client used for ping headers
2022-01-13 15:01:59 -08:00
Olaoluwa Osuntokun 135f8a1455 docs/release-notes: add entry for peer defer fix 2022-01-13 15:01:23 -08:00
Olaoluwa Osuntokun 3481286ea0 lnwire+peer: clamp pong bytes, make ping handler more effcieint
This was not properly enforced and would be a spec violation on the
peer's end. Also re-use a pong buffer to save on heap allocations if
there are a lot of peers. The pong buffer is only read from, so this
is concurrent safe.
2022-01-13 15:01:18 -08:00
Olaoluwa Osuntokun ae16f2b631 peer: always defer clean up of the block epoch client used for ping headers
In this commit, we fix an inadvertent memory leak by ensuring we always
use `defer` to clean up the allocated objects/memory we use to be
notified of new blocks to update what we send within the set of ping
headers.

A further optimization here would be using a single global block epoch
housed within the server, that all peer `pingHandler` goroutines use
directly.

Fixes #6143.
2022-01-13 15:01:13 -08:00
Olaoluwa Osuntokun fd63301dc5 Merge pull request #6006 from guggero/remote-signer-no-chain
Allow remote signer to run without chain backend
2022-01-07 17:37:16 -08:00
Olaoluwa Osuntokun 8b00e3c0ce Merge pull request #6139 from guggero/itest-refactor
itest: refactor for re-use in LiT
2022-01-07 17:16:59 -08:00
Olaoluwa Osuntokun ebc1547abc Merge pull request #6054 from yyforyongyu/itest-fix-gossiper
discovery: resend premature messages when block height reached
2022-01-04 17:52:18 -08:00
Olaoluwa Osuntokun d13246dbc2 Merge pull request #6075 from Roasbeef/chan-type-satisfice
funding: always send a channel type in explicit mode
2021-12-15 16:39:02 -08:00
Olaoluwa Osuntokun e78560c472 docs/release-notes: add entry for chan type fix 2021-12-15 16:38:34 -08:00
Olaoluwa Osuntokun 99f79ea507 funding: always send a channel type in explicit mode
In this commit, we switch to always sending a channel type when we're in
explicit mode. This is compatible with prior versions of lnd as they
won't send a channel type, and we'll just arrive at the same type via
the existing implicit funding.

Fixes https://github.com/lightningnetwork/lnd/issues/6067
2021-12-15 16:36:28 -08:00
Olaoluwa Osuntokun e58a9793b8 Merge pull request #6076 from ellemouton/alwaysClampFeeFloor
lnwallet+docs: minrelayfee always above fee floor
2021-12-15 16:33:28 -08:00
Olaoluwa Osuntokun f022e557bf Merge pull request #6068 from bhandras/mc_store_fix
routing: fix memory corruption in MC store
2021-12-09 15:20:07 -08:00
Olaoluwa Osuntokun 842fa15229 Merge pull request #6062 from yyforyongyu/6056-fix-webapi
chainfee: return floor fee rate when a given target is not found
2021-12-09 15:17:05 -08:00
Olaoluwa Osuntokun ad78ff114f Merge pull request #6049 from bhandras/etcd_msg_size
etcd: make max message size configurable
2021-12-02 15:19:37 -08:00
Olaoluwa Osuntokun 6c66338b14 Merge pull request #6027 from Roasbeef/funding-api-consistency
funding: ensure a local funding w/ explicit type can't be downgraded
2021-11-24 13:58:34 -08:00
Olaoluwa Osuntokun ed854cf492 docs/release-notes: add entry for funding API downgrade protection 2021-11-24 14:32:55 -06:00
Olaoluwa Osuntokun f630cfd4d7 funding: ensure a local funding w/ explicit type can't be downgraded
In this commit, we fix an API inconsistency introduced by a recent fix.
Without this commit, it would be possible for a local user to attempt an
explicit funding type, but then _fallback_ to implicit negotiation if
the remote party didn't have the bit set.

We resolve this by adding a new bit of information to ensure that if
we're the funder and want explicit chan negotiation, we don't settle
for anything less. A new test case has been added to exercise this
behavior.

To recap for posterity, the following issues were found and fixed in the
negotiation logic:

  1. If the remote party sent a channel type (in accept channel), but we
     didn't, then we would error out. We no longer error out and instead
     ensure the channel type they sent matches what we derived via
     implicit funding.

  2. If the remote party _did not_ have the bit set, but they sent a
     chan type (in open channel), we would error out. We no longer error
     out, but instead will fall back to implicit negotiation.

Ultimately we want to eventually flip the explicit funding bit to
_required_ to eliminate any other future ambiguities and also ensure
that it isn't possible to inadvertently fall back to implicit funding,
when the _user_ expects explicit funding.
2021-11-24 14:32:55 -06:00
Olaoluwa Osuntokun 32d0ecdca1 docs/release-notes: add entry for cnct bug fix 2021-11-24 14:40:27 +01:00
Olaoluwa Osuntokun 5a28582719 contractcourt: only supplement resolvers if channel has historical state
In this commit, we fix a bug that would cause newly updated nodes to be
unable to start up, if they have an older channel that was closed before
we started to store all the historical state for each channel.

The issue is that we started to write the complete state to disk, but
newer channels don't have it, so when we try to supplement the
resolvers, we run into this error.

Ultimately, we only need this new supplemented information for script
enforcement channels. Ideally we would instead check the channel type
there instead, but it doesn't appear to be available in this context as
is, without further changes.

Fixes https://github.com/lightningnetwork/lnd/issues/6001.
2021-11-24 14:38:56 +01:00
Olaoluwa Osuntokun 5a5d535dc5 docs/release-notes: add section about transitive feature dep fix 2021-11-24 14:36:52 +01:00
Olaoluwa Osuntokun 31ae48c59c feature: if a bit is unset, then all other features that dep it should be
This fixes an issue where if one tries to unset a feature like anchors,
and other feature depend on it, then `lnd` fails to start as it realizes
that its dependnacy set is inconsistent.

Fixes https://github.com/lightningnetwork/lnd/issues/6002
2021-11-24 14:35:34 +01:00
Olaoluwa Osuntokun df0b82f016 build: bump version to v0.14.0-beta 2021-11-17 12:02:49 -08:00
Olaoluwa Osuntokun 39b4b7158f docs/release-notes: update contributor set for 0.14.0 2021-11-17 12:01:16 -08:00
Olaoluwa Osuntokun 451280daa4 Merge pull request #5992 from bottlepay/pg-max-conn
postgres: add connection limit
2021-11-17 11:53:52 -08:00
Olaoluwa Osuntokun fb060f742c Merge pull request #5991 from Roasbeef/remove-amp-hold-over
cmd/lncli: remove --amp-reuse flag from lncli payinvoice
2021-11-17 11:21:08 -08:00
Olaoluwa Osuntokun 94eae34a3b docs/release-notes: mentionn removing amp-reuse CLI flag 2021-11-16 18:26:12 -08:00
Olaoluwa Osuntokun 7d46836e9a cmd/lncli: remove --amp-reuse flag from lncli payinvoice
In this commit, we remove the `--amp-reuse` flag as with the latest
version of lnd that implements properly re-useable AMP invoices, this
flag is no longer needed.
2021-11-16 18:19:03 -08:00
Olaoluwa Osuntokun b0fa19e8b0 Merge pull request #5990 from guggero/lncli-payments-nil-map
cmd/lncli: fix nil map in payment req [skip ci]
2021-11-16 12:00:36 -08:00
Olaoluwa Osuntokun d45675d469 Merge pull request #5985 from Roasbeef/0-14-rc4
multi: bump version to v0.14.0-beta.rc4, include postgres+etcd in release build
2021-11-15 19:58:25 -08:00
Olaoluwa Osuntokun e94ddf7b17 build: bump release+build version to Go 1.17.3 2021-11-15 17:29:02 -08:00
Olaoluwa Osuntokun 1bff146c43 build: add new WASM specific release/build tags
We need to drop things like postgres+etcd, as they don't understand the
WASM/JS build target.
2021-11-15 17:14:09 -08:00
Olaoluwa Osuntokun f7dd70b5cb docs/release-notes: add release notes for illumos drop 2021-11-15 16:04:16 -08:00
Olaoluwa Osuntokun 4c6bc80d83 build: remove illumos as a release build target 2021-11-15 16:01:15 -08:00
Olaoluwa Osuntokun 203bae9aff build: bump version to v0.14.0-beta.rc4 2021-11-15 13:59:22 -08:00
Olaoluwa Osuntokun 68309d30c2 make+build: build with postgres+etcd for the release build 2021-11-15 13:54:24 -08:00
Olaoluwa Osuntokun c4e55bbe6b Merge pull request #5970 from Roasbeef/pruned-block-fix-btcwallet
build: update to new btcwallet version w/ pruned node fix
2021-11-15 10:56:42 -08:00
Olaoluwa Osuntokun e351b879dc docs/release-notes: add release notes for pruned node fix 2021-11-12 18:27:57 -08:00
Olaoluwa Osuntokun d4ae92efb8 build: update to new btcwallet version w/ pruned node fix
See this PR for context: https://github.com/btcsuite/btcwallet/pull/778
2021-11-12 18:24:02 -08:00
Olaoluwa Osuntokun 1abe1da5b3 build: bump version to v0.14.0-beta.rc3 2021-11-08 18:28:22 -08:00
Olaoluwa Osuntokun c28b26935c Merge pull request #5950 from guggero/middleware-request-id
RPC middleware: turn request ID into end-to-end identifier
2021-11-08 18:26:20 -08:00
Olaoluwa Osuntokun c57b573f23 Merge branch 'master' into middleware-request-id 2021-11-08 18:25:35 -08:00
Olaoluwa Osuntokun 5166e19e9e Merge pull request #5948 from guggero/daemon-error-logging
Fix logging issues, cleanup config parsing
2021-11-08 18:05:12 -08:00
Olaoluwa Osuntokun e7e3adeb98 Merge pull request #5941 from bhandras/graph_cache_deadlock
channeldb: avoid locking the graph cache while iterating channels
2021-11-08 17:51:07 -08:00
Olaoluwa Osuntokun b7b3326433 build: bump version to v0.14.0-beta.rc2 2021-11-04 17:58:29 -07:00
Olaoluwa Osuntokun 55d983dee7 server: defer ticker stop to avoid goroutine leak 2021-11-04 17:53:36 -07:00
Olaoluwa Osuntokun 1ab5cc3ae8 Merge pull request #5925 from ellemouton/staggerConnToMultipleAddresses
server: stagger connReqs to multi-address peers
2021-11-04 17:48:49 -07:00
Olaoluwa Osuntokun 5404fe82c1 Merge pull request #5873 from Roasbeef/rpc-graph-cache
channeldb+rpc: optimize graph related RPC calls
2021-11-04 17:38:28 -07:00
Olaoluwa Osuntokun 7d6915d17c Merge pull request #5902 from Roasbeef/lru-chan-upd
discovery: revamp premature update map
2021-11-04 16:46:28 -07:00
Olaoluwa Osuntokun 090b917ee2 docs/release-notes: add entry for rpc graph cache 2021-11-04 15:30:36 -07:00
Olaoluwa Osuntokun 67e18e6089 rpc: optimize DescribeGraph by caching the response
Unfortunately, we can't use the graph cache directly here as it doesn't
include all the information we need, since it only includes the minimal
amount of information needed for path finding.

Instead, we use a simple mutex guarded cache that evicts itself after a
certain interval. The default is set small enough that most users
shouldn't really notice. We also provide a way to disable the cache, and
also disable the cache in the itests.

Fixes https://github.com/lightningnetwork/lnd/issues/1232
2021-11-04 15:30:31 -07:00
Olaoluwa Osuntokun 79406696ad rpc: optimize GetNetworkInfo by using the channel graph cache 2021-11-04 15:30:29 -07:00
Olaoluwa Osuntokun fae470293f channeldb: add new ForEachNode method using the channel graph cache
This commit, adds a new ForEachNode method to the channel graph cache
that assumes the contents won't be modified. This is generally useful,
and will be used in a later commit to optimize some heavy RPC calls.
2021-11-04 15:30:25 -07:00
Olaoluwa Osuntokun 75ae7e68b0 docs/release-notes: add new entry for gossip cache revamp 2021-11-04 15:21:25 -07:00
Olaoluwa Osuntokun 5a8255550b discovery: revamp recent rejects map
Similar to the prior commit, in this commit, we move to using a basic
LRU cache to store the set of prior rejected messages.
2021-11-04 15:21:20 -07:00
Olaoluwa Osuntokun 8627b5d128 discovery: revamp premature update map
Turns out we need it right now to handle some low latency race
conditions in our integration tests, so we'll opt to simply cap the size
of it to a low amount. We use a basic LRU caching mechainsm.

Fixes https://github.com/lightningnetwork/lnd/issues/5076
2021-11-04 15:21:18 -07:00
Olaoluwa Osuntokun fbbf10fecd Merge pull request #5933 from Roasbeef/neutrino-13
build: upgrade to neutrino v0.13.0
2021-11-04 15:18:13 -07:00
Olaoluwa Osuntokun 36acb107f7 docs/release-notes: add entry for neutrino version upgrade 2021-11-04 15:16:36 -07:00
Olaoluwa Osuntokun cc643fc0d8 build: upgrade to neutrino v0.13.0
Includes some bug fixes, and a measure to make some heretics more
taproot-proof.
2021-11-04 13:59:14 -07:00
Olaoluwa Osuntokun a6f22c6185 Merge pull request #5928 from Roasbeef/bitcoind-22
script: update CI to bitcoind 22
2021-11-03 18:10:40 -07:00
Olaoluwa Osuntokun 906120d80c docs/release-notes: add bitcoind 22 to release notes 2021-11-03 16:43:32 -07:00
Olaoluwa Osuntokun 56d00f40ef script: update CI to bitcoind 22 2021-11-03 16:43:27 -07:00
Olaoluwa Osuntokun 859c6d7ac5 Merge pull request #5922 from Roasbeef/graph-cache-panic-fix
channeldb: fix crash when inbound policy is unset
2021-11-03 10:30:35 -07:00
Olaoluwa Osuntokun fc2a29f717 channeldb: add failing test to demonstrate panic w/o graph cache
This test panics as is, since we assume the inbound edge is always
there.
2021-11-02 20:19:01 -07:00
Olaoluwa Osuntokun b99157efbe Merge pull request #5905 from guggero/itest-fixes
itest: fix two flakes
2021-11-02 14:59:37 -07:00
Olaoluwa Osuntokun 40ea494d2a Merge pull request #5913 from bhandras/invoices_5911
invoices: do not log when invoice is already deleted
2021-11-01 15:31:53 -07:00
Olaoluwa Osuntokun df6492d4d7 Merge pull request #5917 from bhandras/le_doc_update
docs: update leader election docs [skip ci]
2021-11-01 15:25:58 -07:00