Skip to content

Commit 0a07c00

Browse files
authored
fix(test-ci): Fix benchmark artifact expectation for new builder prealloc (#2142)
1 parent a9df61a commit 0a07c00

2 files changed

Lines changed: 8 additions & 15 deletions

File tree

packages/testing/src/execution_testing/cli/extract_config.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
)
3737
from execution_testing.fixtures.blockchain import FixtureHeader
3838
from execution_testing.fixtures.file import Fixtures
39-
from execution_testing.fixtures.pre_alloc_groups import PreAllocGroup
39+
from execution_testing.fixtures.pre_alloc_groups import PreAllocGroupBuilder
4040
from execution_testing.forks import Fork
4141

4242

@@ -176,8 +176,9 @@ def from_fixture(cls, fixture_path: Path) -> Self:
176176
pass
177177

178178
try:
179-
# Try to load pre-allocation group
180-
pre_alloc_group = PreAllocGroup.model_validate_json(fixture_bytes)
179+
# Load as builder format and compute genesis on-demand
180+
builder = PreAllocGroupBuilder.model_validate_json(fixture_bytes)
181+
pre_alloc_group = builder.build()
181182
return cls(
182183
header=pre_alloc_group.genesis,
183184
alloc=pre_alloc_group.pre,

packages/testing/src/execution_testing/fixtures/pre_alloc_groups.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
Tuple,
1818
)
1919

20-
from pydantic import Field, PrivateAttr, ValidationError
20+
from pydantic import Field, PrivateAttr
2121

2222
from execution_testing.base_types import (
2323
CamelModel,
@@ -340,21 +340,13 @@ def from_file(cls, file: Path) -> Self:
340340
"""
341341
Load a pre-allocation group from a JSON file.
342342
343-
Handles both builder format (without genesis) and full format (with
344-
genesis). If genesis is missing, computes it from the pre-allocation
345-
state. This ensures state root computation happens exactly once when
346-
loading in Phase 2, not during Phase 1 merging.
343+
Files are stored in builder format (without genesis). Genesis is
344+
computed on-demand when loading, ensuring state root computation
345+
happens exactly once in Phase 2, not during Phase 1 merging.
347346
"""
348347
with open(file) as f:
349348
data = f.read()
350349

351-
# Try loading as full PreAllocGroup first (backwards compatibility)
352-
try:
353-
return cls.model_validate_json(data)
354-
except ValidationError:
355-
pass
356-
357-
# Load as builder format and compute genesis
358350
builder = PreAllocGroupBuilder.model_validate_json(data)
359351
built = builder.build()
360352
# Use cls.model_validate to ensure proper Self return type

0 commit comments

Comments
 (0)