Skip to content

Commit 7ca71aa

Browse files
jsignmarioevz
authored andcommitted
feat(specs/blockchain): Add optional field to exclude postState (ethereum#1578)
* add optional field to exclude including postState Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com> * Update src/ethereum_test_specs/blockchain.py Co-authored-by: Mario Vega <marioevz@gmail.com> * switch to not including postState field Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com> * lints Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com> * Update src/ethereum_test_specs/blockchain.py Co-authored-by: Mario Vega <marioevz@gmail.com> * Update src/ethereum_test_specs/blockchain.py Co-authored-by: Mario Vega <marioevz@gmail.com> * feedback fixes Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com> --------- Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com> Co-authored-by: Mario Vega <marioevz@gmail.com>
1 parent ff4e743 commit 7ca71aa

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/ethereum_test_specs/blockchain.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,11 @@ class BlockchainTest(BaseTest):
300300
genesis_environment: Environment = Field(default_factory=Environment)
301301
verify_sync: bool = False
302302
chain_id: int = 1
303+
exclude_full_post_state_in_output: bool = False
304+
"""
305+
Exclude the post state from the fixture output.
306+
In this case, the state verification is only performed based on the state root.
307+
"""
303308

304309
supported_fixture_formats: ClassVar[Sequence[FixtureFormat | LabeledFixtureFormat]] = [
305310
BlockchainFixture,
@@ -652,7 +657,7 @@ def make_fixture(
652657
blocks=fixture_blocks,
653658
last_block_hash=head,
654659
pre=pre,
655-
post_state=alloc,
660+
post_state=alloc if not self.exclude_full_post_state_in_output else None,
656661
config=FixtureConfig(
657662
fork=network_info,
658663
blob_schedule=FixtureBlobSchedule.from_blob_schedule(fork.blob_schedule()),
@@ -751,7 +756,7 @@ def make_hive_fixture(
751756
payloads=fixture_payloads,
752757
fcu_version=fcu_version,
753758
pre=pre,
754-
post_state=alloc,
759+
post_state=alloc if not self.exclude_full_post_state_in_output else None,
755760
sync_payload=sync_payload,
756761
last_block_hash=head_hash,
757762
config=FixtureConfig(

0 commit comments

Comments
 (0)