diff --git a/specs/fulu/beacon-chain.md b/specs/fulu/beacon-chain.md index 8f30e683e7..5dca6580f5 100644 --- a/specs/fulu/beacon-chain.md +++ b/specs/fulu/beacon-chain.md @@ -1,4 +1,4 @@ -# EIP7594 -- The Beacon Chain +# Fulu -- The Beacon Chain **Notice**: This document is a work-in-progress for researchers and implementers. @@ -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 @@ -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( @@ -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 diff --git a/specs/fulu/p2p-interface.md b/specs/fulu/p2p-interface.md index 95d6ffbb86..7dbb16432c 100644 --- a/specs/fulu/p2p-interface.md +++ b/specs/fulu/p2p-interface.md @@ -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 @@ -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 @@ -215,21 +215,21 @@ 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 `` 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] ) ``` @@ -237,27 +237,27 @@ 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 `` 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: @@ -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 @@ -290,8 +290,8 @@ The `` 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: @@ -338,8 +338,8 @@ The `` 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: diff --git a/specs/fulu/validator.md b/specs/fulu/validator.md index 0fddad4ebe..b8781e8ad6 100644 --- a/specs/fulu/validator.md +++ b/specs/fulu/validator.md @@ -1,4 +1,4 @@ -# EIP7594 -- Honest Validator +# Fulu -- Honest Validator ## Table of contents @@ -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 @@ -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, diff --git a/tests/core/pyspec/eth2spec/test/fulu/unittests/test_config_invariants.py b/tests/core/pyspec/eth2spec/test/fulu/unittests/test_config_invariants.py index 6be2a3f64c..57b40f6e2c 100644 --- a/tests/core/pyspec/eth2spec/test/fulu/unittests/test_config_invariants.py +++ b/tests/core/pyspec/eth2spec/test/fulu/unittests/test_config_invariants.py @@ -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 ) diff --git a/tests/core/pyspec/eth2spec/test/fulu/unittests/test_custody.py b/tests/core/pyspec/eth2spec/test/fulu/unittests/test_custody.py index dcd08ce1d2..fa2fcbc7dc 100644 --- a/tests/core/pyspec/eth2spec/test/fulu/unittests/test_custody.py +++ b/tests/core/pyspec/eth2spec/test/fulu/unittests/test_custody.py @@ -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): diff --git a/tests/core/pyspec/eth2spec/test/helpers/blob.py b/tests/core/pyspec/eth2spec/test/helpers/blob.py index e0d82da1a0..f89b1ff527 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/blob.py +++ b/tests/core/pyspec/eth2spec/test/helpers/blob.py @@ -4,7 +4,7 @@ from eth2spec.test.helpers.forks import ( is_post_electra, - is_post_eip7594, + is_post_fulu, ) @@ -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: diff --git a/tests/core/pyspec/eth2spec/test/helpers/forks.py b/tests/core/pyspec/eth2spec/test/helpers/forks.py index e261e3a754..4bb3d54ed3 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/forks.py +++ b/tests/core/pyspec/eth2spec/test/helpers/forks.py @@ -1,6 +1,6 @@ from .constants import ( PHASE0, ALTAIR, BELLATRIX, CAPELLA, DENEB, - ELECTRA, WHISK, EIP7732, EIP7594, + ELECTRA, FULU, WHISK, EIP7732, PREVIOUS_FORK_OF, ) @@ -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): diff --git a/tests/core/pyspec/eth2spec/test/utils/randomized_block_tests.py b/tests/core/pyspec/eth2spec/test/utils/randomized_block_tests.py index df67872880..0e4727b794 100644 --- a/tests/core/pyspec/eth2spec/test/utils/randomized_block_tests.py +++ b/tests/core/pyspec/eth2spec/test/utils/randomized_block_tests.py @@ -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)