lnrpc: add AMPRecord to Hop

This commit is contained in:
Conner Fromknecht committed 2021-04-07 12:09:43 -07:00
1 parent cfa9e954c7
commit 00581efec6
4 files changed
+1016 -883

No files matched your search

+22 -1
View File
@@ -441,6 +441,23 @@
], ],
"default": "IN_FLIGHT" "default": "IN_FLIGHT"
}, },
"lnrpcAMPRecord": {
"type": "object",
"properties": {
"root_share": {
"type": "string",
"format": "byte"
},
"set_id": {
"type": "string",
"format": "byte"
},
"child_index": {
"type": "integer",
"format": "int64"
}
}
},
"lnrpcChannelPoint": { "lnrpcChannelPoint": {
"type": "object", "type": "object",
"properties": { "properties": {
@@ -677,7 +694,11 @@
}, },
"mpp_record": { "mpp_record": {
"$ref": "#/definitions/lnrpcMPPRecord", "$ref": "#/definitions/lnrpcMPPRecord",
"description": "An optional TLV record that signals the use of an MPP payment. If present,\nthe receiver will enforce that that the same mpp_record is included in the\nfinal hop payload of all non-zero payments in the HTLC set. If empty, a\nregular single-shot payment is or was attempted." "description": "An optional TLV record that signals the use of an MPP payment. If present,\nthe receiver will enforce that the same mpp_record is included in the final\nhop payload of all non-zero payments in the HTLC set. If empty, a regular\nsingle-shot payment is or was attempted."
},
"amp_record": {
"$ref": "#/definitions/lnrpcAMPRecord",
"description": "An optional TLV record that signals the use of an AMP payment. If present,\nthe receiver will treat all received payments including the same\n(payment_addr, set_id) pair as being part of one logical payment. The\npayment will be settled by XORing the root_share's together and deriving the\nchild hashes and preimages according to BOLT XX. Must be used in conjunction\nwith mpp_record."
}, },
"custom_records": { "custom_records": {
"type": "object", "type": "object",
+951 -878
View File
File diff suppressed because it is too large. Load diff
+21 -3
View File
@@ -2493,12 +2493,22 @@ message Hop {
/* /*
An optional TLV record that signals the use of an MPP payment. If present, An optional TLV record that signals the use of an MPP payment. If present,
the receiver will enforce that that the same mpp_record is included in the the receiver will enforce that the same mpp_record is included in the final
final hop payload of all non-zero payments in the HTLC set. If empty, a hop payload of all non-zero payments in the HTLC set. If empty, a regular
regular single-shot payment is or was attempted. single-shot payment is or was attempted.
*/ */
MPPRecord mpp_record = 10; MPPRecord mpp_record = 10;
/*
An optional TLV record that signals the use of an AMP payment. If present,
the receiver will treat all received payments including the same
(payment_addr, set_id) pair as being part of one logical payment. The
payment will be settled by XORing the root_share's together and deriving the
child hashes and preimages according to BOLT XX. Must be used in conjunction
with mpp_record.
*/
AMPRecord amp_record = 12;
/* /*
An optional set of key-value TLV records. This is useful within the context An optional set of key-value TLV records. This is useful within the context
of the SendToRoute call as it allows callers to specify arbitrary K-V pairs of the SendToRoute call as it allows callers to specify arbitrary K-V pairs
@@ -2525,6 +2535,14 @@ message MPPRecord {
int64 total_amt_msat = 10; int64 total_amt_msat = 10;
} }
message AMPRecord {
bytes root_share = 1;
bytes set_id = 2;
uint32 child_index = 3;
}
/* /*
A path through the channel graph which runs over one or more channels in A path through the channel graph which runs over one or more channels in
succession. This struct carries all the information required to craft the succession. This struct carries all the information required to craft the
+22 -1
View File
@@ -2536,6 +2536,23 @@
}, },
"description": "Details specific to AMP HTLCs." "description": "Details specific to AMP HTLCs."
}, },
"lnrpcAMPRecord": {
"type": "object",
"properties": {
"root_share": {
"type": "string",
"format": "byte"
},
"set_id": {
"type": "string",
"format": "byte"
},
"child_index": {
"type": "integer",
"format": "int64"
}
}
},
"lnrpcAbandonChannelResponse": { "lnrpcAbandonChannelResponse": {
"type": "object" "type": "object"
}, },
@@ -4025,7 +4042,11 @@
}, },
"mpp_record": { "mpp_record": {
"$ref": "#/definitions/lnrpcMPPRecord", "$ref": "#/definitions/lnrpcMPPRecord",
"description": "An optional TLV record that signals the use of an MPP payment. If present,\nthe receiver will enforce that that the same mpp_record is included in the\nfinal hop payload of all non-zero payments in the HTLC set. If empty, a\nregular single-shot payment is or was attempted." "description": "An optional TLV record that signals the use of an MPP payment. If present,\nthe receiver will enforce that the same mpp_record is included in the final\nhop payload of all non-zero payments in the HTLC set. If empty, a regular\nsingle-shot payment is or was attempted."
},
"amp_record": {
"$ref": "#/definitions/lnrpcAMPRecord",
"description": "An optional TLV record that signals the use of an AMP payment. If present,\nthe receiver will treat all received payments including the same\n(payment_addr, set_id) pair as being part of one logical payment. The\npayment will be settled by XORing the root_share's together and deriving the\nchild hashes and preimages according to BOLT XX. Must be used in conjunction\nwith mpp_record."
}, },
"custom_records": { "custom_records": {
"type": "object", "type": "object",