Commit a00a3a11 authored by Adrian Sutton's avatar Adrian Sutton Committed by GitHub

op-e2e: Add e2e test for uploading sha256 and blob data (#9442)

Also tests that fault proofs work with batches posted as blobs.
parent a7b55a89
......@@ -258,7 +258,7 @@ func TestOutputCannonStepWithPreimage(t *testing.T) {
op_e2e.InitParallel(t, op_e2e.UsesCannon)
ctx := context.Background()
sys, _ := startFaultDisputeSystem(t)
sys, _ := startFaultDisputeSystem(t, withBlobBatches())
t.Cleanup(sys.Close)
disputeGameFactory := disputegame.NewFactoryHelper(t, ctx, sys)
......@@ -281,9 +281,14 @@ func TestOutputCannonStepWithPreimage(t *testing.T) {
// So we don't waste time resolving the game - that's tested elsewhere.
}
t.Run("non-existing preimage", func(t *testing.T) {
testPreimageStep(t, cannon.FirstKeccakPreimageLoad(), false)
})
preimageConditions := []string{"keccak", "sha256", "blob"}
for _, preimageType := range preimageConditions {
preimageType := preimageType
t.Run("non-existing preimage-"+preimageType, func(t *testing.T) {
testPreimageStep(t, cannon.FirstPreimageLoadOfType(preimageType), false)
})
}
// Only test pre-existing images with one type to save runtime
t.Run("preimage already exists", func(t *testing.T) {
testPreimageStep(t, cannon.FirstKeccakPreimageLoad(), true)
})
......
......@@ -3,7 +3,9 @@ package faultproofs
import (
"testing"
batcherFlags "github.com/ethereum-optimism/optimism/op-batcher/flags"
op_e2e "github.com/ethereum-optimism/optimism/op-e2e"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/stretchr/testify/require"
)
......@@ -16,6 +18,17 @@ func withBatcherStopped() faultDisputeConfigOpts {
}
}
func withBlobBatches() faultDisputeConfigOpts {
return func(cfg *op_e2e.SystemConfig) {
cfg.DataAvailabilityType = batcherFlags.BlobsType
genesisActivation := hexutil.Uint64(0)
cfg.DeployConfig.L1CancunTimeOffset = &genesisActivation
cfg.DeployConfig.L2GenesisDeltaTimeOffset = &genesisActivation
cfg.DeployConfig.L2GenesisEcotoneTimeOffset = &genesisActivation
}
}
func startFaultDisputeSystem(t *testing.T, opts ...faultDisputeConfigOpts) (*op_e2e.System, *ethclient.Client) {
cfg := op_e2e.DefaultSystemConfig(t)
delete(cfg.Nodes, "verifier")
......
......@@ -50,7 +50,7 @@
"requiredProtocolVersion": "0x0000000000000000000000000000000000000000000000000000000000000000",
"recommendedProtocolVersion": "0x0000000000000000000000000000000000000000000000000000000000000000",
"faultGameAbsolutePrestate": "0x03c7ae758795765c6664a5d39bf63841c71ff191e9189522bad8ebff5d4eca98",
"faultGameMaxDepth": 44,
"faultGameMaxDepth": 46,
"faultGameMaxDuration": 2400,
"faultGameGenesisBlock": 0,
"faultGameGenesisOutputRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
......
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