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
62b1d4f3
Unverified
Commit
62b1d4f3
authored
Nov 04, 2022
by
Mark Tyneway
Committed by
GitHub
Nov 04, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3890 from ethereum-optimism/chain-ops/errors
op-chain-ops: wrap errors
parents
356a6c4e
86ce8cab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
migrate.go
op-chain-ops/crossdomain/migrate.go
+2
-2
db_migration.go
op-chain-ops/genesis/db_migration.go
+10
-10
No files found.
op-chain-ops/crossdomain/migrate.go
View file @
62b1d4f3
...
...
@@ -27,7 +27,7 @@ func MigrateWithdrawals(withdrawals []*LegacyWithdrawal, db vm.StateDB, l1CrossD
legacyValue
:=
db
.
GetState
(
predeploys
.
LegacyMessagePasserAddr
,
legacySlot
)
if
legacyValue
!=
abiTrue
{
return
fmt
.
Errorf
(
"%w: %s"
,
errLegacyStorageSlotNotFound
,
legacy
Value
)
return
fmt
.
Errorf
(
"%w: %s"
,
errLegacyStorageSlotNotFound
,
legacy
Slot
)
}
withdrawal
,
err
:=
MigrateWithdrawal
(
legacy
,
l1CrossDomainMessenger
,
l1StandardBridge
)
...
...
@@ -37,7 +37,7 @@ func MigrateWithdrawals(withdrawals []*LegacyWithdrawal, db vm.StateDB, l1CrossD
slot
,
err
:=
withdrawal
.
StorageSlot
()
if
err
!=
nil
{
return
err
return
fmt
.
Errorf
(
"cannot compute withdrawal storage slot: %w"
,
err
)
}
db
.
SetState
(
predeploys
.
L2ToL1MessagePasserAddr
,
slot
,
abiTrue
)
...
...
op-chain-ops/genesis/db_migration.go
View file @
62b1d4f3
...
...
@@ -27,46 +27,46 @@ func MigrateDB(ldb ethdb.Database, config *DeployConfig, l1Block *types.Block, l
db
,
err
:=
state
.
New
(
header
.
Root
,
state
.
NewDatabase
(
ldb
),
nil
)
if
err
!=
nil
{
return
err
return
fmt
.
Errorf
(
"cannot open StateDB: %w"
,
err
)
}
// Convert all of the messages into legacy withdrawals
withdrawals
,
err
:=
migrationData
.
ToWithdrawals
()
if
err
!=
nil
{
return
err
return
fmt
.
Errorf
(
"cannot serialize withdrawals: %w"
,
err
)
}
if
err
:=
CheckWithdrawals
(
db
,
withdrawals
);
err
!=
nil
{
return
err
return
fmt
.
Errorf
(
"withdrawals mismatch: %w"
,
err
)
}
// Now start the migration
if
err
:=
SetL2Proxies
(
db
);
err
!=
nil
{
return
err
return
fmt
.
Errorf
(
"cannot set L2Proxies: %w"
,
err
)
}
storage
,
err
:=
NewL2StorageConfig
(
config
,
l1Block
,
l2Addrs
)
if
err
!=
nil
{
return
err
return
fmt
.
Errorf
(
"cannot create storage config: %w"
,
err
)
}
immutable
,
err
:=
NewL2ImmutableConfig
(
config
,
l1Block
,
l2Addrs
)
if
err
!=
nil
{
return
err
return
fmt
.
Errorf
(
"cannot create immutable config: %w"
,
err
)
}
if
err
:=
SetImplementations
(
db
,
storage
,
immutable
);
err
!=
nil
{
return
err
return
fmt
.
Errorf
(
"cannot set implementations: %w"
,
err
)
}
err
=
crossdomain
.
MigrateWithdrawals
(
withdrawals
,
db
,
&
l2Addrs
.
L1CrossDomainMessengerProxy
,
&
l2Addrs
.
L1StandardBridgeProxy
)
if
err
!=
nil
{
return
err
return
fmt
.
Errorf
(
"cannot migrate withdrawals: %w"
,
err
)
}
addrs
:=
migrationData
.
Addresses
()
if
err
:=
ether
.
MigrateLegacyETH
(
ldb
,
addrs
,
migrationData
.
OvmAllowances
,
int
(
config
.
L1ChainID
));
err
!=
nil
{
return
err
return
fmt
.
Errorf
(
"cannot migrate legacy eth: %w"
,
err
)
}
if
!
commit
{
...
...
@@ -75,7 +75,7 @@ func MigrateDB(ldb ethdb.Database, config *DeployConfig, l1Block *types.Block, l
root
,
err
:=
db
.
Commit
(
true
)
if
err
!=
nil
{
return
err
return
fmt
.
Errorf
(
"cannot commit state db: %w"
,
err
)
}
// Create the bedrock transition block
...
...
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