Commit Graph

57 Commits

Author SHA1 Message Date
elsirion
d71c164188 Add median multiplier option to feeadjuster docs 2023-01-09 13:27:11 +01:00
elsirion
b52afa1762 Add option to scale median fee adjustment strategy 2023-01-09 13:27:11 +01:00
Michael Schmoock
81899006e2 feeadjuster: fix forward_event hook msat parsing
Subscribed notifications have never been handled by `pyln.client.Plugin()`
in a way that for `_msat` keys values have been replaced by `Millisatoshi()`
on the fly. This only was the case for normal JSON request/responses.

On recent cln versions, having `--allow-deprecated-apis=True`,
cln actually returns a string ending with `msat`, which is not
compatible with a `Millisatoshi()` when doing arithmetic operations.

See: https://github.com/ElementsProject/lightning/pull/5798
2022-12-27 12:56:17 +01:00
Michael Schmoock
ec75211f0a feeadjuster: fix python code nits 2022-12-26 13:56:30 +01:00
Michael Schmoock
4d8b258f8b feeadjuster: fix testflake in test_feeadjuster_imbalance 2022-12-26 13:52:00 +01:00
Gálli Zoltán
a778da4e10 feeadjuster: setchannelfee last two parameters are optional
- feeadjuster keeps crashing without this
2022-12-04 21:47:13 +01:00
Michael Schmoock
656068ba09 feeadjuster: rpcversion check for new format 2022-12-02 16:12:29 +01:00
Michael Schmoock
4d3560b129 reqirements: switch to pyln-client 0.12 for backup, drain, feeadj, rebalance and summary
This is required as newer versions of cln (>=0.12) use non numeric json
rpc IDs.
2022-11-04 11:43:00 +01:00
Michael Schmoock
2810f4d032 feeadjuster: update forward_event _msat values 2022-11-04 11:43:00 +01:00
openoms
0ecd10b27f feeadjuster: exclude list non-required and verbose 2022-08-28 10:45:46 +02:00
openoms
eb03e4fbed add option to exclude channels with nodes
skip setting channels with the IDs in the feeadjuster-exclude.list file
2022-08-24 18:20:10 +02:00
identity unknown
81f66f6185 Add a readme 2022-08-24 18:19:31 +02:00
identity unknown
89c6cb8f9c Add max htlc adjustment 2022-08-24 18:19:31 +02:00
Michael Schmoock
be688b0920 feeadjuster: improve setchannelfee deprecation detection 2022-04-27 22:19:11 +02:00
Michael Schmoock
5c43c7f3bf feeadjuster: upgrade to new setchannel command 2022-04-03 17:15:35 +02:00
Michael Schmoock
69e02e23b1 cleanups: feeadjuster, drain and summary 2022-02-17 10:26:54 +01:00
svewa
a207969404 another instance of unchecked short_channel_id access in fee_strategy: get_fees_median (#330)
* skip channels that are not (yet) locked in

* another unchecked request to ch['short_channel_id']

* this was meant to be the change.
2022-01-28 15:53:07 +01:00
svewa
f492affe2e skip channels that are not (yet) locked in 2022-01-27 17:40:48 +01:00
Michael Schmoock
125b2c650d feeadjuster: feature to adjust a specific channel
This adds an optional paramter to the `feeadjust` method which is `scid`
that will, if set, only adjust one channel. Default remains None which
will adjust all channels.
2021-08-29 13:44:13 +02:00
Michael Schmoock
1f968b247c feeadjuster: disable dynamic base fee scaling
This disables scaling of the base fee based on channel distortion and
instead always sets global config base fee.

The rationale behind this is that the base fee is meant to cover the
'fixed risk' of accepting an HTLC. In reality the risk may vary,
but this is unrelated on channel balance distortion but other factors.

We can have dynamic base fee per channel if we implent a better way
of competing and cost/risk coverage for this value.
2021-08-18 10:54:26 +02:00
Rusty Russell
ca375ad367 feeadjuster: fix test for latest c-lightning which required payment_secret
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-07-23 22:03:27 +09:30
Michael Schmoock
e7f2dbb606 feeadjuster: use listchannels by destination dynamically 2021-06-25 16:31:22 +02:00
Michael Schmoock
1d81d70fa4 feeadjuster: logs fee_strategy on startup 2021-06-25 16:31:22 +02:00
Michael Schmoock
a2c58e647d feeadjuster: adds switchable per channel fee strategy 2021-06-23 20:00:11 +02:00
Michael Schmoock
445bca51cb feeadjuster: simplified get_chan 2021-06-23 20:00:11 +02:00
Michael Schmoock
2074eeb30d feeadjuster: use listpeers to get local fees
Using gossip is not reliable and having fees in `listpeers` is
supported in `lightningd` since 0.9.3 (Jan 21).
2021-06-23 20:00:11 +02:00
Michael Schmoock
3e56d4d4d3 feeadjuster: cleanups 2021-06-23 20:00:11 +02:00
Michael Schmoock
92aafe7404 chore: rename feeadjustertoggle to feeadjuster-toggle 2021-01-19 12:17:30 +01:00
Gálli Zoltán
7c8840266d feeadjuster: no underscore in method name
cannot call methods from python framework with underscore in its name
6f924e63c2/contrib/pyln-client/pyln/client/lightning.py (L316)
2021-01-18 10:56:23 +01:00
Gálli Zoltán
bfb1cf5d27 feeadjuster toggle
possibility to turn off the forward event with config or plugin method
2021-01-14 12:53:32 +01:00
Gálli Zoltán
31dcc8cf09 feeadjuster: CI test fix 2020-12-21 15:00:38 +01:00
Gálli Zoltán
be10209355 feeadjuster: review fixes part 4 2020-12-21 15:00:38 +01:00
Gálli Zoltán
0dbafa1abd feeadjuster: review fixes part 3
- enough liquidity feature is turned off by default
2020-12-21 15:00:38 +01:00
Gálli Zoltán
0a3fe31056 feeadjuster: review fixes part 2 2020-12-21 15:00:38 +01:00
Gálli Zoltán
fabb7d370a feeadjuster: review fixes 2020-12-21 15:00:38 +01:00
Gálli Zoltán
5f71204f33 feeadjuster: option to handle big channels differently
- nit: lots of fstring
2020-12-21 15:00:38 +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
df4b422491 fix: flaky test on 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
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