Skip to content
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

op-challenger: fail immediately if VmBin and Server don't exist #13588

Merged
merged 7 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from 3 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
25 changes: 25 additions & 0 deletions op-challenger/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"net/url"
"os"
"runtime"
"slices"
"strconv"
Expand Down Expand Up @@ -216,6 +217,14 @@ func (c Config) Check() error {
if c.Cannon.Server == "" {
return ErrMissingCannonServer
}

if _, err := os.Stat(c.Cannon.VmBin); err != nil {
return fmt.Errorf("%w: %v", ErrMissingCannonBin, err)
}
if _, err := os.Stat(c.Cannon.Server); err != nil {
return fmt.Errorf("%w: %v", ErrMissingCannonServer, err)
}

if c.Cannon.Network == "" {
if c.Cannon.RollupConfigPath == "" {
return ErrMissingCannonRollupConfig
Expand Down Expand Up @@ -254,6 +263,14 @@ func (c Config) Check() error {
if c.Asterisc.Server == "" {
return ErrMissingAsteriscServer
}

if _, err := os.Stat(c.Asterisc.VmBin); err != nil {
return fmt.Errorf("%w: %v", ErrMissingAsteriscBin, err)
}
if _, err := os.Stat(c.Asterisc.Server); err != nil {
return fmt.Errorf("%w: %v", ErrMissingAsteriscServer, err)
}

if c.Asterisc.Network == "" {
if c.Asterisc.RollupConfigPath == "" {
return ErrMissingAsteriscRollupConfig
Expand Down Expand Up @@ -289,6 +306,14 @@ func (c Config) Check() error {
if c.AsteriscKona.Server == "" {
return ErrMissingAsteriscKonaServer
}

if _, err := os.Stat(c.AsteriscKona.VmBin); err != nil {
return fmt.Errorf("%w: %v", ErrMissingAsteriscKonaBin, err)
}
if _, err := os.Stat(c.AsteriscKona.Server); err != nil {
return fmt.Errorf("%w: %v", ErrMissingAsteriscKonaServer, err)
}

if c.AsteriscKona.Network == "" {
if c.AsteriscKona.RollupConfigPath == "" {
return ErrMissingAsteriscKonaRollupConfig
Expand Down
Loading