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
014b91d2
Unverified
Commit
014b91d2
authored
Dec 01, 2022
by
mergify[bot]
Committed by
GitHub
Dec 01, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4139 from ethereum-optimism/fixes/op-migrate
op-migrate: various sanity checks + cleanup
parents
1a24329e
33be0e65
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
db_migration.go
op-chain-ops/genesis/db_migration.go
+20
-2
No files found.
op-chain-ops/genesis/db_migration.go
View file @
014b91d2
...
@@ -120,6 +120,9 @@ func MigrateDB(ldb ethdb.Database, config *DeployConfig, l1Block *types.Block, m
...
@@ -120,6 +120,9 @@ func MigrateDB(ldb ethdb.Database, config *DeployConfig, l1Block *types.Block, m
}
}
log
.
Info
(
"Completed ERC20 ETH migration"
,
"root"
,
newRoot
)
log
.
Info
(
"Completed ERC20 ETH migration"
,
"root"
,
newRoot
)
// Set the amount of gas used so that EIP 1559 starts off stable
gasUsed
:=
(
uint64
)(
config
.
L2GenesisBlockGasLimit
)
*
config
.
EIP1559Elasticity
// Create the bedrock transition block
// Create the bedrock transition block
bedrockHeader
:=
&
types
.
Header
{
bedrockHeader
:=
&
types
.
Header
{
ParentHash
:
header
.
Hash
(),
ParentHash
:
header
.
Hash
(),
...
@@ -132,16 +135,25 @@ func MigrateDB(ldb ethdb.Database, config *DeployConfig, l1Block *types.Block, m
...
@@ -132,16 +135,25 @@ func MigrateDB(ldb ethdb.Database, config *DeployConfig, l1Block *types.Block, m
Difficulty
:
common
.
Big0
,
Difficulty
:
common
.
Big0
,
Number
:
new
(
big
.
Int
)
.
Add
(
header
.
Number
,
common
.
Big1
),
Number
:
new
(
big
.
Int
)
.
Add
(
header
.
Number
,
common
.
Big1
),
GasLimit
:
(
uint64
)(
config
.
L2GenesisBlockGasLimit
),
GasLimit
:
(
uint64
)(
config
.
L2GenesisBlockGasLimit
),
GasUsed
:
0
,
GasUsed
:
gasUsed
,
Time
:
uint64
(
config
.
L2OutputOracleStartingTimestamp
),
Time
:
uint64
(
config
.
L2OutputOracleStartingTimestamp
),
Extra
:
bedrockTransitionBlockExtraData
,
Extra
:
bedrockTransitionBlockExtraData
,
MixDigest
:
common
.
Hash
{},
MixDigest
:
common
.
Hash
{},
Nonce
:
types
.
BlockNonce
{},
Nonce
:
types
.
BlockNonce
{},
BaseFee
:
(
*
big
.
Int
)(
config
.
L2GenesisBlockBaseFeePerGas
),
BaseFee
:
big
.
NewInt
(
params
.
InitialBaseFee
),
}
}
bedrockBlock
:=
types
.
NewBlock
(
bedrockHeader
,
nil
,
nil
,
nil
,
trie
.
NewStackTrie
(
nil
))
bedrockBlock
:=
types
.
NewBlock
(
bedrockHeader
,
nil
,
nil
,
nil
,
trie
.
NewStackTrie
(
nil
))
log
.
Info
(
"Built Bedrock transition"
,
"hash"
,
bedrockBlock
.
Hash
(),
"root"
,
bedrockBlock
.
Root
(),
"number"
,
bedrockBlock
.
NumberU64
(),
"gas-used"
,
bedrockBlock
.
GasUsed
(),
"gas-limit"
,
bedrockBlock
.
GasLimit
(),
)
res
:=
&
MigrationResult
{
res
:=
&
MigrationResult
{
TransitionHeight
:
bedrockBlock
.
NumberU64
(),
TransitionHeight
:
bedrockBlock
.
NumberU64
(),
TransitionTimestamp
:
bedrockBlock
.
Time
(),
TransitionTimestamp
:
bedrockBlock
.
Time
(),
...
@@ -183,6 +195,12 @@ func MigrateDB(ldb ethdb.Database, config *DeployConfig, l1Block *types.Block, m
...
@@ -183,6 +195,12 @@ func MigrateDB(ldb ethdb.Database, config *DeployConfig, l1Block *types.Block, m
}
}
rawdb
.
WriteChainConfig
(
ldb
,
genesisHash
,
cfg
)
rawdb
.
WriteChainConfig
(
ldb
,
genesisHash
,
cfg
)
log
.
Info
(
"wrote chain config"
,
"1559-denominator"
,
config
.
EIP1559Denominator
,
"1559-elasticity"
,
config
.
EIP1559Elasticity
,
)
log
.
Info
(
log
.
Info
(
"wrote Bedrock transition block"
,
"wrote Bedrock transition block"
,
"height"
,
bedrockHeader
.
Number
,
"height"
,
bedrockHeader
.
Number
,
...
...
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