Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions op-acceptance-tests/tests/interop/proofs/challenger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func TestChallengerPlaysGame(gt *testing.T) {
badClaim := common.HexToHash("0xdeadbeef00000000000000000000000000000000000000000000000000000000")
attacker := sys.FunderL1.NewFundedEOA(eth.Ether(15))
dgf := sys.DisputeGameFactory()
game := dgf.StartSuperCannonGame(attacker, proofs.WithSuperRootFrom(eth.Bytes32(badClaim), eth.Bytes32(badClaim)))
game := dgf.StartSuperCannonKonaGame(attacker, proofs.WithSuperRootFrom(eth.Bytes32(badClaim), eth.Bytes32(badClaim)))

claim := game.RootClaim() // This is the bad claim from attacker
counterClaim := claim.WaitForCounterClaim() // This is the counter-claim from the challenger
Expand All @@ -47,7 +47,7 @@ func TestChallengerRespondsToMultipleInvalidClaims(gt *testing.T) {
attacker := sys.FunderL1.NewFundedEOA(eth.TenEther)
dgf := sys.DisputeGameFactory()

game := dgf.StartSuperCannonGame(attacker)
game := dgf.StartSuperCannonKonaGame(attacker)
claims := game.PerformMoves(attacker,
proofs.Move(0, common.Hash{0x01}, true),
proofs.Move(1, common.Hash{0x03}, true),
Expand All @@ -70,7 +70,7 @@ func TestChallengerRespondsToMultipleInvalidClaimsEOA(gt *testing.T) {
dgf := sys.DisputeGameFactory()
attacker := dgf.CreateHelperEOA(sys.FunderL1.NewFundedEOA(eth.TenEther))

game := dgf.StartSuperCannonGame(attacker.EOA)
game := dgf.StartSuperCannonKonaGame(attacker.EOA)
claims := attacker.PerformMoves(game.FaultDisputeGame,
proofs.Move(0, common.Hash{0x01}, true),
proofs.Move(1, common.Hash{0x03}, true),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func TestChallengerPlaysGame(gt *testing.T) {
attacker := sys.FunderL1.NewFundedEOA(eth.Ether(15))
dgf := sys.DisputeGameFactory()

game := dgf.StartSuperCannonGame(attacker, proofs.WithSuperRootFrom(eth.Bytes32(badClaim), eth.Bytes32(badClaim)))
game := dgf.StartSuperCannonKonaGame(attacker, proofs.WithSuperRootFrom(eth.Bytes32(badClaim), eth.Bytes32(badClaim)))

claim := game.RootClaim() // This is the bad claim from attacker
counterClaim := claim.WaitForCounterClaim() // This is the counter-claim from the challenger
Expand Down
7 changes: 6 additions & 1 deletion op-acceptance-tests/tests/isthmus/preinterop/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ import (
"testing"

"github.com/ethereum-optimism/optimism/op-devstack/presets"
"github.com/ethereum-optimism/optimism/op-devstack/stack"
"github.com/ethereum-optimism/optimism/op-devstack/sysgo"
)

func TestMain(m *testing.M) {
presets.DoMain(m, presets.WithIsthmusSuperSupernode())
presets.DoMain(m,
presets.WithIsthmusSuperSupernode(),
stack.MakeCommon(sysgo.WithChallengerCannonKonaEnabled()),
)
}
16 changes: 8 additions & 8 deletions op-devstack/dsl/proofs/dispute_game_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,13 @@ func (f *DisputeGameFactory) WaitForGame() *FaultDisputeGame {
return f.GameAtIndex(initialCount)
}

func (f *DisputeGameFactory) StartSuperCannonGame(eoa *dsl.EOA, opts ...GameOpt) *SuperFaultDisputeGame {
func (f *DisputeGameFactory) StartSuperCannonKonaGame(eoa *dsl.EOA, opts ...GameOpt) *SuperFaultDisputeGame {
f.require.NotNil(f.superNode, "super node is required to start super games")

return f.startSuperCannonGameOfType(eoa, gameTypes.SuperCannonGameType, opts...)
return f.startSuperGameOfType(eoa, gameTypes.SuperCannonKonaGameType, opts...)
}

func (f *DisputeGameFactory) startSuperCannonGameOfType(eoa *dsl.EOA, gameType gameTypes.GameType, opts ...GameOpt) *SuperFaultDisputeGame {
func (f *DisputeGameFactory) startSuperGameOfType(eoa *dsl.EOA, gameType gameTypes.GameType, opts ...GameOpt) *SuperFaultDisputeGame {
cfg := NewGameCfg(opts...)
if len(cfg.superOutputRoots) != 0 && cfg.rootClaimSet {
f.t.Error("cannot set both super output roots and root claim in super game")
Expand Down Expand Up @@ -274,13 +274,13 @@ func (f *DisputeGameFactory) honestTraceForGame(game *FaultDisputeGame) challeng
f.challengerCfg.CannonKona,
vm.NewKonaExecutor(),
)
case gameTypes.SuperCannonGameType:
case gameTypes.SuperCannonKonaGameType:
return f.honestSuperCannonTrace(
game,
f.challengerCfg.CannonAbsolutePreStateBaseURL,
f.challengerCfg.CannonAbsolutePreState,
f.challengerCfg.Cannon,
vm.NewOpProgramServerExecutor(f.log),
f.challengerCfg.CannonKonaAbsolutePreStateBaseURL,
f.challengerCfg.CannonKonaAbsolutePreState,
f.challengerCfg.CannonKona,
vm.NewKonaSuperExecutor(),
)
default:
f.require.Truef(false, "Honest trace not supported for game type %v", game.GameType())
Expand Down
23 changes: 18 additions & 5 deletions op-devstack/shared/challenger/challenger.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func applyCannonConfig(c *config.Config, rollupCfgs []*rollup.Config, l1Genesis
return nil
}

func applyCannonKonaConfig(c *config.Config, rollupCfgs []*rollup.Config, l1Genesis *core.Genesis, l2Geneses []*core.Genesis) error {
func applyCannonKonaConfig(c *config.Config, rollupCfgs []*rollup.Config, l1Genesis *core.Genesis, l2Geneses []*core.Genesis, interop bool) error {
root, err := findMonorepoRoot()
if err != nil {
return err
Expand All @@ -85,9 +85,16 @@ func applyCannonKonaConfig(c *config.Config, rollupCfgs []*rollup.Config, l1Gene
if err != nil {
return fmt.Errorf("failed to get absolute path to prestate dir: %w", err)
}
c.CannonKonaAbsolutePreStateBaseURL, err = url.Parse("file:" + absRoot + "/kona/prestate-artifacts-cannon")
if err != nil {
return fmt.Errorf("failed to create kona prestates url: %w", err)
if interop {
c.CannonKonaAbsolutePreStateBaseURL, err = url.Parse("file:" + absRoot + "/kona/prestate-artifacts-cannon-interop")
if err != nil {
return err
}
} else {
c.CannonKonaAbsolutePreStateBaseURL, err = url.Parse("file:" + absRoot + "/kona/prestate-artifacts-cannon")
if err != nil {
return err
}
}
return nil
}
Expand Down Expand Up @@ -150,7 +157,13 @@ func WithCannonConfig(rollupCfgs []*rollup.Config, l1Genesis *core.Genesis, l2Ge

func WithCannonKonaConfig(rollupCfgs []*rollup.Config, l1Genesis *core.Genesis, l2Geneses []*core.Genesis) Option {
return func(c *config.Config) error {
return applyCannonKonaConfig(c, rollupCfgs, l1Genesis, l2Geneses)
return applyCannonKonaConfig(c, rollupCfgs, l1Genesis, l2Geneses, false)
}
}

func WithCannonKonaInteropConfig(rollupCfgs []*rollup.Config, l1Genesis *core.Genesis, l2Geneses []*core.Genesis) Option {
return func(c *config.Config) error {
return applyCannonKonaConfig(c, rollupCfgs, l1Genesis, l2Geneses, true)
}
}

Expand Down
2 changes: 1 addition & 1 deletion op-devstack/sysgo/l2_challenger.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func WithL2ChallengerPostDeploy(orch *Orchestrator, challengerID stack.L2Challen
}
if orch.l2ChallengerOpts.useCannonKonaConfig {
options = append(options,
shared.WithCannonKonaConfig(rollupCfgs, l1Genesis, l2Geneses),
shared.WithCannonKonaInteropConfig(rollupCfgs, l1Genesis, l2Geneses),
shared.WithSuperCannonKonaGameType(),
)
}
Expand Down