Skip to content

Commit

Permalink
Make changes after rebasing
Browse files Browse the repository at this point in the history
  • Loading branch information
jtraglia committed Dec 11, 2024
1 parent f15d116 commit b504270
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 44 deletions.
10 changes: 5 additions & 5 deletions specs/fulu/beacon-chain.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# EIP7594 -- The Beacon Chain
# Fulu -- The Beacon Chain

**Notice**: This document is a work-in-progress for researchers and implementers.

Expand Down Expand Up @@ -27,8 +27,8 @@

| Name | Value | Description |
| - | - | - |
| `TARGET_BLOBS_PER_BLOCK_EIP7594` | `uint64(9)` | *[New in EIP7594]* Target number of blobs in a single block limited by `MAX_BLOBS_PER_BLOCK_EIP7594` |
| `MAX_BLOBS_PER_BLOCK_EIP7594` | `uint64(12)` | *[New in EIP7594]* Maximum number of blobs in a single block limited by `MAX_BLOB_COMMITMENTS_PER_BLOCK` |
| `TARGET_BLOBS_PER_BLOCK_FULU` | `uint64(9)` | *[New in Fulu:EIP7594]* Target number of blobs in a single block limited by `MAX_BLOBS_PER_BLOCK_FULU` |
| `MAX_BLOBS_PER_BLOCK_FULU` | `uint64(12)` | *[New in Fulu:EIP7594]* Maximum number of blobs in a single block limited by `MAX_BLOB_COMMITMENTS_PER_BLOCK` |

#### Execution payload

Expand All @@ -45,7 +45,7 @@ def process_execution_payload(state: BeaconState, body: BeaconBlockBody, executi
# Verify timestamp
assert payload.timestamp == compute_timestamp_at_slot(state, state.slot)
# Verify commitments are under limit
assert len(body.blob_kzg_commitments) <= MAX_BLOBS_PER_BLOCK_EIP7594 # [Modified in EIP7594]
assert len(body.blob_kzg_commitments) <= MAX_BLOBS_PER_BLOCK_FULU # [Modified in Fulu:EIP7594]
# Verify the execution payload is valid
versioned_hashes = [kzg_commitment_to_versioned_hash(commitment) for commitment in body.blob_kzg_commitments]
assert execution_engine.verify_and_notify_new_payload(
Expand All @@ -54,7 +54,7 @@ def process_execution_payload(state: BeaconState, body: BeaconBlockBody, executi
versioned_hashes=versioned_hashes,
parent_beacon_block_root=state.latest_block_header.parent_root,
execution_requests=body.execution_requests,
target_blobs_per_block=TARGET_BLOBS_PER_BLOCK_EIP7594, # [Modified in EIP7594]
target_blobs_per_block=TARGET_BLOBS_PER_BLOCK_FULU, # [Modified in Fulu:EIP7594]
)
)
# Cache execution payload header
Expand Down
38 changes: 19 additions & 19 deletions specs/fulu/p2p-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ The specification of these changes continues in the same format as the network s
| `DATA_COLUMN_SIDECAR_SUBNET_COUNT` | `128` | The number of data column sidecar subnets used in the gossipsub protocol |
| `MAX_REQUEST_DATA_COLUMN_SIDECARS` | `MAX_REQUEST_BLOCKS_DENEB * NUMBER_OF_COLUMNS` | Maximum number of data column sidecars in a single request |
| `MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS` | `2**12` (= 4096 epochs, ~18 days) | The minimum epoch range over which a node must serve data column sidecars |
| `MAX_REQUEST_BLOB_SIDECARS_EIP7594` | `MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_EIP7594` | Maximum number of blob sidecars in a single request |
| `MAX_REQUEST_BLOB_SIDECARS_FULU` | `MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_FULU` | Maximum number of blob sidecars in a single request |

### Containers

Expand Down Expand Up @@ -174,7 +174,7 @@ Some gossip meshes are upgraded in the Fulu fork to support upgraded types.
*Updated validation*

- _[REJECT]_ The length of KZG commitments is less than or equal to the limitation defined in Consensus Layer --
i.e. validate that `len(body.signed_beacon_block.message.blob_kzg_commitments) <= MAX_BLOBS_PER_BLOCK_EIP7594`
i.e. validate that `len(body.signed_beacon_block.message.blob_kzg_commitments) <= MAX_BLOBS_PER_BLOCK_FULU`

##### Blob subnets

Expand Down Expand Up @@ -215,49 +215,49 @@ The following validations MUST pass before forwarding the `sidecar: DataColumnSi

**Protocol ID:** `/eth2/beacon_chain/req/blob_sidecars_by_root/3/`

*[Modified in EIP7594]*
*[Modified in Fulu:EIP7594]*

The `<context-bytes>` field is calculated as `context = compute_fork_digest(fork_version, genesis_validators_root)`:

[1]: # (eth2spec: skip)

| `fork_version` | Chunk SSZ type |
|------------------------|-----------------------|
| `EIP7594_FORK_VERSION` | `eip7594.BlobSidecar` |
| `fork_version` | Chunk SSZ type |
|---------------------|--------------------|
| `FULU_FORK_VERSION` | `fulu.BlobSidecar` |

Request Content:

```
(
List[BlobIdentifier, MAX_REQUEST_BLOB_SIDECARS_EIP7594]
List[BlobIdentifier, MAX_REQUEST_BLOB_SIDECARS_FULU]
)
```

Response Content:

```
(
List[BlobSidecar, MAX_REQUEST_BLOB_SIDECARS_EIP7594]
List[BlobSidecar, MAX_REQUEST_BLOB_SIDECARS_FULU]
)
```

*Updated validation*

No more than `MAX_REQUEST_BLOB_SIDECARS_EIP7594` may be requested at a time.
No more than `MAX_REQUEST_BLOB_SIDECARS_FULU` may be requested at a time.

##### BlobSidecarsByRange v3

**Protocol ID:** `/eth2/beacon_chain/req/blob_sidecars_by_range/3/`

*[Modified in EIP7594]*
*[Modified in Fulu:EIP7594]*

The `<context-bytes>` field is calculated as `context = compute_fork_digest(fork_version, genesis_validators_root)`:

[1]: # (eth2spec: skip)

| `fork_version` | Chunk SSZ type |
|------------------------|-----------------------|
| `EIP7594_FORK_VERSION` | `eip7594.BlobSidecar` |
| `fork_version` | Chunk SSZ type |
|---------------------|--------------------|
| `FULU_FORK_VERSION` | `fulu.BlobSidecar` |

Request Content:

Expand All @@ -272,13 +272,13 @@ Response Content:

```
(
List[BlobSidecar, MAX_REQUEST_BLOB_SIDECARS_EIP7594]
List[BlobSidecar, MAX_REQUEST_BLOB_SIDECARS_FULU]
)
```

*Updated validation*

Clients MUST respond with at least the blob sidecars of the first blob-carrying block that exists in the range, if they have it, and no more than `MAX_REQUEST_BLOB_SIDECARS_EIP7594` sidecars.
Clients MUST respond with at least the blob sidecars of the first blob-carrying block that exists in the range, if they have it, and no more than `MAX_REQUEST_BLOB_SIDECARS_FULU` sidecars.

##### DataColumnSidecarsByRoot v1

Expand All @@ -290,8 +290,8 @@ The `<context-bytes>` field is calculated as `context = compute_fork_digest(fork

[1]: # (eth2spec: skip)

| `fork_version` | Chunk SSZ type |
|------------------------|-----------------------------|
| `fork_version` | Chunk SSZ type |
|---------------------|--------------------------|
| `FULU_FORK_VERSION` | `fulu.DataColumnSidecar` |

Request Content:
Expand Down Expand Up @@ -338,8 +338,8 @@ The `<context-bytes>` field is calculated as `context = compute_fork_digest(fork

[1]: # (eth2spec: skip)

| `fork_version` | Chunk SSZ type |
|------------------------|-----------------------------|
| `fork_version` | Chunk SSZ type |
|---------------------|--------------------------|
| `FULU_FORK_VERSION` | `fulu.DataColumnSidecar` |

Request Content:
Expand Down
10 changes: 5 additions & 5 deletions specs/fulu/validator.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# EIP7594 -- Honest Validator
# Fulu -- Honest Validator

## Table of contents

Expand All @@ -17,14 +17,14 @@

## Introduction

This document represents the changes to be made in the code of an "honest validator" to implement EIP7594.
This document represents the changes to be made in the code of an "honest validator" to implement Fulu.

## Prerequisites

This document is an extension of the [Electra -- Honest Validator](../electra/validator.md) guide.
All behaviors and definitions defined in this document, and documents it extends, carry over unless explicitly noted or overridden.

All terminology, constants, functions, and protocol mechanics defined in the updated Beacon Chain doc of [EIP7594](./beacon-chain.md) are requisite for this document and used throughout.
All terminology, constants, functions, and protocol mechanics defined in the updated Beacon Chain doc of [Fulu](./beacon-chain.md) are requisite for this document and used throughout.
Please see related Beacon Chain doc before continuing and use them as a reference throughout.

## Block proposal
Expand Down Expand Up @@ -56,8 +56,8 @@ def prepare_execution_payload(state: BeaconState,
suggested_fee_recipient=suggested_fee_recipient,
withdrawals=withdrawals,
parent_beacon_block_root=hash_tree_root(state.latest_block_header),
target_blobs_per_block=TARGET_BLOBS_PER_BLOCK_EIP7594, # [Modified in EIP7594]
max_blobs_per_block=MAX_BLOBS_PER_BLOCK_EIP7594, # [Modified in EIP7594]
target_blobs_per_block=TARGET_BLOBS_PER_BLOCK_FULU, # [Modified in Fulu:EIP7594]
max_blobs_per_block=MAX_BLOBS_PER_BLOCK_FULU, # [Modified in Fulu:EIP7594]
)
return execution_engine.notify_forkchoice_updated(
head_block_hash=parent_hash,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ def test_polynomical_commitments_sampling(spec):
assert spec.FIELD_ELEMENTS_PER_EXT_BLOB == 2 * spec.FIELD_ELEMENTS_PER_BLOB


@with_eip7594_and_later
@with_fulu_and_later
@spec_test
@single_phase
def test_networking(spec):
assert spec.config.TARGET_BLOBS_PER_BLOCK_EIP7594 <= spec.config.MAX_BLOBS_PER_BLOCK_EIP7594
assert spec.config.MAX_BLOBS_PER_BLOCK_EIP7594 <= spec.MAX_BLOB_COMMITMENTS_PER_BLOCK
assert spec.config.TARGET_BLOBS_PER_BLOCK_FULU <= spec.config.MAX_BLOBS_PER_BLOCK_FULU
assert spec.config.MAX_BLOBS_PER_BLOCK_FULU <= spec.MAX_BLOB_COMMITMENTS_PER_BLOCK
assert (
spec.config.MAX_REQUEST_BLOB_SIDECARS_EIP7594 ==
spec.config.MAX_REQUEST_BLOCKS_DENEB * spec.config.MAX_BLOBS_PER_BLOCK_EIP7594
spec.config.MAX_REQUEST_BLOB_SIDECARS_FULU ==
spec.config.MAX_REQUEST_BLOCKS_DENEB * spec.config.MAX_BLOBS_PER_BLOCK_FULU
)
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def test_get_custody_columns_custody_size_more_than_number_of_groups(spec):
expect_assertion_error(lambda: spec.get_custody_groups(node_id, custody_group_count))


@with_eip7594_and_later
@with_fulu_and_later
@spec_test
@single_phase
def test_compute_columns_for_custody_group_out_of_bound_custody_group(spec):
Expand Down
6 changes: 3 additions & 3 deletions tests/core/pyspec/eth2spec/test/helpers/blob.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from eth2spec.test.helpers.forks import (
is_post_electra,
is_post_eip7594,
is_post_fulu,
)


Expand Down Expand Up @@ -107,8 +107,8 @@ def get_sample_blob_tx(spec, blob_count=1, rng=random.Random(5566), is_valid_blo


def get_max_blob_count(spec):
if is_post_eip7594(spec):
return spec.config.MAX_BLOBS_PER_BLOCK_EIP7594
if is_post_fulu(spec):
return spec.config.MAX_BLOBS_PER_BLOCK_FULU
elif is_post_electra(spec):
return spec.config.MAX_BLOBS_PER_BLOCK_ELECTRA
else:
Expand Down
10 changes: 5 additions & 5 deletions tests/core/pyspec/eth2spec/test/helpers/forks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from .constants import (
PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB,
ELECTRA, WHISK, EIP7732, EIP7594,
ELECTRA, FULU, WHISK, EIP7732,
PREVIOUS_FORK_OF,
)

Expand Down Expand Up @@ -41,12 +41,12 @@ def is_post_electra(spec):
return is_post_fork(spec.fork, ELECTRA)


def is_post_whisk(spec):
return is_post_fork(spec.fork, WHISK)
def is_post_fulu(spec):
return is_post_fork(spec.fork, FULU)


def is_post_eip7594(spec):
return is_post_fork(spec.fork, EIP7594)
def is_post_whisk(spec):
return is_post_fork(spec.fork, WHISK)


def is_post_eip7732(spec):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def random_block_capella(spec, state, signed_blocks, scenario_state, rng=Random(
def random_block_deneb(spec, state, signed_blocks, scenario_state, rng=Random(3456)):
block = random_block_capella(spec, state, signed_blocks, scenario_state, rng=rng)
# TODO: more commitments. blob_kzg_commitments: List[KZGCommitment, MAX_BLOBS_PER_BLOCK]
# TODO: add MAX_BLOBS_PER_BLOCK_EIP7594 at fulu
# TODO: add MAX_BLOBS_PER_BLOCK_FULU at fulu
opaque_tx, _, blob_kzg_commitments, _ = get_sample_blob_tx(
spec, blob_count=rng.randint(0, spec.config.MAX_BLOBS_PER_BLOCK), rng=rng)
block.body.execution_payload.transactions.append(opaque_tx)
Expand Down

0 comments on commit b504270

Please sign in to comment.