Commit graph

549 commits

Author SHA1 Message Date
Rusty Russell
3fe4180b8c commando: minor cleanups to keep flake8/mypy happy.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-08-26 13:00:33 +09:30
Rusty Russell
c09149ec7f commando: add unique id as we hand our runes.
This allows us to blacklist them in future.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-08-26 12:53:04 +09:30
Rusty Russell
34be3b7edf commando: update now datastore uses arrays for keys
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-08-26 12:52:44 +09:30
Rusty Russell
bb5ed8b1de commando: don't let readonly default read the datastore.
That... would be dumb, since it holds the master secret!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-08-26 12:51:44 +09:30
Rusty Russell
b5f023a218 requirements.txt: update to runes version which is correctly packaged.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-08-26 12:51:44 +09:30
Rusty Russell
8868282207 commando: remove gratuitous logging.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-08-26 12:51:44 +09:30
Rusty Russell
503de089d1 commando: don't deadlock if the make us call into ourselves.
For now we only support calling into commando-rune, not chaining commando
commands!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-08-26 12:51:44 +09:30
Rusty Russell
48be26664f commando: optionally use runes for authorization.
Now it requires the datastore (or datastore.py plugin), if you want
to use runes.  The simple reader/writer control lists don't require
that, but for simplicity we always require the runes Python module.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-08-26 12:51:44 +09:30
Rusty Russell
6254a06b26 Feedback from GH Review.
1. Fix README.md dynamic plugin example (needs keywords, abspath!)
   (pointed out by @carnhofdaki).
2. Define magic number we use (suggested by @FreePietje)
2021-08-26 12:50:54 +09:30
Rusty Russell
c170ccea28 commando: reckless? Try going commando!
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-08-26 12:50:54 +09:30
Rusty Russell
d7bfc2204d datastore: fix emptying of store into upgraded node.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-08-25 18:10:40 +02:00
Rusty Russell
eac6b087da datastore: apply feedback from Christian Decker
And fix missing blank line (makes flake8 a bit happier).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-08-25 18:10:40 +02:00
Rusty Russell
0b9e6c9517 datastore: change keys into an array.
We store this internally as hex, since shelve insists on string keys.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-08-25 18:10:40 +02:00
Rusty Russell
2ec769e05b datastore.py: update to meet new datastore builtin PR.
The new datastore PR now has a generation count; this passes
the tests against that now.

Also copies tests from c-lightning, and adds ugprade test.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-08-25 18:10:40 +02:00
Michael Schmoock
941c1b7141 rebalance: nits 2021-08-22 23:16:51 +02:00
Gálli Zoltán
88bb8beacf rebalance: division by zero fix
this occurs if I don't have any transaction forward for a day
2021-08-19 10:07:28 +02:00
LightningHelper
0b400559f9 Add backup plugin to the table 2021-08-18 14:29:26 +02:00
LightningHelper
3da5778dcf explain that plugin can also be added to the config 2021-08-18 14:26:52 +02:00
LightningHelper
bfd80ada80 added instruction to stop the node before running the plugin
As instructed here:
https://github.com/ElementsProject/lightning/blob/master/doc/BACKUP.md#backup-plugin-and-remote-nfs-mount
2021-08-18 14:26:28 +02:00
Simon Vrouwe
44cf6ecaea backup: optimize restore and backup-compact
fix comments and typos, enable the `restore` progress bar
2021-08-18 14:26:00 +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
Michael Schmoock
9d70293c44 rebalance: add average_forward_fee_ppm for 1s 7d and 30d interval to report 2021-08-16 15:50:46 +02:00
Rusty Russell
1f6f701bf1 datastore: plugin to replicate datastore commands before next release.
See https://github.com/ElementsProject/lightning/pull/4674
(I manually tested that it passes all the tests there, too!)

When they finally upgrade the node, this automatically puts any
datastore data into the inbuilt datastore and shuts down.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-07-25 10:56:40 +09:30
Michael Schmoock
424770449a jitrebalance: fix missing payment_secret for sendpay 2021-07-23 17:04:14 +02:00
Rusty Russell
87c9f56f75 jitrebalance: 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
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
Rusty Russell
76b16a60b3 drain: fix for latest lightningd which require payment_secret.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-07-23 22:03:27 +09:30
Rusty Russell
a6e8a10618 rebalance: fix for next release.
We now insist on payment_secret, so rebalance fails!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-07-23 22:03:27 +09:30
guibressan
3aa58770bd drain: README.md correction 2021-07-23 11:42:37 +02:00
Billy Garrison
c06f898316 rebalance: fix example usage in readme
The parameters were in incorrect order, causing an error when user doesn't use with `-k`
2021-07-23 10:35:19 +02:00
Wladimir J. van der Laan
43fc3c6d34 backup: Implement automatic reconnect in socket backend
Add automatic reconnect (with exponential back-off) to the socket backend.

If the connection is lost while pusing a change, try to reconnect.
Handle edge-cases that might come up depending on when the disconnect
happaned.

Currently the parameters are hardcoded: it will retry 5 times,
on the first retry it will wait 5 seconds before reconnecting.
There is an exponential backoff of 1.5, so on the fifth try it
will wait about 25 seconds.

This is particularly useful when conencting over Tor, as transient
interruptions are fairly common there.
2021-07-23 17:44:38 +09:30
Michael Schmoock
9fdc57c3a2 drain: fix a broken log statement expansion 2021-06-30 13:01:52 +02:00
Michael Schmoock
85b8b440bb drain: a comment about necessary code duplication 2021-06-29 10:43:56 +02:00
Michael Schmoock
a83ec975ba summary: remove code duplication wait_for from pyln.testing.utils 2021-06-29 10:43:56 +02:00
Michael Schmoock
4c0e3aba67 rebalance: test for additional stop msg 2021-06-29 10:42:16 +02:00
Michael Schmoock
70d0977371 rebalance: return last rebalanceall_msg even when nothing was stopped
When the last `rebalanceall` run terminated silently in the background,
it is still useful to get the ending message of that run.

This change will make the `rebalancestop` method to return the same
'nothing to stop' message plus the rebalanceall_msg when there
was a `rebalanceall` somewhere in the past.
2021-06-29 10:42:16 +02:00
Michael Schmoock
ed98e657c1 rebalance: nits 2021-06-29 10:42:16 +02:00
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
0062e92011 summary: fix another flake
This will make the test to wait for one node to see that the second node
disconnected after using .stop().

For that it adds wait_for(lambda) testing utils method.
2021-06-25 13:34:58 +02:00
Michael Schmoock
321e5cecf1 monitor: fix flakyness
Sometimes a channels funding allocation was not yet readable
via listpeers which is why this plugin test was flaky.

Also makes use of funding_msat instead of deprecated fields.
2021-06-25 12:51:25 +02:00
Vincenzo Palazzo
5f3bb380cd Adding Java API to the list, and another bitcoin backend
The bitcoin backend plugin is inspired by #112 #214

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2021-06-25 11:52:50 +02:00
Michael Schmoock
5475f256ed summary: nits 2021-06-24 14:19:55 +02:00
Michael Schmoock
2afe310a6e summary: makes test_summary_persist more precise 2021-06-24 14:19:55 +02:00
Michael Schmoock
37022fbc15 summary: logs summary.dat shelve usage 2021-06-24 14:19:55 +02:00
Michael Schmoock
b862247e2b summary: logs PeerThred activity to debug
This will eliminate a potential flakyness of the tests
because we can use that log as a marker to wait for the PeerThread.
2021-06-24 14:19:55 +02:00
Zoltán Gálli
5f0fce5820
rebalance: measure liquidity health (#257)
rebalance: measure liquidity health
2021-06-24 11:42:58 +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