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
6c76ac76
Unverified
Commit
6c76ac76
authored
Nov 07, 2022
by
protolambda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-node: set initial system config gaslimit, check initial values
parent
e8ed2453
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
cmd.go
op-node/cmd/genesis/cmd.go
+6
-0
types.go
op-node/rollup/types.go
+12
-0
No files found.
op-node/cmd/genesis/cmd.go
View file @
6c76ac76
...
@@ -109,6 +109,9 @@ var Subcommands = cli.Commands{
...
@@ -109,6 +109,9 @@ var Subcommands = cli.Commands{
if
config
.
L1StartingBlockTag
==
nil
{
if
config
.
L1StartingBlockTag
==
nil
{
return
errors
.
New
(
"must specify a starting block tag in genesis"
)
return
errors
.
New
(
"must specify a starting block tag in genesis"
)
}
}
if
config
.
L2GenesisBlockGasLimit
==
0
{
// TODO: this is a hotfix, need to set default values in more clean way + sanity check the config
config
.
L2GenesisBlockGasLimit
=
15
_000_000
}
client
,
err
:=
ethclient
.
Dial
(
ctx
.
String
(
"l1-rpc"
))
client
,
err
:=
ethclient
.
Dial
(
ctx
.
String
(
"l1-rpc"
))
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -164,6 +167,9 @@ var Subcommands = cli.Commands{
...
@@ -164,6 +167,9 @@ var Subcommands = cli.Commands{
}
}
rollupConfig
:=
makeRollupConfig
(
config
,
l1StartBlock
,
l2Genesis
,
portalProxy
.
Address
,
sysCfgProxy
.
Address
)
rollupConfig
:=
makeRollupConfig
(
config
,
l1StartBlock
,
l2Genesis
,
portalProxy
.
Address
,
sysCfgProxy
.
Address
)
if
err
:=
rollupConfig
.
Check
();
err
!=
nil
{
return
fmt
.
Errorf
(
"generated rollup config does not pass validation: %w"
,
err
)
}
if
err
:=
writeGenesisFile
(
ctx
.
String
(
"outfile.l2"
),
l2Genesis
);
err
!=
nil
{
if
err
:=
writeGenesisFile
(
ctx
.
String
(
"outfile.l2"
),
l2Genesis
);
err
!=
nil
{
return
err
return
err
...
...
op-node/rollup/types.go
View file @
6c76ac76
...
@@ -81,6 +81,18 @@ func (cfg *Config) Check() error {
...
@@ -81,6 +81,18 @@ func (cfg *Config) Check() error {
if
cfg
.
Genesis
.
L2Time
==
0
{
if
cfg
.
Genesis
.
L2Time
==
0
{
return
errors
.
New
(
"missing L2 genesis time"
)
return
errors
.
New
(
"missing L2 genesis time"
)
}
}
if
cfg
.
Genesis
.
SystemConfig
.
BatcherAddr
==
(
common
.
Address
{})
{
return
errors
.
New
(
"missing genesis system config batcher address"
)
}
if
cfg
.
Genesis
.
SystemConfig
.
Overhead
==
(
eth
.
Bytes32
{})
{
return
errors
.
New
(
"missing genesis system config overhead"
)
}
if
cfg
.
Genesis
.
SystemConfig
.
Scalar
==
(
eth
.
Bytes32
{})
{
return
errors
.
New
(
"missing genesis system config scalar"
)
}
if
cfg
.
Genesis
.
SystemConfig
.
GasLimit
==
0
{
return
errors
.
New
(
"missing genesis system config gas limit"
)
}
if
cfg
.
P2PSequencerAddress
==
(
common
.
Address
{})
{
if
cfg
.
P2PSequencerAddress
==
(
common
.
Address
{})
{
return
errors
.
New
(
"missing p2p sequencer address"
)
return
errors
.
New
(
"missing p2p sequencer address"
)
}
}
...
...
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