From 95ddd1567af355bd3204677272a09b16bd79320a Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Mon, 22 Jul 2024 20:02:01 +0200 Subject: [PATCH 1/2] Document `ForkDigest`-context for EIP-4844 `BlobSidecar` in Electra Currently, documentation does not state what determines the `ForkDigest` for `BlobSidecar`. It makes most sense to use the corresponding slot as that one determines the `ForkDigest` of the corresponding beacon block. Furthermore, add "and later" remarks so that `ELECTRA_FORK_VERSION` is also associated with the `deneb.BlobSidecar` type. This is in line with how `light-client/p2p-interface.md` is done. --- specs/deneb/p2p-interface.md | 49 +++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/specs/deneb/p2p-interface.md b/specs/deneb/p2p-interface.md index 41e2fa9d3f..8501f599d0 100644 --- a/specs/deneb/p2p-interface.md +++ b/specs/deneb/p2p-interface.md @@ -187,6 +187,16 @@ The following validations MUST pass before forwarding the `blob_sidecar` on the - _[REJECT]_ The sidecar is proposed by the expected `proposer_index` for the block's slot in the context of the current shuffling (defined by `block_header.parent_root`/`block_header.slot`). If the `proposer_index` cannot immediately be verified against the expected shuffling, the sidecar MAY be queued for later processing while proposers for the block's branch are calculated -- in such a case _do not_ `REJECT`, instead `IGNORE` this message. +The gossip `ForkDigest`-context is determined based on `compute_fork_version(compute_epoch_at_slot(blob_sidecar.signed_block_header.message.slot))`. + +Per `context = compute_fork_digest(fork_version, genesis_validators_root)`: + +[0]: # (eth2spec: skip) + +| `fork_version` | Chunk SSZ type | +|--------------------------------|-------------------------------| +| `DENEB_FORK_VERSION` and later | `deneb.BlobSidecar` | + ##### Attestation subnets ###### `beacon_attestation_{subnet_id}` @@ -241,7 +251,7 @@ No more than `MAX_REQUEST_BLOCKS_DENEB` may be requested at a time. Per `context = compute_fork_digest(fork_version, genesis_validators_root)`: -[1]: # (eth2spec: skip) +[0]: # (eth2spec: skip) | `fork_version` | Chunk SSZ type | |--------------------------|-------------------------------| @@ -263,14 +273,6 @@ Clients SHOULD NOT respond with blocks that fail the beacon chain state transiti *[New in Deneb:EIP4844]* -The `` field is calculated as `context = compute_fork_digest(fork_version, genesis_validators_root)`: - -[1]: # (eth2spec: skip) - -| `fork_version` | Chunk SSZ type | -|--------------------------|-------------------------------| -| `DENEB_FORK_VERSION` | `deneb.BlobSidecar` | - Request Content: ``` @@ -309,19 +311,22 @@ Clients SHOULD include a sidecar in the response as soon as it passes the gossip Clients SHOULD NOT respond with sidecars related to blocks that fail gossip validation rules. Clients SHOULD NOT respond with sidecars related to blocks that fail the beacon chain state transition -##### BlobSidecarsByRange v1 +For each `response_chunk`, a `ForkDigest`-context based on `compute_fork_version(compute_epoch_at_slot(blob_sidecar.signed_block_header.message.slot))` is used to select the fork namespace of the Response type. -**Protocol ID:** `/eth2/beacon_chain/req/blob_sidecars_by_range/1/` +Per `context = compute_fork_digest(fork_version, genesis_validators_root)`: -*[New in Deneb:EIP4844]* +[0]: # (eth2spec: skip) -The `` field is calculated as `context = compute_fork_digest(fork_version, genesis_validators_root)`: +| `fork_version` | Chunk SSZ type | +|--------------------------------|-------------------------------| +| `DENEB_FORK_VERSION` and later | `deneb.BlobSidecar` | -[1]: # (eth2spec: skip) -| `fork_version` | Chunk SSZ type | -|--------------------------|-------------------------------| -| `DENEB_FORK_VERSION` | `deneb.BlobSidecar` | +##### BlobSidecarsByRange v1 + +**Protocol ID:** `/eth2/beacon_chain/req/blob_sidecars_by_range/1/` + +*[New in Deneb:EIP4844]* Request Content: ``` @@ -389,6 +394,16 @@ Clients MUST respond with blob sidecars that are consistent from a single chain After the initial blob sidecar, clients MAY stop in the process of responding if their fork choice changes the view of the chain in the context of the request. +For each `response_chunk`, a `ForkDigest`-context based on `compute_fork_version(compute_epoch_at_slot(blob_sidecar.signed_block_header.message.slot))` is used to select the fork namespace of the Response type. + +Per `context = compute_fork_digest(fork_version, genesis_validators_root)`: + +[0]: # (eth2spec: skip) + +| `fork_version` | Chunk SSZ type | +|--------------------------------|-------------------------------| +| `DENEB_FORK_VERSION` and later | `deneb.BlobSidecar` | + ## Design decision rationale ### Why are blobs relayed as a sidecar, separate from beacon blocks? From dec28c1322356b8b39970bf7771df72ec0ffbe02 Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Wed, 24 Jul 2024 16:53:46 +0200 Subject: [PATCH 2/2] Rename to `ForkDigestValue` for Gossipsub topics --- specs/altair/light-client/p2p-interface.md | 4 ++-- specs/deneb/p2p-interface.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/specs/altair/light-client/p2p-interface.md b/specs/altair/light-client/p2p-interface.md index c33d887a50..e1fe7487db 100644 --- a/specs/altair/light-client/p2p-interface.md +++ b/specs/altair/light-client/p2p-interface.md @@ -71,7 +71,7 @@ For light clients, the following validations MUST additionally pass before forwa Light clients SHOULD call `process_light_client_finality_update` even if the message is ignored. -The gossip `ForkDigest`-context is determined based on `compute_fork_version(compute_epoch_at_slot(finality_update.attested_header.beacon.slot))`. +The gossip `ForkDigestValue` is determined based on `compute_fork_version(compute_epoch_at_slot(finality_update.attested_header.beacon.slot))`. Per `context = compute_fork_digest(fork_version, genesis_validators_root)`: @@ -99,7 +99,7 @@ For light clients, the following validations MUST additionally pass before forwa Light clients SHOULD call `process_light_client_optimistic_update` even if the message is ignored. -The gossip `ForkDigest`-context is determined based on `compute_fork_version(compute_epoch_at_slot(optimistic_update.attested_header.beacon.slot))`. +The gossip `ForkDigestValue` is determined based on `compute_fork_version(compute_epoch_at_slot(optimistic_update.attested_header.beacon.slot))`. Per `context = compute_fork_digest(fork_version, genesis_validators_root)`: diff --git a/specs/deneb/p2p-interface.md b/specs/deneb/p2p-interface.md index 8501f599d0..7af3faa22d 100644 --- a/specs/deneb/p2p-interface.md +++ b/specs/deneb/p2p-interface.md @@ -187,7 +187,7 @@ The following validations MUST pass before forwarding the `blob_sidecar` on the - _[REJECT]_ The sidecar is proposed by the expected `proposer_index` for the block's slot in the context of the current shuffling (defined by `block_header.parent_root`/`block_header.slot`). If the `proposer_index` cannot immediately be verified against the expected shuffling, the sidecar MAY be queued for later processing while proposers for the block's branch are calculated -- in such a case _do not_ `REJECT`, instead `IGNORE` this message. -The gossip `ForkDigest`-context is determined based on `compute_fork_version(compute_epoch_at_slot(blob_sidecar.signed_block_header.message.slot))`. +The gossip `ForkDigestValue` is determined based on `compute_fork_version(compute_epoch_at_slot(blob_sidecar.signed_block_header.message.slot))`. Per `context = compute_fork_digest(fork_version, genesis_validators_root)`: