Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion op-e2e/e2eutils/disputegame/preimage/preimage_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/stretchr/testify/require"
)

const MinPreimageSize = 18000
const MinPreimageSize = 10000

type Helper struct {
t *testing.T
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion op-e2e/faultproofs/challenge_preimage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{})

Expand Down
3 changes: 2 additions & 1 deletion op-e2e/faultproofs/output_cannon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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.
}
Expand Down
6 changes: 4 additions & 2 deletions op-e2e/faultproofs/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"faultGameGenesisBlock": 0,
"faultGameGenesisOutputRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
"faultGameSplitDepth": 14,
"preimageOracleMinProposalSize": 18000,
"preimageOracleMinProposalSize": 10000,
"preimageOracleChallengePeriod": 120,
"preimageOracleCancunActivationTimestamp": 0
}