Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pyln-spec: update to latest version of the spec. #4763

Merged
merged 1 commit into from
Sep 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions contrib/pyln-spec/bolt1/pyln/spec/bolt1/gen_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__base_version__ = "1.0"
__post_version__ = "137"
__gitversion__ = "9e8e29af9b9a922eb114b2c716205d0772946e56"
__post_version__ = "186"
__gitversion__ = "38abac62065172c00722dca10e7d3fc3049afd72"
16 changes: 9 additions & 7 deletions contrib/pyln-spec/bolt1/pyln/spec/bolt1/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@
### Requirements

The sending node:
- MUST order `tlv_record`s in a `tlv_stream` by monotonically-increasing `type`.
- MUST order `tlv_record`s in a `tlv_stream` by strictly-increasing `type`,
hence MUST not produce more than a single TLV record with the same `type`
- MUST minimally encode `type` and `length`.
- When defining custom record `type` identifiers:
- SHOULD pick random `type` identifiers to avoid collision with other
Expand All @@ -152,7 +153,8 @@
- MUST stop parsing the `tlv_stream`.
- if a `type` or `length` is not minimally encoded:
- MUST fail to parse the `tlv_stream`.
- if decoded `type`s are not monotonically-increasing:
- if decoded `type`s are not strictly-increasing (including situations when
two or more occurrences of the same `type` are met):
- MUST fail to parse the `tlv_stream`.
- if `length` exceeds the number of bytes remaining in the message:
- MUST fail to parse the `tlv_stream`.
Expand All @@ -176,8 +178,8 @@
field, the node is forced to add parsing logic for that field in order to
determine the offset of any fields that follow.

The monotonicity constraint ensures that all `type`s are unique and can appear
at most once. Fields that map to complex objects, e.g. vectors, maps, or
The strict monotonicity constraint ensures that all `type`s are unique and can
appear at most once. Fields that map to complex objects, e.g. vectors, maps, or
structs, should do so by defining the encoding such that the object is
serialized within a single `tlv_record`. The uniqueness constraint, among other
things, enables the following optimizations:
Expand Down Expand Up @@ -252,7 +254,7 @@
* [`flen*byte`:`features`]
* [`init_tlvs`:`tlvs`]

1. tlvs: `init_tlvs`
1. `tlv_stream`: `init_tlvs`
2. types:
1. type: 1 (`networks`)
2. data:
Expand Down Expand Up @@ -671,7 +673,7 @@

The n1 namespace supports the following TLV types:

1. tlvs: `n1`
1. `tlv_stream`: `n1`
2. types:
1. type: 1 (`tlv1`)
2. data:
Expand All @@ -690,7 +692,7 @@

The n2 namespace supports the following TLV types:

1. tlvs: `n2`
1. `tlv_stream`: `n2`
2. types:
1. type: 0 (`tlv1`)
2. data:
Expand Down
8 changes: 8 additions & 0 deletions contrib/pyln-spec/bolt2/pyln/spec/bolt2/csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
"msgdata,open_channel,tlvs,open_channel_tlvs,",
"tlvtype,open_channel_tlvs,upfront_shutdown_script,0",
"tlvdata,open_channel_tlvs,upfront_shutdown_script,shutdown_scriptpubkey,byte,...",
"tlvtype,open_channel_tlvs,channel_type,1",
"tlvdata,open_channel_tlvs,channel_type,type,byte,...",
"msgtype,accept_channel,33",
"msgdata,accept_channel,temporary_channel_id,byte,32",
"msgdata,accept_channel,dust_limit_satoshis,u64,",
Expand All @@ -39,6 +41,8 @@
"msgdata,accept_channel,tlvs,accept_channel_tlvs,",
"tlvtype,accept_channel_tlvs,upfront_shutdown_script,0",
"tlvdata,accept_channel_tlvs,upfront_shutdown_script,shutdown_scriptpubkey,byte,...",
"tlvtype,accept_channel_tlvs,channel_type,1",
"tlvdata,accept_channel_tlvs,channel_type,type,byte,...",
rustyrussell marked this conversation as resolved.
Show resolved Hide resolved
"msgtype,funding_created,34",
"msgdata,funding_created,temporary_channel_id,byte,32",
"msgdata,funding_created,funding_txid,sha256,",
Expand All @@ -58,6 +62,10 @@
"msgdata,closing_signed,channel_id,channel_id,",
"msgdata,closing_signed,fee_satoshis,u64,",
"msgdata,closing_signed,signature,signature,",
"msgdata,closing_signed,tlvs,closing_signed_tlvs,",
"tlvtype,closing_signed_tlvs,fee_range,1",
"tlvdata,closing_signed_tlvs,fee_range,min_fee_satoshis,u64,",
"tlvdata,closing_signed_tlvs,fee_range,max_fee_satoshis,u64,",
"msgtype,update_add_htlc,128",
"msgdata,update_add_htlc,channel_id,channel_id,",
"msgdata,update_add_htlc,id,u64,",
Expand Down
2 changes: 1 addition & 1 deletion contrib/pyln-spec/bolt2/pyln/spec/bolt2/gen_csv_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__csv_version__ = "1"
__csv_version__ = "2"
4 changes: 2 additions & 2 deletions contrib/pyln-spec/bolt2/pyln/spec/bolt2/gen_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__base_version__ = "1.0"
__post_version__ = "137"
__gitversion__ = "9e8e29af9b9a922eb114b2c716205d0772946e56"
__post_version__ = "186"
__gitversion__ = "38abac62065172c00722dca10e7d3fc3049afd72"
Loading