Skip to content

Commit 39e47a0

Browse files
ajsuttonQuentinI
authored andcommitted
op-challenger: Set agreed prestate preimage for super cannon games. (ethereum-optimism#13838)
Changes type to just []byte and uses empty array as not set for simplicity.
1 parent 1bf5348 commit 39e47a0

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

op-challenger/game/fault/trace/super/super_cannon.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ func NewSuperCannonTraceAccessor(
3737
logger := logger.New("agreedPrestate", claimInfo.AgreedPrestate, "claim", claimInfo.Claim, "localContext", localContext)
3838
subdir := filepath.Join(dir, localContext.Hex())
3939
localInputs := utils.LocalGameInputs{
40-
L1Head: l1Head.Hash,
41-
L2OutputRoot: crypto.Keccak256Hash(claimInfo.AgreedPrestate),
42-
L2Claim: claimInfo.Claim,
43-
L2BlockNumber: new(big.Int).SetUint64(poststateBlock),
40+
L1Head: l1Head.Hash,
41+
L2OutputRoot: crypto.Keccak256Hash(claimInfo.AgreedPrestate),
42+
AgreedPreState: claimInfo.AgreedPrestate,
43+
L2Claim: claimInfo.Claim,
44+
L2BlockNumber: new(big.Int).SetUint64(poststateBlock),
4445
}
4546
provider := cannon.NewTraceProvider(logger, m.ToTypedVmMetrics(cfg.VmType.String()), cfg, serverExecutor, prestateProvider, cannonPrestate, localInputs, subdir, depth)
4647
return provider, nil

op-challenger/game/fault/trace/utils/local.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type LocalGameInputs struct {
1313
L1Head common.Hash
1414
L2Head common.Hash
1515
L2OutputRoot common.Hash
16-
AgreedPreState *[]byte
16+
AgreedPreState []byte
1717
L2Claim common.Hash
1818
L2BlockNumber *big.Int
1919
}

op-challenger/game/fault/trace/vm/kona_interop_server_executor.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func NewNativeKonaSuperExecutor() *KonaSuperExecutor {
2222
}
2323

2424
func (s *KonaSuperExecutor) OracleCommand(cfg Config, dataDir string, inputs utils.LocalGameInputs) ([]string, error) {
25-
if inputs.AgreedPreState == nil {
25+
if len(inputs.AgreedPreState) == 0 {
2626
return nil, errors.New("agreed pre-state is not defined")
2727
}
2828

@@ -33,7 +33,7 @@ func (s *KonaSuperExecutor) OracleCommand(cfg Config, dataDir string, inputs uti
3333
"--l1-beacon-address", cfg.L1Beacon,
3434
"--l2-node-addresses", cfg.L2,
3535
"--l1-head", inputs.L1Head.Hex(),
36-
"--agreed-l2-pre-state", common.Bytes2Hex(*inputs.AgreedPreState),
36+
"--agreed-l2-pre-state", common.Bytes2Hex(inputs.AgreedPreState),
3737
"--claimed-l2-post-state", inputs.L2Claim.Hex(),
3838
"--claimed-l2-timestamp", inputs.L2BlockNumber.Text(10),
3939
}

op-e2e/actions/proofs/helpers/kona.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func RunKonaNative(
7070
var hostCmd []string
7171
var err error
7272
if fixtureInputs.InteropEnabled {
73-
inputs.AgreedPreState = &fixtureInputs.AgreedPrestate
73+
inputs.AgreedPreState = fixtureInputs.AgreedPrestate
7474
hostCmd, err = vm.NewNativeKonaSuperExecutor().OracleCommand(vmCfg, workDir, inputs)
7575
} else {
7676
hostCmd, err = vm.NewNativeKonaExecutor().OracleCommand(vmCfg, workDir, inputs)

0 commit comments

Comments
 (0)