Skip to content

Commit 4eb19d5

Browse files
committed
autoclean: clean network events (30 days by default).
We also document this in the listnetworkevents command itself. The test_autoclean_once was getting repetitive, so I cleaned that up too. Signed-off-by: Rusty Russell <[email protected]> Changelog-Added: `autoclean` will remove networkevents after 30 days by default.
1 parent da33aba commit 4eb19d5

File tree

12 files changed

+1495
-1161
lines changed

12 files changed

+1495
-1161
lines changed

.msggen.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,7 @@
791791
"AutoClean-Once.autoclean.expiredinvoices": 6,
792792
"AutoClean-Once.autoclean.failedforwards": 2,
793793
"AutoClean-Once.autoclean.failedpays": 4,
794+
"AutoClean-Once.autoclean.networkevents": 7,
794795
"AutoClean-Once.autoclean.paidinvoices": 5,
795796
"AutoClean-Once.autoclean.succeededforwards": 1,
796797
"AutoClean-Once.autoclean.succeededpays": 3
@@ -807,6 +808,10 @@
807808
"AutoClean-Once.autoclean.failedpays.cleaned": 1,
808809
"AutoClean-Once.autoclean.failedpays.uncleaned": 2
809810
},
811+
"Autoclean-onceAutocleanNetworkevents": {
812+
"AutoClean-Once.autoclean.networkevents.cleaned": 1,
813+
"AutoClean-Once.autoclean.networkevents.uncleaned": 2
814+
},
810815
"Autoclean-onceAutocleanPaidinvoices": {
811816
"AutoClean-Once.autoclean.paidinvoices.cleaned": 1,
812817
"AutoClean-Once.autoclean.paidinvoices.uncleaned": 2
@@ -830,6 +835,7 @@
830835
"AutoClean-Status.autoclean.expiredinvoices": 6,
831836
"AutoClean-Status.autoclean.failedforwards": 2,
832837
"AutoClean-Status.autoclean.failedpays": 4,
838+
"AutoClean-Status.autoclean.networkevents": 7,
833839
"AutoClean-Status.autoclean.paidinvoices": 5,
834840
"AutoClean-Status.autoclean.succeededforwards": 1,
835841
"AutoClean-Status.autoclean.succeededpays": 3
@@ -849,6 +855,11 @@
849855
"AutoClean-Status.autoclean.failedpays.cleaned": 2,
850856
"AutoClean-Status.autoclean.failedpays.enabled": 1
851857
},
858+
"Autoclean-statusAutocleanNetworkevents": {
859+
"AutoClean-Status.autoclean.networkevents.age": 3,
860+
"AutoClean-Status.autoclean.networkevents.cleaned": 2,
861+
"AutoClean-Status.autoclean.networkevents.enabled": 1
862+
},
852863
"Autoclean-statusAutocleanPaidinvoices": {
853864
"AutoClean-Status.autoclean.paidinvoices.age": 3,
854865
"AutoClean-Status.autoclean.paidinvoices.cleaned": 2,
@@ -4571,6 +4582,18 @@
45714582
"added": "pre-v0.10.1",
45724583
"deprecated": null
45734584
},
4585+
"AutoClean-Once.autoclean.networkevents": {
4586+
"added": "v25.12",
4587+
"deprecated": null
4588+
},
4589+
"AutoClean-Once.autoclean.networkevents.cleaned": {
4590+
"added": "v25.12",
4591+
"deprecated": null
4592+
},
4593+
"AutoClean-Once.autoclean.networkevents.uncleaned": {
4594+
"added": "v25.12",
4595+
"deprecated": null
4596+
},
45744597
"AutoClean-Once.autoclean.paidinvoices": {
45754598
"added": "pre-v0.10.1",
45764599
"deprecated": null
@@ -4667,6 +4690,22 @@
46674690
"added": "pre-v0.10.1",
46684691
"deprecated": null
46694692
},
4693+
"AutoClean-Status.autoclean.networkevents": {
4694+
"added": "v25.12",
4695+
"deprecated": null
4696+
},
4697+
"AutoClean-Status.autoclean.networkevents.age": {
4698+
"added": "v25.12",
4699+
"deprecated": null
4700+
},
4701+
"AutoClean-Status.autoclean.networkevents.cleaned": {
4702+
"added": "v25.12",
4703+
"deprecated": null
4704+
},
4705+
"AutoClean-Status.autoclean.networkevents.enabled": {
4706+
"added": "v25.12",
4707+
"deprecated": null
4708+
},
46704709
"AutoClean-Status.autoclean.paidinvoices": {
46714710
"added": "pre-v0.10.1",
46724711
"deprecated": null

cln-grpc/proto/node.proto

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cln-grpc/src/convert.rs

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cln-rpc/src/model.rs

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contrib/msggen/msggen/schema.json

Lines changed: 101 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1851,7 +1851,8 @@
18511851
"succeededpays",
18521852
"failedpays",
18531853
"paidinvoices",
1854-
"expiredinvoices"
1854+
"expiredinvoices",
1855+
"networkevents"
18551856
],
18561857
"description": [
18571858
"What subsystem to clean. Currently supported subsystems are:",
@@ -1860,7 +1861,8 @@
18601861
" * `failedpays`: payment attempts which did not succeed (`failed` in listpays `status`).",
18611862
" * `succeededpays`: payment attempts which succeeded (`complete` in listpays `status`).",
18621863
" * `expiredinvoices`: invoices which were not paid (and cannot be) (`expired` in listinvoices `status`).",
1863-
" * `paidinvoices`: invoices which were paid (`paid` in listinvoices `status)."
1864+
" * `paidinvoices`: invoices which were paid (`paid` in listinvoices `status).",
1865+
" * `networkevents`: all events in listnetworkevents (added *v25.12*)"
18641866
]
18651867
},
18661868
"age": {
@@ -2012,6 +2014,31 @@
20122014
]
20132015
}
20142016
}
2017+
},
2018+
"networkevents": {
2019+
"type": "object",
2020+
"additionalProperties": false,
2021+
"added": "v25.12",
2022+
"required": [
2023+
"cleaned",
2024+
"uncleaned"
2025+
],
2026+
"properties": {
2027+
"cleaned": {
2028+
"added": "v25.12",
2029+
"type": "u64",
2030+
"description": [
2031+
"Total number of deletions done this run."
2032+
]
2033+
},
2034+
"uncleaned": {
2035+
"added": "v25.12",
2036+
"type": "u64",
2037+
"description": [
2038+
"The total number of entries *not* deleted this run."
2039+
]
2040+
}
2041+
}
20152042
}
20162043
}
20172044
}
@@ -2086,7 +2113,8 @@
20862113
"succeededpays",
20872114
"failedpays",
20882115
"paidinvoices",
2089-
"expiredinvoices"
2116+
"expiredinvoices",
2117+
"networkevents"
20902118
],
20912119
"description": [
20922120
"What subsystem to ask about. Currently supported subsystems are:",
@@ -2095,7 +2123,8 @@
20952123
" * `failedpays`: payment attempts which did not succeed (`failed` in listpays `status`).",
20962124
" * `succeededpays`: payment attempts which succeeded (`complete` in listpays `status`).",
20972125
" * `expiredinvoices`: invoices which were not paid (and cannot be) (`expired` in listinvoices `status`).",
2098-
" * `paidinvoices`: invoices which were paid (`paid` in listinvoices `status)."
2126+
" * `paidinvoices`: invoices which were paid (`paid` in listinvoices `status).",
2127+
" * `networkevents`: all events in listnetworkevents (added *v25.12*)"
20992128
]
21002129
}
21012130
}
@@ -2481,6 +2510,72 @@
24812510
"cleaned": {}
24822511
}
24832512
}
2513+
},
2514+
"networkevents": {
2515+
"type": "object",
2516+
"added": "v25.12",
2517+
"additionalProperties": true,
2518+
"required": [
2519+
"enabled",
2520+
"cleaned"
2521+
],
2522+
"properties": {
2523+
"enabled": {
2524+
"type": "boolean",
2525+
"added": "v25.12",
2526+
"description": [
2527+
"Whether autocleaning is enabled for networkevents."
2528+
]
2529+
},
2530+
"cleaned": {
2531+
"type": "u64",
2532+
"added": "v25.12",
2533+
"description": [
2534+
"Total number of deletions done (ever)."
2535+
]
2536+
}
2537+
},
2538+
"if": {
2539+
"additionalProperties": true,
2540+
"properties": {
2541+
"enabled": {
2542+
"type": "boolean",
2543+
"enum": [
2544+
true
2545+
]
2546+
}
2547+
}
2548+
},
2549+
"then": {
2550+
"additionalProperties": false,
2551+
"required": [
2552+
"enabled",
2553+
"age",
2554+
"cleaned"
2555+
],
2556+
"properties": {
2557+
"enabled": {},
2558+
"cleaned": {},
2559+
"age": {
2560+
"added": "v25.12",
2561+
"type": "u64",
2562+
"description": [
2563+
"Age (in seconds) to clean networkevents."
2564+
]
2565+
}
2566+
}
2567+
},
2568+
"else": {
2569+
"additionalProperties": false,
2570+
"required": [
2571+
"enabled",
2572+
"cleaned"
2573+
],
2574+
"properties": {
2575+
"enabled": {},
2576+
"cleaned": {}
2577+
}
2578+
}
24842579
}
24852580
}
24862581
}
@@ -21778,7 +21873,8 @@
2177821873
"title": "Command for querying network events",
2177921874
"added": "v25.12",
2178021875
"description": [
21781-
"The **listnetworkevents** RPC command retrieves the log of connections, disconnections and pings on the network. This can be analyzed to evaluate node reliability and latency."
21876+
"The **listnetworkevents** RPC command retrieves the log of connections, disconnections and pings on the network. This can be analyzed to evaluate node reliability and latency.",
21877+
"Note: the `autoclean` plugin deletes network events older than 30 days; you can adjust `autoclean-networkevents-age` to change this"
2178221878
],
2178321879
"categories": [
2178421880
"readonly"

contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py

Lines changed: 1082 additions & 1078 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)