Add @prestonvanloon and @djrtwo's comments for muliple beacon topics
This commit is contained in:
parent
22d44969f7
commit
b83a7c4a23
|
@ -53,12 +53,20 @@ updated to topic hashes in later versions - https://github.com/libp2p/rust-libp2
|
||||||
|
|
||||||
For Eth2.0 clients, topics will be sent as `SHA2-256` hashes of the topic string.
|
For Eth2.0 clients, topics will be sent as `SHA2-256` hashes of the topic string.
|
||||||
|
|
||||||
There is one dedicated topic for propagating beacon blocks and aggregated
|
There are two main topics used to propagate attestations and beacon blocks to
|
||||||
attestations across the network. This topic will have the string
|
all nodes on the network.
|
||||||
`beacon_chain`. Each shard will have it's own topic allowing relevant parties
|
|
||||||
to subscribe to in order to receive local shard attestations. The shard topics are
|
- The `beacon_block` topic - This topic is used solely for propagating new
|
||||||
prefixed with `shard` followed by the number of the shard. For example,
|
beacon blocks to all nodes on the networks.
|
||||||
messages relating to shard 10, will have the topic string `shard10`.
|
- The `beacon_attestation` topic - This topic is used to for propagate
|
||||||
|
aggregated attestations to subscribing nodes (typically block proposers) to
|
||||||
|
be included into future blocks. Attestations will be aggregated in their
|
||||||
|
respective subnets before publishing on this topic.
|
||||||
|
|
||||||
|
Shards will be grouped into their own subnets (defined by a shard topic). The
|
||||||
|
number of shard subnets will be defined via `SHARD_SUBNET_COUNT` and the shard
|
||||||
|
`shard_number % SHARD_SUBNET_COUNT` will be assigned to the topic:
|
||||||
|
`shard{shard_number % SHARD_SUBNET_COUNT}`.
|
||||||
|
|
||||||
### Messages
|
### Messages
|
||||||
|
|
||||||
|
@ -78,24 +86,9 @@ The byte array is prefixed with a unsigned 64 bit length number encoded as an
|
||||||
+--------------------------+
|
+--------------------------+
|
||||||
```
|
```
|
||||||
|
|
||||||
The body of the message is an SSZ-encoded object representing either a
|
The body of the message is an SSZ-encoded object. For the `beacon_block` topic,
|
||||||
beacon block or attestation. The type of objected is determined via a prefixed
|
this will be a `beacon_block`. For the `beacon_attestation` topic, this will be
|
||||||
nibble. Currently there are two objects that are sent across the gossip
|
an `attestation`.
|
||||||
network. They are (with their corresponding nibble specification):
|
|
||||||
|
|
||||||
- `0x1`: Beacon block
|
|
||||||
- `0x2`: Attestation
|
|
||||||
|
|
||||||
The body therefore takes the form:
|
|
||||||
```
|
|
||||||
+--------------------------+
|
|
||||||
| type nibble |
|
|
||||||
+--------------------------+
|
|
||||||
| |
|
|
||||||
| SSZ-encoded object |
|
|
||||||
| |
|
|
||||||
+--------------------------+
|
|
||||||
```
|
|
||||||
|
|
||||||
## Eth-2 RPC
|
## Eth-2 RPC
|
||||||
|
|
||||||
|
@ -103,7 +96,6 @@ The body therefore takes the form:
|
||||||
|
|
||||||
The [RPC Interface](./rpc-interface.md) is specified in this repository.
|
The [RPC Interface](./rpc-interface.md) is specified in this repository.
|
||||||
|
|
||||||
|
|
||||||
## Identify
|
## Identify
|
||||||
|
|
||||||
#### Protocol Id: `/ipfs/id/1.0.0` (to be updated to `/p2p/id/1.0.0`)
|
#### Protocol Id: `/ipfs/id/1.0.0` (to be updated to `/p2p/id/1.0.0`)
|
||||||
|
|
Loading…
Reference in New Issue