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

BOLT 4: link to BOLT 1 for tlv_payload format #801

Merged
merged 3 commits into from
Nov 9, 2020
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
6 changes: 3 additions & 3 deletions 01-messaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ The `features` field MUST be padded to bytes with 0s.
* [`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 @@ -672,7 +672,7 @@ The following tests assume that two separate TLV namespaces exist: n1 and n2.

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 @@ -691,7 +691,7 @@ The n1 namespace supports the following TLV types:

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
4 changes: 2 additions & 2 deletions 02-peer-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ the funding transaction and both versions of the commitment transaction.
* [`byte`:`channel_flags`]
* [`open_channel_tlvs`:`tlvs`]

1. tlvs: `open_channel_tlvs`
1. `tlv_stream`: `open_channel_tlvs`
2. types:
1. type: 0 (`upfront_shutdown_script`)
2. data:
Expand Down Expand Up @@ -300,7 +300,7 @@ funding transaction and both versions of the commitment transaction.
* [`point`:`first_per_commitment_point`]
* [`accept_channel_tlvs`:`tlvs`]

1. tlvs: `accept_channel_tlvs`
1. `tlv_stream`: `accept_channel_tlvs`
2. types:
1. type: 0 (`upfront_shutdown_script`)
2. data:
Expand Down
3 changes: 2 additions & 1 deletion 04-onion-routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,9 @@ parameters may lead to extraneous routing failure.
### `tlv_payload` format

This is a more flexible format, which avoids the redundant `short_channel_id` field for the final node.
It is formatted according to the Type-Length-Value format defined in [BOLT #1](01-messaging.md#type-length-value-format).

1. tlvs: `tlv_payload`
1. `tlv_stream`: `tlv_payload`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure @rustyrussell's tooling to automatically generate the C definitions from the spec will like that change

2. types:
1. type: 2 (`amt_to_forward`)
2. data:
Expand Down
6 changes: 3 additions & 3 deletions 07-routing-gossip.md
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ Nodes can signal that they support extended gossip queries with the `gossip_quer
* [`len*byte`:`encoded_short_ids`]
* [`query_short_channel_ids_tlvs`:`tlvs`]

1. tlvs: `query_short_channel_ids_tlvs`
1. `tlv_stream`: `query_short_channel_ids_tlvs`
2. types:
1. type: 1 (`query_flags`)
2. data:
Expand Down Expand Up @@ -703,7 +703,7 @@ timeouts. It also causes a natural ratelimiting of queries.
* [`u32`:`number_of_blocks`]
* [`query_channel_range_tlvs`:`tlvs`]

1. tlvs: `query_channel_range_tlvs`
1. `tlv_stream`: `query_channel_range_tlvs`
2. types:
1. type: 1 (`query_option`)
2. data:
Expand All @@ -728,7 +728,7 @@ Though it is possible, it would not be very useful to ask for checksums without
* [`len*byte`:`encoded_short_ids`]
* [`reply_channel_range_tlvs`:`tlvs`]

1. tlvs: `reply_channel_range_tlvs`
1. `tlv_stream`: `reply_channel_range_tlvs`
2. types:
1. type: 1 (`timestamps_tlv`)
2. data:
Expand Down
2 changes: 1 addition & 1 deletion tools/extract-formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
typeline = re.compile(
'(1\.|\*) type: (?P<value>[-0-9A-Za-z_|]+) \(`(?P<name>[A-Za-z0-9_]+)`\)( \(`?(?P<option>[^)`]*)`\))?')
tlvline = re.compile(
'(1\.|\*) tlvs: `(?P<name>[A-Za-z0-9_]+)`( \(`?(?P<option>[^)`]*)`\))?')
'(1\.|\*) `tlv_stream`: `(?P<name>[A-Za-z0-9_]+)`( \(`?(?P<option>[^)`]*)`\))?')
subtypeline = re.compile(
'(1\.|\*) subtype: `(?P<name>[A-Za-z0-9_]+)`( \(`?(?P<option>[^)`]*)`\))?')
dataline = re.compile(
Expand Down