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
2650227e
Commit
2650227e
authored
Dec 02, 2022
by
Mark Tyneway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: configurable L2 genesis block number
parent
4c09d293
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
+7
-6
main.go
op-chain-ops/cmd/op-migrate/main.go
+1
-1
config.go
op-chain-ops/genesis/config.go
+2
-3
cmd.go
op-node/cmd/genesis/cmd.go
+4
-2
No files found.
op-chain-ops/cmd/op-migrate/main.go
View file @
2650227e
...
@@ -182,7 +182,7 @@ func main() {
...
@@ -182,7 +182,7 @@ func main() {
return
err
return
err
}
}
opNodeConfig
,
err
:=
config
.
RollupConfig
(
block
,
res
.
TransitionBlockHash
)
opNodeConfig
,
err
:=
config
.
RollupConfig
(
block
,
res
.
TransitionBlockHash
,
res
.
TransitionHeight
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
...
op-chain-ops/genesis/config.go
View file @
2650227e
...
@@ -269,9 +269,8 @@ func (d *DeployConfig) InitDeveloperDeployedAddresses() error {
...
@@ -269,9 +269,8 @@ func (d *DeployConfig) InitDeveloperDeployedAddresses() error {
return
nil
return
nil
}
}
// TODO: convert the input to this function
// RollupConfig converts a DeployConfig to a rollup.Config
// RollupConfig converts a DeployConfig to a rollup.Config
func
(
d
*
DeployConfig
)
RollupConfig
(
l1StartBlock
*
types
.
Block
,
l2GenesisBlockHash
common
.
Hash
)
(
*
rollup
.
Config
,
error
)
{
func
(
d
*
DeployConfig
)
RollupConfig
(
l1StartBlock
*
types
.
Block
,
l2GenesisBlockHash
common
.
Hash
,
l2GenesisBlockNumber
uint64
)
(
*
rollup
.
Config
,
error
)
{
if
d
.
OptimismPortalProxy
==
(
common
.
Address
{})
{
if
d
.
OptimismPortalProxy
==
(
common
.
Address
{})
{
return
nil
,
errors
.
New
(
"OptimismPortalProxy cannot be address(0)"
)
return
nil
,
errors
.
New
(
"OptimismPortalProxy cannot be address(0)"
)
}
}
...
@@ -287,7 +286,7 @@ func (d *DeployConfig) RollupConfig(l1StartBlock *types.Block, l2GenesisBlockHas
...
@@ -287,7 +286,7 @@ func (d *DeployConfig) RollupConfig(l1StartBlock *types.Block, l2GenesisBlockHas
},
},
L2
:
eth
.
BlockID
{
L2
:
eth
.
BlockID
{
Hash
:
l2GenesisBlockHash
,
Hash
:
l2GenesisBlockHash
,
Number
:
0
,
Number
:
l2GenesisBlockNumber
,
},
},
L2Time
:
l1StartBlock
.
Time
(),
L2Time
:
l1StartBlock
.
Time
(),
SystemConfig
:
eth
.
SystemConfig
{
SystemConfig
:
eth
.
SystemConfig
{
...
...
op-node/cmd/genesis/cmd.go
View file @
2650227e
...
@@ -67,7 +67,8 @@ var Subcommands = cli.Commands{
...
@@ -67,7 +67,8 @@ var Subcommands = cli.Commands{
return
err
return
err
}
}
rollupConfig
,
err
:=
config
.
RollupConfig
(
l1StartBlock
,
l2Genesis
.
ToBlock
()
.
Hash
())
l2GenesisBlock
:=
l2Genesis
.
ToBlock
()
rollupConfig
,
err
:=
config
.
RollupConfig
(
l1StartBlock
,
l2GenesisBlock
.
Hash
(),
l2GenesisBlock
.
Number
()
.
Uint64
())
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
@@ -155,7 +156,8 @@ var Subcommands = cli.Commands{
...
@@ -155,7 +156,8 @@ var Subcommands = cli.Commands{
return
fmt
.
Errorf
(
"error creating l2 developer genesis: %w"
,
err
)
return
fmt
.
Errorf
(
"error creating l2 developer genesis: %w"
,
err
)
}
}
rollupConfig
,
err
:=
config
.
RollupConfig
(
l1StartBlock
,
l2Genesis
.
ToBlock
()
.
Hash
())
l2GenesisBlock
:=
l2Genesis
.
ToBlock
()
rollupConfig
,
err
:=
config
.
RollupConfig
(
l1StartBlock
,
l2GenesisBlock
.
Hash
(),
l2GenesisBlock
.
Number
()
.
Uint64
())
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
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