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

op-e2e: Re-enable large preimage e2e test (#9346)

* Reduce the min size for large preimages in devnet to make it easier to reach the limit.
* Provide a buffer between target and max batch size to avoid the batcher splitting the large tx across multiple smaller frames.
parent afb20489
......@@ -25,7 +25,7 @@ import (
"github.com/stretchr/testify/require"
)
const MinPreimageSize = 18000
const MinPreimageSize = 10000
type Helper struct {
t *testing.T
......@@ -68,6 +68,14 @@ func WithReplacedCommitment(idx uint64, value common.Hash) InputModifier {
}
}
func WithLastCommitment(value common.Hash) InputModifier {
return func(startBlock uint64, input *types.InputData) {
if input.Finalize {
input.Commitments[len(input.Commitments)-1] = value
}
}
}
// UploadLargePreimage inits the preimage upload and uploads the leaves, starting the challenge period.
// Squeeze is not called by this method as the challenge period has not yet elapsed.
func (h *Helper) UploadLargePreimage(ctx context.Context, dataSize int, modifiers ...InputModifier) types.LargePreimageIdent {
......
......@@ -60,7 +60,7 @@ func TestChallengeLargePreimages_ChallengeLast(t *testing.T) {
challenger.WithPrivKey(sys.Cfg.Secrets.Mallory))
preimageHelper := disputeGameFactory.PreimageHelper(ctx)
ident := preimageHelper.UploadLargePreimage(ctx, preimage.MinPreimageSize,
preimage.WithReplacedCommitment(132, common.Hash{0xaa}))
preimage.WithLastCommitment(common.Hash{0xaa}))
require.NotEqual(t, ident.Claimant, common.Address{})
......
......@@ -10,6 +10,7 @@ import (
op_e2e "github.com/ethereum-optimism/optimism/op-e2e"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/challenger"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/disputegame"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/disputegame/preimage"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/wait"
"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/require"
......@@ -254,7 +255,7 @@ func TestOutputCannonStepWithLargePreimage(t *testing.T) {
// execution game. We then move to challenge it to induce a large preimage load.
sender := sys.Cfg.Secrets.Addresses().Alice
preimageLoadCheck := game.CreateStepLargePreimageLoadCheck(ctx, sender)
game.ChallengeToPreimageLoad(ctx, outputRootClaim, sys.Cfg.Secrets.Alice, cannon.PreimageLargerThan(18_000), preimageLoadCheck, false)
game.ChallengeToPreimageLoad(ctx, outputRootClaim, sys.Cfg.Secrets.Alice, cannon.PreimageLargerThan(preimage.MinPreimageSize), preimageLoadCheck, false)
// The above method already verified the image was uploaded and step called successfully
// So we don't waste time resolving the game - that's tested elsewhere.
}
......
......@@ -12,9 +12,11 @@ type faultDisputeConfigOpts func(cfg *op_e2e.SystemConfig)
func withLargeBatches() faultDisputeConfigOpts {
return func(cfg *op_e2e.SystemConfig) {
maxTxDataSize := uint64(131072) // As per the Ethereum spec.
// Allow the batcher to produce really huge calldata transactions.
cfg.BatcherTargetL1TxSizeBytes = 130072 // A bit under the max tx size as per Ethereum spec
cfg.BatcherMaxL1TxSizeBytes = 130072
// Make the max deliberately bigger than the target but still with some padding below the actual limit
cfg.BatcherTargetL1TxSizeBytes = maxTxDataSize - 5000
cfg.BatcherMaxL1TxSizeBytes = maxTxDataSize - 1000
}
}
......
......@@ -55,7 +55,7 @@
"faultGameGenesisBlock": 0,
"faultGameGenesisOutputRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"faultGameSplitDepth": 14,
"preimageOracleMinProposalSize": 18000,
"preimageOracleMinProposalSize": 10000,
"preimageOracleChallengePeriod": 120,
"preimageOracleCancunActivationTimestamp": 0
}
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