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
d5ebf81a
Commit
d5ebf81a
authored
Oct 04, 2023
by
refcell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use native uint64 big int check
parent
9c380bee
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
7 deletions
+3
-7
provider.go
op-challenger/game/fault/trace/cannon/provider.go
+2
-4
provider.go
op-challenger/game/fault/trace/outputs/provider.go
+1
-3
No files found.
op-challenger/game/fault/trace/cannon/provider.go
View file @
d5ebf81a
...
@@ -5,8 +5,6 @@ import (
...
@@ -5,8 +5,6 @@ import (
"encoding/json"
"encoding/json"
"errors"
"errors"
"fmt"
"fmt"
"math"
"math/big"
"os"
"os"
"path/filepath"
"path/filepath"
...
@@ -91,7 +89,7 @@ func (p *CannonTraceProvider) SetMaxDepth(gameDepth uint64) {
...
@@ -91,7 +89,7 @@ func (p *CannonTraceProvider) SetMaxDepth(gameDepth uint64) {
func
(
p
*
CannonTraceProvider
)
Get
(
ctx
context
.
Context
,
pos
types
.
Position
)
(
common
.
Hash
,
error
)
{
func
(
p
*
CannonTraceProvider
)
Get
(
ctx
context
.
Context
,
pos
types
.
Position
)
(
common
.
Hash
,
error
)
{
traceIndex
:=
pos
.
TraceIndex
(
int
(
p
.
gameDepth
))
traceIndex
:=
pos
.
TraceIndex
(
int
(
p
.
gameDepth
))
if
traceIndex
.
Cmp
(
new
(
big
.
Int
)
.
SetUint64
(
math
.
MaxUint64
))
>
0
{
if
!
traceIndex
.
IsUint64
()
{
return
common
.
Hash
{},
errors
.
New
(
"trace index out of bounds"
)
return
common
.
Hash
{},
errors
.
New
(
"trace index out of bounds"
)
}
}
proof
,
err
:=
p
.
loadProof
(
ctx
,
traceIndex
.
Uint64
())
proof
,
err
:=
p
.
loadProof
(
ctx
,
traceIndex
.
Uint64
())
...
@@ -108,7 +106,7 @@ func (p *CannonTraceProvider) Get(ctx context.Context, pos types.Position) (comm
...
@@ -108,7 +106,7 @@ func (p *CannonTraceProvider) Get(ctx context.Context, pos types.Position) (comm
func
(
p
*
CannonTraceProvider
)
GetStepData
(
ctx
context
.
Context
,
pos
types
.
Position
)
([]
byte
,
[]
byte
,
*
types
.
PreimageOracleData
,
error
)
{
func
(
p
*
CannonTraceProvider
)
GetStepData
(
ctx
context
.
Context
,
pos
types
.
Position
)
([]
byte
,
[]
byte
,
*
types
.
PreimageOracleData
,
error
)
{
traceIndex
:=
pos
.
TraceIndex
(
int
(
p
.
gameDepth
))
traceIndex
:=
pos
.
TraceIndex
(
int
(
p
.
gameDepth
))
if
traceIndex
.
Cmp
(
new
(
big
.
Int
)
.
SetUint64
(
math
.
MaxUint64
))
>
0
{
if
!
traceIndex
.
IsUint64
()
{
return
nil
,
nil
,
nil
,
errors
.
New
(
"trace index out of bounds"
)
return
nil
,
nil
,
nil
,
errors
.
New
(
"trace index out of bounds"
)
}
}
proof
,
err
:=
p
.
loadProof
(
ctx
,
traceIndex
.
Uint64
())
proof
,
err
:=
p
.
loadProof
(
ctx
,
traceIndex
.
Uint64
())
...
...
op-challenger/game/fault/trace/outputs/provider.go
View file @
d5ebf81a
...
@@ -3,8 +3,6 @@ package outputs
...
@@ -3,8 +3,6 @@ package outputs
import
(
import
(
"context"
"context"
"fmt"
"fmt"
"math"
"math/big"
"github.com/ethereum-optimism/optimism/op-challenger/game/fault/types"
"github.com/ethereum-optimism/optimism/op-challenger/game/fault/types"
"github.com/ethereum-optimism/optimism/op-service/client"
"github.com/ethereum-optimism/optimism/op-service/client"
...
@@ -55,7 +53,7 @@ func NewTraceProviderFromInputs(logger log.Logger, rollupClient OutputRollupClie
...
@@ -55,7 +53,7 @@ func NewTraceProviderFromInputs(logger log.Logger, rollupClient OutputRollupClie
func
(
o
*
OutputTraceProvider
)
Get
(
ctx
context
.
Context
,
pos
types
.
Position
)
(
common
.
Hash
,
error
)
{
func
(
o
*
OutputTraceProvider
)
Get
(
ctx
context
.
Context
,
pos
types
.
Position
)
(
common
.
Hash
,
error
)
{
traceIndex
:=
pos
.
TraceIndex
(
int
(
o
.
gameDepth
))
traceIndex
:=
pos
.
TraceIndex
(
int
(
o
.
gameDepth
))
if
traceIndex
.
Cmp
(
new
(
big
.
Int
)
.
SetUint64
(
math
.
MaxUint64
))
>
0
{
if
!
traceIndex
.
IsUint64
()
{
return
common
.
Hash
{},
fmt
.
Errorf
(
"trace index %v is greater than max uint64"
,
traceIndex
)
return
common
.
Hash
{},
fmt
.
Errorf
(
"trace index %v is greater than max uint64"
,
traceIndex
)
}
}
outputBlock
:=
traceIndex
.
Uint64
()
+
o
.
prestateBlock
+
1
outputBlock
:=
traceIndex
.
Uint64
()
+
o
.
prestateBlock
+
1
...
...
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