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
8381a6f4
Unverified
Commit
8381a6f4
authored
Nov 30, 2022
by
Mark Tyneway
Committed by
GitHub
Nov 30, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4128 from ethereum-optimism/fix/err-handling
op-chain-ops: better error handling in op-migrate
parents
64bff0e7
0c189f09
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
db_migration.go
op-chain-ops/genesis/db_migration.go
+6
-0
No files found.
op-chain-ops/genesis/db_migration.go
View file @
8381a6f4
...
...
@@ -34,8 +34,14 @@ type MigrationResult struct {
// MigrateDB will migrate an old l2geth database to the new bedrock style system
func
MigrateDB
(
ldb
ethdb
.
Database
,
config
*
DeployConfig
,
l1Block
*
types
.
Block
,
migrationData
*
migration
.
MigrationData
,
commit
,
noCheck
bool
)
(
*
MigrationResult
,
error
)
{
hash
:=
rawdb
.
ReadHeadHeaderHash
(
ldb
)
log
.
Info
(
"Reading chain tip from database"
,
"hash"
,
hash
)
num
:=
rawdb
.
ReadHeaderNumber
(
ldb
,
hash
)
if
num
==
nil
{
return
nil
,
fmt
.
Errorf
(
"cannot find header number for %s"
,
hash
)
}
header
:=
rawdb
.
ReadHeader
(
ldb
,
hash
,
*
num
)
log
.
Info
(
"Read header from database"
,
"number"
,
*
num
)
if
bytes
.
Equal
(
header
.
Extra
,
bedrockTransitionBlockExtraData
)
{
log
.
Info
(
"Detected migration already happened"
,
"root"
,
header
.
Root
,
"blockhash"
,
header
.
Hash
())
...
...
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