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
2a1b398f
Unverified
Commit
2a1b398f
authored
Sep 13, 2023
by
Adrian Sutton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-challenger: Use claim with no pre-image. Improve logging.
parent
12dd92cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
9 deletions
+4
-9
game_solver_test.go
op-challenger/game/fault/solver/game_solver_test.go
+4
-9
No files found.
op-challenger/game/fault/solver/game_solver_test.go
View file @
2a1b398f
...
@@ -5,7 +5,6 @@ import (
...
@@ -5,7 +5,6 @@ import (
"encoding/hex"
"encoding/hex"
"testing"
"testing"
"github.com/ethereum-optimism/optimism/cannon/mipsevm"
faulttest
"github.com/ethereum-optimism/optimism/op-challenger/game/fault/test"
faulttest
"github.com/ethereum-optimism/optimism/op-challenger/game/fault/test"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
...
@@ -90,13 +89,8 @@ func TestCalculateNextActions(t *testing.T) {
...
@@ -90,13 +89,8 @@ func TestCalculateNextActions(t *testing.T) {
name
:
"PoisonedPreState"
,
name
:
"PoisonedPreState"
,
agreeWithOutputRoot
:
true
,
agreeWithOutputRoot
:
true
,
setupGame
:
func
(
builder
*
faulttest
.
GameBuilder
)
{
setupGame
:
func
(
builder
*
faulttest
.
GameBuilder
)
{
// Create a cannon state that is exited and resolved that the output root was invalid
// A claim hash that has no pre-image
maliciousState
:=
mipsevm
.
State
{
maliciousStateHash
:=
common
.
Hash
{
0x01
,
0xaa
}
Memory
:
mipsevm
.
NewMemory
(),
ExitCode
:
1
,
Exited
:
true
,
}
maliciousStateHash
,
_
:=
maliciousState
.
EncodeWitness
()
.
StateHash
()
// Dishonest actor counters their own claims to set up a situation with an invalid prestate
// Dishonest actor counters their own claims to set up a situation with an invalid prestate
// The honest actor should attack all claims that support the root claim (disagree with the output root)
// The honest actor should attack all claims that support the root claim (disagree with the output root)
...
@@ -120,7 +114,8 @@ func TestCalculateNextActions(t *testing.T) {
...
@@ -120,7 +114,8 @@ func TestCalculateNextActions(t *testing.T) {
test
.
setupGame
(
builder
)
test
.
setupGame
(
builder
)
game
:=
builder
.
Game
game
:=
builder
.
Game
for
i
,
claim
:=
range
game
.
Claims
()
{
for
i
,
claim
:=
range
game
.
Claims
()
{
t
.
Logf
(
"Claim %v: Pos: %v ParentIdx: %v, Countered: %v, Value: %v"
,
i
,
claim
.
Position
.
ToGIndex
(),
claim
.
ParentContractIndex
,
claim
.
Countered
,
claim
.
Value
)
t
.
Logf
(
"Claim %v: Pos: %v TraceIdx: %v ParentIdx: %v, Countered: %v, Value: %v"
,
i
,
claim
.
Position
.
ToGIndex
(),
claim
.
Position
.
TraceIndex
(
maxDepth
),
claim
.
ParentContractIndex
,
claim
.
Countered
,
claim
.
Value
)
}
}
solver
:=
NewGameSolver
(
maxDepth
,
claimBuilder
.
CorrectTraceProvider
())
solver
:=
NewGameSolver
(
maxDepth
,
claimBuilder
.
CorrectTraceProvider
())
...
...
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