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
4d5d7ad7
Unverified
Commit
4d5d7ad7
authored
Dec 13, 2024
by
Matthew Slipper
Committed by
GitHub
Dec 13, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-deployer: Default gov token to disabled (#13378)
parent
743e782b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
8 deletions
+74
-8
apply_test.go
op-deployer/pkg/deployer/integration_test/apply_test.go
+73
-7
deploy_config.go
op-deployer/pkg/deployer/state/deploy_config.go
+1
-1
No files found.
op-deployer/pkg/deployer/integration_test/apply_test.go
View file @
4d5d7ad7
...
...
@@ -148,7 +148,7 @@ func TestEndToEndApply(t *testing.T) {
))
validateSuperchainDeployment
(
t
,
st
,
cg
)
validateOPChainDeployment
(
t
,
cg
,
st
,
intent
)
validateOPChainDeployment
(
t
,
cg
,
st
,
intent
,
false
)
})
t
.
Run
(
"chain with tagged artifacts"
,
func
(
t
*
testing
.
T
)
{
...
...
@@ -232,6 +232,12 @@ func testApplyExistingOPCM(t *testing.T, l1ChainID uint64, forkRPCUrl string, ve
artifacts
.
MustNewLocatorFromTag
(
"op-contracts/v1.6.0"
),
artifacts
.
MustNewLocatorFromTag
(
"op-contracts/v1.7.0-beta.1+l2-contracts"
),
)
// NOTE: the reference allocs for version 1.6 contain the gov token, so we need to enable it
// via override here.
intent
.
GlobalDeployOverrides
=
map
[
string
]
any
{
"enableGovernance"
:
true
,
}
// Define a new create2 salt to avoid contract address collisions
_
,
err
=
rand
.
Read
(
st
.
Create2Salt
[
:
])
require
.
NoError
(
t
,
err
)
...
...
@@ -248,7 +254,7 @@ func testApplyExistingOPCM(t *testing.T, l1ChainID uint64, forkRPCUrl string, ve
},
))
validateOPChainDeployment
(
t
,
ethClientCodeGetter
(
ctx
,
l1Client
),
st
,
intent
)
validateOPChainDeployment
(
t
,
ethClientCodeGetter
(
ctx
,
l1Client
),
st
,
intent
,
true
)
releases
:=
versions
.
Releases
[
"op-contracts/v1.6.0"
]
...
...
@@ -480,7 +486,7 @@ func TestApplyGenesisStrategy(t *testing.T) {
for
i
:=
range
intent
.
Chains
{
t
.
Run
(
fmt
.
Sprintf
(
"chain-%d"
,
i
),
func
(
t
*
testing
.
T
)
{
validateOPChainDeployment
(
t
,
cg
,
st
,
intent
)
validateOPChainDeployment
(
t
,
cg
,
st
,
intent
,
false
)
})
}
}
...
...
@@ -736,6 +742,60 @@ func TestAdditionalDisputeGames(t *testing.T) {
require
.
NotEqual
(
t
,
st
.
ImplementationsDeployment
.
PreimageOracleSingletonAddress
,
gameInfo
.
OracleAddress
)
}
func
TestIntentConfiguration
(
t
*
testing
.
T
)
{
op_e2e
.
InitParallel
(
t
)
tests
:=
[]
struct
{
name
string
mutator
func
(
*
state
.
Intent
)
assertions
func
(
t
*
testing
.
T
,
st
*
state
.
State
)
}{
{
"governance token disabled by default"
,
func
(
intent
*
state
.
Intent
)
{},
func
(
t
*
testing
.
T
,
st
*
state
.
State
)
{
l2Genesis
:=
st
.
Chains
[
0
]
.
Allocs
.
Data
_
,
ok
:=
l2Genesis
.
Accounts
[
predeploys
.
GovernanceTokenAddr
]
require
.
False
(
t
,
ok
)
},
},
{
"governance token enabled via override"
,
func
(
intent
*
state
.
Intent
)
{
intent
.
GlobalDeployOverrides
=
map
[
string
]
any
{
"enableGovernance"
:
true
,
"governanceTokenOwner"
:
common
.
Address
{
'O'
}
.
Hex
(),
}
},
func
(
t
*
testing
.
T
,
st
*
state
.
State
)
{
l2Genesis
:=
st
.
Chains
[
0
]
.
Allocs
.
Data
_
,
ok
:=
l2Genesis
.
Accounts
[
predeploys
.
GovernanceTokenAddr
]
require
.
True
(
t
,
ok
)
checkStorageSlot
(
t
,
l2Genesis
.
Accounts
,
predeploys
.
GovernanceTokenAddr
,
common
.
Hash
{
31
:
0x0a
},
common
.
BytesToHash
(
common
.
Address
{
'O'
}
.
Bytes
()),
)
},
},
}
for
_
,
tt
:=
range
tests
{
t
.
Run
(
tt
.
name
,
func
(
t
*
testing
.
T
)
{
t
.
Parallel
()
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
defer
cancel
()
opts
,
intent
,
st
:=
setupGenesisChain
(
t
,
defaultL1ChainID
)
tt
.
mutator
(
intent
)
require
.
NoError
(
t
,
deployer
.
ApplyPipeline
(
ctx
,
opts
))
tt
.
assertions
(
t
,
st
)
})
}
}
func
setupGenesisChain
(
t
*
testing
.
T
,
l1ChainID
uint64
)
(
deployer
.
ApplyPipelineOpts
,
*
state
.
Intent
,
*
state
.
State
)
{
lgr
:=
testlog
.
Logger
(
t
,
slog
.
LevelDebug
)
...
...
@@ -862,7 +922,7 @@ func validateSuperchainDeployment(t *testing.T, st *state.State, cg codeGetter)
}
}
func
validateOPChainDeployment
(
t
*
testing
.
T
,
cg
codeGetter
,
st
*
state
.
State
,
intent
*
state
.
Intent
)
{
func
validateOPChainDeployment
(
t
*
testing
.
T
,
cg
codeGetter
,
st
*
state
.
State
,
intent
*
state
.
Intent
,
govEnabled
bool
)
{
// Validate that the implementation addresses are always set, even in subsequent deployments
// that pull from an existing OPCM deployment.
implAddrs
:=
[]
struct
{
...
...
@@ -929,9 +989,15 @@ func validateOPChainDeployment(t *testing.T, cg codeGetter, st *state.State, int
// slot 0
ownerSlot
:=
common
.
Hash
{}
checkStorageSlot
(
t
,
alloc
,
predeploys
.
ProxyAdminAddr
,
ownerSlot
,
addrAsSlot
)
var
defaultGovOwner
common
.
Hash
defaultGovOwner
.
SetBytes
(
common
.
HexToAddress
(
"0xDeaDDEaDDeAdDeAdDEAdDEaddeAddEAdDEAdDEad"
)
.
Bytes
())
checkStorageSlot
(
t
,
alloc
,
predeploys
.
GovernanceTokenAddr
,
common
.
Hash
{
31
:
0x0a
},
defaultGovOwner
)
if
govEnabled
{
var
defaultGovOwner
common
.
Hash
defaultGovOwner
.
SetBytes
(
common
.
HexToAddress
(
"0xDeaDDEaDDeAdDeAdDEAdDEaddeAddEAdDEAdDEad"
)
.
Bytes
())
checkStorageSlot
(
t
,
alloc
,
predeploys
.
GovernanceTokenAddr
,
common
.
Hash
{
31
:
0x0a
},
defaultGovOwner
)
}
else
{
_
,
ok
:=
alloc
[
predeploys
.
GovernanceTokenAddr
]
require
.
False
(
t
,
ok
,
"governance token should not be deployed by default"
)
}
require
.
Equal
(
t
,
int
(
chainIntent
.
Eip1559Denominator
),
50
,
"EIP1559Denominator should be set"
)
require
.
Equal
(
t
,
int
(
chainIntent
.
Eip1559Elasticity
),
6
,
"EIP1559Elasticity should be set"
)
...
...
op-deployer/pkg/deployer/state/deploy_config.go
View file @
4d5d7ad7
...
...
@@ -49,7 +49,7 @@ func CombineDeployConfig(intent *Intent, chainIntent *ChainIntent, state *State,
SequencerFeeVaultRecipient
:
chainIntent
.
SequencerFeeVaultRecipient
,
},
GovernanceDeployConfig
:
genesis
.
GovernanceDeployConfig
{
EnableGovernance
:
tru
e
,
EnableGovernance
:
fals
e
,
GovernanceTokenSymbol
:
"OP"
,
GovernanceTokenName
:
"Optimism"
,
GovernanceTokenOwner
:
common
.
HexToAddress
(
"0xDeaDDEaDDeAdDeAdDEAdDEaddeAddEAdDEAdDEad"
),
...
...
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