New directory layout for fixture releases: Split by fork and gas limit #2167
Replies: 4 comments 3 replies
-
|
I like option A, but using |
Beta Was this translation helpful? Give feedback.
-
|
For implementation I think we should be able to configure E.g. if we are filling normal tests, "instruct" it to look into the |
Beta Was this translation helpful? Give feedback.
-
|
Option D: Group by target fork, flat Like Option A but drop the Consensus tests: Benchmark (multi-fork, multiple gas limits): |
Beta Was this translation helpful? Give feedback.
-
|
Option A was implemented in #2134. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Background
Test source code is organized by the fork that introduced the functionality being tested:
When vectors ("fixtures") are generated ("filled"), each test produces fixtures not just for its source fork, but for every fork from the source fork onwards. For example, a Shanghai withdrawal test generates fixtures for Shanghai, Cancun, Prague, and Osaka.
Problem
Currently all of these fixtures land in a single JSON file per test, so files grow with each new axis value:
--gas-benchmark-values. The set doesn't grow indefinitely (it's chosen per run), but still causes significant bloat.Solution
Each JSON file should contain fixtures for exactly one fork and (if applicable) one gas-limit value. This requires a directory layout change in the fixture output (also used in releases).
Current layout
All fork fixtures in the same file:
All gas-limit values in the same file:
Proposed layout options
Option A: Group by target fork (
for_{fork}/{source})Top level = target fork. Source and subtree nested inside.
Consensus tests:
Benchmark (single fork, multiple gas limits):
Benchmark (multi-fork, multiple gas limits):
Pros: Consumer-friendly - grab
for_cancun/and get everything. Preserves the existing{source}/{eip}/{module}subtree exactly.Cons: One extra directory level. Tests sourced from Shanghai are scattered across
for_shanghai/,for_cancun/, etc. Mitigated forconsumevia-k fork_Shanghai; additional-mmarkers can be added if needed.Option B: Group by source (
{source}_for_{fork})Top level = source + target fork combined. Keeps the test source as the primary grouping.
Consensus tests:
Benchmark (single fork, multiple gas limits):
Benchmark (multi-fork, multiple gas limits):
Pros: Familiar - test source immediately visible.
shanghai_for_*groups nicely in sorted listings.Cons: Quadratic top-level directory growth (see below). Consumers must glob
*_for_cancunto collect all tests for a fork.Option C: Split at the leaf (
{source}/.../fork_{fork})Keep the existing
{source}/{eip}/{module}hierarchy unchanged. Push the target fork (and gas limit) to a subdirectory at the leaf level.Consensus tests:
Benchmark (single fork, multiple gas limits):
Benchmark (multi-fork, multiple gas limits):
Pros: Smallest migration footprint - the existing top-level and mid-level directory hierarchy is untouched. No extra top-level directory layer. Linear growth in leaf subdirectories.
Cons: "Give me everything for fork X" requires a recursive glob (
**/fork_cancun/**) rather than a single top-level directory - worse consumer ergonomics. Leaf directories get noisier as forks accumulate.Quick Comparison
Option A caps the top level at
Ndirectories (one per fork) and matches the most common consumer workflow: "give me all tests for fork X" =for_cancun/.Option B has quadratic top-level directory growth: each source fork produces a directory for every subsequent fork (
frontier_for_frontier/,frontier_for_homestead/, ...,frontier_for_osaka/,homestead_for_homestead/, ...). This would lead to ~N(N+1)/2directories; ~105 by Osaka (~14 forks), growing with every new fork.Option C avoids top-level restructuring entirely, but forces consumers to use recursive globs (
**/fork_cancun/**) to collect all tests for a fork. This trades migration simplicity for worse day-to-day ergonomics.Consumer impact
Breaking change to both paths and JSON content:
fork_Cancunbecomes unnecessary.1 vote ·
Beta Was this translation helpful? Give feedback.
All reactions