Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
19 changes: 7 additions & 12 deletions config.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,44 +138,39 @@ runner:
#
# # Option 3: EEST (Ethereum Execution Spec Tests) fixtures from GitHub releases.
# # Downloads fixtures directly from ethereum/execution-spec-tests releases.
# # Genesis files are auto-resolved per client type from the release.
# # Genesis files are generated dynamically from hive/{hash}.json files in the
# # fixtures using mapper.jq scripts (no separate genesis download needed).
# # eest_fixtures:
# # github_repo: ethereum/execution-spec-tests
# # github_release: benchmark@v0.0.7
# # # Optional: Override the subdirectory within fixtures tarball.
# # # fixtures_subdir: fixtures/blockchain_tests_engine_x # default
# # # Optional: Override URLs for fixtures/genesis tarballs.
# # # Optional: Override URL for fixtures tarball.
# # # fixtures_url: https://example.com/fixtures_benchmark.tar.gz
# # # genesis_url: https://example.com/benchmark_genesis.tar.gz
#
# # Option 3b: EEST fixtures from GitHub Actions artifacts.
# # Alternative to releases - downloads from workflow run artifacts.
# # Uses the gh CLI if available, otherwise falls back to the GitHub REST API
# # (requires runner.github_token or BENCHMARKOOR_RUNNER_GITHUB_TOKEN).
# # Requires runner.github_token or BENCHMARKOOR_RUNNER_GITHUB_TOKEN.
# # eest_fixtures:
# # github_repo: ethereum/execution-spec-tests
# # fixtures_artifact_name: fixtures_benchmark_fast # Required (instead of github_release)
# # genesis_artifact_name: benchmark_genesis # Optional, defaults to 'benchmark_genesis'
# # # Optional: Specify a specific workflow run ID (uses latest if not specified)
# # # fixtures_artifact_run_id: "12345678901"
# # # genesis_artifact_run_id: "12345678901"
# # # fixtures_subdir also works with artifacts
#
# # Option 3c: EEST fixtures from local directories.
# # Points directly at already-extracted fixtures and genesis directories.
# # Points directly at already-extracted fixtures directory.
# # No downloading or caching — useful for local development with locally-built EEST fixtures.
# # eest_fixtures:
# # local_fixtures_dir: /home/user/eest-output/fixtures
# # local_genesis_dir: /home/user/eest-output/genesis
# # # fixtures_subdir also works with local directories
# # # fixtures_subdir: fixtures/blockchain_tests_engine_x # default
#
# # Option 3d: EEST fixtures from local .tar.gz tarballs.
# # Extracts tarballs to a cache directory (keyed by content hash, re-extraction skipped
# # Option 3d: EEST fixtures from local .tar.gz tarball.
# # Extracts tarball to a cache directory (keyed by content hash, re-extraction skipped
# # if already cached). Useful when you have locally-built tarballs but haven't extracted them.
# # eest_fixtures:
# # local_fixtures_tarball: /home/user/eest-output/fixtures_benchmark.tar.gz
# # local_genesis_tarball: /home/user/eest-output/benchmark_genesis.tar.gz
# # # fixtures_subdir also works with local tarballs

# Optional: API server for authentication and user management.
Expand Down
46 changes: 9 additions & 37 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,39 +155,35 @@ type SourceConfig struct {
}

// EESTFixturesSource defines an EEST fixtures source from GitHub releases, artifacts,
// or local directories/tarballs.
// or local directories/tarballs. Genesis files are generated dynamically from
// hive/{hash}.json files included in the fixtures using mapper.jq scripts.
type EESTFixturesSource struct {
GitHubRepo string `yaml:"github_repo,omitempty" mapstructure:"github_repo"`
GitHubRelease string `yaml:"github_release,omitempty" mapstructure:"github_release"`
FixturesURL string `yaml:"fixtures_url,omitempty" mapstructure:"fixtures_url"`
GenesisURL string `yaml:"genesis_url,omitempty" mapstructure:"genesis_url"`
FixturesSubdir string `yaml:"fixtures_subdir,omitempty" mapstructure:"fixtures_subdir"`
// GitHub Actions artifact support (alternative to releases).
FixturesArtifactName string `yaml:"fixtures_artifact_name,omitempty" mapstructure:"fixtures_artifact_name"`
GenesisArtifactName string `yaml:"genesis_artifact_name,omitempty" mapstructure:"genesis_artifact_name"`
FixturesArtifactRunID string `yaml:"fixtures_artifact_run_id,omitempty" mapstructure:"fixtures_artifact_run_id"`
GenesisArtifactRunID string `yaml:"genesis_artifact_run_id,omitempty" mapstructure:"genesis_artifact_run_id"`
// Local directory support (already-extracted fixtures).
LocalFixturesDir string `yaml:"local_fixtures_dir,omitempty" mapstructure:"local_fixtures_dir"`
LocalGenesisDir string `yaml:"local_genesis_dir,omitempty" mapstructure:"local_genesis_dir"`
// Local tarball support (.tar.gz files).
LocalFixturesTarball string `yaml:"local_fixtures_tarball,omitempty" mapstructure:"local_fixtures_tarball"`
LocalGenesisTarball string `yaml:"local_genesis_tarball,omitempty" mapstructure:"local_genesis_tarball"`
}

// UseArtifacts returns true if the source is configured to use GitHub Actions artifacts.
func (e *EESTFixturesSource) UseArtifacts() bool {
return e.FixturesArtifactName != "" || e.GenesisArtifactName != ""
return e.FixturesArtifactName != ""
}

// UseLocalDir returns true if the source is configured to use local directories.
// UseLocalDir returns true if the source is configured to use a local directory.
func (e *EESTFixturesSource) UseLocalDir() bool {
return e.LocalFixturesDir != "" || e.LocalGenesisDir != ""
return e.LocalFixturesDir != ""
}

// UseLocalTarball returns true if the source is configured to use local tarballs.
// UseLocalTarball returns true if the source is configured to use a local tarball.
func (e *EESTFixturesSource) UseLocalTarball() bool {
return e.LocalFixturesTarball != "" || e.LocalGenesisTarball != ""
return e.LocalFixturesTarball != ""
}

// validate checks the EEST fixtures source configuration for errors.
Expand Down Expand Up @@ -219,8 +215,8 @@ func (e *EESTFixturesSource) validate() error {
if modeCount == 0 {
return fmt.Errorf(
"eest_fixtures: must specify one of: github_release, " +
"fixtures_artifact_name, local_fixtures_dir/local_genesis_dir, " +
"or local_fixtures_tarball/local_genesis_tarball",
"fixtures_artifact_name, local_fixtures_dir, " +
"or local_fixtures_tarball",
)
}

Expand All @@ -238,40 +234,16 @@ func (e *EESTFixturesSource) validate() error {

// Validate local dir mode.
if hasLocalDir {
if e.LocalFixturesDir == "" {
return fmt.Errorf("eest_fixtures: local_fixtures_dir is required when local_genesis_dir is set")
}

if e.LocalGenesisDir == "" {
return fmt.Errorf("eest_fixtures: local_genesis_dir is required when local_fixtures_dir is set")
}

if err := validateDirExists(e.LocalFixturesDir, "eest_fixtures.local_fixtures_dir"); err != nil {
return err
}

if err := validateDirExists(e.LocalGenesisDir, "eest_fixtures.local_genesis_dir"); err != nil {
return err
}
}

// Validate local tarball mode.
if hasLocalTarball {
if e.LocalFixturesTarball == "" {
return fmt.Errorf("eest_fixtures: local_fixtures_tarball is required when local_genesis_tarball is set")
}

if e.LocalGenesisTarball == "" {
return fmt.Errorf("eest_fixtures: local_genesis_tarball is required when local_fixtures_tarball is set")
}

if err := validateFileExists(e.LocalFixturesTarball, "eest_fixtures.local_fixtures_tarball"); err != nil {
return err
}

if err := validateFileExists(e.LocalGenesisTarball, "eest_fixtures.local_genesis_tarball"); err != nil {
return err
}
}

return nil
Expand Down
49 changes: 3 additions & 46 deletions pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,7 @@ func TestSourceConfig_Validate(t *testing.T) {

// Create test tarballs for local tarball validation tests.
fixturesTarball := filepath.Join(tmpDir, "fixtures.tar.gz")
genesisTarball := filepath.Join(tmpDir, "genesis.tar.gz")
createTestTarball(t, fixturesTarball)
createTestTarball(t, genesisTarball)

tests := []struct {
name string
Expand Down Expand Up @@ -445,37 +443,23 @@ func TestSourceConfig_Validate(t *testing.T) {
source: SourceConfig{
EESTFixtures: &EESTFixturesSource{
LocalFixturesDir: tmpDir,
LocalGenesisDir: tmpDir,
},
},
wantErr: false,
},
{
name: "eest_fixtures local dir missing local_genesis_dir",
name: "eest_fixtures must specify a mode",
source: SourceConfig{
EESTFixtures: &EESTFixturesSource{
LocalFixturesDir: tmpDir,
},
EESTFixtures: &EESTFixturesSource{},
},
wantErr: true,
errSubstr: "local_genesis_dir is required",
},
{
name: "eest_fixtures local dir missing local_fixtures_dir",
source: SourceConfig{
EESTFixtures: &EESTFixturesSource{
LocalGenesisDir: tmpDir,
},
},
wantErr: true,
errSubstr: "local_fixtures_dir is required",
errSubstr: "must specify one of",
},
{
name: "eest_fixtures local dir path does not exist",
source: SourceConfig{
EESTFixtures: &EESTFixturesSource{
LocalFixturesDir: "/nonexistent/fixtures",
LocalGenesisDir: tmpDir,
},
},
wantErr: true,
Expand All @@ -486,7 +470,6 @@ func TestSourceConfig_Validate(t *testing.T) {
source: SourceConfig{
EESTFixtures: &EESTFixturesSource{
LocalFixturesDir: tmpDir,
LocalGenesisDir: tmpDir,
},
},
wantErr: false,
Expand All @@ -498,7 +481,6 @@ func TestSourceConfig_Validate(t *testing.T) {
GitHubRepo: "ethereum/execution-spec-tests",
GitHubRelease: "benchmark@v0.0.6",
LocalFixturesDir: tmpDir,
LocalGenesisDir: tmpDir,
},
},
wantErr: true,
Expand All @@ -509,9 +491,7 @@ func TestSourceConfig_Validate(t *testing.T) {
source: SourceConfig{
EESTFixtures: &EESTFixturesSource{
LocalFixturesDir: tmpDir,
LocalGenesisDir: tmpDir,
LocalFixturesTarball: fixturesTarball,
LocalGenesisTarball: genesisTarball,
},
},
wantErr: true,
Expand All @@ -522,37 +502,15 @@ func TestSourceConfig_Validate(t *testing.T) {
source: SourceConfig{
EESTFixtures: &EESTFixturesSource{
LocalFixturesTarball: fixturesTarball,
LocalGenesisTarball: genesisTarball,
},
},
wantErr: false,
},
{
name: "eest_fixtures local tarball missing local_genesis_tarball",
source: SourceConfig{
EESTFixtures: &EESTFixturesSource{
LocalFixturesTarball: fixturesTarball,
},
},
wantErr: true,
errSubstr: "local_genesis_tarball is required",
},
{
name: "eest_fixtures local tarball missing local_fixtures_tarball",
source: SourceConfig{
EESTFixtures: &EESTFixturesSource{
LocalGenesisTarball: genesisTarball,
},
},
wantErr: true,
errSubstr: "local_fixtures_tarball is required",
},
{
name: "eest_fixtures local tarball path does not exist",
source: SourceConfig{
EESTFixtures: &EESTFixturesSource{
LocalFixturesTarball: "/nonexistent/fixtures.tar.gz",
LocalGenesisTarball: genesisTarball,
},
},
wantErr: true,
Expand All @@ -565,7 +523,6 @@ func TestSourceConfig_Validate(t *testing.T) {
GitHubRepo: "ethereum/execution-spec-tests",
FixturesArtifactName: "fixtures_benchmark",
LocalFixturesTarball: fixturesTarball,
LocalGenesisTarball: genesisTarball,
},
},
wantErr: true,
Expand Down
Loading
Loading