From 209816520359014f8bab973080cb3ff699fe9a96 Mon Sep 17 00:00:00 2001 From: Ignacio Hagopian Date: Thu, 8 May 2025 13:29:50 -0300 Subject: [PATCH 1/7] add optional field to exclude including postState Signed-off-by: Ignacio Hagopian --- src/ethereum_test_specs/blockchain.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ethereum_test_specs/blockchain.py b/src/ethereum_test_specs/blockchain.py index 679c464c028..bde00985224 100644 --- a/src/ethereum_test_specs/blockchain.py +++ b/src/ethereum_test_specs/blockchain.py @@ -300,6 +300,7 @@ class BlockchainTest(BaseTest): genesis_environment: Environment = Field(default_factory=Environment) verify_sync: bool = False chain_id: int = 1 + exclude_post_state: bool = False supported_fixture_formats: ClassVar[Sequence[FixtureFormat | LabeledFixtureFormat]] = [ BlockchainFixture, @@ -643,7 +644,8 @@ def make_fixture( t8n, t8n_state=alloc, expected_state=block.expected_post_state ) self.check_exception_test(exception=invalid_blocks > 0) - self.verify_post_state(t8n, t8n_state=alloc) + if not self.exclude_post_state: + self.verify_post_state(t8n, t8n_state=alloc) network_info = BlockchainTest.network_info(fork, eips) return BlockchainFixture( fork=network_info, @@ -652,7 +654,7 @@ def make_fixture( blocks=fixture_blocks, last_block_hash=head, pre=pre, - post_state=alloc, + post_state=alloc if not self.exclude_post_state else {}, config=FixtureConfig( fork=network_info, blob_schedule=FixtureBlobSchedule.from_blob_schedule(fork.blob_schedule()), @@ -714,7 +716,8 @@ def make_hive_fixture( " The framework should never try to execute this test case." ) - self.verify_post_state(t8n, t8n_state=alloc) + if not self.exclude_post_state: + self.verify_post_state(t8n, t8n_state=alloc) sync_payload: Optional[FixtureEngineNewPayload] = None if self.verify_sync: @@ -751,7 +754,7 @@ def make_hive_fixture( payloads=fixture_payloads, fcu_version=fcu_version, pre=pre, - post_state=alloc, + post_state=alloc if not self.exclude_post_state else {}, sync_payload=sync_payload, last_block_hash=head_hash, config=FixtureConfig( From 87ff69a28e224b329387cfce72c85aa58b122b29 Mon Sep 17 00:00:00 2001 From: Ignacio Hagopian Date: Fri, 9 May 2025 12:44:36 -0300 Subject: [PATCH 2/7] Update src/ethereum_test_specs/blockchain.py Co-authored-by: Mario Vega --- src/ethereum_test_specs/blockchain.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ethereum_test_specs/blockchain.py b/src/ethereum_test_specs/blockchain.py index bde00985224..7bba81cca08 100644 --- a/src/ethereum_test_specs/blockchain.py +++ b/src/ethereum_test_specs/blockchain.py @@ -301,6 +301,11 @@ class BlockchainTest(BaseTest): verify_sync: bool = False chain_id: int = 1 exclude_post_state: bool = False + """ + Exclude the post state from the fixture output. + + In this case, the state verification is only performed based on the state root. + """ supported_fixture_formats: ClassVar[Sequence[FixtureFormat | LabeledFixtureFormat]] = [ BlockchainFixture, From cfac111452ca0a4d580b004a34a0d74fb5799a6d Mon Sep 17 00:00:00 2001 From: Ignacio Hagopian Date: Fri, 9 May 2025 14:47:47 -0300 Subject: [PATCH 3/7] switch to not including postState field Signed-off-by: Ignacio Hagopian --- src/ethereum_test_specs/blockchain.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ethereum_test_specs/blockchain.py b/src/ethereum_test_specs/blockchain.py index 7bba81cca08..d6d4d7fab22 100644 --- a/src/ethereum_test_specs/blockchain.py +++ b/src/ethereum_test_specs/blockchain.py @@ -659,7 +659,7 @@ def make_fixture( blocks=fixture_blocks, last_block_hash=head, pre=pre, - post_state=alloc if not self.exclude_post_state else {}, + post_state=alloc if not self.exclude_post_state else None, config=FixtureConfig( fork=network_info, blob_schedule=FixtureBlobSchedule.from_blob_schedule(fork.blob_schedule()), @@ -759,7 +759,7 @@ def make_hive_fixture( payloads=fixture_payloads, fcu_version=fcu_version, pre=pre, - post_state=alloc if not self.exclude_post_state else {}, + post_state=alloc if not self.exclude_post_state else None, sync_payload=sync_payload, last_block_hash=head_hash, config=FixtureConfig( From 77ab3eb5217f54ed233083b6d5c4ee08c50ef0d1 Mon Sep 17 00:00:00 2001 From: Ignacio Hagopian Date: Fri, 9 May 2025 15:08:57 -0300 Subject: [PATCH 4/7] lints Signed-off-by: Ignacio Hagopian --- src/ethereum_test_specs/blockchain.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ethereum_test_specs/blockchain.py b/src/ethereum_test_specs/blockchain.py index d6d4d7fab22..d6632b88dfa 100644 --- a/src/ethereum_test_specs/blockchain.py +++ b/src/ethereum_test_specs/blockchain.py @@ -303,7 +303,6 @@ class BlockchainTest(BaseTest): exclude_post_state: bool = False """ Exclude the post state from the fixture output. - In this case, the state verification is only performed based on the state root. """ From 3ca65f3408df1ffe3d9cfd1717cb5efe8e2917db Mon Sep 17 00:00:00 2001 From: Ignacio Hagopian Date: Tue, 13 May 2025 13:15:46 -0300 Subject: [PATCH 5/7] Update src/ethereum_test_specs/blockchain.py Co-authored-by: Mario Vega --- src/ethereum_test_specs/blockchain.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ethereum_test_specs/blockchain.py b/src/ethereum_test_specs/blockchain.py index d6632b88dfa..b3d68643135 100644 --- a/src/ethereum_test_specs/blockchain.py +++ b/src/ethereum_test_specs/blockchain.py @@ -648,8 +648,7 @@ def make_fixture( t8n, t8n_state=alloc, expected_state=block.expected_post_state ) self.check_exception_test(exception=invalid_blocks > 0) - if not self.exclude_post_state: - self.verify_post_state(t8n, t8n_state=alloc) + self.verify_post_state(t8n, t8n_state=alloc) network_info = BlockchainTest.network_info(fork, eips) return BlockchainFixture( fork=network_info, From df8d11fd90892122c5ef103317d9b32a7f830651 Mon Sep 17 00:00:00 2001 From: Ignacio Hagopian Date: Tue, 13 May 2025 13:17:12 -0300 Subject: [PATCH 6/7] Update src/ethereum_test_specs/blockchain.py Co-authored-by: Mario Vega --- src/ethereum_test_specs/blockchain.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ethereum_test_specs/blockchain.py b/src/ethereum_test_specs/blockchain.py index b3d68643135..468a7d196c4 100644 --- a/src/ethereum_test_specs/blockchain.py +++ b/src/ethereum_test_specs/blockchain.py @@ -300,7 +300,7 @@ class BlockchainTest(BaseTest): genesis_environment: Environment = Field(default_factory=Environment) verify_sync: bool = False chain_id: int = 1 - exclude_post_state: bool = False + exclude_full_post_state_in_output: bool = False """ Exclude the post state from the fixture output. In this case, the state verification is only performed based on the state root. From 950aaa76f72ef7949a4941fbb300d97ca5fd9973 Mon Sep 17 00:00:00 2001 From: Ignacio Hagopian Date: Tue, 13 May 2025 13:22:54 -0300 Subject: [PATCH 7/7] feedback fixes Signed-off-by: Ignacio Hagopian --- src/ethereum_test_specs/blockchain.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ethereum_test_specs/blockchain.py b/src/ethereum_test_specs/blockchain.py index 468a7d196c4..741b0a0857d 100644 --- a/src/ethereum_test_specs/blockchain.py +++ b/src/ethereum_test_specs/blockchain.py @@ -657,7 +657,7 @@ def make_fixture( blocks=fixture_blocks, last_block_hash=head, pre=pre, - post_state=alloc if not self.exclude_post_state else None, + post_state=alloc if not self.exclude_full_post_state_in_output else None, config=FixtureConfig( fork=network_info, blob_schedule=FixtureBlobSchedule.from_blob_schedule(fork.blob_schedule()), @@ -719,8 +719,7 @@ def make_hive_fixture( " The framework should never try to execute this test case." ) - if not self.exclude_post_state: - self.verify_post_state(t8n, t8n_state=alloc) + self.verify_post_state(t8n, t8n_state=alloc) sync_payload: Optional[FixtureEngineNewPayload] = None if self.verify_sync: @@ -757,7 +756,7 @@ def make_hive_fixture( payloads=fixture_payloads, fcu_version=fcu_version, pre=pre, - post_state=alloc if not self.exclude_post_state else None, + post_state=alloc if not self.exclude_full_post_state_in_output else None, sync_payload=sync_payload, last_block_hash=head_hash, config=FixtureConfig(