pytest: also make sure askrene doesn't suffer when reloading many layers on startup.
What changed, and why it matters
This commit only changes a benchmark test file. It extends an existing performance test for the askrene feature to also measure startup time after saving and restoring many layers. There is no security-relevant change to production code, no bug fix, and no vulnerability patch.
No security action needed. This is a benign benchmark-only change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies tests/benchmark.py in Core Lightning. The test_askrene_layers benchmark now passes persistent=True (the second positional argument) when creating 100,000 askrene layers, then restarts the node and creates one more layer. This exercises the datastore-backed persistent layer reload path and increases the measured benchmark time from 29 to 45 seconds. It is purely a test/performance benchmark addition.
Changed components
tests/benchmark.pyInspect captured patch +4 / −1
diff --git a/tests/benchmark.py b/tests/benchmark.py
index 77d6a542..6b50282e 100644
--- a/tests/benchmark.py
+++ b/tests/benchmark.py
@@ -268,4 +268,7 @@ def test_askrene_layers(node_factory):
l1 = get_bench_node(node_factory)
NUM_LAYERS = 100_000
for i in range(NUM_LAYERS):
- l1.rpc.askrene_create_layer(f'test_askrene_layers-{i}')
+ l1.rpc.askrene_create_layer(f'test_askrene_layers-{i}', True)
+
+ l1.restart()
+ l1.rpc.askrene_create_layer(f'test_askrene_layers-{NUM_LAYERS}')
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.