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
df33bf11
Unverified
Commit
df33bf11
authored
Aug 06, 2024
by
Adrian Sutton
Committed by
GitHub
Aug 05, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-challenger: Modify run_trace to run a block prior to the safe head (#11349)
parent
9dc125a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
runner.go
op-challenger/runner/runner.go
+13
-3
No files found.
op-challenger/runner/runner.go
View file @
df33bf11
...
...
@@ -169,11 +169,21 @@ func (r *Runner) createGameInputs(ctx context.Context, client *sources.RollupCli
if
status
.
SafeL2
.
Number
==
0
{
return
utils
.
LocalGameInputs
{},
errors
.
New
(
"safe head is 0"
)
}
claimOutput
,
err
:=
client
.
OutputAtBlock
(
ctx
,
status
.
SafeL2
.
Number
)
blockNumber
:=
status
.
SafeL2
.
Number
// When possible, execute the first block in the submitted batch
if
status
.
SafeL1
.
Number
>
0
{
priorSafeHead
,
err
:=
client
.
SafeHeadAtL1Block
(
ctx
,
status
.
SafeL1
.
Number
-
1
)
if
err
!=
nil
{
r
.
log
.
Warn
(
"Failed to get prior safe head"
,
"err"
,
err
)
}
else
if
priorSafeHead
.
SafeHead
.
Number
!=
0
{
// Sanity check to avoid trying to execute genesis
blockNumber
=
priorSafeHead
.
SafeHead
.
Number
+
1
}
}
claimOutput
,
err
:=
client
.
OutputAtBlock
(
ctx
,
blockNumber
)
if
err
!=
nil
{
return
utils
.
LocalGameInputs
{},
fmt
.
Errorf
(
"failed to get claim output: %w"
,
err
)
}
parentOutput
,
err
:=
client
.
OutputAtBlock
(
ctx
,
status
.
SafeL2
.
Number
-
1
)
parentOutput
,
err
:=
client
.
OutputAtBlock
(
ctx
,
block
Number
-
1
)
if
err
!=
nil
{
return
utils
.
LocalGameInputs
{},
fmt
.
Errorf
(
"failed to get claim output: %w"
,
err
)
}
...
...
@@ -182,7 +192,7 @@ func (r *Runner) createGameInputs(ctx context.Context, client *sources.RollupCli
L2Head
:
parentOutput
.
BlockRef
.
Hash
,
L2OutputRoot
:
common
.
Hash
(
parentOutput
.
OutputRoot
),
L2Claim
:
common
.
Hash
(
claimOutput
.
OutputRoot
),
L2BlockNumber
:
new
(
big
.
Int
)
.
SetUint64
(
status
.
SafeL2
.
Number
),
L2BlockNumber
:
new
(
big
.
Int
)
.
SetUint64
(
block
Number
),
}
return
localInputs
,
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