Skip to content

Commit aa42ed7

Browse files
committed
askrene: add timestamp to biases
We add one more field to biases: "timestamp". With the timestamp variable old biases can be removed with the askrene-age command. Changelog-Added: Plugins: askrene channel biases now have an associated timestamp, and are timed out by askrene-age Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
1 parent 85e97bf commit aa42ed7

File tree

15 files changed

+291
-150
lines changed

15 files changed

+291
-150
lines changed

.msggen.json

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,8 @@
594594
"AskRene-Bias-Channel.biases[].bias": 3,
595595
"AskRene-Bias-Channel.biases[].description": 4,
596596
"AskRene-Bias-Channel.biases[].layer": 1,
597-
"AskRene-Bias-Channel.biases[].short_channel_id_dir": 2
597+
"AskRene-Bias-Channel.biases[].short_channel_id_dir": 2,
598+
"AskRene-Bias-Channel.biases[].timestamp": 5
598599
},
599600
"Askrene-bias-channelRequest": {
600601
"AskRene-Bias-Channel.bias": 3,
@@ -631,7 +632,8 @@
631632
"Askrene-create-layerLayersBiases": {
632633
"AskRene-Create-Layer.layers[].biases[].bias": 2,
633634
"AskRene-Create-Layer.layers[].biases[].description": 3,
634-
"AskRene-Create-Layer.layers[].biases[].short_channel_id_dir": 1
635+
"AskRene-Create-Layer.layers[].biases[].short_channel_id_dir": 1,
636+
"AskRene-Create-Layer.layers[].biases[].timestamp": 4
635637
},
636638
"Askrene-create-layerLayersChannelUpdates": {
637639
"AskRene-Create-Layer.layers[].channel_updates[].delay": 5,
@@ -704,7 +706,8 @@
704706
"Askrene-listlayersLayersBiases": {
705707
"AskRene-ListLayers.layers[].biases[].bias": 2,
706708
"AskRene-ListLayers.layers[].biases[].description": 3,
707-
"AskRene-ListLayers.layers[].biases[].short_channel_id_dir": 1
709+
"AskRene-ListLayers.layers[].biases[].short_channel_id_dir": 1,
710+
"AskRene-ListLayers.layers[].biases[].timestamp": 4
708711
},
709712
"Askrene-listlayersLayersChannelUpdates": {
710713
"AskRene-ListLayers.layers[].channel_updates[].cltv_expiry_delta": 7,
@@ -3985,6 +3988,10 @@
39853988
"added": "v24.11",
39863989
"deprecated": null
39873990
},
3991+
"AskRene-Bias-Channel.biases[].timestamp": {
3992+
"added": "v25.12",
3993+
"deprecated": null
3994+
},
39883995
"AskRene-Bias-Channel.description": {
39893996
"added": "v24.11",
39903997
"deprecated": null
@@ -4073,6 +4080,10 @@
40734080
"added": "v24.11",
40744081
"deprecated": null
40754082
},
4083+
"AskRene-Create-Layer.layers[].biases[].timestamp": {
4084+
"added": "v25.12",
4085+
"deprecated": null
4086+
},
40764087
"AskRene-Create-Layer.layers[].channel_updates[]": {
40774088
"added": "v24.11",
40784089
"deprecated": null
@@ -4281,6 +4292,10 @@
42814292
"added": "v24.11",
42824293
"deprecated": null
42834294
},
4295+
"AskRene-ListLayers.layers[].biases[].timestamp": {
4296+
"added": "v25.12",
4297+
"deprecated": null
4298+
},
42844299
"AskRene-ListLayers.layers[].channel_updates[]": {
42854300
"added": "v24.11",
42864301
"deprecated": null

cln-grpc/proto/node.proto

Lines changed: 3 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: 3 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: 6 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: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@
202202
"title": "Command for expiring information in a layer",
203203
"added": "v24.11",
204204
"description": [
205-
"The **askrene-age** RPC command tells askrene that information added to a layer by *askrene-inform-channel* beyond a certain age is less useful. It currently completely forgets constraints older than *cutoff*."
205+
"The **askrene-age** RPC command tells askrene that information added to a layer by *askrene-inform-channel* and *askrene-bias-channel* beyond a certain age is less useful. It currently completely forgets constraints and biases older than *cutoff*."
206206
],
207207
"request": {
208208
"required": [
@@ -338,7 +338,8 @@
338338
"required": [
339339
"layer",
340340
"short_channel_id_dir",
341-
"bias"
341+
"bias",
342+
"timestamp"
342343
],
343344
"additionalProperties": false,
344345
"properties": {
@@ -365,6 +366,13 @@
365366
"description": [
366367
"The bias (-100 to +100)"
367368
]
369+
},
370+
"timestamp": {
371+
"type": "u64",
372+
"added": "v25.12",
373+
"description": [
374+
"The UNIX timestamp when this bias was created."
375+
]
368376
}
369377
}
370378
}
@@ -721,7 +729,8 @@
721729
"type": "object",
722730
"required": [
723731
"short_channel_id_dir",
724-
"bias"
732+
"bias",
733+
"timestamp"
725734
],
726735
"additionalProperties": false,
727736
"properties": {
@@ -742,6 +751,13 @@
742751
"description": [
743752
"Description/annotation to display in askrene-listlayers(7)"
744753
]
754+
},
755+
"timestamp": {
756+
"type": "u64",
757+
"added": "v25.12",
758+
"description": [
759+
"The UNIX timestamp when this bias was created."
760+
]
745761
}
746762
}
747763
}
@@ -1197,7 +1213,8 @@
11971213
"type": "object",
11981214
"required": [
11991215
"short_channel_id_dir",
1200-
"bias"
1216+
"bias",
1217+
"timestamp"
12011218
],
12021219
"additionalProperties": false,
12031220
"properties": {
@@ -1218,6 +1235,13 @@
12181235
"description": [
12191236
"Description/annotation for the bias"
12201237
]
1238+
},
1239+
"timestamp": {
1240+
"type": "u64",
1241+
"added": "v25.12",
1242+
"description": [
1243+
"The UNIX timestamp when this bias was created."
1244+
]
12211245
}
12221246
}
12231247
}

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

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

contrib/pyln-testing/pyln/testing/grpc2py.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2988,6 +2988,7 @@ def askrene_listlayers_layers_biases2py(m):
29882988
"bias": m.bias, # PrimitiveField in generate_composite
29892989
"description": m.description, # PrimitiveField in generate_composite
29902990
"short_channel_id_dir": m.short_channel_id_dir, # PrimitiveField in generate_composite
2991+
"timestamp": m.timestamp, # PrimitiveField in generate_composite
29912992
})
29922993

29932994

@@ -3045,6 +3046,7 @@ def askrene_create_layer_layers_biases2py(m):
30453046
"bias": m.bias, # PrimitiveField in generate_composite
30463047
"description": m.description, # PrimitiveField in generate_composite
30473048
"short_channel_id_dir": m.short_channel_id_dir, # PrimitiveField in generate_composite
3049+
"timestamp": m.timestamp, # PrimitiveField in generate_composite
30483050
})
30493051

30503052

@@ -3174,6 +3176,7 @@ def askrene_bias_channel_biases2py(m):
31743176
"description": m.description, # PrimitiveField in generate_composite
31753177
"layer": m.layer, # PrimitiveField in generate_composite
31763178
"short_channel_id_dir": m.short_channel_id_dir, # PrimitiveField in generate_composite
3179+
"timestamp": m.timestamp, # PrimitiveField in generate_composite
31773180
})
31783181

31793182

doc/schemas/askrene-age.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"title": "Command for expiring information in a layer",
66
"added": "v24.11",
77
"description": [
8-
"The **askrene-age** RPC command tells askrene that information added to a layer by *askrene-inform-channel* beyond a certain age is less useful. It currently completely forgets constraints older than *cutoff*."
8+
"The **askrene-age** RPC command tells askrene that information added to a layer by *askrene-inform-channel* and *askrene-bias-channel* beyond a certain age is less useful. It currently completely forgets constraints and biases older than *cutoff*."
99
],
1010
"request": {
1111
"required": [

doc/schemas/askrene-bias-channel.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@
6262
"required": [
6363
"layer",
6464
"short_channel_id_dir",
65-
"bias"
65+
"bias",
66+
"timestamp"
6667
],
6768
"additionalProperties": false,
6869
"properties": {
@@ -89,6 +90,13 @@
8990
"description": [
9091
"The bias (-100 to +100)"
9192
]
93+
},
94+
"timestamp": {
95+
"type": "u64",
96+
"added": "v25.12",
97+
"description": [
98+
"The UNIX timestamp when this bias was created."
99+
]
92100
}
93101
}
94102
}

doc/schemas/askrene-create-layer.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@
202202
"type": "object",
203203
"required": [
204204
"short_channel_id_dir",
205-
"bias"
205+
"bias",
206+
"timestamp"
206207
],
207208
"additionalProperties": false,
208209
"properties": {
@@ -223,6 +224,13 @@
223224
"description": [
224225
"Description/annotation to display in askrene-listlayers(7)"
225226
]
227+
},
228+
"timestamp": {
229+
"type": "u64",
230+
"added": "v25.12",
231+
"description": [
232+
"The UNIX timestamp when this bias was created."
233+
]
226234
}
227235
}
228236
}

0 commit comments

Comments
 (0)