Commit Graph
100 Commits
Author SHA1 Message Date
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
Olaoluwa Osuntokun 217019aa8a build: bump version to 0.14.0-beta.rc1 2021-10-28 17:47:35 -07:00
Olaoluwa Osuntokun 66ca2a994b Merge pull request #5901 from Roasbeef/dedup-interceptor
Dedup interceptor
2021-10-28 17:44:49 -07:00
Olaoluwa Osuntokun 7b45a47ce3 docs/release-notes: add entry for HTLC interceptor bug fix 2021-10-28 16:53:44 -07:00
Olaoluwa Osuntokun 52146e0970 Merge pull request #5803 from Roasbeef/amp-set-id-index
channeldb+invoices: enable repeated payments to AMP invoices via new HTLC key prefix storage
2021-10-28 16:49:43 -07:00
Olaoluwa Osuntokun a6e9a17659 docs/release-notes: add note for new AMP invoice features 2021-10-28 15:50:40 -07:00
Olaoluwa Osuntokun a5ae7fbf9c lntest: add new itest for repeated payments to the same AMP invoice 2021-10-28 15:50:35 -07:00
Olaoluwa Osuntokun 31336f91b0 invoices: update testSpontaneousAmpPayment for new AMP logic
Rather than checking the AMP invoice state itself, we'll instead check
the HTLC state.
2021-10-28 15:50:32 -07:00
Olaoluwa Osuntokun 3935725329 invoices: update cancel logic for AMP invoices to be more efficient
By passing in the set ID here, we ensure that we don't need to read ALL
the invoices to update the state of a set of them.
2021-10-28 15:50:30 -07:00
Olaoluwa Osuntokun 01f408ca38 invoices: recognize AMP invoice settles during ntnf dispatch+catchup
In this commit, we add the setID to the invoiceEvent struct as it will
be useful when we need to be able to distinguish a new open invoice,
from an AMP invoice that's being settled for the first time.

we then update the logic during notification dispatch to utilize the new
field to allow it to detect the repeated settles of AMP invoices.
2021-10-28 15:50:27 -07:00
Olaoluwa Osuntokun 37fe29af88 channeldb: add new TestSettleIndexAmpPayments test case 2021-10-28 15:50:25 -07:00
Olaoluwa Osuntokun 7dc5efbebf channeldb: add new test to exercise cancellation of multiple AMP setIDs 2021-10-28 15:50:22 -07:00
Olaoluwa Osuntokun 698b5a8079 lnrpc: populate new AmpInvoiceState field in CreateRPCInvoice 2021-10-28 15:50:20 -07:00
Olaoluwa Osuntokun d8ce00e016 lnrpc/invoicesrpc: expose new lookup modifier to LookupInvoiceV2 2021-10-28 15:50:17 -07:00
Olaoluwa Osuntokun a4f8842831 channeldb: optimize updateInvoice for AMP by only reading relevant HTLCs
In this commit, we update the logic in `updateInvoice` to allow callers
to pass in either a hint, or the setID in the update callback. This
makes things more efficient for AMP invoices with thousands of recurring
payments, as we no longer need to read out _all_ the invoices each time
we go to update the state of a few HTLCs.
2021-10-28 15:50:15 -07:00
Olaoluwa Osuntokun f969d81e1a channeldb: for AMP, store set ID w/ invoice num in settle index
This change allows us to deliver notifications to a user of all the
settled recurring payments to the same payment_addr in the order that
they occurred.
2021-10-28 15:50:12 -07:00
Olaoluwa Osuntokun 3b28ad6d72 channeldb: for AMP don't update the main invoice state in updateInvoice
In this commit, we modify the way we handle state updates for AMP
invoices. With the current logic, once an invoice is settled, we'll
update the primary invoice state. This means that a user can't take the
same payment_addr, w/ a new set_id and pay the invoice again.

To remedy this, we'll move to instead _not_ updating the main invoice
state each time a new htlc Set (group of HTLCs according to setID) is
added. Instead, given that each HTLC stores an individual state, we'll
instead just use that directly from now on.

We also update TestSetIDIndex to account for new repeated settle AMP
logic.
2021-10-28 15:50:10 -07:00
Olaoluwa Osuntokun c0f934e363 channeldb: don't cancel other HTLCs w/ diff setID once once is settled
With this change, we allow multiple users to concurrently pay the same
AMP invoice with distinct set IDs.
2021-10-28 15:50:07 -07:00
Olaoluwa Osuntokun 700bae16a3 channeldb: store AMP invoice htlc sets in new prefix key near invoice
In this commit, we modify the HTLC storage for AMP invoice only to be
stored within a new key prefix next to the main invoice data. We do this
as otherwise each time an AMP invoice is settled (enabled by the
following commits), we need to continually encode+decode the _entire_
set of invoices.

Instead, we store the AMP invoices within the main invoice bucket, using
the invoice number as a key prefix, with the final key being:
`invoiceNum || setID`
2021-10-28 15:50:04 -07:00
Olaoluwa Osuntokun 65cca8dd1c channeldb: add new AMPInvoiceState field to store AMP sub-invoice metadata
In this commit, we add a new type `AMPInvoiceState` that's used to store
AMP sub-invoice meta data alongside the main invoice. This will be used
to allow changes to be made to an AMP invoices without reading out all
the HTLCs. In addition, callers can use this metadata to look up
information about the current sub-invoice state of AMP HTLCs.
2021-10-28 15:50:02 -07:00
Olaoluwa Osuntokun 8299d632e8 lnrpc/invoicesrpc: add new invoice ref LookupInvoiceV2 method
In this commit, we add a new `LookupInvoiceV2` method attached to the
invoice RPC sub-server. Compared to the existing version, this version
allows an invoice to be looked up by an invoice ref. This enables users
to query an AMP invoice based on a specific _set ID_, so they can get
the information related to the set of cumulative settles to that
invoices.
2021-10-28 15:49:25 -07:00
Olaoluwa Osuntokun b45c4ea7e3 Merge pull request #5828 from Crypt-iQ/switch_dust_flake_10052021
htlcswitch: remove 5 second timeout for data race unit tests
2021-10-27 17:13:09 -07:00
Olaoluwa Osuntokun 0a3bc3ee3d Merge pull request #5840 from guggero/bolt-pathfinding-fallback
db: allow turning off in-memory graph cache for bbolt
2021-10-25 14:24:10 -07:00
Olaoluwa Osuntokun 11b157705c Merge pull request #5598 from champo/relax_channel_disabled
routing: relax penalties for channel disabled errors
2021-10-25 14:21:36 -07:00
Olaoluwa Osuntokun 60a1f2d8d9 Merge pull request #5874 from Roasbeef/chan-type-feature-bit-fix
lnwire: switch chan_type feature to bits 44/45
2021-10-25 14:19:29 -07:00
Olaoluwa Osuntokun cac8da819f build: update go.mod with latest healthcheck version
We need a tag after the update to the sub-module, as otherwise projects
that depend on lnd (like `lndclient`) are broken.
2021-10-20 18:53:25 -07:00
Olaoluwa Osuntokun 7f656a2550 Merge pull request #5709 from Roasbeef/lease-script-enforce
Introduce new commitment format to enforce channel lease expirations in scripts
2021-10-20 18:28:40 -07:00
Olaoluwa Osuntokun 287871401a docs/release-notes: add section for propr chan type feature bit 2021-10-19 18:25:58 -07:00
Olaoluwa Osuntokun 028fc86e5c lnwire: switch chan_type feature to bits 44/45
We were using an older feature bit that was just "selected". This commit
has us use the feature bit officially included in the spec.

See https://github.com/lightningnetwork/lightning-rfc/pull/906
2021-10-19 17:40:33 -07:00
Olaoluwa Osuntokun e590abc7be Merge pull request #5813 from naveensrinivasan/naveen/feat/kvdv-1.16
Upgrade to go 1.16 for the left over packages
2021-10-19 16:40:47 -07:00
Olaoluwa Osuntokun 290b78e700 Merge pull request #5512 from carlaKC/5468-amountawarehint
routing: include htlc amount in bandwidth hint queries
2021-10-19 16:31:10 -07:00
Olaoluwa Osuntokun e6c65f1cbd Merge pull request #5346 from joostjager/custom-messages
lnrpc+peer: custom peer messages
2021-10-18 19:07:39 -07:00
Olaoluwa Osuntokun 94b7b71809 Merge pull request #5689 from guggero/remote-signer
Support remote signing over RPC
2021-10-18 18:39:17 -07:00
Olaoluwa Osuntokun d7d9eb958b Merge pull request #5794 from yyforyongyu/5771-fix-tor
tor: enable lnd surviving Tor daemon restart
2021-10-11 02:35:14 -07:00
Olaoluwa Osuntokun 64211da40d Merge pull request #5839 from ellemouton/noDuplicateConnsForDupAddrs
server: use deduped addrMap for connReq creation
2021-10-08 17:01:45 -07:00
Olaoluwa Osuntokun d630b95c8b Merge pull request #5777 from orbitalturtle/buf-pass-macaroon
Lnd: Listen for RPC calls on a bufconn
2021-10-07 18:50:58 -07:00
Olaoluwa Osuntokun 935fd267a0 Merge pull request #5834 from torkelrogstad/2021-10-06-getchaininfo
lncli: take chan_id as uint64 in getchaninfo
2021-10-07 12:49:44 -07:00
Olaoluwa Osuntokun 3efe94b4b1 Merge pull request #5833 from guggero/itest-github-fixes
itest: fix log file upload and flakes
2021-10-07 12:47:32 -07:00
Olaoluwa Osuntokun ca4b8180a0 Merge pull request #5826 from guggero/release-fixes
GitHub: download key from git repo, update Roasbeef's key
2021-10-07 12:32:17 -07:00
Olaoluwa Osuntokun f290746095 Merge pull request #5838 from ellemouton/printPubKeyInHex
server: print pubkey in hex in log [skip ci]
2021-10-07 12:28:48 -07:00
Olaoluwa Osuntokun ccc03931ad Merge pull request #5483 from ellemouton/respectMinFeeRate
multi: respect and update min relay fee
2021-10-05 16:24:57 -07:00
Olaoluwa Osuntokun 5cc10ef18b Merge pull request #5811 from guggero/itest-flake-fix
CI: fix more flakes, move itests to GitHub (except ARM itest)
2021-10-05 16:21:09 -07:00
Olaoluwa Osuntokun af9b620854 Merge pull request #5538 from ellemouton/refreshPeerIP
multi: refresh peer IP during reconnect
2021-10-04 15:26:47 -07:00
Olaoluwa Osuntokun 32fa48df7d Merge pull request #5770 from Crypt-iQ/dust_threshold_0619
lnwallet+htlcswitch: make Switch dust-aware
2021-09-30 20:20:19 -07:00
Olaoluwa Osuntokun 8ba68ca59f Merge pull request #5789 from naveensrinivasan/naveen/feat/fix-CVE-2021-29482
mod: Upgraded xz library to FIX the CVE-2021-29482
2021-09-30 20:16:13 -07:00
Olaoluwa Osuntokun 91edfaed85 Merge pull request #5802 from yyforyongyu/5318-fix-addr-format
lndcfg: give verbose err when failed to load config
2021-09-30 20:14:08 -07:00
Olaoluwa Osuntokun c6b250c479 Merge pull request #5807 from ellemouton/bumpNeutrinoVersion
go.mod: latest neutrino commit
2021-09-30 20:13:03 -07:00
Olaoluwa Osuntokun dd7bfa0c4a Merge pull request #5650 from Roasbeef/go-1-17
build: upgrade all CI+build infra to Go 1.17
2021-09-30 19:12:29 -07:00
Olaoluwa Osuntokun 34cb9357ee Merge pull request #5808 from Crypt-iQ/shutdown_clean_flakefix_0929
htlcswitch: fix flake in TestShutdownIfChannelClean
2021-09-29 17:43:09 -07:00