Commit Graph

14703 Commits

Author SHA1 Message Date
yyforyongyu
e9c10bf0a1
chainntnfs: remove subscriptions when the relevant tx is confirmed
This commit removes the subscribed inputs from mempool notifier when the
relevant transaction is confirmed.
2023-04-19 01:18:19 +08:00
yyforyongyu
556c38fefd
contractcourt+lnd: watch for preimage reveal in mempool
This commit extends the current htlc timeout resolver to also watch for
preimage spend in mempool for a full node backend.

If mempool enabled, the resolver will watch the spend of the htlc output
in mempool and blocks **concurrently**, as if they are independent.

Ideally, a transaction will first appear in mempool then in a block.
However, there's no guarantee it will appear in **our** mempool since
there's no global mempool, thus we need to watch the spend in two places
in case it doesn't go through our mempool.

The current design favors the spend event found in blocks, that is, when
the tx is confirmed, we'd abort the monitoring and conitnue since the
outpoint cannot be double spent and re-appear in mempool again. This is
not true in the rare case of reorg, and we will handle reorg seperately.
2023-04-19 01:18:19 +08:00
yyforyongyu
7ef8072724
contractcourt: refactor spendHtlcOutput for clarity
Also fixes the docs and rename `isSuccessSpend` to `isPreimageSpend`.
2023-04-19 01:18:19 +08:00
yyforyongyu
e81d62fc70
chainntnfs+chainreg: add interface MempoolWatcher
This commit adds the interface `MempoolWatcher` and uses it in the chain
registry.
2023-04-19 01:18:19 +08:00
yyforyongyu
ad5e798392
chainntnfs+chainreg: add mempool watcher to BtcdNotifier
This commit adds the mempool watcher to btcd notifier to allow the
notifier managing the starting and stopping of the watcher.
2023-04-19 01:18:18 +08:00
yyforyongyu
454e76cbb6
chainntnfs+chainreg: add mempool watcher to BitcoindNotifier
This commit adds the mempool watcher to bitcoind notifier to allow the
notifier managing the starting and stopping of the watcher.
2023-04-19 01:18:18 +08:00
yyforyongyu
8b42151edc
chainntnfs: patch unit tests for mempool notifier 2023-04-19 01:18:18 +08:00
yyforyongyu
3b77e9c51f
chainntnfs: add method UnsubscribeEvent to cancel a subscription
This commit adds the method `UnsubscribeEvent` to cancel a single
subscription.
2023-04-19 01:18:18 +08:00
yyforyongyu
5743dd9601
chainntnfs: allow multiple subscriber to the same input
This commit changes the `subscribedInputs` to store a map of subscribers
so multiple subscribers are allowed to receive events from the same
outpoint.
2023-04-19 01:18:18 +08:00
yyforyongyu
81ee3b9fbe
chainntnfs: introduce mempool notifier
This commit adds a mempool notifier which notifies the subscriber the
spending event found in the mempool for a given input.
2023-04-19 01:18:18 +08:00
Oliver Gugger
517f8ed842
Merge pull request #7597 from guggero/persistent-fee-params
Update `channelLink` policy correctly when opening channel with custom fee parameters
2023-04-18 13:36:24 +02:00
Oliver Gugger
d54bc8974a
docs: add release notes 2023-04-18 11:48:49 +02:00
Oliver Gugger
5fbaed6b06
peer: add TODO about initial forwarding policy
The right way to solve the problem of the link not being up to date with
custom user set forwarding policies once the channel is announced would
be to pass in those custom values when the link is created initially.
This requires a bit more of a refactor and is not addressed in this bug
fix.
2023-04-18 11:47:03 +02:00
Oliver Gugger
7eafdd0e08
Merge pull request #7604 from ziggie1984/fmt-fix
Log Output Fix (Missing Value)
2023-04-18 11:04:54 +02:00
Oliver Gugger
1eebbe3f42
itest: update channel open test to send payment
This commit enhances the custom fee policy channel open test by adding a
second channel and testing forwarding payments through the channel with
the custom forwarding policies.
This was able to reproduce the bug reported in #5796 which was fixed in
a previous commit of this PR.
2023-04-18 09:52:14 +02:00
ziggie
461e5f4ac2
docs: update release notes 2023-04-18 09:46:00 +02:00
ziggie
58aae0757e
netann: fix logging output 2023-04-18 09:44:37 +02:00
Oliver Gugger
ebf11bc2f1
itest: move lnd_custom_{message => message_test}.go
This recently added file didn't follow the golang naming convention for
tests.
2023-04-18 09:40:18 +02:00
Oliver Gugger
af70af2710
funding+server: update switch after sending channel update
With this commit we give the funding manager the ability to inform the
switch about custom channel policies, right after we've announced the
channel to the network.
This change is necessary because before #6753 a channel could only be
opened with the default forwarding policies, so the switch automatically
had the "correct" default values. Since #6753 added the ability to
specify forwarding policies at channel open time, we announced those
policies to the network but never updated the switch to inform it about
the changed policies (previously changing the policies was only possible
through the UpdateChannelPolicy RPC which did call the switch).
2023-04-18 09:40:18 +02:00
Oliver Gugger
68881f5c20
funding: refactor manager test 2023-04-18 09:40:17 +02: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
Torakushi
894fc9f2ea
update release-notes-0.16.1 2023-04-17 17:37:56 +02:00
Torakushi
0445fef7ad
funding: use p2tr by default for batch_open_channel
In LND v0.15.1, batch_open_channel used p2tr by default
for change output. However, in a later version, a breaking
change has been fixed in FundPSBT to make the change type
configurable (default to p2wkh). As batch_open_channel
uses FundPsbt, we need to put back p2tr as default for
change output
2023-04-17 17:37:51 +02: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
Emilio Ziniades
ea341bddd5
lnrpc: test witness type mapping 2023-04-12 21:58:17 +02:00
Emilio Ziniades
d8b9a2d042
input: note to update witness type protobuf 2023-04-12 21:58:12 +02:00
Emilio Ziniades
396a138fb7
lnrpc: add allWitnessTypes map
Refactor `PendingSweeps` to use `allWitnessTypes` map, and
return an error from `PendingSweeps` if an unknown witness
type is used, instead of logging a warning.
2023-04-12 21:58:00 +02:00
Emilio Ziniades
e9547daae2
lnrpc: update and regenerate witness type proto 2023-04-12 21:57:35 +02: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
Oliver Gugger
b875084cbe
docs: update remote signing docs
With this commit we update the docs according to the latest changes that
were necessary to support loop and pool (which requires all 255
internally used accounts to be imported at wallet creation time).

Fixes #7567.
2023-04-11 20:44:01 +02:00
Oliver Gugger
b6b536a1b9
Merge pull request #7550 from ardevd/proto-gen-dockerize-go
lnrpc: fully dockerize protobuf generation
2023-04-11 18:57:02 +02:00
ardevd
7c7c95e58a lnrpc: fully dockerize protobuf generation
Remove the need for golang on the host by utilizing golang docker
containers to obtain protobuf and grpc gateway versions.
2023-04-11 16:25:11 +02:00
Oliver Gugger
5046399991
Merge pull request #7588 from Roasbeef/simnet-walletrpc-cointype-fix
config: fix bug in walletrpc interaction due to mismatched coin type
2023-04-11 13:46:43 +02:00
Oliver Gugger
559cb47ec2
Merge pull request #7513 from guggero/publish-tx-logging
wallet: improve logging around transaction broadcast failures
2023-04-11 12:53:06 +02:00
Oliver Gugger
154e654dc0
docs: add release notes 2023-04-11 12:49:27 +02:00
Oliver Gugger
26254d0730
docs: add release notes 2023-04-11 11:15:37 +02:00
Oliver Gugger
3beaf7c4c1
channeldb: use input.GenMultiSigScript 2023-04-11 11:15:36 +02:00
Oliver Gugger
79c275253c
input: set initial script allocation size
The default allocation of 500 bytes for the script that is
used in NewScriptBuilder is way too much for most of our scripts.
With the new functional option we can tune the allocation to exactly
what we need.
2023-04-11 11:15:36 +02:00
Oliver Gugger
a47345bd6f
input: add script size unit and benchmark tests 2023-04-11 11:15:36 +02:00
Oliver Gugger
4bf97477ee
mod: bump btcd version 2023-04-11 10:33:19 +02:00
Oliver Gugger
9b3e4bd5c2
Merge pull request #7584 from lightningnetwork/dependabot/go_modules/golang.org/x/net-0.7.0
build(deps): bump golang.org/x/net from 0.4.0 to 0.7.0
2023-04-11 09:32:17 +02: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:
6e0a67d05b/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
yyforyongyu
8887938429
lnutils: add unit test for SyncMap 2023-04-07 17:34:48 +08:00
yyforyongyu
d1d75d0815
lnutils: add methods ForEach, Len and LoadOrStore to SyncMap 2023-04-07 17:34:45 +08: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