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

Remove one SSZ seralization layer from ping extensions + clean up rest of spec #359

Merged
merged 1 commit into from
Jan 20, 2025
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
2 changes: 1 addition & 1 deletion SPECIFICATION_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ as "Retrieval of block headers by their hash"

<!-- The list of message types from the portal wire protocol that are supported by this network -->

#### `Ping.custom_data` & `Pong.custom_data`
#### `Ping.payload` & `Pong.payload`

<!-- If the PING/PONG messages are used by this protocol they should be specified here -->

Expand Down
4 changes: 2 additions & 2 deletions beacon-chain/beacon-network.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ The beacon chain network supports the following protocol messages:
- `Find Content` - `Found Content`
- `Offer` - `Accept`

#### `Ping.custom_data` & `Pong.custom_data`
#### `Ping.payload` & `Pong.payload`

In the beacon chain network the `custom_payload` field of the `Ping` and `Pong` messages. The first packet between another client MUST be [Type 0: Client Info, Radius, and Capabilities Payload](../ping-payload-extensions/extensions/type-0.md). Then upgraded to the latest payload supported by both of the clients.
In the beacon chain network the `payload` field of the `Ping` and `Pong` messages. The first packet between another client MUST be [Type 0: Client Info, Radius, and Capabilities Payload](../ping-payload-extensions/extensions/type-0.md). Then upgraded to the latest payload supported by both of the clients.

List of currently supported payloads, by latest to oldest.
- [Type 1 Basic Radius Payload](../ping-payload-extensions/extensions/type-1.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ The canonical transaction index network supports the following protocol messages
- `Offer` - `Accept`


#### `Ping.custom_data` & `Pong.custom_data`
#### `Ping.payload` & `Pong.payload`

In the canonical transaction index network the `custom_payload` field of the `Ping` and `Pong` messages. The first packet between another client MUST be [Type 0: Client Info, Radius, and Capabilities Payload](../ping-payload-extensions/extensions/type-0.md). Then upgraded to the latest payload supported by both of the clients.
In the canonical transaction index network the `payload` field of the `Ping` and `Pong` messages. The first packet between another client MUST be [Type 0: Client Info, Radius, and Capabilities Payload](../ping-payload-extensions/extensions/type-0.md). Then upgraded to the latest payload supported by both of the clients.

List of currently supported payloads, by latest to oldest.
- [Type 1 Basic Radius Payload](../ping-payload-extensions/extensions/type-1.md)
Expand Down
4 changes: 2 additions & 2 deletions history/history-network.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ The history network supports the following protocol messages:
- `Find Content` - `Found Content`
- `Offer` - `Accept`

#### `Ping.custom_data` & `Pong.custom_data`
#### `Ping.payload` & `Pong.payload`

In the history network the `custom_payload` field of the `Ping` and `Pong` messages. The first packet between another client MUST be [Type 0: Client Info, Radius, and Capabilities Payload](../ping-payload-extensions/extensions/type-0.md). Then upgraded to the latest payload supported by both of the clients.
In the history network the `payload` field of the `Ping` and `Pong` messages. The first packet between another client MUST be [Type 0: Client Info, Radius, and Capabilities Payload](../ping-payload-extensions/extensions/type-0.md). Then upgraded to the latest payload supported by both of the clients.

List of currently supported payloads, by latest to oldest.
- [Type 2 History Radius Payload](../ping-payload-extensions/extensions/type-2.md)
Expand Down
10 changes: 6 additions & 4 deletions ping-payload-extensions/extensions/template.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ Ping payload
[Payload] = SSZ.serialize(Container([Key Value Pairs]))


[Container Name] = Container(
type: [Type Number],
Ping Message = Container(
enr_seq: uint64,
kdeme marked this conversation as resolved.
Show resolved Hide resolved
payload_type: [Type Number],
payload: [Payload]
)
```
Expand All @@ -19,8 +20,9 @@ Pong payload

[Payload] = SSZ.serialize(Container([Key Value Pairs]))

[Container Name] = Container(
type: [Type Number],
kdeme marked this conversation as resolved.
Show resolved Hide resolved
Pong Message = Container(
enr_seq: uint64,
payload_type: [Type Number],
payload: [Payload]
)
```
3 changes: 2 additions & 1 deletion ping-payload-extensions/extensions/type-0.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ client_info_and_capabilities = SSZ.serialize(Container(
capabilities: List[u16, MAX_CAPABILITIES_LENGTH]
))

CapabilitiesPayload = Container(
Ping/Pong Message = Container(
enr_seq: uint64,
type: 0,
payload: client_info_and_capabilities
)
Expand Down
3 changes: 2 additions & 1 deletion ping-payload-extensions/extensions/type-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Ping and Pong Payload

basic_radius = SSZ.serialize(Container(data_radius: U256))

BasicRadiusPayload = Container(
Ping/Pong Message = Container(
enr_seq: uint64,
type: 1,
payload: basic_radius
)
Expand Down
3 changes: 2 additions & 1 deletion ping-payload-extensions/extensions/type-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Ping and Pong Payload

history_radius = SSZ.serialize(Container(data_radius: U256, ephemeral_header_count=U16))

HistoryRadiusPayload = Container(
Ping/Pong Message = Container(
enr_seq: uint64,
type: 2,
payload: history_radius
)
Expand Down
3 changes: 2 additions & 1 deletion ping-payload-extensions/extensions/type-65535.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ MAX_ERROR_BYTE_LENGTH = 300

error_payload = SSZ.serialize(Container(error_code: u16, message: ByteList[MAX_ERROR_BYTE_LENGTH]))

ErrorPayload = Container(
Pong Message = Container(
enr_seq: uint64,
type: 65535,
payload: error_payload
)
Expand Down
4 changes: 2 additions & 2 deletions portal-wire-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ The transmission of `content` data that is too large to fit a single packet is d

#### Ping (0x00)

Request message to check if a node is reachable, communicate basic information about our node, and request basic information about the recipient node. Additionally sub-protocol can define a schema for the `custom_payload` field to exchange additional information.
Request message to check if a node is reachable, communicate basic information about our node, and request basic information about the recipient node. Additionally sub-protocol can define a schema for the `payload` field to exchange additional information.

```
selector = 0x00
Expand Down Expand Up @@ -325,7 +325,7 @@ port := UDP port number

### Protocol Specific Node State

Sub protocols may define additional node state information which should be tracked in the node state database. This information will typically be transmitted in the `Ping.custom_data` and `Pong.custom_data` fields.
Sub protocols may define additional node state information which should be tracked in the node state database. This information will typically be transmitted in the `Ping.payload` and `Pong.payload` fields.


## Algorithms
Expand Down
4 changes: 2 additions & 2 deletions state/state-network.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ The execution state network supports the following protocol messages:
- `Find Content` - `Found Content`
- `Offer` - `Accept`

#### `Ping.custom_data` & `Pong.custom_data`
#### `Ping.payload` & `Pong.payload`

In the execution state network network the `custom_payload` field of the `Ping` and `Pong` messages. The first packet between another client MUST be [Type 0: Client Info, Radius, and Capabilities Payload](../ping-payload-extensions/extensions/type-0.md). Then upgraded to the latest payload supported by both of the clients.
In the execution state network network the `payload` field of the `Ping` and `Pong` messages. The first packet between another client MUST be [Type 0: Client Info, Radius, and Capabilities Payload](../ping-payload-extensions/extensions/type-0.md). Then upgraded to the latest payload supported by both of the clients.

List of currently supported payloads, by latest to oldest.
- [Type 1 Basic Radius Payload](../ping-payload-extensions/extensions/type-1.md)
Expand Down
2 changes: 1 addition & 1 deletion transaction-gossip/transaction-gossip.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The network uses the PING/PONG/FINDNODES/FOUNDNODES/OFFER/ACCEPT messages from t

The network uses the standard XOR distance function.

In the execution state network the `custom_payload` field of the `Ping` and `Pong` messages is the serialization of an SSZ Container specified as [Type 1 Basic Radius Payload](../ping-payload-extensions/extensions/type-1.md)
In the execution state network the `payload` field of the `Ping` and `Pong` messages is the serialization of an SSZ Container specified as [Type 1 Basic Radius Payload](../ping-payload-extensions/extensions/type-1.md)

## Content Keys

Expand Down
Loading