Commit Graph

56 Commits

Author SHA1 Message Date
Oliver Gugger
a780c81340
lnd: add aux data parser
This commit adds an optional data parser that can inspect and in-place
format custom data of certain RPC messages.
We don't add an implementation of the interface itself, as that will be
provided by external components when packaging up lnd as a bundle with
other software.
2024-05-27 15:53:11 +02:00
Olaoluwa Osuntokun
ebf9856fac
lnwallet: obtain+verify aux sigs for all second level HTLCs
In this commit, we start to use the new AuxSigner to obtain+verify aux sigs for all second level HTLCs. This is similar to the existing SigPool, but we'll only attempt to do this if the AuxSigner is present (won't be for most channels).
2024-05-27 13:02:16 +02:00
Olaoluwa Osuntokun
bb71c496f4
config+serer: add AuxFundingController as top level cfg option 2024-05-27 12:58:28 +02:00
Olaoluwa Osuntokun
5866287aae
multi: make MsgRouter available in the ImplementationCfg
With this commit, we allow the `MsgRouter` to be available in the `ImplementationCfg`. With this, programs outside of lnd itself are able to now hook into the message processing flow to direct handle custom messages, and even normal wire messages.
2024-05-22 18:24:51 +02:00
George Tsagkarelis
a584b7585d
lnd: use impl cfg TlvTrafficShaper 2024-05-22 17:28:22 +02:00
Oliver Gugger
33f2db1c25
multi: thread thru the AuxLeafStore everywhere 2024-05-01 11:19:55 +02:00
Oliver Gugger
648fb22f63
multi: wrap all errors 2024-04-11 15:04:03 +02:00
Andras Banki-Horvath
7f5c8219ef
sqldb+invoices: move SQL invoice store impl to invoices package 2024-04-09 20:46:11 +02:00
Oliver Gugger
15c7686830
Merge pull request #8554 from yyforyongyu/use-new-errors
lnwallet: use new errors returned from `rpcclient`
2024-03-21 01:42:57 -06:00
Andras Banki-Horvath
2d3d11487c
lnd: ensure that native SQL can only be used with a clean KV invoice DB
This commit adds a check to ensure that we don't start LND with native
SQL invoice DB if we already have any invoices in our KV channeldb. This
is needed as native SQL invoices is an experimental feature and we do
not yet support migration.
2024-03-20 08:46:48 +01:00
yyforyongyu
837c7f761c
lnwallet+lnd: make use of the new errors from btcd/rpcclient
This commit updates `btcd` and `btcwallet` packages and make use of the
new RPC error mappings.
2024-03-20 04:40:38 +08:00
Andras Banki-Horvath
88370de1ab
lnd: use native SQL invoice store if configured 2024-03-01 10:08:09 +01:00
Andras Banki-Horvath
debfaf41b9
lncfg: use the sqldb config types instead of the kvdb counterparts 2024-03-01 10:08:09 +01:00
ffranr
cd566eb097
multi: fix fmt.Errorf error wrapping
Refactor fmt.Errorf usage to correctly wrap errors instead of using
non-wrapping format verbs.
2024-02-27 11:13:40 +00:00
Oliver Gugger
cbc11dac8f
multi: add coin selection strategy to channel funding
With this commit we prepare for the lnwallet channel funding logic to be
aware of the config-level coin selection strategy by adding it to the
wallet config.
2024-02-23 08:58:07 +01:00
Keagan McClelland
fb8de14798 lnwallet+funding+lnd: trim unused parameters, from lnwallet.Config
chainreg: remove unused GenDefaultBtcConstraints

lnwallet+funding+lnd: remove DefaultDustLimit from lnwallet.Config
2024-02-19 17:06:21 -08:00
Keagan McClelland
c6ecb10865 chainreg+lnd: remove ChannelConstraints from PartialChainControl 2024-02-19 17:06:21 -08:00
Elle Mouton
031dbd7760 multi: remove ChainRegistry 2023-10-06 16:34:47 -07:00
Elle Mouton
3912d5a0c6 multi: remove Litecoin config options
This commit removes the `Litecoin`, `LtcMode` and `LitecoindMode`
members from the main LND `Config` struct. Since only the bitcoin
blockchain is now supported, this commit also deprecates the
`cfg.Bitcoin.Active` config option.
2023-10-06 16:34:47 -07:00
ziggie
521a67c795
lnd: define additional rebroadcaster function.
The MapCustomBroadcastError of the rebroadcaster is defined.
This let's us use the Rebroadcaster of the neutrino package (pushtx)
with other backends and guarantee a consistent behaviour. Prior
to this change the rebroadcaster would stop rebroadcasting
transactions because they did not meet the neutrino specific
broadcastErr type.
2023-07-26 00:18:08 +02:00
Daniel McNally
16463d4bd4
lnd: generate default macaroons independently
This modifies the `genMacaroons` logic to indepently check for each of
the three default macaroons (admin, readonly, invoice) and generate
whichever are missing. Previously, this was an all or nothing routine.
In other words, either all three didn't exist on disk and all three are
created, or no macaroons are created. Although that works for the first
run of a new node, it can result in inconsistent states if only one or
two of the macaroons is deleted.

See https://github.com/lightningnetwork/lnd/discussions/7566.
2023-04-26 13:30:03 -04: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
positiveblue
4a0a15586b
multi: make linter happy
Fix all the linter problems for the `v0.16.0-beta.rc3`.
2023-03-11 23:29:41 -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
Elle Mouton
0730337cc7
multi: add new NoRevLogAmtData config option
In this commit, a new `--db.no-rev-log-amt-data` flag is added. The
config option is passed though to everywhere that it will be used. Note
that it is still a no-op in this commit. An upcoming commit will make
use of the flag.
2023-02-16 20:47:29 +02:00
Oliver Gugger
0cf0a7dd3b
Merge pull request #7341 from bottlepay/final-settle-opt-in
channeldb: final htlc resolution storage opt-in
2023-02-06 13:21:40 +01: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
Orbital
21816d9118
lnd+config: Move to FileExists function in lnrpc package 2023-01-26 13:32:12 -06:00
Joost Jager
7a785c74c4
channeldb: final htlc resolution storage opt-in 2023-01-26 07:02:17 +01:00
Oliver Gugger
fe5254510e
multi: warn user if they try to switch db types
Warn a user if they attempt to initialise a new db type (sqlite or
postgres) if an old bbolt db file is found.
2023-01-25 14:16:56 +02:00
Elle Mouton
8363c4075c
multi: add sqlite backend option
In this diff, we expose the option to use sqlite as a db backend.
2023-01-25 14:16:55 +02:00
positiveblue
824e792dc2
config: expose the InvoiceDB interface in DatabaseInstances
By now the only implementation is still the one in channeldb but other
project can use their custom implementations if needed.
2023-01-16 07:31:13 -08:00
Oliver Gugger
b17a2deaf4
config_builder: use correct birthday when creating watch-only wallet 2022-10-18 13:29:09 +02:00
Daniel McNally
f1ed9754c2
config_builder: specify root key during wallet init
This sets the macaroon root key during wallet initialization when one
is provided in the init wallet params.
2022-08-12 11:34:44 -04:00
yyforyongyu
87f58a274b
multi: add the flag prune-revocation to perform the optional migration 2022-07-12 21:01:11 +08:00
Olaoluwa Osuntokun
e073b1d343
macaroons: futher abstract NewService from root key store impl
In this commit, we modify the `macaroons.NewService` consturctor to
accept the main interface rather than the raw DB. This allows us to use
other backends other than bolt or the kvdb interface to store the
macaroon root keys.

We also create a new ExtendedRootKeyStore interface that implements some
of the more advanced features we use such as macaroon encryption and
password rotation.
2022-07-06 18:59:50 -07:00
Tommy Volk
8291e8a170 multi: add keep-failed-payment-attempts flag 2022-07-03 21:04:27 +00:00
Oliver Gugger
51a480129b
walletunlocker+keychain+config_builder: use new aezeed version 2022-05-12 12:49:14 +02:00
Olaoluwa Osuntokun
9ec26325b5
build: update to version of neutrino w/ BIP 155 support
Fixes #4973
2022-05-03 15:48:37 -07:00
Oliver Gugger
c73cf03a55
multi: add p2tr keyspend wallet support 2022-03-24 18:02:38 +01:00
Oliver Gugger
5bf9b710fc
config_builder+rpcwallet: add full net params
As a preparation for parsing addresses, we need the full network
parameters and not just the coin type in the RPC wallet.
2022-03-24 14:13:05 +01:00
Oliver Gugger
895a2e497b
multi: formatting and comment fixes 2022-02-10 11:02:02 +01:00
Oliver Gugger
bab807a57d
multi: add migrate-wallet-to-watch-only flag
To enable converting an existing wallet with private key material into a
watch-only wallet on first startup with remote signing enabled, we add a
new flag. Since the conversion is a destructive process, this shouldn't
happen automatically just because remote signing is enabled.
2022-01-06 14:35:26 +01:00
Oliver Gugger
9601a9ab84
multi: make remote signer RPC timeout configurable 2022-01-06 14:35:25 +01:00
Oliver Gugger
3d353a9879
config_builder+rpcwallet: simplify RPC signing
With the remote signing instance now not needing to know anything about
addresses or current derivation indices, we don't need to forward any
such calls to that instance and can simplify the RPCKeyRing
considerably.
2022-01-06 14:35:24 +01:00
Oliver Gugger
338afef862
lnd: standardize printing to stdout
With this commit we standardize the error messages in the config parsing
section of the main package. We only print to stdout/stderr in a single
place and also make sure the same error is printed to the log (which
might or might not yet be initialized at that point).
2021-11-08 15:12:56 +01:00
Oliver Gugger
08b196e236
config_builder: always send admin mac on chan 2021-11-05 10:49:37 +01:00
Oliver Gugger
f216da32f3
lnd+channeldb: add graph cache option to channeldb
With this commit we forward the config option for disabling the channel
graph cache as a boolean to the channeldb. But we invert its meaning to
make the flag easier to understand.
2021-10-22 09:32:48 +02:00
Oliver Gugger
ceb31f9034
multi: allow watch-only wallet creation 2021-10-14 15:42:55 +02:00
Oliver Gugger
19db382e24
multi: forward address and import calls over RPC
In order to support the full range of on-chain functionality, including
importing watch-only accounts in the watch-only instance, we need to
forward some calls like creating new addresses or importing accounts to
the remote signing instance.
2021-10-14 15:42:51 +02:00