2022-11-01 17:54:33 +00:00
# Capella -- Networking
This document contains the networking specification for Capella.
The specification of these changes continues in the same format as the network specifications of previous upgrades, and assumes them as pre-requisite.
2023-04-19 11:10:46 +00:00
### Table of contents
2022-11-01 17:54:33 +00:00
<!-- TOC -->
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE - RUN doctoc TO UPDATE -->
- [Modifications in Capella ](#modifications-in-capella )
- [The gossip domain: gossipsub ](#the-gossip-domain-gossipsub )
- [Topics and messages ](#topics-and-messages )
- [Global topics ](#global-topics )
- [`beacon_block` ](#beacon_block )
- [`bls_to_execution_change` ](#bls_to_execution_change )
- [Transitioning the gossip ](#transitioning-the-gossip )
- [The Req/Resp domain ](#the-reqresp-domain )
- [Messages ](#messages )
- [BeaconBlocksByRange v2 ](#beaconblocksbyrange-v2 )
- [BeaconBlocksByRoot v2 ](#beaconblocksbyroot-v2 )
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<!-- /TOC -->
2023-04-19 11:10:46 +00:00
## Modifications in Capella
2022-11-01 17:54:33 +00:00
2023-04-19 11:10:46 +00:00
### The gossip domain: gossipsub
2022-11-01 17:54:33 +00:00
2022-11-04 22:13:07 +00:00
A new topic is added to support the gossip of withdrawal credential change messages. And an existing topic is upgraded for updated types in Capella.
2022-11-01 17:54:33 +00:00
2023-04-19 11:10:46 +00:00
#### Topics and messages
2022-11-01 17:54:33 +00:00
2022-11-04 22:13:15 +00:00
Topics follow the same specification as in prior upgrades. All existing topics remain stable except the beacon block topic which is updated with the modified type.
2022-11-01 17:54:33 +00:00
The new topics along with the type of the `data` field of a gossipsub message are given in this table:
| Name | Message Type |
| - | - |
| `beacon_block` | `SignedBeaconBlock` (modified) |
| `bls_to_execution_change` | `SignedBLSToExecutionChange` |
Note that the `ForkDigestValue` path segment of the topic separates the old and the new `beacon_block` topics.
2023-04-19 11:10:46 +00:00
##### Global topics
2022-11-01 17:54:33 +00:00
2022-11-04 22:13:23 +00:00
Capella changes the type of the global beacon block topic and adds one global topic to propagate withdrawal credential change messages to all potential proposers of beacon blocks.
2022-11-01 17:54:33 +00:00
2023-04-19 11:10:46 +00:00
###### `beacon_block`
2022-11-01 17:54:33 +00:00
The *type* of the payload of this topic changes to the (modified) `SignedBeaconBlock` found in Capella.
Specifically, this type changes with the addition of `bls_to_execution_changes` to the inner `BeaconBlockBody` .
See Capella [state transition document ](./beacon-chain.md#beaconblockbody ) for further details.
2023-04-19 11:10:46 +00:00
###### `bls_to_execution_change`
2022-11-01 17:54:33 +00:00
This topic is used to propagate signed bls to execution change messages to be included in future blocks.
The following validations MUST pass before forwarding the `signed_bls_to_execution_change` on the network:
2023-01-13 08:49:24 +00:00
- _[IGNORE]_ `current_epoch >= CAPELLA_FORK_EPOCH` ,
where `current_epoch` is defined by the current wall-clock time.
2022-11-01 17:54:33 +00:00
- _[IGNORE]_ The `signed_bls_to_execution_change` is the first valid signed bls to execution change received
for the validator with index `signed_bls_to_execution_change.message.validator_index` .
- _[REJECT]_ All of the conditions within `process_bls_to_execution_change` pass validation.
2023-04-19 11:10:46 +00:00
#### Transitioning the gossip
2022-11-01 17:54:33 +00:00
See gossip transition details found in the [Altair document ](../altair/p2p-interface.md#transitioning-the-gossip ) for
details on how to handle transitioning gossip topics for Capella.
2023-04-19 11:10:46 +00:00
### The Req/Resp domain
2022-11-01 17:54:33 +00:00
2023-04-19 11:10:46 +00:00
#### Messages
2022-11-01 17:54:33 +00:00
2023-04-19 11:10:46 +00:00
##### BeaconBlocksByRange v2
2022-11-01 17:54:33 +00:00
**Protocol ID:** `/eth2/beacon_chain/req/beacon_blocks_by_range/2/`
The Capella fork-digest is introduced to the `context` enum to specify Capella block type.
Per `context = compute_fork_digest(fork_version, genesis_validators_root)` :
[0]: # (eth2spec: skip)
| `fork_version` | Chunk SSZ type |
| ------------------------ | -------------------------- |
| `GENESIS_FORK_VERSION` | `phase0.SignedBeaconBlock` |
| `ALTAIR_FORK_VERSION` | `altair.SignedBeaconBlock` |
| `BELLATRIX_FORK_VERSION` | `bellatrix.SignedBeaconBlock` |
| `CAPELLA_FORK_VERSION` | `capella.SignedBeaconBlock` |
2023-04-19 11:10:46 +00:00
##### BeaconBlocksByRoot v2
2022-11-01 17:54:33 +00:00
**Protocol ID:** `/eth2/beacon_chain/req/beacon_blocks_by_root/2/`
The Capella fork-digest is introduced to the `context` enum to specify Capella block type.
Per `context = compute_fork_digest(fork_version, genesis_validators_root)` :
[1]: # (eth2spec: skip)
| `fork_version` | Chunk SSZ type |
| ------------------------ | -------------------------- |
| `GENESIS_FORK_VERSION` | `phase0.SignedBeaconBlock` |
| `ALTAIR_FORK_VERSION` | `altair.SignedBeaconBlock` |
| `BELLATRIX_FORK_VERSION` | `bellatrix.SignedBeaconBlock` |
| `CAPELLA_FORK_VERSION` | `capella.SignedBeaconBlock` |