Skip to content
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 presets/mainnet/fulu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
FIELD_ELEMENTS_PER_CELL: 64
# `uint64(2 * 4096)` (= 8192)
FIELD_ELEMENTS_PER_EXT_BLOB: 8192
# uint64(floorlog2(get_generalized_index(BeaconBlockBody, 'blob_kzg_commitments'))
# `uint64(floorlog2(get_generalized_index(BeaconBlockBody, 'blob_kzg_commitments'))`
KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH: 4
2 changes: 1 addition & 1 deletion presets/minimal/fulu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
FIELD_ELEMENTS_PER_CELL: 64
# `uint64(2 * 4096)` (= 8192)
FIELD_ELEMENTS_PER_EXT_BLOB: 8192
# uint64(floorlog2(get_generalized_index(BeaconBlockBody, 'blob_kzg_commitments'))
# `uint64(floorlog2(get_generalized_index(BeaconBlockBody, 'blob_kzg_commitments'))`
KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH: 4
6 changes: 3 additions & 3 deletions specs/deneb/validator.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ Please see related Beacon Chain doc before continuing and use them as a referenc
```python
@dataclass
class BlobsBundle(object):
commitments: Sequence[KZGCommitment]
proofs: Sequence[KZGProof]
blobs: Sequence[Blob]
commitments: List[KZGCommitment, MAX_BLOB_COMMITMENTS_PER_BLOCK]
proofs: List[KZGProof, MAX_BLOB_COMMITMENTS_PER_BLOCK]
blobs: List[Blob, MAX_BLOB_COMMITMENTS_PER_BLOCK]
```

### Modified `GetPayloadResponse`
Expand Down
54 changes: 54 additions & 0 deletions specs/fulu/validator.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
- [Prerequisites](#prerequisites)
- [Configuration](#configuration)
- [Custody setting](#custody-setting)
- [Helpers](#helpers)
- [`BlobsBundle`](#blobsbundle)
- [Modified `GetPayloadResponse`](#modified-getpayloadresponse)
- [Protocol](#protocol)
- [`ExecutionEngine`](#executionengine)
- [Modified `get_payload`](#modified-get_payload)
- [Beacon chain responsibilities](#beacon-chain-responsibilities)
- [Validator custody](#validator-custody)
- [Block and sidecar proposal](#block-and-sidecar-proposal)
Expand Down Expand Up @@ -44,6 +50,54 @@ document and used throughout.
| `VALIDATOR_CUSTODY_REQUIREMENT` | `8` | Minimum number of custody groups an honest node with validators attached custodies and serves samples from |
| `BALANCE_PER_ADDITIONAL_CUSTODY_GROUP` | `Gwei(32 * 10**9)` | Balance increment corresponding to one additional group to custody |

## Helpers

### `BlobsBundle`

*[Modified in Fulu:EIP7594]*

The `BlobsBundle` object is modified to include cell KZG proofs instead of blob KZG proofs.

```python
@dataclass
class BlobsBundle(object):
Copy link
Member

Choose a reason for hiding this comment

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

Do we ever hash BlobsBundle? Otherwise the value of MAX_CELLS_PER_EXT_BLOB is meaninglesss

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't understand. What do you mean exactly? This will be SSZ encoded in the builder flow.

Copy link
Contributor

Choose a reason for hiding this comment

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

The max length of the SSZ list doesn't affect SSZ encoding, it only affects tree hashing. So if we don't ever need to hash this object, the number here doesn't matter - i think this is what @dapplion meant.

IMO defining the max length still make sense though for validation purpose, but the structure we sent over the wire remains unchanged.

commitments: List[KZGCommitment, MAX_BLOB_COMMITMENTS_PER_BLOCK]
# [Modified in Fulu:EIP7594]
proofs: List[KZGProof, FIELD_ELEMENTS_PER_EXT_BLOB * MAX_BLOB_COMMITMENTS_PER_BLOCK]

Choose a reason for hiding this comment

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

Suggested change
proofs: List[KZGProof, FIELD_ELEMENTS_PER_EXT_BLOB * MAX_BLOB_COMMITMENTS_PER_BLOCK]
proofs: List[KZGProof, CELLS_PER_EXT_BLOB * MAX_BLOB_COMMITMENTS_PER_BLOCK]

I think length of max cell proofs per block should be derived from number of extended cells per blob * max blobs per block, so not field elements

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi @hangleang, using FIELD_ELEMENTS_PER_EXT_BLOB here is future proofing. This value is the maximum possible cells per ext blob value, where each cell is a single field element. In the future, if we decide to make cells smaller (say 1/4 its current size, 16 field elements per blob) there will be more cells per ext blob. We want a structure which will not need to be updated if CELLS_PER_EXT_BLOB is updated.

Choose a reason for hiding this comment

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

Look good to me then 🎉

blobs: List[Blob, MAX_BLOB_COMMITMENTS_PER_BLOCK]
```

### Modified `GetPayloadResponse`

*[Modified in Fulu:EIP7594]*

The `GetPayloadResponse` object is modified to use the updated `BlobsBundle` object.

```python
@dataclass
class GetPayloadResponse(object):
execution_payload: ExecutionPayload
block_value: uint256
blobs_bundle: BlobsBundle # [Modified in Fulu:EIP7594]
```

## Protocol

### `ExecutionEngine`

#### Modified `get_payload`

The `get_payload` method is modified to return the updated `GetPayloadResponse` object.

```python
def get_payload(self: ExecutionEngine, payload_id: PayloadId) -> GetPayloadResponse:
"""
Return ExecutionPayload, uint256, BlobsBundle objects.
"""
# pylint: disable=unused-argument
...
```

## Beacon chain responsibilities

### Validator custody
Expand Down