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
1f335f15
Unverified
Commit
1f335f15
authored
Oct 31, 2024
by
Matthew Slipper
Committed by
GitHub
Oct 31, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-deployer: Add support for Isthmus calls to OPCM (#12753)
parent
7f941b84
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
286 additions
and
165 deletions
+286
-165
deploy.go
op-chain-ops/interopgen/deploy.go
+1
-1
deployOutput_v160.json
op-deployer/pkg/deployer/opcm/deployOutput_v160.json
+77
-0
opchain.go
op-deployer/pkg/deployer/opcm/opchain.go
+134
-141
opchain.go
op-deployer/pkg/deployer/pipeline/opchain.go
+69
-21
standard.go
op-deployer/pkg/deployer/standard/standard.go
+5
-2
No files found.
op-chain-ops/interopgen/deploy.go
View file @
1f335f15
...
@@ -200,7 +200,7 @@ func DeployL2ToL1(l1Host *script.Host, superCfg *SuperchainConfig, superDeployme
...
@@ -200,7 +200,7 @@ func DeployL2ToL1(l1Host *script.Host, superCfg *SuperchainConfig, superDeployme
l1Host
.
SetTxOrigin
(
cfg
.
Deployer
)
l1Host
.
SetTxOrigin
(
cfg
.
Deployer
)
output
,
err
:=
opcm
.
DeployOPChain
(
l1Host
,
opcm
.
DeployOPChainInput
{
output
,
err
:=
opcm
.
DeployOPChain
V160
(
l1Host
,
opcm
.
DeployOPChainInputV160
{
OpChainProxyAdminOwner
:
cfg
.
ProxyAdminOwner
,
OpChainProxyAdminOwner
:
cfg
.
ProxyAdminOwner
,
SystemConfigOwner
:
cfg
.
SystemConfigOwner
,
SystemConfigOwner
:
cfg
.
SystemConfigOwner
,
Batcher
:
cfg
.
BatchSenderAddress
,
Batcher
:
cfg
.
BatchSenderAddress
,
...
...
op-deployer/pkg/deployer/opcm/deployOutput_v160.json
0 → 100644
View file @
1f335f15
[
{
"type"
:
"function"
,
"name"
:
"decodeOutput"
,
"inputs"
:
[],
"outputs"
:
[
{
"name"
:
"output"
,
"indexed"
:
false
,
"type"
:
"tuple"
,
"components"
:
[
{
"name"
:
"opChainProxyAdmin"
,
"type"
:
"address"
},
{
"name"
:
"addressManager"
,
"type"
:
"address"
},
{
"name"
:
"l1ERC721BridgeProxy"
,
"type"
:
"address"
},
{
"name"
:
"systemConfigProxy"
,
"type"
:
"address"
},
{
"name"
:
"optimismMintableERC20FactoryProxy"
,
"type"
:
"address"
},
{
"name"
:
"l1StandardBridgeProxy"
,
"type"
:
"address"
},
{
"name"
:
"l1CrossDomainMessengerProxy"
,
"type"
:
"address"
},
{
"name"
:
"optimismPortalProxy"
,
"type"
:
"address"
},
{
"name"
:
"disputeGameFactoryProxy"
,
"type"
:
"address"
},
{
"name"
:
"anchorStateRegistryProxy"
,
"type"
:
"address"
},
{
"name"
:
"anchorStateRegistryImpl"
,
"type"
:
"address"
},
{
"name"
:
"faultDisputeGame"
,
"type"
:
"address"
,
"internalType"
:
"contract FaultDisputeGame"
},
{
"name"
:
"permissionedDisputeGame"
,
"type"
:
"address"
},
{
"name"
:
"delayedWETHPermissionedGameProxy"
,
"type"
:
"address"
},
{
"name"
:
"delayedWETHPermissionlessGameProxy"
,
"type"
:
"address"
}
]
}
]
}
]
\ No newline at end of file
op-deployer/pkg/deployer/opcm/opchain.go
View file @
1f335f15
This diff is collapsed.
Click to expand it.
op-deployer/pkg/deployer/pipeline/opchain.go
View file @
1f335f15
...
@@ -29,21 +29,43 @@ func DeployOPChainLiveStrategy(ctx context.Context, env *Env, bundle ArtifactsBu
...
@@ -29,21 +29,43 @@ func DeployOPChainLiveStrategy(ctx context.Context, env *Env, bundle ArtifactsBu
return
fmt
.
Errorf
(
"failed to get chain intent: %w"
,
err
)
return
fmt
.
Errorf
(
"failed to get chain intent: %w"
,
err
)
}
}
input
,
err
:=
makeDCI
(
intent
,
thisIntent
,
chainID
,
st
)
var
deployFunc
func
()
(
opcm
.
DeployOPChainOutput
,
error
)
if
err
!=
nil
{
switch
intent
.
L1ContractsLocator
.
Tag
{
return
fmt
.
Errorf
(
"error making deploy OP chain input: %w"
,
err
)
case
standard
.
ContractsV160Tag
,
standard
.
ContractsV170Beta1L2Tag
:
deployFunc
=
func
()
(
opcm
.
DeployOPChainOutput
,
error
)
{
input
,
err
:=
makeDCIV160
(
intent
,
thisIntent
,
chainID
,
st
)
if
err
!=
nil
{
return
opcm
.
DeployOPChainOutput
{},
fmt
.
Errorf
(
"error making deploy OP chain input: %w"
,
err
)
}
return
opcm
.
DeployOPChainRawV160
(
ctx
,
env
.
L1Client
,
env
.
Broadcaster
,
env
.
Deployer
,
bundle
.
L1
,
input
,
)
}
default
:
deployFunc
=
func
()
(
opcm
.
DeployOPChainOutput
,
error
)
{
input
,
err
:=
makeDCIIsthmus
(
intent
,
thisIntent
,
chainID
,
st
)
if
err
!=
nil
{
return
opcm
.
DeployOPChainOutput
{},
fmt
.
Errorf
(
"error making deploy OP chain input: %w"
,
err
)
}
return
opcm
.
DeployOPChainRawIsthmus
(
ctx
,
env
.
L1Client
,
env
.
Broadcaster
,
env
.
Deployer
,
bundle
.
L1
,
input
,
)
}
}
}
var
dco
opcm
.
DeployOPChainOutput
var
dco
opcm
.
DeployOPChainOutput
lgr
.
Info
(
"deploying OP chain using existing OPCM"
,
"id"
,
chainID
.
Hex
(),
"opcmAddress"
,
st
.
ImplementationsDeployment
.
OpcmProxyAddress
.
Hex
())
lgr
.
Info
(
"deploying OP chain using existing OPCM"
,
"id"
,
chainID
.
Hex
(),
"opcmAddress"
,
st
.
ImplementationsDeployment
.
OpcmProxyAddress
.
Hex
())
dco
,
err
=
opcm
.
DeployOPChainRaw
(
dco
,
err
=
deployFunc
()
ctx
,
env
.
L1Client
,
env
.
Broadcaster
,
env
.
Deployer
,
bundle
.
L1
,
input
,
)
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"error deploying OP chain: %w"
,
err
)
return
fmt
.
Errorf
(
"error deploying OP chain: %w"
,
err
)
}
}
...
@@ -158,19 +180,33 @@ func DeployOPChainGenesisStrategy(env *Env, intent *state.Intent, st *state.Stat
...
@@ -158,19 +180,33 @@ func DeployOPChainGenesisStrategy(env *Env, intent *state.Intent, st *state.Stat
return
fmt
.
Errorf
(
"failed to get chain intent: %w"
,
err
)
return
fmt
.
Errorf
(
"failed to get chain intent: %w"
,
err
)
}
}
input
,
err
:=
makeDCI
(
intent
,
thisIntent
,
chainID
,
st
)
var
deployFunc
func
()
(
opcm
.
DeployOPChainOutput
,
error
)
if
err
!=
nil
{
switch
intent
.
L1ContractsLocator
.
Tag
{
return
fmt
.
Errorf
(
"error making deploy OP chain input: %w"
,
err
)
case
standard
.
ContractsV160Tag
,
standard
.
ContractsV170Beta1L2Tag
:
deployFunc
=
func
()
(
opcm
.
DeployOPChainOutput
,
error
)
{
input
,
err
:=
makeDCIV160
(
intent
,
thisIntent
,
chainID
,
st
)
if
err
!=
nil
{
return
opcm
.
DeployOPChainOutput
{},
fmt
.
Errorf
(
"error making deploy OP chain input: %w"
,
err
)
}
return
opcm
.
DeployOPChainV160
(
env
.
L1ScriptHost
,
input
)
}
default
:
deployFunc
=
func
()
(
opcm
.
DeployOPChainOutput
,
error
)
{
input
,
err
:=
makeDCIIsthmus
(
intent
,
thisIntent
,
chainID
,
st
)
if
err
!=
nil
{
return
opcm
.
DeployOPChainOutput
{},
fmt
.
Errorf
(
"error making deploy OP chain input: %w"
,
err
)
}
return
opcm
.
DeployOPChainIsthmus
(
env
.
L1ScriptHost
,
input
)
}
}
}
env
.
L1ScriptHost
.
ImportState
(
st
.
L1StateDump
.
Data
)
env
.
L1ScriptHost
.
ImportState
(
st
.
L1StateDump
.
Data
)
var
dco
opcm
.
DeployOPChainOutput
var
dco
opcm
.
DeployOPChainOutput
lgr
.
Info
(
"deploying OP chain using local allocs"
,
"id"
,
chainID
.
Hex
())
lgr
.
Info
(
"deploying OP chain using local allocs"
,
"id"
,
chainID
.
Hex
())
dco
,
err
=
opcm
.
DeployOPChain
(
dco
,
err
=
deployFunc
()
env
.
L1ScriptHost
,
input
,
)
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"error deploying OP chain: %w"
,
err
)
return
fmt
.
Errorf
(
"error deploying OP chain: %w"
,
err
)
}
}
...
@@ -190,7 +226,7 @@ type ChainProofParams struct {
...
@@ -190,7 +226,7 @@ type ChainProofParams struct {
DangerouslyAllowCustomDisputeParameters
bool
`json:"dangerouslyAllowCustomDisputeParameters" toml:"dangerouslyAllowCustomDisputeParameters"`
DangerouslyAllowCustomDisputeParameters
bool
`json:"dangerouslyAllowCustomDisputeParameters" toml:"dangerouslyAllowCustomDisputeParameters"`
}
}
func
makeDCI
(
intent
*
state
.
Intent
,
thisIntent
*
state
.
ChainIntent
,
chainID
common
.
Hash
,
st
*
state
.
State
)
(
opcm
.
DeployOPChainInput
,
error
)
{
func
makeDCI
V160
(
intent
*
state
.
Intent
,
thisIntent
*
state
.
ChainIntent
,
chainID
common
.
Hash
,
st
*
state
.
State
)
(
opcm
.
DeployOPChainInputV160
,
error
)
{
proofParams
,
err
:=
jsonutil
.
MergeJSON
(
proofParams
,
err
:=
jsonutil
.
MergeJSON
(
ChainProofParams
{
ChainProofParams
{
DisputeGameType
:
standard
.
DisputeGameType
,
DisputeGameType
:
standard
.
DisputeGameType
,
...
@@ -204,10 +240,10 @@ func makeDCI(intent *state.Intent, thisIntent *state.ChainIntent, chainID common
...
@@ -204,10 +240,10 @@ func makeDCI(intent *state.Intent, thisIntent *state.ChainIntent, chainID common
thisIntent
.
DeployOverrides
,
thisIntent
.
DeployOverrides
,
)
)
if
err
!=
nil
{
if
err
!=
nil
{
return
opcm
.
DeployOPChainInput
{},
fmt
.
Errorf
(
"error merging proof params from overrides: %w"
,
err
)
return
opcm
.
DeployOPChainInput
V160
{},
fmt
.
Errorf
(
"error merging proof params from overrides: %w"
,
err
)
}
}
return
opcm
.
DeployOPChainInput
{
return
opcm
.
DeployOPChainInput
V160
{
OpChainProxyAdminOwner
:
thisIntent
.
Roles
.
L1ProxyAdminOwner
,
OpChainProxyAdminOwner
:
thisIntent
.
Roles
.
L1ProxyAdminOwner
,
SystemConfigOwner
:
thisIntent
.
Roles
.
SystemConfigOwner
,
SystemConfigOwner
:
thisIntent
.
Roles
.
SystemConfigOwner
,
Batcher
:
thisIntent
.
Roles
.
Batcher
,
Batcher
:
thisIntent
.
Roles
.
Batcher
,
...
@@ -230,6 +266,18 @@ func makeDCI(intent *state.Intent, thisIntent *state.ChainIntent, chainID common
...
@@ -230,6 +266,18 @@ func makeDCI(intent *state.Intent, thisIntent *state.ChainIntent, chainID common
},
nil
},
nil
}
}
func
makeDCIIsthmus
(
intent
*
state
.
Intent
,
thisIntent
*
state
.
ChainIntent
,
chainID
common
.
Hash
,
st
*
state
.
State
)
(
opcm
.
DeployOPChainInputIsthmus
,
error
)
{
dci
,
err
:=
makeDCIV160
(
intent
,
thisIntent
,
chainID
,
st
)
if
err
!=
nil
{
return
opcm
.
DeployOPChainInputIsthmus
{},
fmt
.
Errorf
(
"error making deploy OP chain input: %w"
,
err
)
}
return
opcm
.
DeployOPChainInputIsthmus
{
DeployOPChainInputV160
:
dci
,
SystemConfigFeeAdmin
:
common
.
Address
{
'D'
,
'E'
,
'A'
,
'D'
},
},
nil
}
func
makeChainState
(
chainID
common
.
Hash
,
dco
opcm
.
DeployOPChainOutput
)
*
state
.
ChainState
{
func
makeChainState
(
chainID
common
.
Hash
,
dco
opcm
.
DeployOPChainOutput
)
*
state
.
ChainState
{
return
&
state
.
ChainState
{
return
&
state
.
ChainState
{
ID
:
chainID
,
ID
:
chainID
,
...
...
op-deployer/pkg/deployer/standard/standard.go
View file @
1f335f15
...
@@ -26,6 +26,9 @@ const (
...
@@ -26,6 +26,9 @@ const (
DisputeSplitDepth
uint64
=
30
DisputeSplitDepth
uint64
=
30
DisputeClockExtension
uint64
=
10800
DisputeClockExtension
uint64
=
10800
DisputeMaxClockDuration
uint64
=
302400
DisputeMaxClockDuration
uint64
=
302400
ContractsV160Tag
=
"op-contracts/v1.6.0"
ContractsV170Beta1L2Tag
=
"op-contracts/v1.7.0-beta.1+l2-contracts"
)
)
var
DisputeAbsolutePrestate
=
common
.
HexToHash
(
"0x038512e02c4c3f7bdaec27d00edf55b7155e0905301e1a88083e4e0a6764d54c"
)
var
DisputeAbsolutePrestate
=
common
.
HexToHash
(
"0x038512e02c4c3f7bdaec27d00edf55b7155e0905301e1a88083e4e0a6764d54c"
)
...
@@ -40,9 +43,9 @@ var L1VersionsSepolia L1Versions
...
@@ -40,9 +43,9 @@ var L1VersionsSepolia L1Versions
var
L1VersionsMainnet
L1Versions
var
L1VersionsMainnet
L1Versions
var
DefaultL1ContractsTag
=
"op-contracts/v1.6.0"
var
DefaultL1ContractsTag
=
ContractsV160Tag
var
DefaultL2ContractsTag
=
"op-contracts/v1.7.0-beta.1+l2-contracts"
var
DefaultL2ContractsTag
=
ContractsV170Beta1L2Tag
type
L1Versions
struct
{
type
L1Versions
struct
{
Releases
map
[
string
]
L1VersionsReleases
`toml:"releases"`
Releases
map
[
string
]
L1VersionsReleases
`toml:"releases"`
...
...
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