Skip to content

Commit f2a7b19

Browse files
committed
plugins/offers: handle invreq_paths in invoice_requests, set them if necessary.
Changelog-EXPERIMENTAL: offers: `invoicerequest` will set a blinded path if we're an unannounced node. Changelog-EXPERIMENTAL: offers: `sendinvoice` will use a blinded path in an invoice_request, if specified. Signed-off-by: Rusty Russell <[email protected]>
1 parent 71270ae commit f2a7b19

File tree

14 files changed

+1191
-616
lines changed

14 files changed

+1191
-616
lines changed

.msggen.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,17 @@
907907
"Decode.invoice_paths[].path[].blinded_node_id": 1,
908908
"Decode.invoice_paths[].path[].encrypted_recipient_data": 2
909909
},
910+
"DecodeInvreq_paths": {
911+
"Decode.invreq_paths[].blinding": 2,
912+
"Decode.invreq_paths[].first_node_id": 3,
913+
"Decode.invreq_paths[].first_scid": 4,
914+
"Decode.invreq_paths[].first_scid_dir": 1,
915+
"Decode.invreq_paths[].path[]": 5
916+
},
917+
"DecodeInvreq_pathsPath": {
918+
"Decode.invreq_paths[].path[].blinded_node_id": 1,
919+
"Decode.invreq_paths[].path[].encrypted_recipient_data": 2
920+
},
910921
"DecodeOffer_paths": {
911922
"Decode.offer_paths[].blinding": 2,
912923
"Decode.offer_paths[].first_node_id": 1,
@@ -948,6 +959,7 @@
948959
"Decode.invreq_chain": 27,
949960
"Decode.invreq_features": 29,
950961
"Decode.invreq_metadata": 25,
962+
"Decode.invreq_paths[]": 85,
951963
"Decode.invreq_payer_id": 26,
952964
"Decode.invreq_payer_note": 31,
953965
"Decode.invreq_quantity": 30,
@@ -4491,6 +4503,38 @@
44914503
"added": "pre-v0.10.1",
44924504
"deprecated": null
44934505
},
4506+
"Decode.invreq_paths[]": {
4507+
"added": "v24.08",
4508+
"deprecated": null
4509+
},
4510+
"Decode.invreq_paths[].blinding": {
4511+
"added": "v24.08",
4512+
"deprecated": null
4513+
},
4514+
"Decode.invreq_paths[].first_node_id": {
4515+
"added": "v24.08",
4516+
"deprecated": null
4517+
},
4518+
"Decode.invreq_paths[].first_scid": {
4519+
"added": "v24.08",
4520+
"deprecated": null
4521+
},
4522+
"Decode.invreq_paths[].first_scid_dir": {
4523+
"added": "v24.08",
4524+
"deprecated": null
4525+
},
4526+
"Decode.invreq_paths[].path[]": {
4527+
"added": "v24.08",
4528+
"deprecated": null
4529+
},
4530+
"Decode.invreq_paths[].path[].blinded_node_id": {
4531+
"added": "v24.08",
4532+
"deprecated": null
4533+
},
4534+
"Decode.invreq_paths[].path[].encrypted_recipient_data": {
4535+
"added": "v24.08",
4536+
"deprecated": null
4537+
},
44944538
"Decode.invreq_payer_id": {
44954539
"added": "pre-v0.10.1",
44964540
"deprecated": null

cln-grpc/proto/node.proto

Lines changed: 14 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: 26 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: 20 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: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6282,6 +6282,82 @@
62826282
"A note attached by the payer."
62836283
]
62846284
},
6285+
"invreq_paths": {
6286+
"type": "array",
6287+
"added": "v24.08",
6288+
"description": [
6289+
"Paths to the destination."
6290+
],
6291+
"items": {
6292+
"type": "object",
6293+
"required": [
6294+
"blinding",
6295+
"path"
6296+
],
6297+
"additionalProperties": false,
6298+
"properties": {
6299+
"first_node_id": {
6300+
"added": "v24.08",
6301+
"type": "pubkey",
6302+
"description": [
6303+
"The (presumably well-known) public key of the start of the path."
6304+
]
6305+
},
6306+
"first_scid": {
6307+
"added": "v24.08",
6308+
"type": "short_channel_id",
6309+
"description": [
6310+
"the short channel id of the start of the path (alternative to first_node_id)"
6311+
]
6312+
},
6313+
"first_scid_dir": {
6314+
"added": "v24.08",
6315+
"type": "u32",
6316+
"description": [
6317+
"which end of the first_scid is the start of the path"
6318+
]
6319+
},
6320+
"blinding": {
6321+
"added": "v24.08",
6322+
"type": "pubkey",
6323+
"description": [
6324+
"Blinding factor for this path."
6325+
]
6326+
},
6327+
"path": {
6328+
"type": "array",
6329+
"added": "v24.08",
6330+
"description": [
6331+
"An individual path."
6332+
],
6333+
"items": {
6334+
"type": "object",
6335+
"required": [
6336+
"blinded_node_id",
6337+
"encrypted_recipient_data"
6338+
],
6339+
"additionalProperties": false,
6340+
"properties": {
6341+
"blinded_node_id": {
6342+
"added": "v24.08",
6343+
"type": "pubkey",
6344+
"description": [
6345+
"Node_id of the hop."
6346+
]
6347+
},
6348+
"encrypted_recipient_data": {
6349+
"added": "v24.08",
6350+
"type": "hex",
6351+
"description": [
6352+
"Encrypted TLV entry for this hop."
6353+
]
6354+
}
6355+
}
6356+
}
6357+
}
6358+
}
6359+
}
6360+
},
62856361
"invreq_recurrence_counter": {
62866362
"type": "u32",
62876363
"description": [
@@ -6385,6 +6461,7 @@
63856461
"invreq_features": {},
63866462
"invreq_quantity": {},
63876463
"invreq_payer_note": {},
6464+
"invreq_paths": {},
63886465
"invreq_recurrence_counter": {},
63896466
"invreq_recurrence_start": {},
63906467
"warning_invalid_offer_description": {
@@ -6780,6 +6857,82 @@
67806857
"A note attached by the payer."
67816858
]
67826859
},
6860+
"invreq_paths": {
6861+
"type": "array",
6862+
"added": "v24.08",
6863+
"description": [
6864+
"Paths to the destination."
6865+
],
6866+
"items": {
6867+
"type": "object",
6868+
"required": [
6869+
"blinding",
6870+
"path"
6871+
],
6872+
"additionalProperties": false,
6873+
"properties": {
6874+
"first_node_id": {
6875+
"added": "v24.08",
6876+
"type": "pubkey",
6877+
"description": [
6878+
"The (presumably well-known) public key of the start of the path."
6879+
]
6880+
},
6881+
"first_scid": {
6882+
"added": "v24.08",
6883+
"type": "short_channel_id",
6884+
"description": [
6885+
"the short channel id of the start of the path (alternative to first_node_id)"
6886+
]
6887+
},
6888+
"first_scid_dir": {
6889+
"added": "v24.08",
6890+
"type": "u32",
6891+
"description": [
6892+
"which end of the first_scid is the start of the path"
6893+
]
6894+
},
6895+
"blinding": {
6896+
"added": "v24.08",
6897+
"type": "pubkey",
6898+
"description": [
6899+
"Blinding factor for this path."
6900+
]
6901+
},
6902+
"path": {
6903+
"type": "array",
6904+
"added": "v24.08",
6905+
"description": [
6906+
"An individual path."
6907+
],
6908+
"items": {
6909+
"type": "object",
6910+
"required": [
6911+
"blinded_node_id",
6912+
"encrypted_recipient_data"
6913+
],
6914+
"additionalProperties": false,
6915+
"properties": {
6916+
"blinded_node_id": {
6917+
"added": "v24.08",
6918+
"type": "pubkey",
6919+
"description": [
6920+
"Node_id of the hop."
6921+
]
6922+
},
6923+
"encrypted_recipient_data": {
6924+
"added": "v24.08",
6925+
"type": "hex",
6926+
"description": [
6927+
"Encrypted TLV entry for this hop."
6928+
]
6929+
}
6930+
}
6931+
}
6932+
}
6933+
}
6934+
}
6935+
},
67836936
"invreq_recurrence_counter": {
67846937
"type": "u32",
67856938
"description": [
@@ -7068,6 +7221,7 @@
70687221
"invreq_features": {},
70697222
"invreq_quantity": {},
70707223
"invreq_payer_note": {},
7224+
"invreq_paths": {},
70717225
"invreq_node_id": {},
70727226
"invreq_recurrence_counter": {},
70737227
"invreq_recurrence_start": {},

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

Lines changed: 588 additions & 584 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: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,6 +1165,23 @@ def decode_invoice_paths2py(m):
11651165
})
11661166

11671167

1168+
def decode_invreq_paths_path2py(m):
1169+
return remove_default({
1170+
"blinded_node_id": hexlify(m.blinded_node_id), # PrimitiveField in generate_composite
1171+
"encrypted_recipient_data": hexlify(m.encrypted_recipient_data), # PrimitiveField in generate_composite
1172+
})
1173+
1174+
1175+
def decode_invreq_paths2py(m):
1176+
return remove_default({
1177+
"path": [decode_invreq_paths_path2py(i) for i in m.path], # ArrayField[composite] in generate_composite
1178+
"blinding": hexlify(m.blinding), # PrimitiveField in generate_composite
1179+
"first_node_id": hexlify(m.first_node_id), # PrimitiveField in generate_composite
1180+
"first_scid": m.first_scid, # PrimitiveField in generate_composite
1181+
"first_scid_dir": m.first_scid_dir, # PrimitiveField in generate_composite
1182+
})
1183+
1184+
11681185
def decode_offer_paths_path2py(m):
11691186
return remove_default({
11701187
"blinded_node_id": hexlify(m.blinded_node_id), # PrimitiveField in generate_composite
@@ -1238,6 +1255,7 @@ def decode2py(m):
12381255
"fallbacks": [decode_fallbacks2py(i) for i in m.fallbacks], # ArrayField[composite] in generate_composite
12391256
"invoice_fallbacks": [decode_invoice_fallbacks2py(i) for i in m.invoice_fallbacks], # ArrayField[composite] in generate_composite
12401257
"invoice_paths": [decode_invoice_paths2py(i) for i in m.invoice_paths], # ArrayField[composite] in generate_composite
1258+
"invreq_paths": [decode_invreq_paths2py(i) for i in m.invreq_paths], # ArrayField[composite] in generate_composite
12411259
"offer_chains": [hexlify(m.offer_chains) for i in hexlify(m.offer_chains)], # ArrayField[primitive] in generate_composite
12421260
"offer_paths": [decode_offer_paths2py(i) for i in m.offer_paths], # ArrayField[composite] in generate_composite
12431261
"restrictions": [decode_restrictions2py(i) for i in m.restrictions], # ArrayField[composite] in generate_composite

0 commit comments

Comments
 (0)