From 5b0bfe7eb63e164658d5ae656266ebd330343b5f Mon Sep 17 00:00:00 2001 From: terence tsao Date: Wed, 30 Nov 2022 13:57:19 -0800 Subject: [PATCH 1/2] EIP4844: Update `MAX_BLOBS_PER_BLOCK` to 4 --- presets/mainnet/eip4844.yaml | 4 ++-- presets/minimal/eip4844.yaml | 4 ++-- specs/eip4844/beacon-chain.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/presets/mainnet/eip4844.yaml b/presets/mainnet/eip4844.yaml index c40908fdec..3866e82ff7 100644 --- a/presets/mainnet/eip4844.yaml +++ b/presets/mainnet/eip4844.yaml @@ -4,5 +4,5 @@ # --------------------------------------------------------------- # `uint64(4096)` FIELD_ELEMENTS_PER_BLOB: 4096 -# `uint64(2**4)` (= 16) -MAX_BLOBS_PER_BLOCK: 16 +# `uint64(2**2)` (= 4) +MAX_BLOBS_PER_BLOCK: 4 diff --git a/presets/minimal/eip4844.yaml b/presets/minimal/eip4844.yaml index fbb6768190..dacacf5b84 100644 --- a/presets/minimal/eip4844.yaml +++ b/presets/minimal/eip4844.yaml @@ -4,5 +4,5 @@ # --------------------------------------------------------------- # [customized] FIELD_ELEMENTS_PER_BLOB: 4 -# `uint64(2**4)` (= 16) -MAX_BLOBS_PER_BLOCK: 16 +# `uint64(2**2)` (= 4) +MAX_BLOBS_PER_BLOCK: 4 diff --git a/specs/eip4844/beacon-chain.md b/specs/eip4844/beacon-chain.md index 600793a3fb..3f1dc3ca0e 100644 --- a/specs/eip4844/beacon-chain.md +++ b/specs/eip4844/beacon-chain.md @@ -63,7 +63,7 @@ This upgrade adds blobs to the beacon chain as part of EIP-4844. This is an exte | Name | Value | | - | - | -| `MAX_BLOBS_PER_BLOCK` | `uint64(2**4)` (= 16) | +| `MAX_BLOBS_PER_BLOCK` | `uint64(2**2)` (= 4) | ## Configuration From 0dda0b263366a73bae95cd304b7923c8ac2abdc3 Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Thu, 1 Dec 2022 23:37:16 +0800 Subject: [PATCH 2/2] Fix tests --- tests/core/pyspec/eth2spec/test/eip4844/sanity/test_blocks.py | 4 ++-- .../test/eip4844/unittests/validator/test_validator.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/core/pyspec/eth2spec/test/eip4844/sanity/test_blocks.py b/tests/core/pyspec/eth2spec/test/eip4844/sanity/test_blocks.py index f08a7fda92..c83eb38efc 100644 --- a/tests/core/pyspec/eth2spec/test/eip4844/sanity/test_blocks.py +++ b/tests/core/pyspec/eth2spec/test/eip4844/sanity/test_blocks.py @@ -30,11 +30,11 @@ def test_one_blob(spec, state): @with_eip4844_and_later @spec_state_test -def test_multiple_blobs(spec, state): +def test_max_blobs(spec, state): yield 'pre', state block = build_empty_block_for_next_slot(spec, state) - opaque_tx, _, blob_kzg_commitments = get_sample_opaque_tx(spec, blob_count=5) + opaque_tx, _, blob_kzg_commitments = get_sample_opaque_tx(spec, blob_count=spec.MAX_BLOBS_PER_BLOCK) block.body.blob_kzg_commitments = blob_kzg_commitments block.body.execution_payload.transactions = [opaque_tx] signed_block = state_transition_and_sign_block(spec, state, block) diff --git a/tests/core/pyspec/eth2spec/test/eip4844/unittests/validator/test_validator.py b/tests/core/pyspec/eth2spec/test/eip4844/unittests/validator/test_validator.py index d9e3877c3c..bd9f40a6e4 100644 --- a/tests/core/pyspec/eth2spec/test/eip4844/unittests/validator/test_validator.py +++ b/tests/core/pyspec/eth2spec/test/eip4844/unittests/validator/test_validator.py @@ -45,5 +45,5 @@ def test_validate_blobs_sidecar_two_blobs(spec, state): @with_eip4844_and_later @spec_state_test -def test_validate_blobs_sidecar_ten_blobs(spec, state): - _run_validate_blobs_sidecar_test(spec, state, blob_count=10) +def test_validate_blobs_sidecar_max_blobs(spec, state): + _run_validate_blobs_sidecar_test(spec, state, blob_count=spec.MAX_BLOBS_PER_BLOCK)