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
9393fc75
Commit
9393fc75
authored
Sep 27, 2023
by
Andreas Bigger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small fixes
parent
4461b963
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
solver.go
op-challenger/game/fault/solver/solver.go
+3
-4
position.go
op-challenger/game/fault/types/position.go
+7
-0
No files found.
op-challenger/game/fault/solver/solver.go
View file @
9393fc75
...
@@ -108,10 +108,9 @@ func (s *claimSolver) AttemptStep(ctx context.Context, game types.Game, claim ty
...
@@ -108,10 +108,9 @@ func (s *claimSolver) AttemptStep(ctx context.Context, game types.Game, claim ty
return
StepData
{},
err
return
StepData
{},
err
}
}
}
else
{
}
else
{
// We agree with the claim so Defend and use this claim as the starting point to execute the step after
// We agree with the claim so Defend and use this claim as the starting point to
// Thus we need the pre-state of the next step
// execute the step after. Thus we need the pre-state of the next step.
defendingPosition
:=
types
.
NewPosition
(
s
.
gameDepth
,
int
(
claim
.
TraceIndex
(
s
.
gameDepth
))
+
1
)
preState
,
proofData
,
oracleData
,
err
=
s
.
trace
.
GetStepData
(
ctx
,
claim
.
NextStepPosition
(
s
.
gameDepth
))
preState
,
proofData
,
oracleData
,
err
=
s
.
trace
.
GetStepData
(
ctx
,
defendingPosition
)
if
err
!=
nil
{
if
err
!=
nil
{
return
StepData
{},
err
return
StepData
{},
err
}
}
...
...
op-challenger/game/fault/types/position.go
View file @
9393fc75
...
@@ -18,6 +18,13 @@ func NewPositionFromGIndex(x uint64) Position {
...
@@ -18,6 +18,13 @@ func NewPositionFromGIndex(x uint64) Position {
return
NewPosition
(
depth
,
int
(
indexAtDepth
))
return
NewPosition
(
depth
,
int
(
indexAtDepth
))
}
}
func
(
p
Position
)
NextStepPosition
(
gameDepth
int
)
Position
{
return
Position
{
depth
:
gameDepth
,
indexAtDepth
:
int
(
p
.
TraceIndex
(
gameDepth
)
+
1
),
}
}
func
(
p
Position
)
Depth
()
int
{
func
(
p
Position
)
Depth
()
int
{
return
p
.
depth
return
p
.
depth
}
}
...
...
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