Skip to content

Commit

Permalink
Merge pull request #208 from ethereum-optimism/harry/fix_forked_logging
Browse files Browse the repository at this point in the history
feat: fix logging flag for supersim in fork mode
  • Loading branch information
tremarkley authored Oct 17, 2024
2 parents 475d118 + 1e2b0d3 commit 8457d2c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions anvil/anvil.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ func (a *Anvil) Start(ctx context.Context) error {

logFile = tempLogFile
// Clean up the temp log file
// TODO (https://github.com/ethereum-optimism/supersim/issues/205) This results in the temp file being deleted right away instead of after shutdown.
defer a.removeFile(logFile)
} else {
// Expand the path to the log file
Expand Down
5 changes: 4 additions & 1 deletion orchestrator/fork.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import (

const blockTime = 2

func NetworkConfigFromForkCLIConfig(log log.Logger, envPrefix string, forkConfig *config.ForkCLIConfig) (config.NetworkConfig, error) {
func NetworkConfigFromForkCLIConfig(log log.Logger, envPrefix string, cliConfig *config.CLIConfig) (config.NetworkConfig, error) {
forkConfig := cliConfig.ForkConfig
superchain := registry.Superchains[forkConfig.Network]
networkConfig := config.NetworkConfig{InteropEnabled: forkConfig.InteropEnabled}

Expand Down Expand Up @@ -54,6 +55,7 @@ func NetworkConfigFromForkCLIConfig(log log.Logger, envPrefix string, forkConfig
Name: forkConfig.Network,
ChainID: superchain.Config.L1.ChainID,
SecretsConfig: config.DefaultSecretsConfig,
LogsDirectory: cliConfig.LogsDirectory,
ForkConfig: &config.ForkConfig{
RPCUrl: l1RpcUrl,
BlockNumber: l1Header.Number.Uint64(),
Expand Down Expand Up @@ -95,6 +97,7 @@ func NetworkConfigFromForkCLIConfig(log log.Logger, envPrefix string, forkConfig
Name: chainCfg.Chain,
ChainID: chainCfg.ChainID,
SecretsConfig: config.DefaultSecretsConfig,
LogsDirectory: cliConfig.LogsDirectory,
ForkConfig: &config.ForkConfig{
RPCUrl: l2RpcUrl,
BlockNumber: l2ForkHeight,
Expand Down
2 changes: 1 addition & 1 deletion supersim.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func NewSupersim(log log.Logger, envPrefix string, closeApp context.CancelCauseF
log.Info("generating fork configuration", "superchain", superchain.Superchain)

var err error
networkConfig, err = orchestrator.NetworkConfigFromForkCLIConfig(log, envPrefix, cliConfig.ForkConfig)
networkConfig, err = orchestrator.NetworkConfigFromForkCLIConfig(log, envPrefix, cliConfig)
if err != nil {
return nil, fmt.Errorf("failed to construct fork configuration: %w", err)
}
Expand Down

0 comments on commit 8457d2c

Please sign in to comment.