Skip to content

Add optional field to exclude including postState #1578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 13, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/ethereum_test_specs/blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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()),
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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(
Expand Down
Loading