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
778dba38
Unverified
Commit
778dba38
authored
May 15, 2023
by
Mark Tyneway
Committed by
GitHub
May 15, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5699 from ethereum-optimism/feat/wd-comments
op-chain-ops: better comments
parents
4611198b
c7f6fd49
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
main.go
op-chain-ops/cmd/op-migrate/main.go
+4
-0
legacy_withdrawal.go
op-chain-ops/crossdomain/legacy_withdrawal.go
+5
-1
No files found.
op-chain-ops/cmd/op-migrate/main.go
View file @
778dba38
...
@@ -202,6 +202,10 @@ func main() {
...
@@ -202,6 +202,10 @@ func main() {
dryRun
:=
ctx
.
Bool
(
"dry-run"
)
dryRun
:=
ctx
.
Bool
(
"dry-run"
)
noCheck
:=
ctx
.
Bool
(
"no-check"
)
noCheck
:=
ctx
.
Bool
(
"no-check"
)
if
noCheck
{
panic
(
"must run with check on"
)
}
// Perform the migration
// Perform the migration
res
,
err
:=
genesis
.
MigrateDB
(
ldb
,
config
,
block
,
&
migrationData
,
!
dryRun
,
noCheck
)
res
,
err
:=
genesis
.
MigrateDB
(
ldb
,
config
,
block
,
&
migrationData
,
!
dryRun
,
noCheck
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
op-chain-ops/crossdomain/legacy_withdrawal.go
View file @
778dba38
...
@@ -57,7 +57,9 @@ func (w *LegacyWithdrawal) Encode() ([]byte, error) {
...
@@ -57,7 +57,9 @@ func (w *LegacyWithdrawal) Encode() ([]byte, error) {
return
out
,
nil
return
out
,
nil
}
}
// Decode will decode a serialized LegacyWithdrawal
// Decode will decode a serialized LegacyWithdrawal. There is a known inconsistency
// where the decoded `msg.sender` is not authenticated. A round trip of encoding and
// decoding with a spoofed withdrawal will result in a different message being recovered.
func
(
w
*
LegacyWithdrawal
)
Decode
(
data
[]
byte
)
error
{
func
(
w
*
LegacyWithdrawal
)
Decode
(
data
[]
byte
)
error
{
if
len
(
data
)
<
len
(
predeploys
.
L2CrossDomainMessengerAddr
)
+
4
{
if
len
(
data
)
<
len
(
predeploys
.
L2CrossDomainMessengerAddr
)
+
4
{
return
fmt
.
Errorf
(
"withdrawal data too short: %d"
,
len
(
data
))
return
fmt
.
Errorf
(
"withdrawal data too short: %d"
,
len
(
data
))
...
@@ -68,6 +70,8 @@ func (w *LegacyWithdrawal) Decode(data []byte) error {
...
@@ -68,6 +70,8 @@ func (w *LegacyWithdrawal) Decode(data []byte) error {
return
fmt
.
Errorf
(
"invalid selector: 0x%x"
,
data
[
0
:
4
])
return
fmt
.
Errorf
(
"invalid selector: 0x%x"
,
data
[
0
:
4
])
}
}
// This should be the L2CrossDomainMessenger address but is not guaranteed
// to be.
msgSender
:=
data
[
len
(
data
)
-
len
(
predeploys
.
L2CrossDomainMessengerAddr
)
:
]
msgSender
:=
data
[
len
(
data
)
-
len
(
predeploys
.
L2CrossDomainMessengerAddr
)
:
]
raw
:=
data
[
4
:
len
(
data
)
-
len
(
predeploys
.
L2CrossDomainMessengerAddr
)]
raw
:=
data
[
4
:
len
(
data
)
-
len
(
predeploys
.
L2CrossDomainMessengerAddr
)]
...
...
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