Commit 6433af96 authored by Andreas Bigger's avatar Andreas Bigger

Remove maxDepth cheat

parent 633f2f66
...@@ -4,7 +4,6 @@ import ( ...@@ -4,7 +4,6 @@ import (
"context" "context"
"encoding/binary" "encoding/binary"
"fmt" "fmt"
"math"
"math/big" "math/big"
"testing" "testing"
"time" "time"
...@@ -175,16 +174,24 @@ func (h *FactoryHelper) StartCannonGameWithCorrectRoot(ctx context.Context, roll ...@@ -175,16 +174,24 @@ func (h *FactoryHelper) StartCannonGameWithCorrectRoot(ctx context.Context, roll
L2BlockNumber: challengedOutput.L2BlockNumber, L2BlockNumber: challengedOutput.L2BlockNumber,
} }
maxDepth := uint64(math.MaxUint64) cannonTypeAddr, err := h.factory.GameImpls(opts, cannonGameType)
h.require.NoError(err, "fetch cannon game type impl")
gameImpl, err := bindings.NewFaultDisputeGameCaller(cannonTypeAddr, h.client)
h.require.NoError(err, "bind fault dispute game caller")
maxDepth, err := gameImpl.MAXGAMEDEPTH(opts)
h.require.NoError(err, "fetch max game depth")
provider := cannon.NewTraceProviderFromInputs( provider := cannon.NewTraceProviderFromInputs(
testlog.Logger(h.t, log.LvlInfo).New("role", "CorrectTrace"), testlog.Logger(h.t, log.LvlInfo).New("role", "CorrectTrace"),
metrics.NoopMetrics, metrics.NoopMetrics,
cfg, cfg,
inputs, inputs,
cfg.Datadir, cfg.Datadir,
maxDepth, maxDepth.Uint64(),
) )
pos := faultTypes.NewPosition(int(maxDepth), int(maxDepth)) pos := faultTypes.NewPosition(int(maxDepth.Uint64()), int(maxDepth.Uint64()))
rootClaim, err := provider.Get(ctx, pos) rootClaim, err := provider.Get(ctx, pos)
h.require.NoError(err, "Compute correct root hash") h.require.NoError(err, "Compute correct root hash")
// Override the VM status to claim the root is invalid // Override the VM status to claim the root is invalid
......
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