Skip to content

Commit

Permalink
chore(op-challenger): Update kona native mode flag
Browse files Browse the repository at this point in the history
  • Loading branch information
clabby committed Nov 22, 2024
1 parent 8f5c20e commit cd48eb2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
9 changes: 4 additions & 5 deletions op-challenger/game/fault/trace/vm/kona_server_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import (
)

type KonaExecutor struct {
nativeMode bool
clientBinPath string
nativeMode bool
}

var _ OracleServerExecutor = (*KonaExecutor)(nil)
Expand All @@ -19,8 +18,8 @@ func NewKonaExecutor() *KonaExecutor {
return &KonaExecutor{nativeMode: false}
}

func NewNativeKonaExecutor(clientBinPath string) *KonaExecutor {
return &KonaExecutor{nativeMode: true, clientBinPath: clientBinPath}
func NewNativeKonaExecutor() *KonaExecutor {
return &KonaExecutor{nativeMode: true}
}

func (s *KonaExecutor) OracleCommand(cfg Config, dataDir string, inputs utils.LocalGameInputs) ([]string, error) {
Expand All @@ -37,7 +36,7 @@ func (s *KonaExecutor) OracleCommand(cfg Config, dataDir string, inputs utils.Lo
}

if s.nativeMode {
args = append(args, "--exec", s.clientBinPath)
args = append(args, "--native")
} else {
args = append(args, "--server")
args = append(args, "--data-dir", dataDir)
Expand Down
7 changes: 3 additions & 4 deletions op-e2e/actions/proofs/helpers/kona.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@ import (
"github.com/stretchr/testify/require"
)

var konaHostPath, konaClientPath string
var konaHostPath string

func init() {
konaHostPath = os.Getenv("KONA_HOST_PATH")
konaClientPath = os.Getenv("KONA_CLIENT_PATH")
}

func IsKonaConfigured() bool {
return konaHostPath != "" && konaClientPath != ""
return konaHostPath != ""
}

func RunKonaNative(
Expand Down Expand Up @@ -57,7 +56,7 @@ func RunKonaNative(
L2Claim: fixtureInputs.L2Claim,
L2BlockNumber: big.NewInt(int64(fixtureInputs.L2BlockNumber)),
}
hostCmd, err := vm.NewNativeKonaExecutor(konaClientPath).OracleCommand(vmCfg, workDir, inputs)
hostCmd, err := vm.NewNativeKonaExecutor().OracleCommand(vmCfg, workDir, inputs)
require.NoError(t, err)

cmd := exec.Command(hostCmd[0], hostCmd[1:]...)
Expand Down

0 comments on commit cd48eb2

Please sign in to comment.