diff --git a/go.mod b/go.mod index 202286fc0a441..98ee87812ea99 100644 --- a/go.mod +++ b/go.mod @@ -302,7 +302,7 @@ require ( lukechampine.com/blake3 v1.3.0 // indirect ) -replace github.com/ethereum/go-ethereum => github.com/ethereum-optimism/op-geth v1.101602.1-rc.1 +replace github.com/ethereum/go-ethereum => github.com/ethereum-optimism/op-geth v1.101602.3-0.20250911101322-e215d5f615e5 // replace github.com/ethereum/go-ethereum => ../op-geth diff --git a/go.sum b/go.sum index c315ef604bc20..015c6c19273f8 100644 --- a/go.sum +++ b/go.sum @@ -228,8 +228,8 @@ github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A= github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 h1:RWHKLhCrQThMfch+QJ1Z8veEq5ZO3DfIhZ7xgRP9WTc= github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3/go.mod h1:QziizLAiF0KqyLdNJYD7O5cpDlaFMNZzlxYNcWsJUxs= -github.com/ethereum-optimism/op-geth v1.101602.1-rc.1 h1:gt96/7JhVw4bEk4i0URyOKTaAoA3v+Pa+ms868IaoaY= -github.com/ethereum-optimism/op-geth v1.101602.1-rc.1/go.mod h1:rOTZfq3JrsY8ktvTnS6XT9X+t4WQQ42zFb+hzXua2EU= +github.com/ethereum-optimism/op-geth v1.101602.3-0.20250911101322-e215d5f615e5 h1:R78OvBSzkqIEP/8J5ZVx4/gAdXUxMcKqGBFiPaKoGu4= +github.com/ethereum-optimism/op-geth v1.101602.3-0.20250911101322-e215d5f615e5/go.mod h1:rOTZfq3JrsY8ktvTnS6XT9X+t4WQQ42zFb+hzXua2EU= github.com/ethereum-optimism/superchain-registry/validation v0.0.0-20250603144016-9c45ca7d4508 h1:A/3QVFt+Aa9ozpPVXxUTLui8honBjSusAaiCVRbafgs= github.com/ethereum-optimism/superchain-registry/validation v0.0.0-20250603144016-9c45ca7d4508/go.mod h1:NZ816PzLU1TLv1RdAvYAb6KWOj4Zm5aInT0YpDVml2Y= github.com/ethereum/c-kzg-4844/v2 v2.1.0 h1:gQropX9YFBhl3g4HYhwE70zq3IHFRgbbNPw0Shwzf5w= diff --git a/op-acceptance-tests/tests/jovian/calldata_footprint_test.go b/op-acceptance-tests/tests/jovian/calldata_footprint_test.go new file mode 100644 index 0000000000000..999a81f8321ed --- /dev/null +++ b/op-acceptance-tests/tests/jovian/calldata_footprint_test.go @@ -0,0 +1,102 @@ +package jovian + +import ( + "crypto/rand" + "fmt" + "math/big" + "sync" + "testing" + + "github.com/ethereum-optimism/optimism/op-devstack/devtest" + "github.com/ethereum-optimism/optimism/op-devstack/dsl" + "github.com/ethereum-optimism/optimism/op-devstack/presets" + "github.com/ethereum-optimism/optimism/op-node/rollup" + "github.com/ethereum-optimism/optimism/op-service/eth" + "github.com/ethereum-optimism/optimism/op-service/txplan" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/params" + "github.com/stretchr/testify/require" +) + +func sendTx(t devtest.T, eoa *dsl.EOA, to common.Address, calldataSize int) { + data := make([]byte, calldataSize) + _, err := rand.Read(data) + t.Require().NoError(err) + eoa.Transact( + eoa.Plan(), + txplan.WithTo(&to), + txplan.WithData(data), + ) + fmt.Println("sent tx", eoa.Address()) +} + +// TestCalldataFootprint generates a large volume of transactions with configurable calldata size. +// It is used to test the calldata footprint response of the L2 under Jovian HF. +func TestCalldataFootprint(gt *testing.T) { + t := devtest.SerialT(gt) + sys := presets.NewMinimal(t) + + // check that the chain is running on Jovian fork + err := dsl.RequiresL2Fork(t.Ctx(), sys, 0, rollup.Jovian) + require.NoError(t, err, "Jovian fork must be active for this test") + + calldataSize := 120_000 + eoaGroupSize := 50 + + // create eoas + eoaGroup := make([]*dsl.EOA, eoaGroupSize) + for i := range eoaGroup { + eoaGroup[i] = sys.FunderL2.NewFundedEOA(eth.HundredEther) + } + + // all eoas send tx to the same recipient simultaneously + to := eoaGroup[0].Address() + wg := sync.WaitGroup{} + for i := range eoaGroup { + wg.Add(1) + go func() { + defer wg.Done() + sendTx(t, eoaGroup[i], to, calldataSize) + }() + } + wg.Wait() + fmt.Println("all txs sent") + + // get blocks of the L2 and check for the txs + ethClient := sys.L2Chain.Escape().L2ELNodes()[0].EthClient() + lastBlock, err := ethClient.BlockRefByLabel(t.Ctx(), eth.BlockLabel(eth.Unsafe)) + t.Require().NoError(err) + + daLimitedSeen := false + // check for the txs in the block + for i := range lastBlock.Number { + info, txs, err := ethClient.InfoAndTxsByNumber(t.Ctx(), uint64(i)) + t.Require().NoError(err) + fmt.Println("txs", txs.Len()) + fmt.Println("info", info) + blockGasUsed := info.GasUsed() + gasUsedAccumulated := uint64(0) + daFootprintAccumulated := big.NewInt(0) + for _, tx := range txs { + receipt, err := ethClient.TransactionReceipt(t.Ctx(), tx.Hash()) + t.Require().NoError(err) + gasUsedAccumulated += receipt.GasUsed + daFootprintAccumulated.Add(daFootprintAccumulated, tx.RollupCostData().EstimatedDASize()) + } + fmt.Println("blockGasUsed", blockGasUsed) + fmt.Println("gasUsedAccumulated", gasUsedAccumulated) + fmt.Println("daFootprintAccumulated", daFootprintAccumulated) + + // if the blockGasUsed is based on actual gasUsed, nothing to validate + if blockGasUsed == gasUsedAccumulated { + continue + } + + // else, the blockGasUsed is based on da footprint, + // so we need to validate that the calldata footprint rules were followed + daFootprintAccumulated.Mul(daFootprintAccumulated, big.NewInt(params.DAFootprintGasScalar)) + require.Equal(t, daFootprintAccumulated, big.NewInt(int64(blockGasUsed)), "blockGasUsed is not gas or da based") + daLimitedSeen = true + } + require.True(t, daLimitedSeen, "no da limited blocks seen") +} diff --git a/op-acceptance-tests/tests/jovian/init_test.go b/op-acceptance-tests/tests/jovian/init_test.go new file mode 100644 index 0000000000000..b013679b0380e --- /dev/null +++ b/op-acceptance-tests/tests/jovian/init_test.go @@ -0,0 +1,34 @@ +package jovian + +import ( + "testing" + + "github.com/ethereum-optimism/optimism/op-chain-ops/devkeys" + "github.com/ethereum-optimism/optimism/op-devstack/devtest" + "github.com/ethereum-optimism/optimism/op-devstack/presets" + "github.com/ethereum-optimism/optimism/op-devstack/stack" + "github.com/ethereum-optimism/optimism/op-devstack/sysgo" + "github.com/ethereum-optimism/optimism/op-e2e/e2eutils/intentbuilder" + "github.com/ethereum-optimism/optimism/op-node/rollup" +) + +func TestMain(m *testing.M) { + presets.DoMain(m, + presets.WithMinimal(), + WithJovianEnabled(), + ) +} + +// WithJovianEnabled creates a preset option that enables Jovian hardfork at genesis +func WithJovianEnabled() stack.CommonOption { + return stack.MakeCommon(sysgo.WithDeployerOptions(WithJovianAtGenesis())) +} + +// Helper function to activate Jovian at genesis +func WithJovianAtGenesis() sysgo.DeployerOption { + return func(p devtest.P, keys devkeys.Keys, builder intentbuilder.Builder) { + for _, l2Cfg := range builder.L2s() { + l2Cfg.WithForkAtGenesis(rollup.Jovian) + } + } +}