diff --git a/op-challenger/game/fault/test/alphabet2.go b/op-challenger/game/fault/test/alphabet2.go index 8ce996badf22..7e8922bcb50d 100644 --- a/op-challenger/game/fault/test/alphabet2.go +++ b/op-challenger/game/fault/test/alphabet2.go @@ -1,6 +1,7 @@ package test import ( + "context" "math/big" "testing" @@ -8,6 +9,32 @@ import ( "github.com/ethereum-optimism/optimism/op-challenger/game/fault/types" ) +type AlphabetWithOutputRootProvider struct { + *alphabet.AlphabetTraceProvider + depth types.Depth + OracleError error + L2BlockChallenge *types.InvalidL2BlockNumberChallenge + pre bool // preOutputRoot if pre is true; postOutputRoot if pre is false +} + +func (a *AlphabetWithOutputRootProvider) GetStepData(ctx context.Context, i types.Position) ([]byte, []byte, *types.PreimageOracleData, error) { + preimage, _, _, err := a.AlphabetTraceProvider.GetStepData(ctx, i) + if err != nil { + return nil, nil, nil, err + } + traceIndex := i.TraceIndex(a.depth).Uint64() + var key []byte + if a.pre { + // localPreimageKey(1) + STARTING_OUTPUT_ROOT(2) + key = []byte{0x01, 0x02} + } else { + // localPreimageKey(1) + DISPUTED_OUTPUT_ROOT(3) + key = []byte{0x01, 0x03} + } + data := types.NewPreimageOracleData(key, []byte{byte(traceIndex - 1)}, uint32(traceIndex-1)) + return preimage, []byte{byte(traceIndex - 1)}, data, nil +} + func NewAlphabetWithProofProvider2(t *testing.T, startingL2BlockNumber *big.Int, maxDepth types.Depth, rootDepth types.Depth, oracleError error) *AlphabetWithProofProvider { return &AlphabetWithProofProvider{ alphabet.NewTraceProvider2(startingL2BlockNumber, maxDepth, rootDepth), @@ -16,3 +43,13 @@ func NewAlphabetWithProofProvider2(t *testing.T, startingL2BlockNumber *big.Int, nil, } } + +func NewAlphabetWithPreoutputRootProvider(t *testing.T, startingL2BlockNumber *big.Int, maxDepth types.Depth, rootDepth types.Depth, pre bool, oracleError error) *AlphabetWithOutputRootProvider { + return &AlphabetWithOutputRootProvider{ + alphabet.NewTraceProvider2(startingL2BlockNumber, maxDepth, rootDepth), + maxDepth, + oracleError, + nil, + pre, + } +} diff --git a/op-challenger/game/fault/trace/access.go b/op-challenger/game/fault/trace/access.go index 4afe6d5f9b6d..fc6af1bf4825 100644 --- a/op-challenger/game/fault/trace/access.go +++ b/op-challenger/game/fault/trace/access.go @@ -17,11 +17,12 @@ func NewSimpleTraceAccessor(trace types.TraceProvider) *Accessor { type ProviderSelector func(ctx context.Context, game types.Game, ref types.Claim, pos types.Position) (types.TraceProvider, error) func NewAccessor(selector ProviderSelector) *Accessor { - return &Accessor{selector} + return &Accessor{selector, nil} } type Accessor struct { - selector ProviderSelector + selector ProviderSelector + selector2 ProviderSelector2 } func (t *Accessor) Get(ctx context.Context, game types.Game, ref types.Claim, pos types.Position) (common.Hash, error) { diff --git a/op-challenger/game/fault/trace/access2.go b/op-challenger/game/fault/trace/access2.go index c768c989f71e..8d6915ea1622 100644 --- a/op-challenger/game/fault/trace/access2.go +++ b/op-challenger/game/fault/trace/access2.go @@ -6,8 +6,20 @@ import ( "math/big" "github.com/ethereum-optimism/optimism/op-challenger/game/fault/types" + preimage "github.com/ethereum-optimism/optimism/op-preimage" ) +type ProviderSelector2 func(ctx context.Context, game types.Game, ref types.Claim, pos types.Position) (types.TraceProvider, types.DAData, error) + +const ( + LocalPreimageKeyStartingOutputRoot = 0x02 + LocalPreimageKeyDisputedOutputRoot = 0x03 +) + +func NewAccessor2(selector2 ProviderSelector2) *Accessor { + return &Accessor{nil, selector2} +} + // Get the traceIdx's accestor claims hash and its merkel proof in subValues. traceIdx can be ref's traceIdx ±1. // Params: // - relativeTraceIdx: the trace index relative to splitDepth @@ -98,7 +110,7 @@ func findAncestorProofAtDepth2(ctx context.Context, provider types.TraceProvider func (t *Accessor) GetStepData2(ctx context.Context, game types.Game, ref types.Claim, pos types.Position) (prestate []byte, proofData []byte, preimageData *types.PreimageOracleData, err error) { // Get oracle data // prestate, proofData, preimageData, err = t.GetStepData(ctx, game, ref, pos) - provider, err := t.selector(ctx, game, ref, pos) + provider, outputRootDA, err := t.selector2(ctx, game, ref, pos) if err != nil { return nil, nil, nil, err } @@ -122,11 +134,23 @@ func (t *Accessor) GetStepData2(ctx context.Context, game types.Game, ref types. return nil, nil, nil, fmt.Errorf("failed to get postStateDaItem at trace index %v: %w", postTraceIdx, err) } stateData := types.DAData{ - Prestate: preStateDaItem, - PostState: postStateDaItem, + PreDA: preStateDaItem, + PostDA: postStateDaItem, } - preimageData.DAData = stateData + preimageData.VMStateDA = stateData + + keyType := preimage.KeyType(preimageData.OracleKey[0]) + if keyType == preimage.LocalKeyType { + ident := preimageData.GetIdent() + addlocalDataDaItem := types.DAItem{} + if ident.Cmp(big.NewInt(LocalPreimageKeyStartingOutputRoot)) == 0 { + addlocalDataDaItem = outputRootDA.PreDA + } else if ident.Cmp(big.NewInt(LocalPreimageKeyDisputedOutputRoot)) == 0 { + addlocalDataDaItem = outputRootDA.PostDA + } + preimageData.OutputRootDAItem = addlocalDataDaItem + } return prestate, proofData, preimageData, nil } diff --git a/op-challenger/game/fault/trace/access_test.go b/op-challenger/game/fault/trace/access_test.go index 613c1310e05b..e92e5c477594 100644 --- a/op-challenger/game/fault/trace/access_test.go +++ b/op-challenger/game/fault/trace/access_test.go @@ -119,20 +119,21 @@ func TestGetStepData2(t *testing.T) { pos := claim.Position.MoveRight() accessor := &Accessor{ - selector: func(ctx context.Context, actualGame types.Game, ref types.Claim, pos types.Position) (types.TraceProvider, error) { + selector: nil, + selector2: func(ctx context.Context, actualGame types.Game, ref types.Claim, pos types.Position) (types.TraceProvider, types.DAData, error) { require.Equal(t, game, actualGame) require.Equal(t, claim, ref) - return translatedTracerovider, nil + return translatedTracerovider, types.DAData{}, nil }, } expectedStateDA := types.DAData{ - Prestate: types.DAItem{ + PreDA: types.DAItem{ DaType: types.CallDataType, DataHash: subClaimsDep8[0][:], Proof: append(subClaimsDep8[1][:], subClaimsDep8[2][:]...), }, - PostState: types.DAItem{ + PostDA: types.DAItem{ DaType: types.CallDataType, DataHash: subClaimsDep8[1][:], Proof: append(subClaimsDep8[0][:], subClaimsDep8[2][:]...), @@ -140,7 +141,7 @@ func TestGetStepData2(t *testing.T) { } expectedPrestate, expectedProofData, expectedPreimageData, err := translatedTracerovider.GetStepData(ctx, pos) - expectedPreimageData.DAData = expectedStateDA + expectedPreimageData.VMStateDA = expectedStateDA require.NoError(t, err) actualPrestate, actualProofData, actualPreimageData, err := accessor.GetStepData2(ctx, game, claim, pos) @@ -151,6 +152,70 @@ func TestGetStepData2(t *testing.T) { require.Equal(t, expectedPreimageData, actualPreimageData) } +func TestGetStepDataWithStartingOutputRoot(t *testing.T) { + ctx := context.Background() + traceDepth := types.Depth(4) + splitDepth := types.Depth(2) + nbits := uint64(2) + nary := int64(1) << nbits + maxDepth := traceDepth + splitDepth + types.Depth(nbits) + pre := true + provider := test.NewAlphabetWithPreoutputRootProvider(t, big.NewInt(0), traceDepth, splitDepth, pre, nil) + translatedTracerovider := Translate(provider, splitDepth+types.Depth(nary)) + + claimBuilder := test.NewAlphabetClaimBuilder(t, big.NewInt(0), maxDepth) + gameBuilder := claimBuilder.GameBuilder2(nary, splitDepth) + seq := gameBuilder.Seq() + claimBuilder.CreateRootClaim(test.WithValue(common.Hash{0x00})) + subClaimsDep2 := []common.Hash{{0x01}, {0x02}, {0x03}} // claim at splitDepth + seq = seq.Attack2(subClaimsDep2[:], nbits, 0) + // traces + subClaimsDep4 := []common.Hash{{0x04}} + seq = seq.Attack2(subClaimsDep4[:], nbits, 0) + subClaimsDep6 := []common.Hash{{0x61}, {0x62}, {0x63}} + seq = seq.Attack2(subClaimsDep6[:], nbits, 0) + subClaimsDep8 := []common.Hash{{0x81}, {0x82}, {0x83}} + seq.Attack2(subClaimsDep8[:], nbits, 1) + + game := gameBuilder.Game + claim := game.Claims()[len(game.Claims())-1] + + pos := claim.Position.MoveRight() + + outputRootDA := types.DAData{ + PreDA: types.DAItem{DaType: types.CallDataType, DataHash: []byte{0x01}}, + PostDA: types.DAItem{DaType: types.CallDataType, DataHash: []byte{0x02}}, + } + + preAccessor := &Accessor{ + selector: nil, + selector2: func(ctx context.Context, actualGame types.Game, ref types.Claim, pos types.Position) (types.TraceProvider, types.DAData, error) { + require.Equal(t, game, actualGame) + require.Equal(t, claim, ref) + return translatedTracerovider, outputRootDA, nil + }, + } + + _, _, actualPreimageData, err := preAccessor.GetStepData2(ctx, game, claim, pos) + require.NoError(t, err) + require.Equal(t, outputRootDA.PreDA, actualPreimageData.OutputRootDAItem) + + pre = false + provider = test.NewAlphabetWithPreoutputRootProvider(t, big.NewInt(0), traceDepth, splitDepth, pre, nil) + translatedTracerovider = Translate(provider, splitDepth+types.Depth(nary)) + postAccessor := &Accessor{ + selector: nil, + selector2: func(ctx context.Context, actualGame types.Game, ref types.Claim, pos types.Position) (types.TraceProvider, types.DAData, error) { + require.Equal(t, game, actualGame) + require.Equal(t, claim, ref) + return translatedTracerovider, outputRootDA, nil + }, + } + _, _, actualPreimageData, err = postAccessor.GetStepData2(ctx, game, claim, pos) + require.NoError(t, err) + require.Equal(t, outputRootDA.PostDA, actualPreimageData.OutputRootDAItem) +} + func TestFindAncestorProofAtDepth2(t *testing.T) { nbits := uint64(2) nary := int64(1) << nbits diff --git a/op-challenger/game/fault/trace/split/split2.go b/op-challenger/game/fault/trace/split/split2.go index 4cbed7180b88..888f5c6742ec 100644 --- a/op-challenger/game/fault/trace/split/split2.go +++ b/op-challenger/game/fault/trace/split/split2.go @@ -10,15 +10,15 @@ import ( ) // Get the traceIdx's accestor claims for multi-sec fault proof. traceIdx can be ref's traceIdx ±1. -func findAncestorWithTraceIndex2(game types.Game, ref types.Claim, depth types.Depth, traceIdx *big.Int) (types.Claim, error) { +func findAncestorWithTraceIndex2(game types.Game, ref types.Claim, depth types.Depth, traceIdx *big.Int) (types.Claim, types.DAItem, error) { // If traceIdx equals -1, the absolute prestate is returned. if traceIdx.Cmp(big.NewInt(-1)) == 0 { - return types.Claim{}, nil + return types.Claim{}, types.DAItem{}, nil } // If traceIdx is the right most branch, the root Claim is returned. if new(big.Int).Add(traceIdx, big.NewInt(1)).Cmp(new(big.Int).Lsh(big.NewInt(1), uint(depth))) == 0 { - return game.RootClaim(), nil + return game.RootClaim(), types.DAItem{}, nil } ancestor := ref @@ -30,7 +30,7 @@ func findAncestorWithTraceIndex2(game types.Game, ref types.Claim, depth types.D for minTraceIndex.Cmp(traceIdx) == 1 || maxTraceIndex.Cmp(traceIdx) == -1 { parent, err := game.GetParent(ancestor) if err != nil { - return types.Claim{}, fmt.Errorf("failed to get ancestor of claim %v: %w", ancestor.ContractIndex, err) + return types.Claim{}, types.DAItem{}, fmt.Errorf("failed to get ancestor of claim %v: %w", ancestor.ContractIndex, err) } ancestor = parent @@ -48,51 +48,71 @@ func findAncestorWithTraceIndex2(game types.Game, ref types.Claim, depth types.D Position: types.NewPositionFromGIndex(traceIdx), }, } + merkleProof := make([]byte, 0) + for i := int64(0); i < branch; i++ { + merkleProof = append(merkleProof, subValues[i].Bytes()...) + } + + for i := branch + 1; i < int64(game.MaxAttackBranch()); i++ { + merkleProof = append(merkleProof, subValues[i].Bytes()...) + } + + outputRootDAItem := types.DAItem{ + DaType: types.CallDataType, + DataHash: claim.Value.Bytes(), + Proof: merkleProof, + } - return claim, nil + return claim, outputRootDAItem, nil } -func NewSplitProviderSelector2(topProvider types.TraceProvider, topDepth types.Depth, bottomProviderCreator ProviderCreator) trace.ProviderSelector { - return func(ctx context.Context, game types.Game, ref types.Claim, pos types.Position) (types.TraceProvider, error) { +func NewSplitProviderSelector2(topProvider types.TraceProvider, topDepth types.Depth, bottomProviderCreator ProviderCreator) trace.ProviderSelector2 { + return func(ctx context.Context, game types.Game, ref types.Claim, pos types.Position) (types.TraceProvider, types.DAData, error) { if pos.Depth() <= topDepth { - return topProvider, nil + return topProvider, types.DAData{}, nil } if ref.Position.Depth() < topDepth { - return nil, fmt.Errorf("%w, claim depth: %v, depth required: %v", errRefClaimNotDeepEnough, ref.Position.Depth(), topDepth) + return nil, types.DAData{}, fmt.Errorf("%w, claim depth: %v, depth required: %v", errRefClaimNotDeepEnough, ref.Position.Depth(), topDepth) } // Find the ancestor claim at the (splitDepth + 1) level. splitLeaf, err := trace.FindAncestorAtDepth(game, ref, types.Depth(topDepth+game.NBits())) if err != nil { - return nil, err + return nil, types.DAData{}, err } // Find the ancestor claim at the leaf level splitDepth for the top game. topLeaf, err := game.GetParent(splitLeaf) if err != nil { - return nil, err + return nil, types.DAData{}, err } attackBranch := int64(splitLeaf.AttackBranch) preTraceIdx := new(big.Int).Add(topLeaf.TraceIndex(topDepth), big.NewInt(attackBranch)) postTraceIdx := new(big.Int).Add(preTraceIdx, big.NewInt(1)) - pre, err := findAncestorWithTraceIndex2(game, topLeaf, topDepth, preTraceIdx) + + var outputRootDA = types.DAData{} + pre, preDA, err := findAncestorWithTraceIndex2(game, topLeaf, topDepth, preTraceIdx) if err != nil { - return nil, fmt.Errorf("failed to find pre claim: %w", err) + return nil, outputRootDA, fmt.Errorf("failed to find pre claim: %w", err) } - post, err := findAncestorWithTraceIndex2(game, topLeaf, topDepth, postTraceIdx) + post, postDA, err := findAncestorWithTraceIndex2(game, topLeaf, topDepth, postTraceIdx) if err != nil { - return nil, fmt.Errorf("failed to find post claim: %w", err) + return nil, outputRootDA, fmt.Errorf("failed to find post claim: %w", err) } + outputRootDA.PreDA = preDA + outputRootDA.PostDA = postDA + // The top game runs from depth 0 to split depth *inclusive*. // The - 1 here accounts for the fact that the split depth is included in the top game. bottomDepth := game.MaxDepth() - topDepth - game.NBits() provider, err := bottomProviderCreator(ctx, bottomDepth, pre, post) if err != nil { - return nil, err + return nil, outputRootDA, err } + // Translate such that the root of the bottom game is the level below the top game leaf - return trace.Translate(provider, topDepth+game.NBits()), nil + return trace.Translate(provider, topDepth+game.NBits()), outputRootDA, nil } } diff --git a/op-challenger/game/fault/trace/split/split_test.go b/op-challenger/game/fault/trace/split/split_test.go index 09b48b05b19e..05dd9d90d37f 100644 --- a/op-challenger/game/fault/trace/split/split_test.go +++ b/op-challenger/game/fault/trace/split/split_test.go @@ -202,9 +202,11 @@ func TestFindAncestorProofAtDepth2(t *testing.T) { postTraceIdx := new(big.Int).Add(depth4Claim.TraceIndex(splitDepth), big.NewInt(attackBranch)) preTraceIdx := new(big.Int).Sub(postTraceIdx, big.NewInt(1)) expectedPre := types.Claim{} - pre, err := findAncestorWithTraceIndex2(game, topLeaf, splitDepth, preTraceIdx) + expectedPreDA := types.DAItem{} + pre, preDA, err := findAncestorWithTraceIndex2(game, topLeaf, splitDepth, preTraceIdx) require.NoError(t, err) require.Equal(t, expectedPre, pre) + require.Equal(t, expectedPreDA, preDA) expectedPost := types.Claim{ ClaimData: types.ClaimData{ @@ -212,9 +214,16 @@ func TestFindAncestorProofAtDepth2(t *testing.T) { Position: types.NewPositionFromGIndex(postTraceIdx), }, } - post, err := findAncestorWithTraceIndex2(gameBuilder.Game, topLeaf, splitDepth, postTraceIdx) + + expectedPostDA := types.DAItem{ + DaType: types.CallDataType, + DataHash: subClaimsDep4[0][:], + Proof: append(subClaimsDep4[1][:], subClaimsDep4[2][:]...), + } + post, postDA, err := findAncestorWithTraceIndex2(gameBuilder.Game, topLeaf, splitDepth, postTraceIdx) require.NoError(t, err) require.Equal(t, expectedPost, post) + require.Equal(t, expectedPostDA, postDA) } { // Attack the left claim @@ -254,9 +263,15 @@ func TestFindAncestorProofAtDepth2(t *testing.T) { Position: types.NewPositionFromGIndex(preTraceIdx), }, } - pre, err := findAncestorWithTraceIndex2(game, topLeaf, splitDepth, preTraceIdx) + expectedPreDA := types.DAItem{ + DaType: types.CallDataType, + DataHash: subClaimsDep2[0][:], + Proof: append(subClaimsDep2[1][:], subClaimsDep2[2][:]...), + } + pre, preDA, err := findAncestorWithTraceIndex2(game, topLeaf, splitDepth, preTraceIdx) require.NoError(t, err) require.Equal(t, expectedPre, pre) + require.Equal(t, expectedPreDA, preDA) expectedPost := types.Claim{ ClaimData: types.ClaimData{ @@ -264,9 +279,15 @@ func TestFindAncestorProofAtDepth2(t *testing.T) { Position: types.NewPositionFromGIndex(postTraceIdx), }, } - post, err := findAncestorWithTraceIndex2(gameBuilder.Game, topLeaf, splitDepth, postTraceIdx) + expectedPostDA := types.DAItem{ + DaType: types.CallDataType, + DataHash: subClaimsDep4[0][:], + Proof: append(subClaimsDep4[1][:], subClaimsDep4[2][:]...), + } + post, postDA, err := findAncestorWithTraceIndex2(gameBuilder.Game, topLeaf, splitDepth, postTraceIdx) require.NoError(t, err) require.Equal(t, expectedPost, post) + require.Equal(t, expectedPostDA, postDA) } { // Attack the middle claim @@ -308,9 +329,15 @@ func TestFindAncestorProofAtDepth2(t *testing.T) { Position: types.NewPositionFromGIndex(preTraceIdx), }, } - pre, err := findAncestorWithTraceIndex2(game, topLeaf, splitDepth, preTraceIdx) + expectedPreDA := types.DAItem{ + DaType: types.CallDataType, + DataHash: subClaimsDep4[0][:], + Proof: append(subClaimsDep4[1][:], subClaimsDep4[2][:]...), + } + pre, preDA, err := findAncestorWithTraceIndex2(game, topLeaf, splitDepth, preTraceIdx) require.NoError(t, err) require.Equal(t, expectedPre, pre) + require.Equal(t, expectedPreDA, preDA) expectedPost := types.Claim{ ClaimData: types.ClaimData{ @@ -318,9 +345,15 @@ func TestFindAncestorProofAtDepth2(t *testing.T) { Position: types.NewPositionFromGIndex(postTraceIdx), }, } - post, err := findAncestorWithTraceIndex2(gameBuilder.Game, topLeaf, splitDepth, postTraceIdx) + expectedPostDA := types.DAItem{ + DaType: types.CallDataType, + DataHash: subClaimsDep4[1][:], + Proof: append(subClaimsDep4[0][:], subClaimsDep4[2][:]...), + } + post, postDA, err := findAncestorWithTraceIndex2(gameBuilder.Game, topLeaf, splitDepth, postTraceIdx) require.NoError(t, err) require.Equal(t, expectedPost, post) + require.Equal(t, expectedPostDA, postDA) } { // Attack the right claim @@ -362,9 +395,15 @@ func TestFindAncestorProofAtDepth2(t *testing.T) { Position: types.NewPositionFromGIndex(preTraceIdx), }, } - pre, err := findAncestorWithTraceIndex2(game, topLeaf, splitDepth, preTraceIdx) + expectedPreDA := types.DAItem{ + DaType: types.CallDataType, + DataHash: subClaimsDep4[expectedSplitBranch-1][:], + Proof: append(subClaimsDep4[expectedSplitBranch-3][:], subClaimsDep4[expectedSplitBranch-2][:]...), + } + pre, preDA, err := findAncestorWithTraceIndex2(game, topLeaf, splitDepth, preTraceIdx) require.NoError(t, err) require.Equal(t, expectedPre, pre) + require.Equal(t, expectedPreDA, preDA) expectedPost := types.Claim{ ClaimData: types.ClaimData{ @@ -372,9 +411,15 @@ func TestFindAncestorProofAtDepth2(t *testing.T) { Position: types.NewPositionFromGIndex(postTraceIdx), }, } - post, err := findAncestorWithTraceIndex2(gameBuilder.Game, topLeaf, splitDepth, postTraceIdx) + expectedPostDA := types.DAItem{ + DaType: types.CallDataType, + DataHash: subClaimsDep2[expectedTopLeafBranch][:], + Proof: append(subClaimsDep2[expectedTopLeafBranch-1][:], subClaimsDep2[expectedTopLeafBranch+1][:]...), + } + post, postDA, err := findAncestorWithTraceIndex2(gameBuilder.Game, topLeaf, splitDepth, postTraceIdx) require.NoError(t, err) require.Equal(t, expectedPost, post) + require.Equal(t, expectedPostDA, postDA) } { // Attack the right most claim @@ -416,14 +461,22 @@ func TestFindAncestorProofAtDepth2(t *testing.T) { Position: types.NewPositionFromGIndex(preTraceIdx), }, } - pre, err := findAncestorWithTraceIndex2(game, topLeaf, splitDepth, preTraceIdx) + expectedPreDA := types.DAItem{ + DaType: types.CallDataType, + DataHash: subClaimsDep4[expectedSplitBranch-1][:], + Proof: append(subClaimsDep4[expectedSplitBranch-3][:], subClaimsDep4[expectedSplitBranch-2][:]...), + } + pre, preDA, err := findAncestorWithTraceIndex2(game, topLeaf, splitDepth, preTraceIdx) require.NoError(t, err) require.Equal(t, expectedPre, pre) + require.Equal(t, expectedPreDA, preDA) expectedPost := game.RootClaim() - post, err := findAncestorWithTraceIndex2(gameBuilder.Game, topLeaf, splitDepth, postTraceIdx) + expectedPostDA := types.DAItem{} + post, postDA, err := findAncestorWithTraceIndex2(gameBuilder.Game, topLeaf, splitDepth, postTraceIdx) require.NoError(t, err) require.Equal(t, expectedPost, post) + require.Equal(t, expectedPostDA, postDA) } } diff --git a/op-challenger/game/fault/types/types.go b/op-challenger/game/fault/types/types.go index d7cf9b4eb077..5969ab824edb 100644 --- a/op-challenger/game/fault/types/types.go +++ b/op-challenger/game/fault/types/types.go @@ -43,9 +43,9 @@ type PreimageOracleData struct { BlobProof []byte // multi-sec proof for VM step - DAData DAData + VMStateDA DAData // daitem for addLocalData - DAItem DAItem + OutputRootDAItem DAItem } type DaType uint32 @@ -61,9 +61,10 @@ type DAItem struct { Proof []byte } +// Provide DA proof for addLocalData's outputRoot and stepV2's stateRoot type DAData struct { - Prestate DAItem - PostState DAItem + PreDA DAItem + PostDA DAItem } type StepProof struct {