Commit Graph
100 Commits
Author SHA1 Message Date
Olaoluwa Osuntokun 03b26bb909 Merge pull request #7859 from guggero/txnotifier-details-copy
chainntnfs: remove block info from conf detail copy
2023-08-03 14:36:32 -07:00
Olaoluwa Osuntokun 1871970543 Merge pull request #7343 from positiveblue/sqldb
sqldb: new package supporting sql backends
2023-07-31 10:49:42 -07:00
Olaoluwa Osuntokun f64ebfb975 Merge pull request #7844 from hieblmi/add-slyghtning-to-signers
scripts: add gpg key for hieblmi [skip ci]
2023-07-27 11:20:00 -07:00
Olaoluwa Osuntokun 10bd338b33 Merge pull request #7799 from positiveblue/fix-build-route
routing: fix `index out of range` panic
2023-07-27 11:17:31 -07:00
Olaoluwa Osuntokun 8f5fee98a6 Merge pull request #7856 from Roasbeef/p2p-wg-fix
peer: ensure the peer has been started before Disconnect can be called
2023-07-27 11:14:37 -07:00
Olaoluwa Osuntokun 325e844a96 peer: ensure the peer has been started before Disconnect can be called
In this commit, we make sure that all the `wg.Add(1)` calls succeed
before we attempt to wait on the shutdown of all the goroutines. Under
rare scheduling scenarios, if both `Start` and `Disconnect` are called
concurrently, then this internal race error can be hit, causing the
panic to occur.

Fixes https://github.com/lightningnetwork/lnd/issues/7853
2023-07-27 10:59:39 -07:00
Olaoluwa Osuntokun 798821db17 peer: remove unused queueQuit channel
In this commit, we remove an unused `queueQuit` channel.
2023-07-27 10:59:29 -07:00
Olaoluwa Osuntokun 9ed064be75 Merge pull request #7516 from hieblmi/utxo-funding
funding: fund channel with selected utxos
2023-07-25 19:19:42 +02:00
Olaoluwa Osuntokun acecb12f54 Merge pull request #7354 from positiveblue/invoice-sql-schema
sqldb: add invoice schema and sql queries
2023-07-12 17:03:26 -07:00
Olaoluwa Osuntokun 33b470b4a6 Merge pull request #7768 from ProofOfKeags/spurious-htlc-rejections
invoices+htlcswitch: fix spurious htlc rejections from overly strict onion packet integrity checks
2023-07-11 10:51:22 -07:00
Olaoluwa Osuntokun 86e7b4e1e0 Merge pull request #7794 from yyforyongyu/prepare-channel-ready-fix
brontide: refactor peer to prepare channel ready fix
2023-07-04 12:39:59 -07:00
Olaoluwa Osuntokun 55c991a1a7 Merge pull request #7775 from yyforyongyu/fix-logger-order
lnd: fix orders when initializing subsystem loggers
2023-07-04 12:39:39 -07:00
Olaoluwa Osuntokun 5015cd941e Merge pull request #7797 from guggero/kvdb-1-4-2
mod: bump kvdb submodule to v1.4.2
2023-07-04 12:39:23 -07:00
Olaoluwa Osuntokun df9b53b6af Merge pull request #7766 from ffranr/export_unmarshall_outpoint
Export unmarshall outpoint functionality
2023-07-04 12:37:48 -07:00
Olaoluwa Osuntokun f3437d6d2a Merge pull request #7782 from guggero/fix-tor-dial-ipv6
tor: short circuit host lookup if connecting to IP
2023-07-04 12:37:36 -07:00
Olaoluwa Osuntokun aa17c17f9a Merge pull request #7772 from Roasbeef/release-notes-merge-queue
scripts: update release notes check for merge queue usage
2023-06-27 13:46:29 -04:00
Olaoluwa Osuntokun d0ca48a435 Merge pull request #7767 from yyforyongyu/fix-mempool-leak
Fix mempool memory usage
2023-06-22 11:22:20 -05:00
Olaoluwa Osuntokun 7f95810359 Merge pull request #7710 from carlaKC/7297-updateaddtlvs
Channeldb: Store HTLC Extra TLVs in Onion Blob Varbytes
2023-06-16 14:31:11 -05:00
Olaoluwa Osuntokun f42b6a3949 scripts: update release notes check for merge queue usage
Without this commit, PRs can fail to be merged via the merge queue, as
it'll fail with this error:
```
Run scripts/check-release-notes.sh
PR gh-readonly-queue didn't update release notes
Error: Process completed with exit code 1.
```
2023-06-15 17:48:55 -05:00
Olaoluwa Osuntokun 453fbb3358 Merge pull request #7565 from Torakushi/accounts
Fix non-deterministic behaviour for custom accounts
2023-06-14 23:28:42 -05:00
Olaoluwa Osuntokun a7d6826f60 multimutex: remove HashMutex, make Mutex type a type param
In this commit, we eliminate some code duplication by removing the old
`HashMutex` struct as it just duplicates all the code with a different
type (uint64 and hash). We then make the main Mutex struct take a type
param, so the key can be parametrized when the struct is instantiated.
2023-06-01 17:39:49 -07:00
Olaoluwa Osuntokun 20c1af9af6 Merge pull request #7726 from Roasbeef/htlc-must-sweep
contractcourt: force the sweeper to always resolve outgoing HTLCs
2023-05-29 12:49:32 -07:00
Olaoluwa Osuntokun f170f8e104 docs/release-notes: add release notes for adamant htlc sweeps 2023-05-29 12:49:07 -07:00
Olaoluwa Osuntokun 7686d10075 contractcourt: force the sweeper to always resolve outgoing HTLCs
In this commit, we attempt to fix an issue that may lead to force closes due
to small value HTLCs. The sweeper has built in a "negative yield" heuristic
where it won't sweep something that'll result in paying more fees than the
HTLC amount. However for HTLCs, we want to always sweep them, as we don't
cancel back the HTLCs before the outgoing contract is fully resolved.

In the future, we'll start to make more uneconomical decisions about if we
should go to chain at all for small value HTLCs, and also do things like
cancel back early if the HTLC is small and we think we might be contested by
chain fees.
2023-05-26 15:15:36 -07:00
Olaoluwa Osuntokun b9b20acd41 Merge pull request #7711 from Roasbeef/commit-dance-stall-disconnect
htlcswitch+peer: actually actually disconnect if we detect a stalled remote channel state machine
2023-05-23 14:17:07 -07:00
Olaoluwa Osuntokun 4d633f04e3 htlcswitch: add new LinkFailureDisconnect action
In this commit, we add a new LinkFailureDisconnect action that'll be
used if we detect that the remote party hasn't sent a revoke and ack
when it actually should.

Before this commit, we would log our action, tear down the link, but
then not actually force a connection recycle, as we assumed that if the
TCP connection was actually stale, then the read/write timeout would
expire.

In practice this doesn't always seem to be the case, so we make a strong
action here to actually force a disconnection in hopes that either side
will reconnect and keep the good times rollin' 🕺.
2023-05-23 12:25:11 -07:00
Olaoluwa Osuntokun cb5fc71659 htlcswitch: add new LinkFailureAction enum
In this commit, we add a new LinkFailureAction enum to take over the old
force close bool. Force closing isn't the only thing we might want to do
when we decide to fail the link, so this is a prep refactoring for an
upcoming change.
2023-05-23 12:24:55 -07:00
Olaoluwa Osuntokun 04314d3254 Merge pull request #7667 from ziggie1984/log-fix-typo
[skip ci] htlcswitch: fix double sat/kw output
2023-05-04 11:59:54 -05:00
Olaoluwa Osuntokun 3c8c057ea9 Merge pull request #7641 from Roasbeef/btcwallet-async
build: update to btcwallet version with async mempool scan
2023-04-28 14:02:10 -05:00
Olaoluwa Osuntokun 33047e69d9 Merge pull request #7647 from yyforyongyu/skip-checkpoint-resolver
contractcourt: skip checkpoint htlc outgoing resolver if it's resolved
2023-04-28 14:01:14 -05:00
Olaoluwa Osuntokun 239da9268c build: update to btcwallet version with async mempool scan
This version of btcwallet demotes some spammy logs (txns replaced in the
mempool), and makes the initial mempool scan async.

Fixes https://github.com/lightningnetwork/lnd/issues/7640
2023-04-27 16:27:26 -05:00
Olaoluwa Osuntokun 588a7eb9ca Merge pull request #7599 from Roasbeef/sweeper-rebroadcaster-interaction
sweep: remove conflicted sweep txns from the rebroadcaster
2023-04-21 13:58:50 -07:00
Olaoluwa Osuntokun 3d2daeefd8 sweep: remove conflicted sweep txns from the rebroadcaster
In this commit, we an existing gap in our rebroadcast handling logic. As
is, if we're trying to sweep a transaction and a conflicting transaction
is mined (timeout lands on chain, anchor swept), then we'll continue to
try to rebroadcast the tx in the background.

To resolve this, we give the sweeper a new closure function that it can
use to mark conflicted transactions as no longer requiring rebroadcast.
2023-04-21 11:53:08 -07:00
Olaoluwa Osuntokun f56c9e9c8a Merge pull request #7609 from Roasbeef/80-block-cltv
chainreg: increase default CLTV value to 80 blocks (~13 hrs)
2023-04-19 11:42:27 -07:00
Olaoluwa Osuntokun 7e1628d89d chainreg: increase default CLTV value to 80 blocks (~13 hrs)
In this commit, we increase the default CTLV value to 80 blocks.
Initially this was set to 144 blocks in the early days, but then was
lowered to 40 blocks as the lnd implementation matured. By setting this
to a higher value, we increase the safety window (MTTR) when it comes to
node downtime, and also add some buffer room around time locks which may
become more stressed in the future assuming the current mempool load
remains persistent.
2023-04-19 11:39:37 -07:00
Olaoluwa Osuntokun d908becf73 Merge pull request #7613 from ellemouton/fndMgrDefaultPolicyValuesFix
funding: use default forwarding policy if persisted values not found
2023-04-19 11:29:23 -07:00
Olaoluwa Osuntokun ec3cb6939a Merge pull request #7564 from yyforyongyu/mempool-watch
contractcourt: add mempool watcher to notify mempool events
2023-04-18 14:22:23 -07:00
Olaoluwa Osuntokun 37911e2413 Merge pull request #7603 from Torakushi/batch_open_channel_p2tr
funding: use p2tr by default for batch_open_channel
2023-04-17 11:42:34 -07:00
Olaoluwa Osuntokun 66a85bf9db Merge pull request #7473 from emilioziniades/realign-witness-types
input+lnrpc: realign witness types
2023-04-13 16:09:01 -07:00
Olaoluwa Osuntokun 158e93f114 Merge pull request #7464 from guggero/script-builder-capacity
input: reduce memory allocation for ScriptBuilder
2023-04-11 15:07:47 -07:00
Olaoluwa Osuntokun 30010dbaa1 Merge pull request #7593 from guggero/remote-signing-docs
docs: update remote signing docs
2023-04-11 14:51:02 -07:00
Olaoluwa Osuntokun bb3d344fa4 Merge pull request #7563 from yyforyongyu/syncmap-methods
lnutils: add methods `ForEach`, `Len` and `LoadOrStore` to `SyncMap`
2023-04-10 17:00:19 -07:00
Olaoluwa Osuntokun 9580584f73 Merge pull request #7442 from 84adam/postgres-docs-schema-84adam
docs: add notes on contents of Postgres DB as Key-Value store to Postgres.md
2023-04-10 16:51:19 -07:00
Olaoluwa Osuntokun ed0095fbba config: fix bug in walletrpc interaction due to mismatched coin type
In this commit, we fix a bug that would cause the walletrpc on the
simnet chain to not be able to respond to all RPC calls. The issue is
that for the SimNet backend, within chainparams.go:
https://github.com/lightningnetwork/lnd/blob/6e0a67d05bd375c4b39db53dc45df74157227a57/chainreg/chainparams.go#L45-L51,
we set a new CoinType for Simnet in order to match the RegTest value.

Later on, when we go to verify the on disk accounts against the
in-memory cointype, we fall through to an error case as the in-memory
cointype is 115, while the on disk cointype is 1.

To fix this, when we know we're doing simnet mode, we'll override the
cointype similar to the way we did/do for LTC.

Fixes https://github.com/lightningnetwork/lnd/issues/6807.
2023-04-10 11:43:21 -07:00
Olaoluwa Osuntokun 6e0a67d05b Merge pull request #7582 from Roasbeef/go-1-20-3
build: update build system to Go 1.20.3
2023-04-06 11:38:49 -07:00
Olaoluwa Osuntokun a72fb7d3f5 Merge pull request #7585 from lightningnetwork/0-16-1-staging
lnd: manual merge docker bump into master branch
2023-04-06 11:38:22 -07:00
Olaoluwa Osuntokun 591ff120b6 Merge pull request #6903 from hieblmi/fundmax-flag
funding: add `fundmax` flag to `OpenChannelRequest`
2023-04-06 10:57:29 -07:00
Olaoluwa Osuntokun a144eedc51 Merge pull request #7560 from guggero/btcd-version
docker+docs: bump btcd version
2023-04-05 17:21:54 -07:00
Olaoluwa Osuntokun f9f08079d0 Merge pull request #7576 from lightningnetwork/0-17-0-staging
lnd: merge v0.17.0 staging branch into master
2023-04-05 16:48:50 -07:00
Olaoluwa Osuntokun 2596a33529 Merge pull request #7575 from lightningnetwork/0-16-1-staging
lnd: merge the 0.16.1 staging branch into master
2023-04-05 16:48:25 -07:00
Olaoluwa Osuntokun c0f4defe0b build: update build system to Go 1.20.3 2023-04-05 11:28:34 -07:00
Olaoluwa Osuntokun 981771022b Merge pull request #7574 from Roasbeef/16-99-version-bump
build: bump version to v0.16.99
2023-04-04 19:55:32 -07:00
Olaoluwa Osuntokun febf1ab0d5 build: bump version to v0.16.99
In this commit, we bump the version of the master branch to v0.16.99.
This reflects the fact that master will be a super set of all the minor
releases until v0.17, and will also include changes towards v0.17.
2023-04-04 19:51:15 -07:00
Olaoluwa Osuntokun f97454d4ff Merge pull request #7359 from djkazic/fix/ldflags-on-mac-and-android
build: fix Makefile ldflags for mac and mobile, bump gomobile deps, enable gomodules
2023-04-04 18:05:21 -07:00
Olaoluwa Osuntokun 840c939464 build: bump version to v0.16.0-rc3 2023-03-10 19:09:32 -08:00
Olaoluwa Osuntokun 75ee5574a9 Merge pull request #7448 from Roasbeef/tx-rebroadcaster
lnwallet: add new rebroadcaster interface, use for background tx publish
2023-03-10 19:08:38 -08:00
Olaoluwa Osuntokun 8754547ded lnwallet: add tests for the new rebroadcaster logic
We needed to copy some mocks from elsewhere in the codebase, as
otherwise we'd run into an import cycle.
2023-03-10 19:07:50 -08:00
Olaoluwa Osuntokun e007125f78 lnutils: add RecvOrTimeout
This abstracts out a common pattern where we wait for a send on a
channel, and timeout otherwise.
2023-03-10 19:07:45 -08:00
Olaoluwa Osuntokun 6b8a1f1d67 docs/release-notes: add note for new tx rebroadcast 2023-03-10 19:07:42 -08:00
Olaoluwa Osuntokun 42343184f4 lnd: hook up neutrino's rebroadcaster for full node backends
Neutrino already runs this rebroadcaster in the background, so we don't
need to create it again if we're running in that operating mode.
2023-03-10 19:07:40 -08:00
Olaoluwa Osuntokun 10929d80cc lnwallet: add new rebroadcaster interface, use for background tx publish
In this commit, we add a new Rebroadcaster interface to be used for
publishing transactions passively in the background until they've been
confirmed on chain. This is useful if a tx drops out of the mempool, but
then the pool clears down and has more space available to accept the tx
at the current fee level.
2023-03-10 19:07:35 -08:00
Olaoluwa Osuntokun 0bbbd9b911 build: bump min Go version to 1.19
Fixes https://github.com/lightningnetwork/lnd/issues/7495
2023-03-08 18:02:57 -08:00
Olaoluwa Osuntokun d26cfd241a Merge pull request #7485 from Roasbeef/v0-16-0-branch-rc2
build: bump version to v0.16.0-rc2
2023-03-06 12:21:58 -08:00
Olaoluwa Osuntokun 8f4fc29fc1 build: bump version to v0.16.0-rc2 2023-03-06 11:24:37 -08:00
Olaoluwa Osuntokun 4b88020269 Merge pull request #7446 from yyforyongyu/fix-future-msg
discovery: flatten future msg cache and increase its size
2023-03-06 11:21:48 -08:00
Olaoluwa Osuntokun 251802d796 Merge pull request #7444 from bitromortac/2302-capacity-config
routing: configurable capacity fraction for apriori probability
2023-03-02 18:39:01 -08:00
Olaoluwa Osuntokun 530988cadf Merge pull request #7467 from yyforyongyu/rename-lookuphtlc
rpcserver: rename `LookupHtlc` to `LookupHtlcResolution`
2023-03-01 12:05:09 -08:00
Olaoluwa Osuntokun 9f1daf31c1 Merge pull request #7445 from yyforyongyu/fix-heap
discovery: fix heap escape on `cachedMsgs`
2023-02-23 16:24:22 -08:00
Olaoluwa Osuntokun 036a0144cb build: bump version to v0.16.0-rc1 2023-02-23 15:36:51 -08:00
Olaoluwa Osuntokun cfc19a9ac4 Merge pull request #6825 from yyforyongyu/6-new-itest
itest: fix previously known test flakes
2023-02-23 15:35:45 -08:00
Olaoluwa Osuntokun d793a53bba Merge pull request #7406 from Roasbeef/gossip-cache-fix
multi: bump neutrino+btcwallet versions, use new generic lru cache
2023-02-22 15:49:49 -08:00
Olaoluwa Osuntokun a15c45231e multi: bump neutrino+btcwallet versions, use new generic lru cache 2023-02-21 17:28:48 -08:00
Olaoluwa Osuntokun f4fdd82327 Merge pull request #7264 from yyforyongyu/gossip-resend-messages
discovery: fix message order in batch sending
2023-02-21 17:10:13 -08:00
Olaoluwa Osuntokun 748461cba4 Merge pull request #7379 from ellemouton/addFieldsToRevocationLog
multi: add local and remote amount fields to revocation log
2023-02-20 17:57:08 -08:00
Olaoluwa Osuntokun aec10481c1 build: use the new merge_group selector for the merge queue
In this commit, we activate the merge queue by using the new merge_group
selector. Without this, the CI won't report back the progress of a CI
run to the merge queue, so things won't get auto merged.
2023-02-16 15:00:20 -08:00
Olaoluwa Osuntokun 5d22d5eb6c Merge pull request #7252 from ellemouton/sqlite-pt2
multi: add sqlite backend option
2023-01-31 10:14:46 -08:00
Olaoluwa Osuntokun 292551fbf4 Merge pull request #7332 from Roasbeef/sign-output-raw-bug-fix
[1/?] - lnwallet: ensure that SignOutputRaw can sign w/ non-default sighash f…
2023-01-25 18:40:44 -08:00
Olaoluwa Osuntokun be047096c2 docs/release-notes: add entry for taproot sighash bug fix 2023-01-24 19:47:39 -08:00
Olaoluwa Osuntokun 3d8f284af7 lntest/itest: update taproot signing itest to use default and non-default sighashes
Without the prior commit, this test fails with:
```
rpc error: code = Unknown desc = malformed signature: too long: 65 > 64
```
2023-01-24 19:47:34 -08:00
Olaoluwa Osuntokun 8ab598e40c lntest/itest: make publishTxAndConfirmSweep a test helper
Calling ht.Helper() means we'll get the proper line number if an error
hapens.
2023-01-24 19:47:31 -08:00
Olaoluwa Osuntokun 843c62b59d lnwallet: ensure that SignOutputRaw can sign w/ non-default sighash for schnorr sigs
Before this commitment, we'd end up failing in `schnorr.ParseSignature`
if a non-default sighash was used. To fix that, we'll slice the
signature to only pass in the sig w/o the sighash flag.
2023-01-24 19:47:29 -08:00
Olaoluwa Osuntokun 9b422acffe build: update to latest version of btcd 2023-01-24 19:47:26 -08:00
Olaoluwa Osuntokun 266cd97573 Merge pull request #7251 from ellemouton/sqlite-pt1
kvdb: add sqlite
2023-01-23 17:26:15 -08:00
Olaoluwa Osuntokun ea0eb2ce72 Merge pull request #7215 from positiveblue/invoices-channeldb-dep
Invoices: invert package dependency with `channeldb`
2023-01-17 10:13:22 -08:00
Olaoluwa Osuntokun e29a5a59ad Merge pull request #7262 from bottlepay/fix-failure-tlv
lnwire: limit channel update reader
2023-01-04 18:41:44 -08:00
Olaoluwa Osuntokun de3e0d7875 Merge pull request #7239 from Roasbeef/gossip-scoping-issues
discovery: ensure we prioritize sending out our own local announcements
2022-12-16 13:51:17 -08:00
Olaoluwa Osuntokun 050db16e5d docs/release-notes: add release notes for gossip msg prioritization 2022-12-15 11:56:49 -08:00
Olaoluwa Osuntokun f94a67a26d discovery: properly set the isRemote field for validated networkMsg
This wasn't set properly, leading to some test failures after the prior
change.
2022-12-15 11:56:44 -08:00
Olaoluwa Osuntokun 52451b37af discovery: ensure we prioritize sending out our own local announcements
In this commit, we modify our gossip broadcast logic to ensure that we
always will send out our own gossip messages regardless of the
filtering/feature policies of the peer.

Before this commit, it was possible that when we went to broadcast an
announcement, none of our peers actually had us as a syncer peer (lnd
terminology). In this case, the FilterGossipMsg function wouldn't do
anything, as they don't have an active timestamp filter set. When we go
to them merge the syncer map, we'd add all these peers we didn't send
to, meaning we would skip them when it came to broadcast time.

In this commit, we now split things into two phases: we'll broadcast
_our_ own announcements to all our peers, but then do the normal
filtering and chunking for the announcements we got from a remote peer.

Fixes https://github.com/lightningnetwork/lnd/issues/6531
Fixes https://github.com/lightningnetwork/lnd/issues/7223
Fixes https://github.com/lightningnetwork/lnd/issues/7073
2022-12-15 11:56:41 -08:00
Olaoluwa Osuntokun 9a4701d709 discovery: add new msgsToBroadcast struct
This struct will be used to later on do filtering when we go to
broadcast, based on if a message was locally sourced or granted from a
remote peer.
2022-12-15 11:56:38 -08:00
Olaoluwa Osuntokun e8177ea427 discovery: add isLocal bool to msgWithSenders
This lets us keep track of which messages we created ourselves vs the
messages that originated remotely from a peer.
2022-12-15 11:56:36 -08:00
Olaoluwa Osuntokun adb239300f fn: add new fn (func utils) package for generic helper funcs
We start with a simple Map function that can be useful for transforming
objects on the fly.

We may want to eventually make this Taro pakage into a module so we can
just have everything in one place:
https://github.com/lightninglabs/taro/tree/main/chanutils.
2022-12-15 11:56:31 -08:00
Olaoluwa Osuntokun a347e405e8 Merge pull request #7254 from yyforyongyu/fix-tools
tools: fix docker version
2022-12-15 11:55:49 -08:00
Olaoluwa Osuntokun 8a18824851 Merge pull request #7243 from guggero/ghost-utxo-fix
wallet: fix ghost UTXOs not being detected
2022-12-13 20:00:31 -08:00
Olaoluwa Osuntokun d468391d95 Merge pull request #6857 from bitromortac/2208-apriori-capacity
pathfinding: capacity-dependent apriori model probability
2022-12-12 19:07:39 -08:00
Olaoluwa Osuntokun 2477095473 Merge pull request #7209 from guggero/btcwallet-fund-psbt
mod+docs: bump btcwallet to latest version
2022-12-05 19:47:42 -08:00
Olaoluwa Osuntokun aa20bc14d7 docs/release-notes: add entry for 0.15.5
Adds an entry for the change addr bug fix, and a missing entry for the
funding locked sleep fix.
2022-11-22 13:44:55 +01:00
Olaoluwa Osuntokun d75c86f3dd lnwallet: skip dual funding test as not exposed on p2p layer
The internal messages both sides exchange haven't been updated to send
all the information needed to compute a tapscript sighash.
2022-11-22 13:44:54 +01:00
Olaoluwa Osuntokun 7090ff22d7 lnwallet: assert that P2TR addrs are used for change outputs 2022-11-22 13:44:54 +01:00
Olaoluwa Osuntokun 51f131b019 build: update to latest version of btcutil+btcwallet 2022-11-22 13:44:54 +01:00