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
e9bc59cd
Unverified
Commit
e9bc59cd
authored
Jul 24, 2023
by
inphi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix goerli-verify program
parent
cab9dfe9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
7 deletions
+19
-7
goerli.go
op-program/verify/cmd/goerli.go
+19
-7
No files found.
op-program/verify/cmd/goerli.go
View file @
e9bc59cd
...
@@ -100,19 +100,31 @@ func Run(l1RpcUrl string, l2RpcUrl string, l2OracleAddr common.Address) error {
...
@@ -100,19 +100,31 @@ func Run(l1RpcUrl string, l2RpcUrl string, l2OracleAddr common.Address) error {
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"retrieve agreed l2 block: %w"
,
err
)
return
fmt
.
Errorf
(
"retrieve agreed l2 block: %w"
,
err
)
}
}
l2Head
:=
l2AgreedBlock
.
Hash
()
agreedOutputIndex
,
err
:=
outputOracle
.
GetL2OutputIndexAfter
(
callOpts
,
l2AgreedBlock
.
Number
())
agreedOutputIndex
,
err
:=
outputOracle
.
GetL2OutputIndexAfter
(
callOpts
,
l2AgreedBlock
.
Number
())
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to output index after agreed block"
)
return
fmt
.
Errorf
(
"failed to output index after agreed block"
)
}
}
agreedOutput
,
err
:=
outputOracle
.
GetL2Output
(
callOpts
,
agreedOutputIndex
)
// Find an output that differs from what is being claimed
if
err
!=
nil
{
var
agreedOutput
bindings
.
TypesOutputProposal
return
fmt
.
Errorf
(
"retrieve agreed output: %w"
,
err
)
for
{
agreedOutput
,
err
=
outputOracle
.
GetL2Output
(
callOpts
,
agreedOutputIndex
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"retrieve agreed output: %w"
,
err
)
}
if
agreedOutput
.
OutputRoot
!=
output
.
OutputRoot
{
break
}
fmt
.
Printf
(
"Output at %d equals output at finalized block. Continuing search...
\n
"
,
agreedBlockNumber
)
agreedOutputIndex
.
Sub
(
agreedOutputIndex
,
big
.
NewInt
(
1
))
if
agreedOutputIndex
.
Int64
()
<
0
{
return
fmt
.
Errorf
(
"failed to find an output different from finalized block output"
)
}
}
}
if
agreedOutput
.
OutputRoot
==
output
.
OutputRoot
{
l2BlockAtOutput
,
err
:=
l2Client
.
BlockByNumber
(
ctx
,
agreedOutput
.
L2BlockNumber
)
// TODO(inphi): Don't return here but keep searching preceding blocks for a different output
if
err
!=
nil
{
return
fmt
.
Errorf
(
"
agreed output is the same as the output claim"
)
return
fmt
.
Errorf
(
"
retrieve agreed block: %w"
,
err
)
}
}
l2Head
:=
l2BlockAtOutput
.
Hash
()
temp
,
err
:=
os
.
MkdirTemp
(
""
,
"oracledata"
)
temp
,
err
:=
os
.
MkdirTemp
(
""
,
"oracledata"
)
if
err
!=
nil
{
if
err
!=
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