Commit graph

87 commits

Author SHA1 Message Date
daywalker90
e372b06773 summary: fix test flake
Some checks failed
Integration Tests (latest) / Test CLN=25.12.1, PY=3.10, BCD=31.0, EXP=1, DEP=0 (push) Has been cancelled
Integration Tests (latest) / Test CLN=25.12.1, PY=3.12, BCD=31.0, EXP=1, DEP=0 (push) Has been cancelled
Integration Tests (latest) / Test CLN=26.04.1, PY=3.10, BCD=31.0, EXP=1, DEP=0 (push) Has been cancelled
Integration Tests (latest) / Test CLN=26.04.1, PY=3.12, BCD=31.0, EXP=1, DEP=0 (push) Has been cancelled
Integration Tests (latest) / Test CLN=26.06.6, PY=3.10, BCD=31.0, EXP=1, DEP=0 (push) Has been cancelled
Integration Tests (latest) / Test CLN=26.06.6, PY=3.14, BCD=31.0, EXP=1, DEP=0 (push) Has been cancelled
Integration Tests (latest) / CI completion (push) Has been cancelled
Integration Tests (latest) / CI completion-1 (push) Has been cancelled
Integration Tests (latest) / CI completion-2 (push) Has been cancelled
```
          wait_for(lambda: l1.rpc.listpeers(l2id)["peers"][0]["connected"] is False)
          l1.daemon.wait_for_log("Peerstate wrote to datastore")
          time.sleep(1)
          s2 = l1.rpc.summary()

          # then
          avail1 = int(re.search(" ([0-9]*)% ", s1["channels"][2]).group(1))
          avail2 = int(re.search(" ([0-9]*)% ", s2["channels"][2]).group(1))
  >       assert avail1 == 100
  E       assert 50 == 100
```
2026-08-11 12:43:49 +02:00
dependabot[bot]
c0b768f3ed build(deps): bump cryptography from 49.0.0 to 50.0.0 in /summary
Some checks failed
Integration Tests (latest) / Test CLN=25.12.1, PY=3.10, BCD=31.0, EXP=1, DEP=0 (push) Has been cancelled
Integration Tests (latest) / Test CLN=25.12.1, PY=3.12, BCD=31.0, EXP=1, DEP=0 (push) Has been cancelled
Integration Tests (latest) / Test CLN=26.04.1, PY=3.10, BCD=31.0, EXP=1, DEP=0 (push) Has been cancelled
Integration Tests (latest) / Test CLN=26.04.1, PY=3.12, BCD=31.0, EXP=1, DEP=0 (push) Has been cancelled
Integration Tests (latest) / Test CLN=26.06.6, PY=3.10, BCD=31.0, EXP=1, DEP=0 (push) Has been cancelled
Integration Tests (latest) / Test CLN=26.06.6, PY=3.14, BCD=31.0, EXP=1, DEP=0 (push) Has been cancelled
Integration Tests (latest) / CI completion (push) Has been cancelled
Integration Tests (latest) / CI completion-1 (push) Has been cancelled
Integration Tests (latest) / CI completion-2 (push) Has been cancelled
Bumps [cryptography](https://github.com/pyca/cryptography) from 49.0.0 to 50.0.0.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/49.0.0...50.0.0)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-version: 50.0.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-06 12:12:27 +02:00
daywalker90
850f8d5675 summary: fix persist test flake
```
     def test_summary_persist(node_factory):
          # Set a low PeerThread interval so we can test quickly.
          opts = {"summary-availability-interval": 0.5, "may_reconnect": True}
          opts.update(pluginopt)
          l1, l2 = node_factory.line_graph(2, opts=opts)

          # when
          l1.daemon.logsearch_start = 0
          l1.daemon.wait_for_log("Creating a new datastore")
          l1.daemon.wait_for_log("Peerstate wrote to datastore")
          s1 = l1.rpc.summary()
          l2.stop()
          l1.restart()
          assert l1.daemon.is_in_log("Reopened datastore")
          l1.daemon.logsearch_start = len(l1.daemon.logs)
          l1.daemon.wait_for_log("Peerstate wrote to datastore")
          s2 = l1.rpc.summary()

          # then
          avail1 = int(re.search(" ([0-9]*)% ", s1["channels"][2]).group(1))
          avail2 = int(re.search(" ([0-9]*)% ", s2["channels"][2]).group(1))
  >       assert avail1 == 100
  E       assert 88 == 100

  test_summary.py:199: AssertionError
```

The first tick could happen while the peers were not yet connected
2026-07-30 13:23:20 +02:00
daywalker90
42625c5c96 summary: add reckless manifest 2026-07-24 15:18:49 +02:00
daywalker90
9ff215d936 summary: make summary-availability-window an actual integer option
We were converting it to an integer anyways
2026-06-26 18:15:45 +02:00
dependabot[bot]
2d053a11e1 build(deps): bump cryptography from 46.0.7 to 48.0.1 in /summary
Bumps [cryptography](https://github.com/pyca/cryptography) from 46.0.7 to 48.0.1.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/46.0.7...48.0.1)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-version: 48.0.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-16 14:01:43 +02:00
dependabot[bot]
c9db56f378 build(deps): bump the all-dependencies group across 2 directories with 2 updates
Updates the requirements on [pytest-rerunfailures](https://github.com/pytest-dev/pytest-rerunfailures) and [requests[socks]](https://github.com/psf/requests) to permit the latest version.

Updates `pytest-rerunfailures` from 16.1 to 16.2
- [Changelog](https://github.com/pytest-dev/pytest-rerunfailures/blob/master/CHANGES.rst)
- [Commits](https://github.com/pytest-dev/pytest-rerunfailures/compare/16.1...16.2)

Updates `requests[socks]` to 2.34.2
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.34.0...v2.34.2)

---
updated-dependencies:
- dependency-name: pytest-rerunfailures
  dependency-version: '16.2'
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: all-dependencies
- dependency-name: requests[socks]
  dependency-version: 2.34.2
  dependency-type: direct:production
  dependency-group: all-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-25 11:17:15 +02:00
dependabot[bot]
e64513582a build(deps): bump idna from 3.11 to 3.15 in /summary
Bumps [idna](https://github.com/kjd/idna) from 3.11 to 3.15.
- [Release notes](https://github.com/kjd/idna/releases)
- [Changelog](https://github.com/kjd/idna/blob/master/HISTORY.md)
- [Commits](https://github.com/kjd/idna/compare/v3.11...v3.15)

---
updated-dependencies:
- dependency-name: idna
  dependency-version: '3.15'
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-20 00:35:09 +02:00
daywalker90
6ecb2138d0 summary: update shebang versions and revert pyln versions 2026-05-12 22:52:52 +02:00
dependabot[bot]
2387b1a829 build(deps): bump the all-dependencies group across 2 directories with 5 updates
Updates the requirements on [pyln-client](https://github.com/ElementsProject/lightning), [requests[socks]](https://github.com/psf/requests), [pytest](https://github.com/pytest-dev/pytest), pyln-testing and pyln-proto to permit the latest version.

Updates `pyln-client` from 25.9.3 to 26.4.1
- [Release notes](https://github.com/ElementsProject/lightning/releases)
- [Changelog](https://github.com/ElementsProject/lightning/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ElementsProject/lightning/compare/v25.09.3...v26.04.1)

Updates `requests[socks]` to 2.33.1
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.23.0...v2.33.1)

Updates `pytest` from 8.4.2 to 9.0.3
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.4.2...9.0.3)

Updates `pyln-testing` from 25.9.3 to 26.4.1

Updates `pyln-proto` from 25.9.3 to 26.4.1

Updates `pyln-client` from 25.9.3 to 26.4.1
- [Release notes](https://github.com/ElementsProject/lightning/releases)
- [Changelog](https://github.com/ElementsProject/lightning/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ElementsProject/lightning/compare/v25.09.3...v26.04.1)

Updates `pyln-testing` from 25.9.3 to 26.4.1

Updates `pyln-proto` from 25.9.3 to 26.4.1

---
updated-dependencies:
- dependency-name: pyln-client
  dependency-version: 26.4.1
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: all-dependencies
- dependency-name: requests[socks]
  dependency-version: 2.33.1
  dependency-type: direct:production
  dependency-group: all-dependencies
- dependency-name: pytest
  dependency-version: 9.0.3
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: all-dependencies
- dependency-name: pyln-testing
  dependency-version: 26.4.1
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: all-dependencies
- dependency-name: pyln-proto
  dependency-version: 26.4.1
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: all-dependencies
- dependency-name: pyln-client
  dependency-version: 26.4.1
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: all-dependencies
- dependency-name: pyln-testing
  dependency-version: 26.4.1
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: all-dependencies
- dependency-name: pyln-proto
  dependency-version: 26.4.1
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: all-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-12 20:46:04 +02:00
daywalker90
49b36c707e ruff: update paths and rerun format 2026-05-12 15:33:07 +02:00
dependabot[bot]
d6c106e1b0 build(deps): bump urllib3 from 2.6.3 to 2.7.0 in /summary
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.6.3 to 2.7.0.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/2.6.3...2.7.0)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-version: 2.7.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-12 00:44:40 +02:00
dependabot[bot]
24b296a007 build(deps-dev): bump pytest from 8.4.2 to 9.0.3 in /summary
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.4.2 to 9.0.3.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.4.2...9.0.3)

---
updated-dependencies:
- dependency-name: pytest
  dependency-version: 9.0.3
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-11 23:35:58 +02:00
daywalker90
c3a2b4e360 summary: upgrade min version of python to 3.10 and pyln packages to v25.9 2026-04-20 13:46:22 +02:00
daywalker90
306cfadcc9 python plugins: add note for systemd and uv 2025-12-22 15:27:54 +01:00
daywalker90
0a6a9174be summary: fix test flake and format using ruff 2025-12-02 20:01:57 +01:00
daywalker90
877dc0f6b2 summary: migrate to uv shebang 2025-12-02 20:01:57 +01:00
Michael Schmoock
8f6bc53cad summary: fixes exclude testcase index out of range 2024-09-25 16:18:04 +02:00
Michael Schmoock
01ad1d5aef summary: fixes and restores the summary plugin 2024-09-25 16:18:04 +02:00
Chris Guida
3754a9e0f8 Demote autopilot, backup, donations, drain, helpme, historian, paytest, probe, prometheus, rebalance, and summary to the archive
drain: fix drain msats
drain: failing CI because of msats
historian: add inotify to historian deps
historian: update lockfile
2024-02-06 20:29:25 +00:00
Chris Guida
5305dbea0c Remove all references to DEVELOPER env var 2024-02-06 20:29:25 +00:00
Michael Schmoock
4138896223 summary: request ascii mode 2023-02-23 18:15:33 +01:00
Michael Schmoock
30003279e3 summary: check and dismiss old datastores 2023-02-10 18:33:43 +01:00
Michael Schmoock
e79545e9a2 summary: save datastore usage by compater objects 2023-02-10 18:33:43 +01:00
Michael Schmoock
b52360c0cd summary: replace shelve with datastore using pickle
Usage of python shelve caused a lot of issues in the past.
2023-02-10 18:33:43 +01:00
Michael Schmoock
07f9fcfa78 summary: optimize table alignment 2023-02-10 18:33:43 +01:00
Michael Schmoock
6e2b1274fc summary: lowercase the given parameter
Also renames the 'PERMIL' column to 'PPM' which, at least for me, is
more common when it comes to fees.
2023-02-10 18:33:43 +01:00
Michael Schmoock
24bad1c988 summary: adds sortkey parameter and argument 2023-02-10 18:33:43 +01:00
Michael Schmoock
d1d89047bf summary: sort output by scid per default
The sort order got changed to random(?) I think when cln changed to have
multiple channels per peer supprt.

This restores the old sort by scid order, which is nice since old
channels are upfront.

Maybe we can add other orderings in later commits by copfig options and
`summary` method paramters.
2023-02-10 18:33:43 +01:00
Michael Schmoock
b207d2ca9f summary: fix db init when shelve has binary format updates
Sometimes when shelve gets updated, the binary format can differ
and result in first write errors on a re-opened db.

This tries to check for that and drop DB in this case.
2023-02-10 18:33:43 +01:00
Michael Schmoock
fe07f0d578 summary: fix cli upstream changes on listpeerchannels 2023-02-08 15:32:42 +01:00
Vincenzo Palazzo
e70a526a05 increase pyln-client version in summary
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-01-06 17:02:31 +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
3514460ae8 summary: fixes a nasty test flake 2022-11-04 11:43:00 +01:00
Andrew Toth
d1a8db61cb summary: fix attribute errors 2022-09-19 10:45:31 +09:30
Ken Sedgwick
0f42425b65 summary: add fees_collected fiatstr 2022-09-16 12:32:39 +02:00
Ken Sedgwick
8529abd833 summary: use lowercase in bitstamp url 2022-07-30 12:30:19 +02:00
laanwj
6756681e54 summary: lightnind→lightningd in shutdown message 2022-04-28 12:59:54 +02:00
Michael Schmoock
69e02e23b1 cleanups: feeadjuster, drain and summary 2022-02-17 10:26:54 +01:00
Vincenzo Palazzo
22923724a9 summary: close the db when the lightningd will stop.
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2021-12-19 15:17:30 +01:00
Vincenzo Palazzo
a6829450db summary: check for all the extension of the db
Reported by: nathanael on IRC

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2021-12-19 15:17:30 +01:00
Vincenzo Palazzo
4d7ed5cb5f Make a sanity check during the initialization of the db
This commit try to solve the following exception with an additional sanity check:

```
{
   "code": -32600,
   "message": "Error while processing summary: 'Plugin' object has no attribute 'persist'",
   "traceback": "Traceback (most recent call last):\n  File \"/usr/local/lib/python3.8/site-packages/pyln/client/plugin.py\", line 627, in _dispatch_request\n    result = self._exec_func(method.func, request)\n  File \"/usr/local/lib/python3.8/site-packages/pyln/client/plugin.py\", line 609, in _exec_func\n    return func(*ba.args, **ba.kwargs)\n  File \"/home/_lightning/plugins/summary.py\", line 124, in summary\n    addpeer(plugin, p)\n  File \"/var/git/plugins/summary/summary_avail.py\", line 7, in addpeer\n    if pid not in p.persist['peerstate']:\nAttributeError: 'Plugin' object has no attribute 'persist'\n"
}
```

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2021-12-19 15:17:30 +01:00
LightningHelper
bcebb1ba2a added fee per channel
Knowing the fee per channel is very useful for fee selection.
I assume an option can be added to show the fees only if --details is an argument, but it will make the code a bit less clean.
2021-12-13 14:20:29 +01:00
Michael Schmoock
a83ec975ba summary: remove code duplication wait_for from pyln.testing.utils 2021-06-29 10:43:56 +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
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
Aido
defdc28915 summary: Add fees_collected info to output 2021-02-10 15:36:52 +01:00