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
3614064c
Unverified
Commit
3614064c
authored
Jan 17, 2025
by
Matthew Slipper
Committed by
GitHub
Jan 17, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-deployer: Support Holocene genesis (#13843)
parent
704faf26
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
5 deletions
+25
-5
l2genesis.go
op-deployer/pkg/deployer/opcm/l2genesis.go
+12
-4
l2genesis.go
op-deployer/pkg/deployer/pipeline/l2genesis.go
+13
-1
No files found.
op-deployer/pkg/deployer/opcm/l2genesis.go
View file @
3614064c
...
...
@@ -23,6 +23,7 @@ type L1Deployments struct {
type
L2GenesisInput
struct
{
L1Deployments
L1Deployments
L2Config
genesis
.
L2InitializationConfig
OverrideAllocsMode
string
}
type
L2GenesisScript
struct
{
...
...
@@ -33,8 +34,15 @@ func L2Genesis(l2Host *script.Host, input *L2GenesisInput) error {
l2Host
.
SetEnvVar
(
"L2GENESIS_L1CrossDomainMessengerProxy"
,
input
.
L1Deployments
.
L1CrossDomainMessengerProxy
.
String
())
l2Host
.
SetEnvVar
(
"L2GENESIS_L1StandardBridgeProxy"
,
input
.
L1Deployments
.
L1StandardBridgeProxy
.
String
())
l2Host
.
SetEnvVar
(
"L2GENESIS_L1ERC721BridgeProxy"
,
input
.
L1Deployments
.
L1ERC721BridgeProxy
.
String
())
allocsMode
:=
input
.
L2Config
.
UpgradeScheduleDeployConfig
.
AllocMode
(
uint64
(
time
.
Now
()
.
Unix
()))
l2Host
.
SetEnvVar
(
"FORK"
,
string
(
allocsMode
))
var
allocsMode
string
if
input
.
OverrideAllocsMode
==
""
{
allocsMode
=
string
(
input
.
L2Config
.
UpgradeScheduleDeployConfig
.
AllocMode
(
uint64
(
time
.
Now
()
.
Unix
())))
}
else
{
allocsMode
=
input
.
OverrideAllocsMode
}
l2Host
.
SetEnvVar
(
"FORK"
,
allocsMode
)
deployConfig
:=
&
genesis
.
DeployConfig
{
L2InitializationConfig
:
input
.
L2Config
,
...
...
op-deployer/pkg/deployer/pipeline/l2genesis.go
View file @
3614064c
...
...
@@ -3,6 +3,8 @@ package pipeline
import
(
"fmt"
"github.com/ethereum-optimism/optimism/op-deployer/pkg/deployer/standard"
"github.com/ethereum-optimism/optimism/op-deployer/pkg/env"
"github.com/ethereum-optimism/optimism/op-chain-ops/foundry"
...
...
@@ -48,6 +50,15 @@ func GenerateL2Genesis(pEnv *Env, intent *state.Intent, bundle ArtifactsBundle,
return
fmt
.
Errorf
(
"failed to create L2 script host: %w"
,
err
)
}
// This is an ugly hack to support holocene. The v1.7.0 predeploy contracts do not support setting the allocs
// mode as Holocene, even though there are no predeploy changes in Holocene. The v1.7.0 changes are the "official"
// release of the predeploy contracts, so we need to set the allocs mode to "granite" to avoid having to backport
// Holocene support into the predeploy contracts.
var
overrideAllocsMode
string
if
intent
.
L2ContractsLocator
.
IsTag
()
&&
intent
.
L2ContractsLocator
.
Tag
==
standard
.
ContractsV170Beta1L2Tag
{
overrideAllocsMode
=
"granite"
}
if
err
:=
opcm
.
L2Genesis
(
host
,
&
opcm
.
L2GenesisInput
{
L1Deployments
:
opcm
.
L1Deployments
{
L1CrossDomainMessengerProxy
:
thisChainState
.
L1CrossDomainMessengerProxyAddress
,
...
...
@@ -55,6 +66,7 @@ func GenerateL2Genesis(pEnv *Env, intent *state.Intent, bundle ArtifactsBundle,
L1ERC721BridgeProxy
:
thisChainState
.
L1ERC721BridgeProxyAddress
,
},
L2Config
:
initCfg
.
L2InitializationConfig
,
OverrideAllocsMode
:
overrideAllocsMode
,
});
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to call L2Genesis script: %w"
,
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