Skip to content

Commit 22d2d95

Browse files
committed
lnrpc: add imputed costs proto definitions
- Add experimental imputed costs API to router service with three new RPCs: XImportImputedCosts, XQueryImputedCosts, XDeleteImputedCosts. - Introduces ImputedCostNamespace, ImputedCostPair, ImputedCostPolicy messages with support for success-based and attempt-based cost calculations. - Adds imputed_cost_restrictions field to SendPaymentRequest and QueryRoutesRequest for total routing cost limits. - Compiling of the protos - Update router.yaml
1 parent 629c804 commit 22d2d95

10 files changed

Lines changed: 4875 additions & 3198 deletions

lnrpc/lightning.pb.go

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

lnrpc/lightning.proto

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3207,6 +3207,11 @@ message QueryRoutesRequest {
32073207
channel may be used.
32083208
*/
32093209
repeated uint64 outgoing_chan_ids = 20;
3210+
3211+
/*
3212+
An optional restriction to limit routing fees and imputed costs.
3213+
*/
3214+
ImputedCostRestriction imputed_cost_restrictions = 21;
32103215
}
32113216

32123217
message NodePair {
@@ -3236,6 +3241,19 @@ message EdgeLocator {
32363241
bool direction_reverse = 2;
32373242
}
32383243

3244+
message ImputedCostRestriction {
3245+
/*
3246+
The name of the namespace for calculating the imputed costs.
3247+
*/
3248+
string namespace = 1;
3249+
3250+
/*
3251+
The maximum number of millisatoshis that may be incurred, including routing
3252+
fees and imputed costs.
3253+
*/
3254+
int64 total_cost_limit_msat = 2;
3255+
}
3256+
32393257
message QueryRoutesResponse {
32403258
/*
32413259
The route that results from the path finding operation. This is still a

lnrpc/lightning.swagger.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,6 +1511,21 @@
15111511
"format": "uint64"
15121512
},
15131513
"collectionFormat": "multi"
1514+
},
1515+
{
1516+
"name": "imputed_cost_restrictions.namespace",
1517+
"description": "The name of the namespace for calculating the imputed costs.",
1518+
"in": "query",
1519+
"required": false,
1520+
"type": "string"
1521+
},
1522+
{
1523+
"name": "imputed_cost_restrictions.total_cost_limit_msat",
1524+
"description": "The maximum number of millisatoshis that may be incurred, including routing\nfees and imputed costs.",
1525+
"in": "query",
1526+
"required": false,
1527+
"type": "string",
1528+
"format": "int64"
15141529
}
15151530
],
15161531
"tags": [
@@ -1662,6 +1677,10 @@
16621677
"format": "uint64"
16631678
},
16641679
"description": "The channel ids of the channels allowed for the first hop. If empty, any\nchannel may be used."
1680+
},
1681+
"imputed_cost_restrictions": {
1682+
"$ref": "#/definitions/lnrpcImputedCostRestriction",
1683+
"description": "An optional restriction to limit routing fees and imputed costs."
16651684
}
16661685
}
16671686
}
@@ -5578,6 +5597,20 @@
55785597
}
55795598
}
55805599
},
5600+
"lnrpcImputedCostRestriction": {
5601+
"type": "object",
5602+
"properties": {
5603+
"namespace": {
5604+
"type": "string",
5605+
"description": "The name of the namespace for calculating the imputed costs."
5606+
},
5607+
"total_cost_limit_msat": {
5608+
"type": "string",
5609+
"format": "int64",
5610+
"description": "The maximum number of millisatoshis that may be incurred, including routing\nfees and imputed costs."
5611+
}
5612+
}
5613+
},
55815614
"lnrpcInboundFee": {
55825615
"type": "object",
55835616
"properties": {

0 commit comments

Comments
 (0)