Commit 2a1b398f authored by Adrian Sutton's avatar Adrian Sutton

op-challenger: Use claim with no pre-image. Improve logging.

parent 12dd92cb
......@@ -5,7 +5,6 @@ import (
"encoding/hex"
"testing"
"github.com/ethereum-optimism/optimism/cannon/mipsevm"
faulttest "github.com/ethereum-optimism/optimism/op-challenger/game/fault/test"
"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/require"
......@@ -90,13 +89,8 @@ func TestCalculateNextActions(t *testing.T) {
name: "PoisonedPreState",
agreeWithOutputRoot: true,
setupGame: func(builder *faulttest.GameBuilder) {
// Create a cannon state that is exited and resolved that the output root was invalid
maliciousState := mipsevm.State{
Memory: mipsevm.NewMemory(),
ExitCode: 1,
Exited: true,
}
maliciousStateHash, _ := maliciousState.EncodeWitness().StateHash()
// A claim hash that has no pre-image
maliciousStateHash := common.Hash{0x01, 0xaa}
// 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)
......@@ -120,7 +114,8 @@ func TestCalculateNextActions(t *testing.T) {
test.setupGame(builder)
game := builder.Game
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())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment