Skip to content

Commit

Permalink
fundchannel_start & multifundchannel: add channel_type.
Browse files Browse the repository at this point in the history
Let's tell the caller what channel_type they got!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `fundchannel`, `multifundchannel`, `fundchannel_start` and `openchannel_init`: new field `channel_type`.
  • Loading branch information
rustyrussell committed Jan 29, 2024
1 parent 4cf4dcc commit 17d0d00
Show file tree
Hide file tree
Showing 24 changed files with 496 additions and 212 deletions.
6 changes: 6 additions & 0 deletions cln-grpc/proto/node.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions cln-grpc/src/convert.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions cln-rpc/src/model.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

194 changes: 98 additions & 96 deletions contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions contrib/pyln-testing/pyln/testing/grpc2py.py
Original file line number Diff line number Diff line change
Expand Up @@ -1318,6 +1318,13 @@ def fetchinvoice2py(m):
})


def fundchannel_channel_type2py(m):
return remove_default({
"bits": [m.bits for i in m.bits], # ArrayField[primitive] in generate_composite
"names": [str(i) for i in m.names], # ArrayField[composite] in generate_composite
})


def fundchannel2py(m):
return remove_default({
"tx": hexlify(m.tx), # PrimitiveField in generate_composite
Expand Down
7 changes: 6 additions & 1 deletion doc/lightning-fundchannel.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ On success, an object is returned, containing:
- **txid** (txid): The txid of the transaction which funded the channel
- **outnum** (u32): The 0-based output index showing which output funded the channel
- **channel\_id** (hex): The channel\_id of the resulting channel (always 64 characters)
- **channel\_type** (object): channel\_type as negotiated with peer *(added v24.02)*:
- **bits** (array of u32s): Each bit set in this channel\_type *(added v24.02)*:
- Bit number
- **names** (array of strings): Feature name for each bit set in this channel\_type *(added v24.02)*:
- Name of feature bit (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even")
- **close\_to** (hex, optional): The raw scriptPubkey which mutual close will go to; only present if *close\_to* parameter was specified and peer supports `option_upfront_shutdown_script`
- **mindepth** (u32, optional): Number of confirmations before we consider the channel active.

Expand Down Expand Up @@ -135,4 +140,4 @@ RESOURCES

Main web site: <https://github.com/ElementsProject/lightning>

[comment]: # ( SHA256STAMP:d4ba5524781fae00bc3280f1488deb805d961e8ae78822ba651d55cb39dbefd7)
[comment]: # ( SHA256STAMP:b890bd25970e8e1ef92812daa89a25ded100173f9ab411492a87d6cd268ee32d)
7 changes: 6 additions & 1 deletion doc/lightning-fundchannel_start.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ On success, an object is returned, containing:

- **funding\_address** (string): The address to send funding to for the channel. DO NOT SEND COINS TO THIS ADDRESS YET.
- **scriptpubkey** (hex): The raw scriptPubkey for the address
- **channel\_type** (object): channel\_type as negotiated with peer *(added v24.02)*:
- **bits** (array of u32s): Each bit set in this channel\_type *(added v24.02)*:
- Bit number
- **names** (array of strings): Feature name for each bit set in this channel\_type *(added v24.02)*:
- Name of feature bit (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even")
- **close\_to** (hex, optional): The raw scriptPubkey which mutual close will go to; only present if *close\_to* parameter was specified and peer supports `option_upfront_shutdown_script`
- **mindepth** (u32, optional): Number of confirmations before we consider the channel active.

Expand Down Expand Up @@ -102,4 +107,4 @@ RESOURCES

Main web site: <https://github.com/ElementsProject/lightning>

[comment]: # ( SHA256STAMP:8d9c42f4424065f442b6ae5eb5624e4a4c2cb2e73649faf9c9547b8fc12803ee)
[comment]: # ( SHA256STAMP:55a714d25c1e01c90076462f022ad814aad42bbf824ba44060d406d53ebcad0c)
7 changes: 6 additions & 1 deletion doc/lightning-multifundchannel.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ On success, an object is returned, containing:
- **id** (pubkey): The peer we opened the channel with
- **outnum** (u32): The 0-based output index showing which output funded the channel
- **channel\_id** (hex): The channel\_id of the resulting channel (always 64 characters)
- **channel\_type** (object): channel\_type as negotiated with peer *(added v24.02)*:
- **bits** (array of u32s): Each bit set in this channel\_type *(added v24.02)*:
- Bit number
- **names** (array of strings): Feature name for each bit set in this channel\_type *(added v24.02)*:
- Name of feature bit (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even")
- **close\_to** (hex, optional): The raw scriptPubkey which mutual close will go to; only present if *close\_to* parameter was specified and peer supports `option_upfront_shutdown_script`
- **failed** (array of objects, optional): any peers we failed to open with (if *minchannels* was specified less than the number of destinations):
- **id** (pubkey): The peer we failed to open the channel with
Expand Down Expand Up @@ -209,4 +214,4 @@ RESOURCES
Main web site: <https://github.com/ElementsProject/lightning>
[comment]: # ( SHA256STAMP:86f5966b49a03858655163407e15b4331147d52dd6e773480157279a222e77a2)
[comment]: # ( SHA256STAMP:eb35e768173dcc45cfd56c0847995fbc8ff9e182dbade3e11c192cf27b6bfcba)
7 changes: 6 additions & 1 deletion doc/lightning-openchannel_bump.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ RETURN VALUE
On success, an object is returned, containing:

- **channel\_id** (hex): the channel id of the channel (always 64 characters)
- **channel\_type** (object): channel\_type as negotiated with peer *(added v24.02)*:
- **bits** (array of u32s): Each bit set in this channel\_type *(added v24.02)*:
- Bit number
- **names** (array of strings): Feature name for each bit set in this channel\_type *(added v24.02)*:
- Name of feature bit (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even")
- **psbt** (string): the (incomplete) PSBT of the RBF transaction
- **commitments\_secured** (boolean): whether the *psbt* is complete (always *false*)
- **funding\_serial** (u64): the serial\_id of the funding output in the *psbt*
Expand Down Expand Up @@ -83,4 +88,4 @@ RESOURCES

Main web site: <https://github.com/ElementsProject/lightning>

[comment]: # ( SHA256STAMP:0eca72ceb743e1b5582b444a08cf8f4a22576baf8512c78d501aeae7f689cb25)
[comment]: # ( SHA256STAMP:98faf34f08ec57a266c82dfdb876f35d08187a16c1b6d53fedaa12570144a64f)
7 changes: 6 additions & 1 deletion doc/lightning-openchannel_init.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ On success, an object is returned, containing:
- **channel\_id** (hex): the channel id of the channel (always 64 characters)
- **psbt** (string): the (incomplete) PSBT of the funding transaction
- **channel\_type** (object): channel\_type as negotiated with peer *(added v24.02)*:
- **bits** (array of u32s): Each bit set in this channel\_type *(added v24.02)*:
- Bit number
- **names** (array of strings): Feature name for each bit set in this channel\_type *(added v24.02)*:
- Name of feature bit (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even")
- **commitments\_secured** (boolean): whether the *psbt* is complete (always *false*)
- **funding\_serial** (u64): the serial\_id of the funding output in the *psbt*
- **requires\_confirmed\_inputs** (boolean, optional): Does peer require confirmed inputs in psbt?
Expand Down Expand Up @@ -119,4 +124,4 @@ RESOURCES
Main web site: <https://github.com/ElementsProject/lightning>
[comment]: # ( SHA256STAMP:71a3f74f3cb3325a51f4d998675a0d8fd01de20d1f3326c553789066bcf8c3a1)
[comment]: # ( SHA256STAMP:2815e0b486c5346d0d058a7670b7e34f55b7ce0f5d35861dd76316e42b7b589d)
7 changes: 6 additions & 1 deletion doc/lightning-openchannel_update.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ RETURN VALUE
On success, an object is returned, containing:

- **channel\_id** (hex): the channel id of the channel (always 64 characters)
- **channel\_type** (object): channel\_type as negotiated with peer *(added v24.02)*:
- **bits** (array of u32s): Each bit set in this channel\_type *(added v24.02)*:
- Bit number
- **names** (array of strings): Feature name for each bit set in this channel\_type *(added v24.02)*:
- Name of feature bit (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even")
- **psbt** (string): the PSBT of the funding transaction
- **commitments\_secured** (boolean): whether the *psbt* is complete (if true, sign *psbt* and call `openchannel_signed` to complete the channel open)
- **funding\_outnum** (u32): The index of the funding output in the psbt
Expand Down Expand Up @@ -77,4 +82,4 @@ RESOURCES

Main web site: <https://github.com/ElementsProject/lightning>

[comment]: # ( SHA256STAMP:9118c5e4b40298ccbf51932798af177e79b15396e60d8b08e2bc3695241b080a)
[comment]: # ( SHA256STAMP:13df70a54c29a3ac4b8f44a0d2f4cdc47928417b7c810bc19ec35fe820558730)
38 changes: 38 additions & 0 deletions doc/schemas/fundchannel.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"tx",
"txid",
"outnum",
"channel_type",
"channel_id"
],
"properties": {
Expand All @@ -27,6 +28,43 @@
"minLength": 64,
"maxLength": 64
},
"channel_type": {
"type": "object",
"description": "channel_type as negotiated with peer",
"added": "v24.02",
"additionalProperties": false,
"required": [
"bits",
"names"
],
"properties": {
"bits": {
"type": "array",
"description": "Each bit set in this channel_type",
"added": "v24.02",
"items": {
"type": "u32",
"description": "Bit number"
}
},
"names": {
"type": "array",
"description": "Feature name for each bit set in this channel_type",
"added": "v24.02",
"items": {
"type": "string",
"enum": [
"static_remotekey/even",
"anchor_outputs/even",
"anchors_zero_fee_htlc_tx/even",
"scid_alias/even",
"zeroconf/even"
],
"description": "Name of feature bit"
}
}
}
},
"close_to": {
"type": "hex",
"description": "The raw scriptPubkey which mutual close will go to; only present if *close_to* parameter was specified and peer supports `option_upfront_shutdown_script`"
Expand Down
38 changes: 38 additions & 0 deletions doc/schemas/fundchannel_start.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"required": [
"funding_address",
"scriptpubkey",
"channel_type",
"warning_usage"
],
"properties": {
Expand All @@ -16,6 +17,43 @@
"type": "hex",
"description": "The raw scriptPubkey for the address"
},
"channel_type": {
"type": "object",
"description": "channel_type as negotiated with peer",
"added": "v24.02",
"additionalProperties": false,
"required": [
"bits",
"names"
],
"properties": {
"bits": {
"type": "array",
"added": "v24.02",
"description": "Each bit set in this channel_type",
"items": {
"type": "u32",
"description": "Bit number"
}
},
"names": {
"type": "array",
"description": "Feature name for each bit set in this channel_type",
"added": "v24.02",
"items": {
"type": "string",
"enum": [
"static_remotekey/even",
"anchor_outputs/even",
"anchors_zero_fee_htlc_tx/even",
"scid_alias/even",
"zeroconf/even"
],
"description": "Name of feature bit"
}
}
}
},
"close_to": {
"type": "hex",
"description": "The raw scriptPubkey which mutual close will go to; only present if *close_to* parameter was specified and peer supports `option_upfront_shutdown_script`"
Expand Down
38 changes: 38 additions & 0 deletions doc/schemas/multifundchannel.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"required": [
"id",
"channel_id",
"channel_type",
"outnum"
],
"properties": {
Expand All @@ -41,6 +42,43 @@
"minLength": 64,
"maxLength": 64
},
"channel_type": {
"type": "object",
"description": "channel_type as negotiated with peer",
"added": "v24.02",
"additionalProperties": false,
"required": [
"bits",
"names"
],
"properties": {
"bits": {
"type": "array",
"description": "Each bit set in this channel_type",
"added": "v24.02",
"items": {
"type": "u32",
"description": "Bit number"
}
},
"names": {
"type": "array",
"description": "Feature name for each bit set in this channel_type",
"added": "v24.02",
"items": {
"type": "string",
"enum": [
"static_remotekey/even",
"anchor_outputs/even",
"anchors_zero_fee_htlc_tx/even",
"scid_alias/even",
"zeroconf/even"
],
"description": "Name of feature bit"
}
}
}
},
"close_to": {
"type": "hex",
"description": "The raw scriptPubkey which mutual close will go to; only present if *close_to* parameter was specified and peer supports `option_upfront_shutdown_script`"
Expand Down
38 changes: 38 additions & 0 deletions doc/schemas/openchannel_bump.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"additionalProperties": false,
"required": [
"channel_id",
"channel_type",
"psbt",
"commitments_secured",
"funding_serial"
Expand All @@ -15,6 +16,43 @@
"maxLength": 64,
"minLength": 64
},
"channel_type": {
"type": "object",
"description": "channel_type as negotiated with peer",
"added": "v24.02",
"additionalProperties": false,
"required": [
"bits",
"names"
],
"properties": {
"bits": {
"type": "array",
"description": "Each bit set in this channel_type",
"added": "v24.02",
"items": {
"type": "u32",
"description": "Bit number"
}
},
"names": {
"type": "array",
"description": "Feature name for each bit set in this channel_type",
"added": "v24.02",
"items": {
"type": "string",
"enum": [
"static_remotekey/even",
"anchor_outputs/even",
"anchors_zero_fee_htlc_tx/even",
"scid_alias/even",
"zeroconf/even"
],
"description": "Name of feature bit"
}
}
}
},
"psbt": {
"type": "string",
"description": "the (incomplete) PSBT of the RBF transaction"
Expand Down
Loading

0 comments on commit 17d0d00

Please sign in to comment.