Skip to content

Commit c792b4e

Browse files
ajsuttonspacesailor24
authored andcommitted
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.
1 parent ed51029 commit c792b4e

File tree

5 files changed

+17
-6
lines changed

5 files changed

+17
-6
lines changed

op-e2e/e2eutils/disputegame/preimage/preimage_helper.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
"github.com/stretchr/testify/require"
2626
)
2727

28-
const MinPreimageSize = 18000
28+
const MinPreimageSize = 10000
2929

3030
type Helper struct {
3131
t *testing.T
@@ -68,6 +68,14 @@ func WithReplacedCommitment(idx uint64, value common.Hash) InputModifier {
6868
}
6969
}
7070

71+
func WithLastCommitment(value common.Hash) InputModifier {
72+
return func(startBlock uint64, input *types.InputData) {
73+
if input.Finalize {
74+
input.Commitments[len(input.Commitments)-1] = value
75+
}
76+
}
77+
}
78+
7179
// UploadLargePreimage inits the preimage upload and uploads the leaves, starting the challenge period.
7280
// Squeeze is not called by this method as the challenge period has not yet elapsed.
7381
func (h *Helper) UploadLargePreimage(ctx context.Context, dataSize int, modifiers ...InputModifier) types.LargePreimageIdent {

op-e2e/faultproofs/challenge_preimage_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func TestChallengeLargePreimages_ChallengeLast(t *testing.T) {
6060
challenger.WithPrivKey(sys.Cfg.Secrets.Mallory))
6161
preimageHelper := disputeGameFactory.PreimageHelper(ctx)
6262
ident := preimageHelper.UploadLargePreimage(ctx, preimage.MinPreimageSize,
63-
preimage.WithReplacedCommitment(132, common.Hash{0xaa}))
63+
preimage.WithLastCommitment(common.Hash{0xaa}))
6464

6565
require.NotEqual(t, ident.Claimant, common.Address{})
6666

op-e2e/faultproofs/output_cannon_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
op_e2e "github.com/ethereum-optimism/optimism/op-e2e"
1111
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/challenger"
1212
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/disputegame"
13+
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/disputegame/preimage"
1314
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/wait"
1415
"github.com/ethereum/go-ethereum/common"
1516
"github.com/stretchr/testify/require"
@@ -254,7 +255,7 @@ func TestOutputCannonStepWithLargePreimage(t *testing.T) {
254255
// execution game. We then move to challenge it to induce a large preimage load.
255256
sender := sys.Cfg.Secrets.Addresses().Alice
256257
preimageLoadCheck := game.CreateStepLargePreimageLoadCheck(ctx, sender)
257-
game.ChallengeToPreimageLoad(ctx, outputRootClaim, sys.Cfg.Secrets.Alice, cannon.PreimageLargerThan(18_000), preimageLoadCheck, false)
258+
game.ChallengeToPreimageLoad(ctx, outputRootClaim, sys.Cfg.Secrets.Alice, cannon.PreimageLargerThan(preimage.MinPreimageSize), preimageLoadCheck, false)
258259
// The above method already verified the image was uploaded and step called successfully
259260
// So we don't waste time resolving the game - that's tested elsewhere.
260261
}

op-e2e/faultproofs/util.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ type faultDisputeConfigOpts func(cfg *op_e2e.SystemConfig)
1212

1313
func withLargeBatches() faultDisputeConfigOpts {
1414
return func(cfg *op_e2e.SystemConfig) {
15+
maxTxDataSize := uint64(131072) // As per the Ethereum spec.
1516
// Allow the batcher to produce really huge calldata transactions.
16-
cfg.BatcherTargetL1TxSizeBytes = 130072 // A bit under the max tx size as per Ethereum spec
17-
cfg.BatcherMaxL1TxSizeBytes = 130072
17+
// Make the max deliberately bigger than the target but still with some padding below the actual limit
18+
cfg.BatcherTargetL1TxSizeBytes = maxTxDataSize - 5000
19+
cfg.BatcherMaxL1TxSizeBytes = maxTxDataSize - 1000
1820
}
1921
}
2022

packages/contracts-bedrock/deploy-config/devnetL1-template.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"faultGameGenesisBlock": 0,
5656
"faultGameGenesisOutputRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
5757
"faultGameSplitDepth": 14,
58-
"preimageOracleMinProposalSize": 18000,
58+
"preimageOracleMinProposalSize": 10000,
5959
"preimageOracleChallengePeriod": 120,
6060
"preimageOracleCancunActivationTimestamp": 0
6161
}

0 commit comments

Comments
 (0)