Skip to content

Commit 9f3c38c

Browse files
committed
sysext: infer L1 config when possible
1 parent 24bc9fb commit 9f3c38c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

devnet-sdk/shell/env/devnet.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"github.com/ethereum-optimism/optimism/devnet-sdk/controller/surface"
1212
"github.com/ethereum-optimism/optimism/devnet-sdk/descriptors"
1313
"github.com/ethereum-optimism/optimism/op-node/rollup"
14+
"github.com/ethereum-optimism/optimism/op-service/eth"
1415
"github.com/ethereum/go-ethereum/params"
1516
)
1617

@@ -138,8 +139,12 @@ func fixupDevnetConfig(config *descriptors.DevnetEnvironment) error {
138139
return fmt.Errorf("invalid L1 ID: %s", config.L1.ID)
139140
}
140141
if config.L1.Config == nil {
141-
config.L1.Config = &params.ChainConfig{
142-
ChainID: l1ID,
142+
if l1Config := eth.L1ChainConfigByChainID(eth.ChainIDFromBig(l1ID)); l1Config != nil {
143+
config.L1.Config = l1Config
144+
} else {
145+
config.L1.Config = &params.ChainConfig{
146+
ChainID: l1ID,
147+
}
143148
}
144149
}
145150
for _, l2Chain := range config.L2 {

0 commit comments

Comments
 (0)