Commit Graph

304 Commits

Author SHA1 Message Date
Michael Schmoock
b7abc6f188 drain: update requirements.txt 2020-11-30 10:38:44 +01:00
Michael Schmoock
7ae25feb1f drain: fix Millisatoshi from float bug
This was compatible in the past but pyln changed and
doing e.g. `10000msat * 0.01 * percentage` became unreliable
on rounding errors.
2020-11-30 10:38:44 +01:00
Michael Schmoock
9ee7006de2 drain: test openchannel instead of fund_channel
The usage of fund_channel is no longer recommended as of
main repo e802b128

The return value of pyln funchannel has changed to a tuple
as of main repo de34f08b

The usage of fundchannel is no longer supported by Travis
for unknown reasons
2020-11-30 10:38:44 +01:00
Michael Schmoock
96a5ff8306 feeadjuster: fix check-python flak8 nits 2020-11-29 16:30:02 +01:00
Michael Schmoock
d38cad534a feeadjuster: remaining test flakes and cleanups 2020-11-29 16:30:02 +01:00
Antoine Poinsot
8c2be06595 feeadjuster: test fee adjustment in init
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-11-29 16:30:02 +01:00
Antoine Poinsot
b9f321d586 feeadjuster: misc cleanups in imbalance test
Be sure to catch the actual line we want to catch (one per scid), and
remove an unused variable.

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-11-29 16:30:02 +01:00
Gálli Zoltán
00fe0c209e feeadjuster: final nits 2020-11-28 14:49:26 +01:00
Gálli Zoltán
7c798a423b feeadjuster: nit fixes
- no default parameter for maybe_setchannelfee
- using fstring
- log adjustment function name instead of reference
2020-11-28 14:49:26 +01:00
Gálli Zoltán
6bbd26af18 feeadjuster: review fixes
- forcefeeadjust method becomes feeadjust
- call feeadjust in plugin init
- prevent calling setchannelfee multiple times with the same parameters
- new optional get_ratio_hard and get_ratio_soft functions
- safety check in get_ratio functions
- maybe_setchannelfee is more concise thanks to @m-schmoock
- new test cases by @m-schmoock
2020-11-28 14:49:26 +01:00
Gálli Zoltán
ca518fd291 feeadjuster: forcefeeadjust can run after a successful payment too 2020-11-28 14:49:26 +01:00
Gálli Zoltán
a431fe0495 feeadjuster: method to adjust all existing channels
After start using this plugin, now you have a method to adjust fees for all of your channels. Ideally called only once.

Also, now it is allowed to customize "feeadjuster-ratio-base" to set up fee ratio:
New fee = <default fee> * feeadjuster-ratio-base**(0.5 - <our liquidity ratio>)
2020-11-28 14:49:26 +01:00
Michael Schmoock
0cbee3fc48 backup: fix loglevel to just INFO 2020-11-27 12:05:51 +01:00
Michael Schmoock
040b3a3a35 backup: adds a basic README.md 2020-11-27 12:05:51 +01:00
Christian Decker
3a1a89ecf8 backup: Add a warning about the deprecated backup-destination flag 2020-11-25 19:26:44 +01:00
Christian Decker
f34787d065 backup: Rely solely on backup.lock and do not cache writes
Caching writes was causing us some issues if the startup of
`lightningd` didn't complete, i.e., the writes would happen on the
live DB, but we'd forget about them. Since we have the backup.lock
file in same directory as the plugin is running in, we no longer have
to defer the writes. This hugely simplifies our logic.

Fixes #155

Changelog-Fixed: backup: The plugin doesn't lose sync anymore if the startup is interrupted
2020-11-25 19:26:44 +01:00
Christian Decker
630d385a0b backup: Mark the backup-destination option as UNUSED
We'll start relying solely on the `backup.lock` file generated by the
`backup-cli`. But we keep the option so we don't automatically break
all configs that simply updated.
2020-11-25 19:26:44 +01:00
Michael Schmoock
355f0e7745 summary: fix test flakes 2020-11-23 11:54:36 +01:00
Michael Schmoock
2a798864f8 summary: fix bitstamp api 404 2020-11-23 11:54:36 +01:00
Michael Schmoock
5d274f67c4 summary: fix always-use-proxy check 2020-11-23 11:54:36 +01:00
Rusty Russell
6cd4726369 summary: use proxy if configuration says to.
All plugins should take care to do this if config
specifies always-use-proxy!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-11-13 14:24:00 +01:00
Michael Schmoock
df4b422491 fix: flaky test on feeadjuster 2020-11-11 12:00:27 +01:00
Michael Schmoock
dddc893414 doc: adds missing link to feeadjuster 2020-11-11 12:00:27 +01:00
Michael Schmoock
75c4194b03 feeadjuster: adds imbalance limiter 2020-11-11 12:00:27 +01:00
Michael Schmoock
ad9c5df9ef feeadjuster: remove unused loop 2020-11-11 12:00:27 +01:00
Michael Schmoock
9809cc2dfd feeadjuster: fix typos 2020-11-11 12:00:27 +01:00
Christian Decker
b7804408f4 noise: Add missing dependency on psutil>=5 2020-10-21 16:13:29 +02:00
Christian Decker
1a426fd940 autoreload: Remove the autoreload plugin
It has been superseded by the dynamic start / stop functionality added into
c-lightning itself.

Closes #108
2020-10-21 16:13:29 +02:00
Antoine Poinsot
78c24afe48 feeadjuster: allow to customize the update threshold
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-10-21 16:06:40 +02:00
Antoine Poinsot
c675979a21 jitrebalance: we might have many channel entries with one peer
Co-Authored-By: Michael Schmoock <michael@schmoock.net>
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-10-21 16:06:40 +02:00
Antoine Poinsot
3617674dc4 feeadjuster: fuzz update trigger treshold, add hysterisis
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-10-21 16:06:40 +02:00
Antoine Poinsot
26c25fc8ee feeadjuster: unparallelize
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-10-21 16:06:40 +02:00
Antoine Poinsot
2cb082d878 feeadjuster: test fee adjustment
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-10-21 16:06:40 +02:00
Antoine Poinsot
d80b30579e feeadjuster: only update fees on substantial unbalancing
5% is a rather conservative value

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-10-21 16:06:40 +02:00
Antoine Poinsot
4e5b26dd1e feeadjuster: always update the configuration's base and ppm fees
This avoids exponentially updating them by only multiplying constants.

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-10-21 16:06:40 +02:00
Antoine Poinsot
a86ef381e7 feeadjuster: a plugin to adjust fees depending on balancing
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-10-21 16:06:40 +02:00
Moller40
2464c328a2 autopilot: Improve calculation of available funds
Deduct the funds that are awaiting lockin and can't be used.
2020-10-20 12:45:35 +02:00
Moller40
de1cd7314f autopilot: Avoid "ZeroDivisionError: float division by zero"
Adding checks that prevents num_channels to be zero (or negative)
and by that avoiding zero division error.
2020-10-20 12:45:35 +02:00
Antoine Poinsot
89a4fa3f59 jitrebalance: handle the failure of the scid lookup in our peers
Somehow, it happened:
```
**BROKEN** lightningd: Plugin for htlc_accepted returned non-result response {"jsonrpc": "2.0", "id": 23, "error": {"code": -32600, "message": "Error while processing htlc_accepted: 'NoneType' object is not subscriptable", "traceback": "Traceback (most recent call last):\n  File \"/home/lightningd/.local/lib/python3.8/site-packages/pyln/client/plugin.py\", line 440, in _dispatch_request\n    result = self._exec_func(method.func, request)\n  File \"/home/lightningd/.local/lib/python3.8/site-packages/pyln/client/plugin.py\", line 427, in _exec_func\n    return func(*ba.args, **ba.kwargs)\n  File \"/home/lightningd/.lightning/plugins/jitrebalance/jitrebalance.py\", line 172, in on_htlc_accepted\n    if not peer['connected'] or chan['state'] != \"CHANNELD_NORMAL\":\nTypeError: 'NoneType' object is not subscriptable\n"}
```

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-10-15 19:35:43 +02:00
Michael Schmoock
08f3da8706 drain: fix test for clnd with exp features 2020-09-19 17:00:19 +02:00
Christian Decker
ef4c1bf1e8 readme: Add the Boltz Channel Creation Plugin 2020-09-04 16:29:27 +02:00
Antoine Poinsot
550cd2522a sauron: handle testnet API unreliability
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-08-30 10:48:01 +02:00
Christian Decker
f108a0580c travis: Reduce build parallelism 2020-08-29 19:43:19 +02:00
Christian Decker
746513bf5a helpme: Verify that the caller has specified an invoice
Reported-by: Sebastian Falbesoner <@theStack>
Fixes #107
2020-08-29 14:54:40 +02:00
Christian Decker
acdf3fb356 readme: Added two new plugins by @rbndg
Suggested-by: Reza <@rbndg>
2020-08-29 14:54:24 +02:00
Christian Decker
9f3ac44a77 prometheus: Change default port to 9750 as per port-allocation
We registered port 9750 the [port allocation] list for the prometheus project,
so we should use that port :-)

Suggested-by: Martin Milata <@mmilata>

[port allocation]: https://github.com/prometheus/prometheus/wiki/Default-port-allocations
2020-08-29 14:36:03 +02:00
Christian Decker
581a2fd568 drain: Disable test_setbalance if EXPERIMENTAL_FEATURES=1
Amounts seem not to match anymore, need to look into it.
2020-08-28 23:06:30 +02:00
Christian Decker
d029ccfd42 travis: Rerun failed tests to avoid flaking out 2020-08-28 23:06:30 +02:00
Christian Decker
40e2df377a travis: Giving up on coverage... 2020-08-28 23:06:30 +02:00
Christian Decker
7ea33d2497 travis: Bump bitcoind to v0.20.1 2020-08-28 23:06:30 +02:00