Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
344e0639
Unverified
Commit
344e0639
authored
Oct 26, 2023
by
protolambda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-node: enable all network options by default
parent
f0a81441
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
34 deletions
+5
-34
main_test.go
op-challenger/cmd/main_test.go
+2
-3
chains.go
op-node/chaincfg/chains.go
+0
-21
chains_test.go
op-node/chaincfg/chains_test.go
+0
-2
flags.go
op-node/flags/flags.go
+3
-4
service.go
op-node/service.go
+0
-4
No files found.
op-challenger/cmd/main_test.go
View file @
344e0639
...
@@ -7,7 +7,6 @@ import (
...
@@ -7,7 +7,6 @@ import (
"time"
"time"
"github.com/ethereum-optimism/optimism/op-challenger/config"
"github.com/ethereum-optimism/optimism/op-challenger/config"
"github.com/ethereum-optimism/optimism/op-node/chaincfg"
"github.com/ethereum-optimism/optimism/op-service/txmgr"
"github.com/ethereum-optimism/optimism/op-service/txmgr"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
...
@@ -17,8 +16,8 @@ import (
...
@@ -17,8 +16,8 @@ import (
var
(
var
(
l1EthRpc
=
"http://example.com:8545"
l1EthRpc
=
"http://example.com:8545"
gameFactoryAddressValue
=
"0xbb00000000000000000000000000000000000000"
gameFactoryAddressValue
=
"0xbb00000000000000000000000000000000000000"
cannonNetwork
=
chaincfg
.
AvailableNetworks
()[
0
]
cannonNetwork
=
"op-mainnet"
otherCannonNetwork
=
chaincfg
.
AvailableNetworks
()[
1
]
otherCannonNetwork
=
"op-goerli"
cannonBin
=
"./bin/cannon"
cannonBin
=
"./bin/cannon"
cannonServer
=
"./bin/op-program"
cannonServer
=
"./bin/op-program"
cannonPreState
=
"./pre.json"
cannonPreState
=
"./pre.json"
...
...
op-node/chaincfg/chains.go
View file @
344e0639
...
@@ -33,14 +33,7 @@ var L2ChainIDToNetworkDisplayName = func() map[string]string {
...
@@ -33,14 +33,7 @@ var L2ChainIDToNetworkDisplayName = func() map[string]string {
}()
}()
// AvailableNetworks returns the selection of network configurations that is available by default.
// AvailableNetworks returns the selection of network configurations that is available by default.
// Other configurations that are part of the superchain-registry can be used with the --beta.network flag.
func
AvailableNetworks
()
[]
string
{
func
AvailableNetworks
()
[]
string
{
return
[]
string
{
"op-mainnet"
,
"op-goerli"
,
"op-sepolia"
}
}
// BetaAvailableNetworks returns all available network configurations in the superchain-registry.
// This set of configurations is experimental, and may change at any time.
func
BetaAvailableNetworks
()
[]
string
{
var
networks
[]
string
var
networks
[]
string
for
_
,
cfg
:=
range
superchain
.
OPChains
{
for
_
,
cfg
:=
range
superchain
.
OPChains
{
networks
=
append
(
networks
,
cfg
.
Chain
+
"-"
+
cfg
.
Superchain
)
networks
=
append
(
networks
,
cfg
.
Chain
+
"-"
+
cfg
.
Superchain
)
...
@@ -48,20 +41,6 @@ func BetaAvailableNetworks() []string {
...
@@ -48,20 +41,6 @@ func BetaAvailableNetworks() []string {
return
networks
return
networks
}
}
func
IsAvailableNetwork
(
name
string
,
beta
bool
)
bool
{
name
=
handleLegacyName
(
name
)
available
:=
AvailableNetworks
()
if
beta
{
available
=
BetaAvailableNetworks
()
}
for
_
,
v
:=
range
available
{
if
v
==
name
{
return
true
}
}
return
false
}
func
handleLegacyName
(
name
string
)
string
{
func
handleLegacyName
(
name
string
)
string
{
switch
name
{
switch
name
{
case
"goerli"
:
case
"goerli"
:
...
...
op-node/chaincfg/chains_test.go
View file @
344e0639
...
@@ -27,8 +27,6 @@ func TestGetRollupConfig(t *testing.T) {
...
@@ -27,8 +27,6 @@ func TestGetRollupConfig(t *testing.T) {
}
}
for
name
,
expectedCfg
:=
range
configsByName
{
for
name
,
expectedCfg
:=
range
configsByName
{
require
.
True
(
t
,
IsAvailableNetwork
(
name
,
false
))
gotCfg
,
err
:=
GetRollupConfig
(
name
)
gotCfg
,
err
:=
GetRollupConfig
(
name
)
require
.
NoError
(
t
,
err
)
require
.
NoError
(
t
,
err
)
...
...
op-node/flags/flags.go
View file @
344e0639
...
@@ -237,11 +237,10 @@ var (
...
@@ -237,11 +237,10 @@ var (
Value
:
false
,
Value
:
false
,
}
}
BetaExtraNetworks
=
&
cli
.
BoolFlag
{
BetaExtraNetworks
=
&
cli
.
BoolFlag
{
Name
:
"beta.extra-networks"
,
Name
:
"beta.extra-networks"
,
Usage
:
fmt
.
Sprintf
(
"Beta feature: enable selection of a predefined-network from the superchain-registry. "
+
Usage
:
"Legacy flag, ignored, all superchain-registry networks are enabled by default."
,
"The superchain-registry is experimental, and the availability of configurations may change."
+
"Available networks: %s"
,
strings
.
Join
(
chaincfg
.
BetaAvailableNetworks
(),
", "
)),
EnvVars
:
prefixEnvVars
(
"BETA_EXTRA_NETWORKS"
),
EnvVars
:
prefixEnvVars
(
"BETA_EXTRA_NETWORKS"
),
Hidden
:
true
,
// hidden, this is deprecated, the flag is not used anymore.
}
}
RollupHalt
=
&
cli
.
StringFlag
{
RollupHalt
=
&
cli
.
StringFlag
{
Name
:
"rollup.halt"
,
Name
:
"rollup.halt"
,
...
...
op-node/service.go
View file @
344e0639
...
@@ -194,10 +194,6 @@ Startup will proceed to use the network-parameter and ignore the rollup config.
...
@@ -194,10 +194,6 @@ Startup will proceed to use the network-parameter and ignore the rollup config.
Conflicting configuration is deprecated, and will stop the op-node from starting in the future.
Conflicting configuration is deprecated, and will stop the op-node from starting in the future.
`
,
"network"
,
network
,
"rollup_config"
,
rollupConfigPath
)
`
,
"network"
,
network
,
"rollup_config"
,
rollupConfigPath
)
}
}
// check that the network is available
if
!
chaincfg
.
IsAvailableNetwork
(
network
,
ctx
.
Bool
(
flags
.
BetaExtraNetworks
.
Name
))
{
return
nil
,
fmt
.
Errorf
(
"unavailable network: %q"
,
network
)
}
config
,
err
:=
chaincfg
.
GetRollupConfig
(
network
)
config
,
err
:=
chaincfg
.
GetRollupConfig
(
network
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment