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
f42f65a4
Unverified
Commit
f42f65a4
authored
Jul 20, 2023
by
protolambda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-node: log error when op-node is configured with conflicting network and rollup-config file
parent
8be2b53d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
7 deletions
+14
-7
entrypoint.go
op-bootnode/bootnode/entrypoint.go
+1
-1
service.go
op-node/service.go
+9
-3
main.go
op-program/host/cmd/main.go
+1
-1
config.go
op-program/host/config/config.go
+3
-2
No files found.
op-bootnode/bootnode/entrypoint.go
View file @
f42f65a4
...
@@ -44,7 +44,7 @@ func Main(cliCtx *cli.Context) error {
...
@@ -44,7 +44,7 @@ func Main(cliCtx *cli.Context) error {
m
:=
metrics
.
NewMetrics
(
"default"
)
m
:=
metrics
.
NewMetrics
(
"default"
)
ctx
:=
context
.
Background
()
ctx
:=
context
.
Background
()
config
,
err
:=
opnode
.
NewRollupConfig
(
cliCtx
)
config
,
err
:=
opnode
.
NewRollupConfig
(
logger
,
cliCtx
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
...
op-node/service.go
View file @
f42f65a4
...
@@ -30,7 +30,7 @@ func NewConfig(ctx *cli.Context, log log.Logger) (*node.Config, error) {
...
@@ -30,7 +30,7 @@ func NewConfig(ctx *cli.Context, log log.Logger) (*node.Config, error) {
return
nil
,
err
return
nil
,
err
}
}
rollupConfig
,
err
:=
NewRollupConfig
(
ctx
)
rollupConfig
,
err
:=
NewRollupConfig
(
log
,
ctx
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
@@ -168,9 +168,16 @@ func NewDriverConfig(ctx *cli.Context) *driver.Config {
...
@@ -168,9 +168,16 @@ func NewDriverConfig(ctx *cli.Context) *driver.Config {
}
}
}
}
func
NewRollupConfig
(
ctx
*
cli
.
Context
)
(
*
rollup
.
Config
,
error
)
{
func
NewRollupConfig
(
log
log
.
Logger
,
ctx
*
cli
.
Context
)
(
*
rollup
.
Config
,
error
)
{
network
:=
ctx
.
String
(
flags
.
Network
.
Name
)
network
:=
ctx
.
String
(
flags
.
Network
.
Name
)
rollupConfigPath
:=
ctx
.
String
(
flags
.
RollupConfig
.
Name
)
if
network
!=
""
{
if
network
!=
""
{
if
rollupConfigPath
!=
""
{
log
.
Error
(
`Cannot configure network and rollup-config at the same time.
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.
`
,
"network"
,
network
,
"rollup_config"
,
rollupConfigPath
)
}
config
,
err
:=
chaincfg
.
GetRollupConfig
(
network
)
config
,
err
:=
chaincfg
.
GetRollupConfig
(
network
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
...
@@ -179,7 +186,6 @@ func NewRollupConfig(ctx *cli.Context) (*rollup.Config, error) {
...
@@ -179,7 +186,6 @@ func NewRollupConfig(ctx *cli.Context) (*rollup.Config, error) {
return
&
config
,
nil
return
&
config
,
nil
}
}
rollupConfigPath
:=
ctx
.
String
(
flags
.
RollupConfig
.
Name
)
file
,
err
:=
os
.
Open
(
rollupConfigPath
)
file
,
err
:=
os
.
Open
(
rollupConfigPath
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"failed to read rollup config: %w"
,
err
)
return
nil
,
fmt
.
Errorf
(
"failed to read rollup config: %w"
,
err
)
...
...
op-program/host/cmd/main.go
View file @
f42f65a4
...
@@ -63,7 +63,7 @@ func run(args []string, action ConfigAction) error {
...
@@ -63,7 +63,7 @@ func run(args []string, action ConfigAction) error {
}
}
logger
.
Info
(
"Starting fault proof program"
,
"version"
,
VersionWithMeta
)
logger
.
Info
(
"Starting fault proof program"
,
"version"
,
VersionWithMeta
)
cfg
,
err
:=
config
.
NewConfigFromCLI
(
ctx
)
cfg
,
err
:=
config
.
NewConfigFromCLI
(
logger
,
ctx
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
...
op-program/host/config/config.go
View file @
f42f65a4
...
@@ -12,6 +12,7 @@ import (
...
@@ -12,6 +12,7 @@ import (
"github.com/ethereum-optimism/optimism/op-program/host/flags"
"github.com/ethereum-optimism/optimism/op-program/host/flags"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/params"
"github.com/urfave/cli/v2"
"github.com/urfave/cli/v2"
)
)
...
@@ -110,11 +111,11 @@ func NewConfig(rollupCfg *rollup.Config, l2Genesis *params.ChainConfig, l1Head c
...
@@ -110,11 +111,11 @@ func NewConfig(rollupCfg *rollup.Config, l2Genesis *params.ChainConfig, l1Head c
}
}
}
}
func
NewConfigFromCLI
(
ctx
*
cli
.
Context
)
(
*
Config
,
error
)
{
func
NewConfigFromCLI
(
log
log
.
Logger
,
ctx
*
cli
.
Context
)
(
*
Config
,
error
)
{
if
err
:=
flags
.
CheckRequired
(
ctx
);
err
!=
nil
{
if
err
:=
flags
.
CheckRequired
(
ctx
);
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
rollupCfg
,
err
:=
opnode
.
NewRollupConfig
(
ctx
)
rollupCfg
,
err
:=
opnode
.
NewRollupConfig
(
log
,
ctx
)
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