rpc: add new commitment_type field to OpenChannelRequest

This field will be examined later down the stack along with the set of
feature bits to determine if explicit channel commitment type
negotiation is possible or not.
This commit is contained in:
Olaoluwa Osuntokun committed 2021-08-30 19:17:28 -07:00
1 parent d0779e2ec2
commit 5a9f499dd5
5 files changed
+671 -612

No files matched your search

+616 -600
View File
File diff suppressed because it is too large. Load diff
+14 -8
View File
@@ -1115,11 +1115,16 @@ message HTLC {
}
enum CommitmentType {
/*
Returned when the commitment type isn't known or unavailable.
*/
UNKNOWN_COMMITMENT_TYPE = 0;
/*
A channel using the legacy commitment format having tweaked to_remote
keys.
*/
LEGACY = 0;
LEGACY = 1;
/*
A channel that uses the modern commitment format where the key in the
@@ -1127,19 +1132,14 @@ enum CommitmentType {
up and recovery easier as when the channel is closed, the funds go
directly to that key.
*/
STATIC_REMOTE_KEY = 1;
STATIC_REMOTE_KEY = 2;
/*
A channel that uses a commitment format that has anchor outputs on the
commitments, allowing fee bumping after a force close transaction has
been broadcast.
*/
ANCHORS = 2;
/*
Returned when the commitment type isn't known or unavailable.
*/
UNKNOWN_COMMITMENT_TYPE = 999;
ANCHORS = 3;
}
message ChannelConstraints {
@@ -1867,6 +1867,12 @@ message OpenChannelRequest {
transaction.
*/
uint32 max_local_csv = 17;
/*
The explicit commitment type to use. Note this field will only be used if
the remote peer supports explicit channel negotiation.
*/
CommitmentType commitment_type = 18;
}
message OpenStatusUpdate {
oneof update {
+8 -4
View File
@@ -3502,13 +3502,13 @@
"lnrpcCommitmentType": {
"type": "string",
"enum": [
"UNKNOWN_COMMITMENT_TYPE",
"LEGACY",
"STATIC_REMOTE_KEY",
"ANCHORS",
"UNKNOWN_COMMITMENT_TYPE"
"ANCHORS"
],
"default": "LEGACY",
"description": " - LEGACY: A channel using the legacy commitment format having tweaked to_remote\nkeys.\n - STATIC_REMOTE_KEY: A channel that uses the modern commitment format where the key in the\noutput of the remote party does not change each state. This makes back\nup and recovery easier as when the channel is closed, the funds go\ndirectly to that key.\n - ANCHORS: A channel that uses a commitment format that has anchor outputs on the\ncommitments, allowing fee bumping after a force close transaction has\nbeen broadcast.\n - UNKNOWN_COMMITMENT_TYPE: Returned when the commitment type isn't known or unavailable."
"default": "UNKNOWN_COMMITMENT_TYPE",
"description": " - UNKNOWN_COMMITMENT_TYPE: Returned when the commitment type isn't known or unavailable.\n - LEGACY: A channel using the legacy commitment format having tweaked to_remote\nkeys.\n - STATIC_REMOTE_KEY: A channel that uses the modern commitment format where the key in the\noutput of the remote party does not change each state. This makes back\nup and recovery easier as when the channel is closed, the funds go\ndirectly to that key.\n - ANCHORS: A channel that uses a commitment format that has anchor outputs on the\ncommitments, allowing fee bumping after a force close transaction has\nbeen broadcast."
},
"lnrpcConnectPeerRequest": {
"type": "object",
@@ -4923,6 +4923,10 @@
"type": "integer",
"format": "int64",
"description": "Max local csv is the maximum csv delay we will allow for our own commitment\ntransaction."
},
"commitment_type": {
"$ref": "#/definitions/lnrpcCommitmentType",
"description": "The explicit commitment type to use. Note this field will only be used if\nthe remote peer supports explicit channel negotiation."
}
}
},