Skip to content

Commit

Permalink
Use NewConfig to ensure defaults are set correctly. (ethereum-optimis…
Browse files Browse the repository at this point in the history
  • Loading branch information
ajsutton authored Mar 2, 2024
1 parent 4a3a18d commit df98e90
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions op-program/verify/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,10 @@ func Run(l1RpcUrl string, l1RpcKind string, l1BeaconUrl string, l2RpcUrl string,
if err != nil {
return fmt.Errorf("failed to load rollup config: %w", err)
}
offlineCfg := config.Config{
Rollup: rollupCfg,
DataDir: dataDir,
L2ChainConfig: chainCfg,
L2Head: l2Head,
L2OutputRoot: agreedOutput.OutputRoot,
L2Claim: l2Claim,
L2ClaimBlockNumber: l2BlockNumber.Uint64(),
L1Head: l1Head,
}
onlineCfg := offlineCfg
offlineCfg := config.NewConfig(
rollupCfg, chainCfg, l1Head, l2Head, agreedOutput.OutputRoot, l2Claim, l2BlockNumber.Uint64())
offlineCfg.DataDir = dataDir
onlineCfg := *offlineCfg
onlineCfg.L1URL = l1RpcUrl
onlineCfg.L1BeaconURL = l1BeaconUrl
onlineCfg.L2URL = l2RpcUrl
Expand All @@ -153,7 +146,7 @@ func Run(l1RpcUrl string, l1RpcKind string, l1BeaconUrl string, l2RpcUrl string,
}

fmt.Println("Running in offline mode")
err = host.Main(oplog.NewLogger(os.Stderr, logger), &offlineCfg)
err = host.Main(oplog.NewLogger(os.Stderr, logger), offlineCfg)
if err != nil {
return fmt.Errorf("offline mode failed: %w", err)
}
Expand Down

0 comments on commit df98e90

Please sign in to comment.