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
61bc11cf
Commit
61bc11cf
authored
Aug 03, 2023
by
Mark Tyneway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check-l2: update to check for the initialized values
parent
f2bc432b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
9 deletions
+21
-9
main.go
op-chain-ops/cmd/check-l2/main.go
+21
-9
No files found.
op-chain-ops/cmd/check-l2/main.go
View file @
61bc11cf
...
...
@@ -36,16 +36,16 @@ func main() {
Usage
:
"Check that an OP Stack L2 has been configured correctly"
,
Flags
:
[]
cli
.
Flag
{
&
cli
.
StringFlag
{
Name
:
"l1-rpc-url"
,
Required
:
true
,
Usage
:
"L1 RPC URL"
,
EnvVars
:
[]
string
{
"L1_RPC_URL"
},
Name
:
"l1-rpc-url"
,
Value
:
"http://127.0.0.1:8545"
,
Usage
:
"L1 RPC URL"
,
EnvVars
:
[]
string
{
"L1_RPC_URL"
},
},
&
cli
.
StringFlag
{
Name
:
"l2-rpc-url"
,
Required
:
true
,
Usage
:
"L2 RPC URL"
,
EnvVars
:
[]
string
{
"L2_RPC_URL"
},
Name
:
"l2-rpc-url"
,
Value
:
"http://127.0.0.1:9545"
,
Usage
:
"L2 RPC URL"
,
EnvVars
:
[]
string
{
"L2_RPC_URL"
},
},
},
Action
:
entrypoint
,
...
...
@@ -718,6 +718,13 @@ func checkL2CrossDomainMessenger(addr common.Address, client *ethclient.Client)
if
err
!=
nil
{
return
err
}
initialized
,
err
:=
getInitialized
(
"L2CrossDomainMessenger"
,
addr
,
client
)
if
err
!=
nil
{
return
err
}
log
.
Info
(
"L2CrossDomainMessenger"
,
"_initialized"
,
initialized
)
log
.
Info
(
"L2CrossDomainMessenger version"
,
"version"
,
version
)
return
nil
}
...
...
@@ -834,6 +841,11 @@ func getInitialized(name string, addr common.Address, client *ethclient.Client)
if
entry
.
Offset
+
typ
.
NumberOfBytes
>
uint
(
len
(
value
))
{
return
nil
,
fmt
.
Errorf
(
"value length is too short"
)
}
initialized
:=
new
(
big
.
Int
)
.
SetBytes
(
value
[
entry
.
Offset
:
entry
.
Offset
+
typ
.
NumberOfBytes
])
// Swap the endianness
slice
:=
common
.
CopyBytes
(
value
)
for
i
,
j
:=
0
,
len
(
slice
)
-
1
;
i
<
j
;
i
,
j
=
i
+
1
,
j
-
1
{
slice
[
i
],
slice
[
j
]
=
slice
[
j
],
slice
[
i
]
}
initialized
:=
new
(
big
.
Int
)
.
SetBytes
(
slice
[
entry
.
Offset
:
entry
.
Offset
+
typ
.
NumberOfBytes
])
return
initialized
,
nil
}
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