2
0
mirror of https://github.com/lightninglabs/loop synced 2024-11-09 19:10:47 +00:00
Commit Graph

235 Commits

Author SHA1 Message Date
Andras Banki-Horvath
451311d582
build: bump lnd dep to v0.16.0-beta 2023-03-29 15:39:14 +02:00
George Tsagkarelis
aca6428b0e
liquidity+loopd: move last budget refresh to parameters 2023-03-16 02:10:32 +02:00
George Tsagkarelis
af7a470aea
liquidity+loopd: add sticky loop out swap with amount backoff 2023-03-09 00:43:07 +02:00
George Tsagkarelis
b025b9ae37
multi: add recurring autoloop budget 2023-02-22 19:48:03 +02:00
Andras Banki-Horvath
4ab6c65186
dep+build: bump LND dependency to include GenCertPair fix 2023-02-09 11:22:14 +01:00
Andras Banki-Horvath
476f47275b
loopd: set minimum LND version to 0.15.99-beta 2023-02-06 20:46:03 +01:00
Andras Banki-Horvath
a7451622e5
mod: bump LND and lndclient to include musig2 1.0rc2 changes
This commit bumps LND and lndclient to make it possible to upgrade
taproot HTLC construction with a MuSig2 version. This is required to
support both old (MuSig2 0.4) and new (MuSig2 1.0) clients.
2023-02-06 20:46:03 +01:00
George Tsagkarelis
fa0393b331
multi: add OutAddr parameter for autoloop loop out 2022-12-16 12:02:46 +02:00
Andras Banki-Horvath
049b17ff96
misc: refactor loop tests to use require where possible 2022-11-30 18:16:45 +01:00
Andras Banki-Horvath
bdb4b773ed
swap: refactor htlc construction to allow passing of internal keys
This commit is a refactor of how we construct htlcs to make it possible
to pass in internal keys for the sender and receiver when creating P2TR
htlcs. Furthermore the commit also cleans up constructors to not pass in
script versions and output types to make the code more readable.
2022-11-30 18:16:44 +01:00
Andras Banki-Horvath
105d3d1ab4
loopd: bump minimum lnd version to v0.15.4 2022-11-18 21:24:31 +01:00
Andras Banki-Horvath
88956455b4
multi: completely remove support for NP2WSH htlcs
This commit removes all code related to NP2WSH htlcs. These were
historically used when segwit adoption was very sporadic and are not
used anywhere anymore. Some historical swaps stored in the DB may be
listed with incorrect htlc adresses from here on.
2022-11-04 17:14:53 +01:00
Andras Banki-Horvath
b36885fb65
loopd: correct htlc output type on view command
Previously view may have set the output type wrongly for internal p2wsh
and p2tr loop-in swaps which is corrected in this commit.
2022-11-04 17:14:50 +01:00
Andras Banki-Horvath
977b72019d
loopd: bump minimum lnd version to v0.15.1-beta
In this commit we bump the minimum LND version required to run loopd to
v0.15.1-beta in order to ensure that the underlying chain backend
supports taproot (https://github.com/lightningnetwork/lnd/pull/6798)
2022-10-07 12:24:25 +02:00
sputn1ck
0f924b36cd
multi: bump lndclient and lnd version to latest
Co-authored-by: Oliver Gugger <gugger@gmail.com>
2022-07-07 17:28:22 +02:00
András Bánki-Horváth
11ab596080
Merge pull request #497 from bhandras/taproot-musig2
multi: upgrade to using P2TR htlcs and added support for MuSig2 loopout sweep
2022-07-06 22:46:29 +02:00
Andras Banki-Horvath
85145ca4bb
loop: set minimum LND version to 0.15.0 2022-06-30 16:59:59 +02:00
Andras Banki-Horvath
391ef57ea3
loopout: enable p2tr without keyspend 2022-06-30 16:59:55 +02:00
Andras Banki-Horvath
901a935514
loopin: enable p2tr htlcs without keyspend 2022-06-30 16:59:55 +02:00
Andras Banki-Horvath
00cf4bf71c
multi: make the next protocol version optional 2022-06-30 16:59:54 +02:00
Elle Mouton
8ccd35e0c1
loopd: move RequiredPermissions to dedicated dir
This commit moves the RequiredPermissions map to its own directory so
that projects importing the permissions list dont need to import all the
dependencies of the loopd package.
2022-06-14 15:13:34 +02:00
András Bánki-Horváth
8f23c6789b
Merge pull request #477 from bhandras/taproot-htlc
multi: changes to the taproot HTLC  required for both client and server
2022-06-09 20:10:37 +02:00
Andras Banki-Horvath
9610becebd
multi: add the aggregate internal pubkey to the v3 htlc 2022-06-09 10:20:16 +02:00
sputn1ck
1df6685653
looprpc: fix suggestswaps response
This commit fixes the SuggestSwaps rpc call. Previously, when multiple
DisqualifiedPeers were provided, all pubkeys would be the same.
2022-06-08 12:09:02 +02:00
yyforyongyu
425a007aaf
loopd+liquidity: persist parameters on disk
This commit saves the RPC request used to construct the `Parameters` on
disk. Since it's a proto message, an easy way to read/write it is to
rely on the proto marshal/unmarshal methods. A side effect is that
migration also becomes easy as proto message have its own internal
mechanism to keep track of the compatibility.
2022-06-07 20:18:11 +08:00
yyforyongyu
8217ee31c3
liquidity+loopd: refactor SetParameters to take a rpc request
This commit refactors the method `manager.SetParameters` to take a
`SetLiquidityParamsRequest`. As we'll see in the following commit, this
will enable us saving the params to disk more easily.
2022-06-07 19:19:52 +08:00
sputn1ck
ece0f76e7f
loop: update listswaps api 2022-05-31 16:26:55 +02:00
Yong
e98d813885
Merge pull request #495 from sputn1ck/check_p2pk_dest
loopout: reject P2PK addresses
2022-05-25 00:10:22 +08:00
sputn1ck
ce596468e9
loopout: reject unsupported address formats
This commit adds a check to reject unsupported address
formats such as P2PK or P2TR addresses
2022-05-20 10:22:11 +02:00
sputn1ck
a34f22c443
make fmt 2022-05-20 10:16:47 +02:00
sputn1ck
a1271fee40
multi: fix linter issues 2022-05-20 10:16:46 +02:00
sputn1ck
f0bf9302cc
make: dockerize linter 2022-05-20 10:16:42 +02:00
Harsha Goli
dec6dd7e70
swap: HTLCV3 added
In this commit we add the version 3 htlc, which is implemented with
taproot script spending the two payment paths: the claim path case, and
the timeout case.
2022-04-22 11:36:09 -04:00
Harsha Goli
7a16e3b25d
multi: bump btcec/v2 and btcutil to new versions 2022-03-25 11:00:16 +01:00
Andras Banki-Horvath
5b737855c1
loopd: update minimum required LND version to v0.14.2-beta 2022-03-16 13:23:41 +01:00
Andras Banki-Horvath
1d1354d2cb
config: make total payment timeout and retries configurable 2022-02-14 10:14:47 +01:00
Elle Mouton
2d7745ecf4 loopd/daemon: rename createDefaultMacaroonFile
Rename createDefaultMacaroonFile to withMacaroonService since this is
now a more appropriate name.
2022-01-17 16:13:19 +02:00
Elle Mouton
ad7cdc8ed2 multi: use lndclient MacaroonService
Since the code for creating and using a macaroon service is the same for
multiple projects (pool, loop, litd etc), the code has been unified in
lndclient. So this commit removes the macaroon service code and instead
uses the lndclient code.
2022-01-17 16:13:19 +02:00
Andras Banki-Horvath
b3d8f5f096
loopd: close dbs when the daemon stops 2021-12-22 10:32:11 +01:00
carla
16799838f7
multi: surface loop in parameters on rpc 2021-12-15 09:11:46 +02:00
carla
4689040333
multi: surface suggested loop in swap on rpc 2021-12-15 09:10:28 +02:00
carla
5280721636
multi: add ability to autoloop in 2021-12-15 09:01:22 +02:00
carla
5e47a0c6e9
multi: add loop in swap builder implementation 2021-12-15 09:01:20 +02:00
carla
213f5c7c8b
loopd: alias server rpc import with looprpc
Packages importing loopd can't import 2x looprpc packages (in the
form of swapserverrpc and looprpc). To get around this, we alias
each import with a different name, updating the server in this
commit.
2021-12-14 11:35:30 +02:00
carla
996b5e43ab
loopd: alias client rpc import with clientrpc
Packages importing loopd can't import 2x looprpc packages (in the
form of swapserverrpc and looprpc). To get around this, we alias
each import with a different name, starting with the client in this
commit.
2021-12-13 15:28:38 +02:00
carla
dad103530f
multi: move server proto files to their own directory
Protobuf does not allow naming conflicts for files within the same
process, because all proto messages register themselves in a global
registry.

This is problematic because the server's itests import the client's
looprpc package to make rpc queries to the loopd client, thus importing
duplicate common.proto and server.proto from the client's looprc package
(since they're both in there as well).

This change moves the server's proto files into their own directory so
that they are not imported when we want to use the client's files. We
cannot change the package name for the server, because that would be
a breaking change (the package name is included in URIS). Fortunately,
we have the go_package option which allows us to place generated files
in a different location.
2021-12-13 13:56:40 +02:00
Harsha Goli
52087c8bb4
Merge pull request #434 from arshbot/default-macaroon-locations
loopd: Consider network when making LND paths
2021-12-08 17:11:34 -05:00
Harsha Goli
3fb75131ea
loopd: Consider network when making LND paths
In this commit we consider the passed network options when assuming the
LND macaroon path if not passed by user
2021-12-08 13:54:03 -05:00
Harsha Goli
f1a7d8fb49
multi: pass private, routehints from loopcli - loopd - loop server
This commit passes routehints all the way from when/if the user passes
them from the cli all the way to the backend loop server. If private is
used, this commit passes that boolean down to different stages, where it
is then converted into routehints.

main: add --private and --route_hints to quote

Adds --private and --route_hints flags to quote cli
2021-12-07 21:04:07 -05:00
carla
91a90968d0
multi: surface swap type on rpc 2021-11-30 13:18:28 +02:00
carla
25b8d20f75
liquidity: add type to rules
In preparation for adding loop in swaps, we relate liquidity rules
to a specific type of swap that we want to dispatch. This allows us
to use a single rule format for multiple swap types.
2021-11-30 13:18:27 +02:00
Carla Kirk-Cohen
04b4f0a389
Merge pull request #432 from carlaKC/export-listnerconfig
loopd: export NewListenerConfig
2021-11-18 10:03:33 +01:00
carla
618310fe6f
loopd: export NewListenerConfig 2021-11-12 11:26:07 +02:00
Turtle
1503001ee5
loopd: conditionally create default macaroon file
In some cases we don't want the default macaroon file to be created on
disk, so we allow passing in a boolean that toggles the macaroon
creation.
2021-11-04 14:09:27 +01:00
Oliver Gugger
2c6e035235
multi: bump lnd compile time dependency to v0.14.0-beta.rc1 2021-11-03 19:31:21 +01:00
carla
cca5926263
multi: bump lndclient to v0.12.0-13
To allow code with more up-to-date dependencies to import loop, we
bump our lndclient version. The minimum loop version remains 11.1
since we're not using any new apis.
2021-10-24 10:22:30 +02:00
Martin Habovstiak
158e22f2a7 Documented the menaing of returned bool 2021-08-10 08:25:32 +02:00
Martin Habovstiak
c00da1cf09 Renamed explicitConfig to hasExplicitConfig
`hasExplicitConfig` is considered cleaner.
2021-08-10 08:25:32 +02:00
Martin Habovštiak
2c1e437f26
Remove extra space
Co-authored-by: Yong <yy2452@columbia.edu>
2021-08-10 08:19:27 +02:00
Martin Habovstiak
84582bbb88 Improve error handling of config file
This makes two changes to handling of errors when configuration file
could not be loaded:

1. Only NotFound errors are considered OK - access errors and other FS
   issues are now treated as fatal.
2. Failing to load config file specified explicitly via `--configfile`
   option is alway a fatal error.

Rationale: If the configfile was specified explicitly then it indicates
the user really wishes to load it. While the user could want it to be
optionally loaded for extra configuration options, this can be
accomplished using an empty file.

If the config file was not specified explicitly then its' path was
computed from loop directory. If the file is inaccessible due to
permissions or other FS errors it's nearly certain other following
operations will fail as well. Failing early with a clear message is thus
beneficial.

This still leaves room for uncaught user error (e.g. mistakenly naming
config file inside loop dir as `loop.conf` instead of `loopd.conf`) but
it's greatly reduced and such error should be easier to identify.

(Indirectly) closes #412
2021-08-05 18:19:52 +02:00
Andras Banki-Horvath
0e7ed91d5d
loop: integrate the probe api with loop-in quote
In this commit we add a call to the new probe endpoint directly into the
loop-in quote call. Furthermore we add an option to include private
channels in the loopin swap payment request. This is also useful for when
users quote/probe directly using the client API and specify hop hints.
2021-07-30 13:22:12 +02:00
Andras Banki-Horvath
f786aaa016
loop: add support for the probe API 2021-07-30 13:22:12 +02:00
Oliver Gugger
a7fff0ac2f
multi: update lnd master with grpc-gateway upgrade
To make loop work with the latest lnd version inside of LiT, we need
to upgrade the grpc-gateway library to the same v2 version here too.
2021-07-29 17:02:06 +02:00
Oliver Gugger
7091b90e95
Merge pull request #404 from guggero/fix-alpn-error
loopd: fix ALPN issue with Python
2021-07-19 13:55:04 +02:00
Oliver Gugger
803773bb65
loop+loopd: fix linter after re-generating protos
Apparently re-generating the protos caused the linter to pick up on
fields that are now deprecated. We need to fix that with a few comments.
2021-07-14 17:21:54 +02:00
Oliver Gugger
4e45c2908a
loopd: fix ALPN issue with Python
There is an open issue for Python gRPC clients that is
currently being debugged grpc/grpc#23172

It can be mitigated server-side by specifying h2 in the metadata header.
2021-07-13 22:04:28 +02:00
Oliver Gugger
45dbd582d1
multi: bump lnd min version to v0.11.1-beta
The version v0.10.1-beta of lnd is quite old with v0.13.0-beta just
being published as RC2. Maintaining backward compatibility in the
lndclient library is quite an effort. We decided to merge the v0.11.1
branch into master meaning that all our projects now have this minimum
version requirement.
2021-05-19 14:25:23 +02:00
Oliver Gugger
32f1f2657b
multi: bump lnd to version v0.13.0-beta.rc2
This commit bumps the _compile time_ version of lnd to v0.13.0-beta.rc2.
This does not have an effect on the user, the run time backward compatibility
will be preserved. Only the next commit will bump that minimum version.
2021-05-19 14:24:41 +02:00
Oliver Gugger
27fd6b3304
multi: use aperture instead of local lsat library
Since the lsat code was copied over to aperture a while ago for other
projects to use as well, we should migrate over to that shared code
also. This will give us the recently added "remove token if payment
failed and try again" feature for free along with some other small
updates to the lsat package.
2021-04-29 10:01:15 +02:00
Oliver Gugger
39c8c9278d
loopd+loopdb: add timeout to DB open
To make sure we don't just block for forever if another Loop daemon
process is already running, we add a timeout and error out if obtaining
the unique file lock fails after 5 seconds.
2021-04-28 17:16:27 +02:00
Elle Mouton
65fe06cec2 loopd: verify loop out amount
This commit adds validation that checks if the loop out amount specified can
be satisfied given the nodes current channel balances.
2021-03-17 10:12:30 +02:00
Carla Kirk-Cohen
d6db6184f3
Merge pull request #348 from yyforyongyu/344-loop-quote
looprpc: add verbose resp in loop quote
2021-03-11 21:23:05 +02:00
Carla Kirk-Cohen
4d9d398b23
Merge pull request #349 from ellemouton/validate-dest-addr-network
loopd: verify that dest addr is for correct chain
2021-03-09 09:18:35 +02:00
Elle Mouton
5399e60554 loopd: verify that dest addr is for correct chain
This commit adds verification to the loop out request to ensure that the
formatting of the specified destination address matches the network that
lnd is running on.
2021-03-08 11:41:54 +02:00
Elle Mouton
5c34dd1177 loopd: refactor loop out request validation
This commit moves loop out request validation for labels and
confirmation targets into its own function for the purpose of easy
testing and also to make the additions of future request validation easy
to add and test.
2021-03-08 11:40:42 +02:00
yyforyongyu
c4d46a24a0
looprpc: add conf_target to loop in/out quote resp 2021-03-08 02:23:25 +08:00
carla
90561f8ac7
multi: add fee percentage to rpc 2021-03-04 10:14:52 +02:00
carla
dd1a2de731
multi: add flat fee percentage to autoloop 2021-03-04 10:14:37 +02:00
carla
c778124718
liquidity: move fees behind interface 2021-03-04 10:14:35 +02:00
Carla Kirk-Cohen
fd4214e68d
Merge pull request #333 from carlaKC/autoloop-3-peerrules
autoloop: add peer level rules for aggregate liquidity management
2021-02-17 14:31:42 +02:00
carla
b9aae4f8f9
loop: add peer rules to set rule command 2021-02-17 14:12:56 +02:00
carla
949e76bb2a
looprpc: add peer level rules to rpc 2021-02-17 10:56:32 +02:00
Andras Banki-Horvath
591a244867
loop: add sane default for --lnd.macaroonpath 2021-02-11 18:38:49 +01:00
carla
22bd4cabb4
looprpc: add disqualified channels to suggest swaps response 2021-02-08 09:39:03 +02:00
carla
7c4d71b175
liquidity: add reasons for autoloops not executing 2021-02-08 09:39:02 +02:00
carla
7ba1821696
liquidity: fail suggest swaps when no rules are set
In an effort to surface more information about why autoloop is not
executing, we add an error when suggest swaps is called with no rules.
In other cases we can surface a reason enum with each rule that is set,
but in the case where we have no rules, there are no results to
accompany with reasons.
2021-02-08 09:38:23 +02:00
Oliver Gugger
2a089d131e
loopd: all only specifying one lnd macaroon
Fixes #299 by allowing only one macaroon to be specified in the
--lnd.macaroonpath config option/command line flag.
2021-02-05 12:55:45 +01:00
carla
476ae39ce9
multi: make server side restrictions function generic 2021-02-03 08:54:50 +02:00
carla
24aa429aa0
liquidity: rename ticker and default to autoloop 2021-02-03 08:54:49 +02:00
carla
71ace95ac8
loop: rename autoloop specific parameters 2021-02-03 08:54:48 +02:00
carla
a168ba3400
liquidity: rename auto out boolean to autoloop 2021-02-03 08:54:47 +02:00
Carla Kirk-Cohen
d85cc010b0
Merge pull request #327 from carlaKC/325-waitunlocked
loopd: wait for lnd to be unlocked on startup
2021-01-14 09:24:19 +02:00
carla
3818e4576e
loopd: wait for lnd to be unlocked before starting 2021-01-14 09:15:09 +02:00
carla
6c2d88b3a5
multi: bump lndclient to version with wait for unlock 2021-01-14 09:13:01 +02:00
Oliver Gugger
1a57e03df4
loopd: pass macaroon root key ID in context 2021-01-07 17:33:21 +01:00
Oliver Gugger
fb9034220c
mod: update lnd to v0.12.0 2021-01-07 17:33:21 +01:00
carla
74f2c96810
looprpc: add custom client sizes for autoloop 2020-12-01 13:06:37 +02:00
carla
3f0fc14c34
liquidity: allow custom autoloop swap sizes within the server's limits 2020-12-01 13:06:35 +02:00
Oliver Gugger
8758d00862
loopd: add initiator to swap requests 2020-11-09 12:57:32 +01:00
carla
87b02b7715
multi: add force tick endpoint behind debug server
To itest our autolooper, we need to be able to trigger dispatch on
demand. This functionality is included in a separate rpc server behind
a dev flag. Since it is unlikely that we need to split loop into
multiple rpc servers, this commit simply adds an additional debug server
rather than opting for a full subserver setup.
2020-10-15 13:53:27 +02:00