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

102 Commits

Author SHA1 Message Date
longxiangqiao
273422eef7 chore: fix some comments for struct field
Signed-off-by: longxiangqiao <longxiangqiao@qq.com>
2024-07-13 13:50:12 +08:00
chengehe
0aff202988 chore: make function comments match function names
Signed-off-by: chengehe <hechenge@yeah.net>
2024-06-06 17:39:29 +08:00
Slyghtning
402d9a84df
gomod: bump lnd to version 0.18.0-beta 2024-05-31 09:39:20 +02:00
Boris Nagaev
3be5a37cd3
liquidity: fix flaky autoloop test
This failure became normal recently:

=== RUN   TestAutoLoopInEnabled
    autoloop_testcontext_test.go:318:
        	Error Trace:	/home/runner/work/loop/loop/liquidity/autoloop_testcontext_test.go:318
        	            				/home/runner/work/loop/loop/liquidity/autoloop_test.go:804
        	Error:      	Not equal:
        	            	expected: 80000
        	            	actual  : 160000
        	Test:       	TestAutoLoopInEnabled
    autoloop_testcontext_test.go:318:
        	Error Trace:	/home/runner/work/loop/loop/liquidity/autoloop_testcontext_test.go:318
        	            				/home/runner/work/loop/loop/liquidity/autoloop_test.go:804
        	Error:      	Not equal:
        	            	expected: 160000
        	            	actual  : 80000
        	Test:       	TestAutoLoopInEnabled
    autoloop_testcontext_test.go:343:
        	Error Trace:	/home/runner/work/loop/loop/liquidity/autoloop_testcontext_test.go:343
        	            				/home/runner/work/loop/loop/liquidity/autoloop_test.go:804
        	Error:      	Should be true
        	Test:       	TestAutoLoopInEnabled

The root cause is them the order of items in c.quoteRequestIn depends on the
order of loopInBuilder.buildSwap calls, which depends on the order of channel
handling in Manager.SuggestSwaps, which depends on the order of map traversal,
which is not determitistic.

Since in the test all the amounts are different, I used amount as a key and
put the expected calls into a map using amount as a key. When I extract an
item from c.quoteRequestIn channel, I find the corresponding item in the map
and remove it. All other logic is preserved.
2024-05-30 15:41:51 -03:00
Boris Nagaev
e30cb5f2a8
multi: apply make fmt 2024-04-23 15:18:15 -03:00
George Tsagkarelis
a9be69b281
multi: use isExternalAddr flag 2024-01-23 20:38:07 +02:00
András Bánki-Horváth
7dd30a731e
Merge pull request #644 from bhandras/easy-autoloop-destaddr-fixup
liquidity: dest address support for easy autloop
2023-10-04 14:26:00 +02:00
Andras Banki-Horvath
87c8ca0d8b
liquidity: dest address support for easy autloop 2023-10-04 14:18:37 +02:00
Oliver Gugger
08026dab93
multi: update linter, fix issues 2023-10-03 19:36:40 +02:00
Slyghtning
fd6a9cf3e9
loopin: consider settled invoices success 2023-09-01 13:09:10 +02:00
George Tsagkarelis
e9bc1dcc9e
multi: add initiator to mocked interfaces for tests 2023-07-28 14:43:19 +03:00
George Tsagkarelis
921f4d06e7
multi: integrate initiator string to various calls 2023-07-28 14:43:18 +03:00
Slyghtning
21281e3eb8
liquidity: xpub support for autoloop 2023-07-27 13:51:53 +02:00
Konstantin Nick
0781cafbfb
Merge pull request #585 from sputn1ck/sqlite
Migrate from boltdb to sql
2023-06-20 19:54:37 +02:00
sputn1ck
becc8a38d8
multi: use context in loopdb call
This commit adds a context to our loopdb interface, which we should use
in the sqlite migration.
2023-06-19 12:28:32 +02:00
George Tsagkarelis
afca558817
liquidity: add false-positive checks on autoloop tests 2023-06-14 16:27:46 +03:00
George Tsagkarelis
dbb49cfa05
liquidity: test low feeppm case for easyautoloop 2023-06-14 15:58:44 +03:00
George Tsagkarelis
64d2cbe5d6
liquidity: respect feeppm if set for easyautoloop 2023-06-14 15:53:09 +03:00
George Tsagkarelis
319a519309
Merge pull request #591 from GeorgeTsagk/autoloop-easy-tag
Autoloop easy tag
2023-06-05 17:49:51 +03:00
George Tsagkarelis
dcc28936ce
liquidity: bump miner multiplier in autoloop-in test
After the FeePPM miner fee fix there has probably been a race condition
in this test. The test would expect only one of the two quotes to work,
as one had a marginally high miner fee. After the FeePPM fix that miner
fee was considered valid and we dispatched two swaps instead of one,
with the test setup examining the first one that reached the go channel.
2023-06-02 14:08:10 +03:00
George Tsagkarelis
1f72dcc095
liquidity: use easy autoloop labels 2023-06-02 14:00:58 +03:00
George Tsagkarelis
a48924a664
liquidity: get autoloop flag directly from params
Previously we would exclusively pass the autoloop boolean to multiple
functions while they had directly access to the manager's parameters.
With this commit we remove this explicit flag from the various function
interfaces and retrieve the value directly from the parameters.
2023-05-29 13:24:16 +03:00
George Tsagkarelis
9a9766775a
liquidity: add easy autoloop test 2023-05-22 15:48:38 +03:00
George Tsagkarelis
fad9f40ae3
liquidity+loopd: add easy autoloop
Adds the easy autoloop function which executes a budget update and the
best easy-autoloop swap. The easy-autoloop function re-uses functions
used in the normal autoloop that relate to on-going swaps and traffic
summary.
2023-05-22 15:48:38 +03:00
George Tsagkarelis
36f014ac0a
liquidity: fix tests to reflect new miner fee scaling 2023-05-12 14:21:39 +03:00
George Tsagkarelis
102d3cdd1a
liquidity: differentiate autoloop expected vs max miner fees 2023-05-12 14:21:39 +03:00
George Tsagkarelis
bf4f72fd8d
liquidity: exclude prepay from total swap fees 2023-04-12 19:02:13 +03:00
Andras Banki-Horvath
4d34eb97ce
build: fixup new linter issues 2023-03-29 15:56:40 +02:00
George Tsagkarelis
55c769ef9d
liquidity: parse old auto budget to new parameters 2023-03-20 17:20:56 +02:00
George Tsagkarelis
aca6428b0e
liquidity+loopd: move last budget refresh to parameters 2023-03-16 02:10:32 +02:00
George Tsagkarelis
c17e5a6fc6
liquidity: fix tests for autoloop sticky loop out 2023-03-09 00:43:07 +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
3b896babc6
liquidity: add test for recurring budget 2023-02-22 19:48:04 +02:00
George Tsagkarelis
5d6be011f9
liquidity: tweak autoloop tests for recurring budget 2023-02-22 19:48:04 +02:00
George Tsagkarelis
b025b9ae37
multi: add recurring autoloop budget 2023-02-22 19:48:03 +02:00
George Tsagkarelis
a14f6e8bd6
liquidity: add autoloop test for outaddr 2022-12-16 12:02:46 +02:00
George Tsagkarelis
fa0393b331
multi: add OutAddr parameter for autoloop loop out 2022-12-16 12:02:46 +02: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
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
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
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
yyforyongyu
9c5ac0fb36
liquidity: move parameters into a new file
This commit refactors the `liquidity` by moving `Parameters` related
code into one file.
2022-06-07 19:19:52 +08:00
Oliver Gugger
d5952f1202
multi: bump all dependency to use lnd 0.15.0-beta.rc4
This commit bumps all dependencies to be in line with what's required
for the current release candidate of lnd 0.15.0-beta.
2022-06-03 10:50:47 +02:00
sputn1ck
a1271fee40
multi: fix linter issues 2022-05-20 10:16:46 +02:00
Harsha Goli
7a16e3b25d
multi: bump btcec/v2 and btcutil to new versions 2022-03-25 11:00:16 +01:00
carla
66d16f52a7
liquidity/test: add autoloop in tests 2021-12-15 09:01:23 +02:00
carla
5280721636
multi: add ability to autoloop in 2021-12-15 09:01:22 +02:00
carla
f6c3d77c51
liquidity/test: use mock for server restrictions
This change makes the test easier to change when we add loop in
restrictions as well.
2021-12-15 09:01:21 +02:00