2
0
mirror of https://github.com/lightninglabs/loop synced 2024-11-08 01:10:29 +00:00
Commit Graph

165 Commits

Author SHA1 Message Date
Andras Banki-Horvath
00cf4bf71c
multi: make the next protocol version optional 2022-06-30 16:59:54 +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