diff --git a/execution/gethexec/node.go b/execution/gethexec/node.go index 70c4bd4e02..660ac29712 100644 --- a/execution/gethexec/node.go +++ b/execution/gethexec/node.go @@ -19,6 +19,7 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/eth" "github.com/ethereum/go-ethereum/eth/filters" + "github.com/ethereum/go-ethereum/eth/tracers/native" "github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/log" @@ -263,6 +264,7 @@ type ExecutionNode struct { ClassicOutbox *ClassicOutboxRetriever started atomic.Bool bulkBlockMetadataFetcher *BulkBlockMetadataFetcher + rpcClient *rpc.Client // for debug tracing operations } func CreateExecutionNode( @@ -448,6 +450,9 @@ func (n *ExecutionNode) Initialize(ctx context.Context) error { return fmt.Errorf("error setting sync backend: %w", err) } + // Initialize RPC client for debug tracing + n.rpcClient = n.Backend.Stack().Attach() + return nil } @@ -494,6 +499,9 @@ func (n *ExecutionNode) StopAndWait() { if err := n.Backend.Stop(); err != nil { log.Error("backend stop", "err", err) } + if n.rpcClient != nil { + n.rpcClient.Close() + } // TODO after separation // if err := n.Stack.Close(); err != nil { // log.Error("error on stak close", "err", err) @@ -614,6 +622,26 @@ func (n *ExecutionNode) SetConsensusSyncData(syncData *execution.ConsensusSyncDa return containers.NewReadyPromise(struct{}{}, nil) } +// DebugTraceTransaction calls debug_traceTransaction on the Geth node's RPC API +func (n *ExecutionNode) DebugTraceTransaction(ctx context.Context, txHash common.Hash, tracerConfig map[string]interface{}) (native.ExecutionResult, error) { + if n.rpcClient == nil { + return native.ExecutionResult{}, errors.New("RPC client not initialized") + } + var result native.ExecutionResult + err := n.rpcClient.CallContext(ctx, &result, "debug_traceTransaction", txHash, tracerConfig) + return result, err +} + +// DebugTraceTransactionByOpcode calls debug_traceTransaction with txGasDimensionByOpcode tracer on the Geth node's RPC API +func (n *ExecutionNode) DebugTraceTransactionByOpcode(ctx context.Context, txHash common.Hash, tracerConfig map[string]interface{}) (native.TxGasDimensionByOpcodeExecutionResult, error) { + if n.rpcClient == nil { + return native.TxGasDimensionByOpcodeExecutionResult{}, errors.New("RPC client not initialized") + } + var result native.TxGasDimensionByOpcodeExecutionResult + err := n.rpcClient.CallContext(ctx, &result, "debug_traceTransaction", txHash, tracerConfig) + return result, err +} + func (n *ExecutionNode) InitializeTimeboost(ctx context.Context, chainConfig *params.ChainConfig) error { execNodeConfig := n.configFetcher.Get() if execNodeConfig.Sequencer.Timeboost.Enable { diff --git a/execution/interface.go b/execution/interface.go index aad650c400..b12bbb3fa0 100644 --- a/execution/interface.go +++ b/execution/interface.go @@ -8,6 +8,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/rawdb" "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/eth/tracers/native" "github.com/offchainlabs/nitro/arbos/arbostypes" "github.com/offchainlabs/nitro/arbutil" @@ -118,3 +119,19 @@ type FullConsensusClient interface { ConsensusInfo ConsensusSequencer } + +// ExecutionDebugger provides debug/tracing operations on execution client +type ExecutionDebugger interface { + // DebugTraceTransaction traces a transaction using txGasDimensionLogger tracer + DebugTraceTransaction( + ctx context.Context, + txHash common.Hash, + tracerConfig map[string]interface{}, + ) (native.ExecutionResult, error) + // DebugTraceTransactionByOpcode traces a transaction using txGasDimensionByOpcode tracer + DebugTraceTransactionByOpcode( + ctx context.Context, + txHash common.Hash, + tracerConfig map[string]interface{}, + ) (native.TxGasDimensionByOpcodeExecutionResult, error) +} diff --git a/execution/nethexec/compare_client.go b/execution/nethexec/compare_client.go index 79ceee0ec0..cbe980b8cc 100644 --- a/execution/nethexec/compare_client.go +++ b/execution/nethexec/compare_client.go @@ -3,12 +3,15 @@ package nethexec import ( "context" "fmt" + "math/big" "time" "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/eth/tracers/native" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/metrics" @@ -116,11 +119,21 @@ func compare[T any](op string, intRes T, intErr error, extRes T, extErr error) e case intErr == nil && extErr != nil: return fmt.Errorf("external operation failed: %w", extErr) default: - if !cmp.Equal(intRes, extRes) { - opts := cmp.Options{ - cmp.Transformer("HashHex", func(h common.Hash) string { return h.Hex() }), - } - diff := cmp.Diff(intRes, extRes, opts) + opts := cmp.Options{ + cmp.Transformer("HashHex", func(h common.Hash) string { return h.Hex() }), + cmp.Comparer(func(x, y *big.Int) bool { + if x == nil && y == nil { + return true + } + if x == nil || y == nil { + return false + } + return x.Cmp(y) == 0 + }), + cmpopts.EquateEmpty(), + } + if !cmp.Equal(intRes, extRes, opts...) { + diff := cmp.Diff(intRes, extRes, opts...) // Log the detailed diff using fmt.Printf to avoid escaping fmt.Printf("ERROR: Execution mismatch detected in operation: %s\n", op) fmt.Printf("Diff details:\n%s\n", diff) @@ -400,3 +413,59 @@ func (w *compareExecutionClient) SetConsensusClient(consensus execution.FullCons func (w *compareExecutionClient) Initialize(ctx context.Context) error { return w.gethExecutionClient.Initialize(ctx) } + +// DebugTraceTransaction calls debug_traceTransaction on both Geth and Nethermind and compares results. +func (w *compareExecutionClient) DebugTraceTransaction(ctx context.Context, txHash common.Hash, tracerConfig map[string]interface{}) (native.ExecutionResult, error) { + start := time.Now() + tracer := tracerConfig["tracer"] + log.Info("CompareExecutionClient: DebugTraceTransaction", "txHash", txHash, "tracer", tracer) + + gethResult, gethErr := w.gethExecutionClient.DebugTraceTransaction(ctx, txHash, tracerConfig) + nethResult, nethErr := w.nethermindExecutionClient.DebugTraceTransaction(ctx, txHash, tracerConfig) + + log.Info("CompareExecutionClient: DebugTraceTransaction completed", + "txHash", txHash, + "tracer", tracer, + "gethErr", gethErr, + "nethErr", nethErr, + "elapsed", time.Since(start)) + + if err := compare("DebugTraceTransaction", gethResult, gethErr, nethResult, nethErr); err != nil { + select { + case w.fatalErrChan <- fmt.Errorf("compareExecutionClient DebugTraceTransaction: %s", err.Error()): + default: + log.Error("Non-fatal trace comparison error", "txHash", txHash, "err", err) + } + return gethResult, err + } + + return gethResult, gethErr +} + +// DebugTraceTransactionByOpcode calls debug_traceTransaction with txGasDimensionByOpcode tracer on both Geth and Nethermind and compares results. +func (w *compareExecutionClient) DebugTraceTransactionByOpcode(ctx context.Context, txHash common.Hash, tracerConfig map[string]interface{}) (native.TxGasDimensionByOpcodeExecutionResult, error) { + start := time.Now() + tracer := tracerConfig["tracer"] + log.Info("CompareExecutionClient: DebugTraceTransactionByOpcode", "txHash", txHash, "tracer", tracer) + + gethResult, gethErr := w.gethExecutionClient.DebugTraceTransactionByOpcode(ctx, txHash, tracerConfig) + nethResult, nethErr := w.nethermindExecutionClient.DebugTraceTransactionByOpcode(ctx, txHash, tracerConfig) + + log.Info("CompareExecutionClient: DebugTraceTransactionByOpcode completed", + "txHash", txHash, + "tracer", tracer, + "gethErr", gethErr, + "nethErr", nethErr, + "elapsed", time.Since(start)) + + if err := compare("DebugTraceTransactionByOpcode", gethResult, gethErr, nethResult, nethErr); err != nil { + select { + case w.fatalErrChan <- fmt.Errorf("compareExecutionClient DebugTraceTransactionByOpcode: %s", err.Error()): + default: + log.Error("Non-fatal trace comparison error", "txHash", txHash, "err", err) + } + return gethResult, err + } + + return gethResult, gethErr +} diff --git a/execution/nethexec/execution_client.go b/execution/nethexec/execution_client.go index 79d657e0a0..f21b3f301b 100644 --- a/execution/nethexec/execution_client.go +++ b/execution/nethexec/execution_client.go @@ -9,6 +9,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/rawdb" "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/eth/tracers/native" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/rpc" @@ -301,3 +302,13 @@ func (p *nethermindExecutionClient) BlockNumber(ctx context.Context) (uint64, er func (p *nethermindExecutionClient) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error) { return p.rpcClient.BalanceAt(ctx, account, blockNumber) } + +// DebugTraceTransaction calls debug_traceTransaction on Nethermind +func (p *nethermindExecutionClient) DebugTraceTransaction(ctx context.Context, txHash common.Hash, tracerConfig map[string]interface{}) (native.ExecutionResult, error) { + return p.rpcClient.DebugTraceTransaction(ctx, txHash, tracerConfig) +} + +// DebugTraceTransactionByOpcode calls debug_traceTransaction with txGasDimensionByOpcode tracer on Nethermind +func (p *nethermindExecutionClient) DebugTraceTransactionByOpcode(ctx context.Context, txHash common.Hash, tracerConfig map[string]interface{}) (native.TxGasDimensionByOpcodeExecutionResult, error) { + return p.rpcClient.DebugTraceTransactionByOpcode(ctx, txHash, tracerConfig) +} diff --git a/execution/nethexec/nethrpcclient.go b/execution/nethexec/nethrpcclient.go index bf7c15fa29..1e74655d07 100644 --- a/execution/nethexec/nethrpcclient.go +++ b/execution/nethexec/nethrpcclient.go @@ -9,6 +9,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/eth/tracers/native" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/rpc" @@ -371,3 +372,26 @@ func (c *nethRpcClient) FullSyncProgressMap(ctx context.Context) (map[string]int } return result, nil } + +// DebugTraceTransaction calls debug_traceTransaction on the Nethermind node +// tracerConfig should include "tracer" key specifying the tracer name +func (c *nethRpcClient) DebugTraceTransaction(ctx context.Context, txHash common.Hash, tracerConfig map[string]interface{}) (native.ExecutionResult, error) { + log.Debug("Making JSON-RPC call to debug_traceTransaction", "url", c.url, "txHash", txHash, "tracer", tracerConfig["tracer"]) + var result native.ExecutionResult + if err := c.client.CallContext(ctx, &result, "debug_traceTransaction", txHash, tracerConfig); err != nil { + log.Error("Failed to call debug_traceTransaction", "error", err, "txHash", txHash) + return native.ExecutionResult{}, fmt.Errorf("failed to call debug_traceTransaction: %w", err) + } + return result, nil +} + +// DebugTraceTransactionByOpcode calls debug_traceTransaction with txGasDimensionByOpcode tracer on the Nethermind node +func (c *nethRpcClient) DebugTraceTransactionByOpcode(ctx context.Context, txHash common.Hash, tracerConfig map[string]interface{}) (native.TxGasDimensionByOpcodeExecutionResult, error) { + log.Debug("Making JSON-RPC call to debug_traceTransaction (byOpcode)", "url", c.url, "txHash", txHash, "tracer", tracerConfig["tracer"]) + var result native.TxGasDimensionByOpcodeExecutionResult + if err := c.client.CallContext(ctx, &result, "debug_traceTransaction", txHash, tracerConfig); err != nil { + log.Error("Failed to call debug_traceTransaction (byOpcode)", "error", err, "txHash", txHash) + return native.TxGasDimensionByOpcodeExecutionResult{}, fmt.Errorf("failed to call debug_traceTransaction: %w", err) + } + return result, nil +} diff --git a/system_tests/common_test.go b/system_tests/common_test.go index aaf80fa383..7e45d4bf20 100644 --- a/system_tests/common_test.go +++ b/system_tests/common_test.go @@ -49,7 +49,7 @@ import ( "github.com/ethereum/go-ethereum/eth/filters" "github.com/ethereum/go-ethereum/eth/tracers" _ "github.com/ethereum/go-ethereum/eth/tracers/js" - _ "github.com/ethereum/go-ethereum/eth/tracers/native" + "github.com/ethereum/go-ethereum/eth/tracers/native" "github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/log" @@ -73,6 +73,7 @@ import ( "github.com/offchainlabs/nitro/daprovider/das/dastree" "github.com/offchainlabs/nitro/daprovider/das/dasutil" "github.com/offchainlabs/nitro/deploy" + "github.com/offchainlabs/nitro/execution" "github.com/offchainlabs/nitro/execution/gethexec" _ "github.com/offchainlabs/nitro/execution/nodeInterface" "github.com/offchainlabs/nitro/solgen/go/bridgegen" @@ -220,6 +221,32 @@ func (tc *TestClient) BalanceDifferenceAtBlock(address common.Address, blockNum return arbmath.BigSub(newBalance, prevBalance), nil } +// DebugTraceTransaction calls debug_traceTransaction on the execution client. +// Routes through geth, nethermind, or comparison client based on ExecutionClientMode. +func (tc *TestClient) DebugTraceTransaction(ctx context.Context, txHash common.Hash, tracerConfig map[string]interface{}) (native.ExecutionResult, error) { + if tc.ConsensusNode == nil { + return native.ExecutionResult{}, fmt.Errorf("consensus node is nil") + } + debugger, ok := tc.ConsensusNode.ExecutionClient.(execution.ExecutionDebugger) + if !ok { + return native.ExecutionResult{}, fmt.Errorf("execution client does not implement ExecutionDebugger") + } + return debugger.DebugTraceTransaction(ctx, txHash, tracerConfig) +} + +// DebugTraceTransactionByOpcode calls debug_traceTransaction with txGasDimensionByOpcode tracer on the execution client. +// Routes through geth, nethermind, or comparison client based on ExecutionClientMode. +func (tc *TestClient) DebugTraceTransactionByOpcode(ctx context.Context, txHash common.Hash, tracerConfig map[string]interface{}) (native.TxGasDimensionByOpcodeExecutionResult, error) { + if tc.ConsensusNode == nil { + return native.TxGasDimensionByOpcodeExecutionResult{}, fmt.Errorf("consensus node is nil") + } + debugger, ok := tc.ConsensusNode.ExecutionClient.(execution.ExecutionDebugger) + if !ok { + return native.TxGasDimensionByOpcodeExecutionResult{}, fmt.Errorf("execution client does not implement ExecutionDebugger") + } + return debugger.DebugTraceTransactionByOpcode(ctx, txHash, tracerConfig) +} + // GetCodeHash retrieves the code hash for a contract address via RPC. // This works with any execution client (geth or external like Nethermind). func GetCodeHash(t *testing.T, ctx context.Context, client *ethclient.Client, address common.Address) common.Hash { diff --git a/system_tests/gas_dim_log_a_common_test.go b/system_tests/gas_dim_log_a_common_test.go index ec8d0b50f1..cf6f5f3e2e 100644 --- a/system_tests/gas_dim_log_a_common_test.go +++ b/system_tests/gas_dim_log_a_common_test.go @@ -5,8 +5,8 @@ package arbtest import ( "context" - "encoding/json" "testing" + "time" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" @@ -14,6 +14,7 @@ import ( "github.com/ethereum/go-ethereum/eth/tracers/native" "github.com/ethereum/go-ethereum/params" + "github.com/offchainlabs/nitro/arbnode" "github.com/offchainlabs/nitro/solgen/go/gas_dimensionsgen" ) @@ -31,21 +32,38 @@ const ( // ######################################################################################################### // ######################################################################################################### -// Run a test where we set up an L2, then send a transaction +// Core test function for computation-only opcodes. +// Runs a test where we set up an L2, then send a transaction // that only has computation-only opcodes. Then call debug_traceTransaction -// with the txGasDimensionLogger tracer. +// with the txGasDimensionLogger tracer on a replica node. // -// we expect in this case to get back a json response, with the gas dimension logs +// We expect in this case to get back a json response, with the gas dimension logs // containing only the computation-only opcodes and that the gas in the computation // only opcodes is equal to the OneDimensionalGasCost. -func TestDimLogComputationOnlyOpcodes(t *testing.T) { +func testDimLogComputationOnlyOpcodes(t *testing.T, executionClientMode ExecutionClientMode) { ctx, cancel, builder, auth, cleanup := gasDimensionTestSetup(t, false) defer cancel() defer cleanup() + // Build replica node with specified execution client mode + replicaConfig := arbnode.ConfigDefaultL1NonSequencerTest() + replicaParams := &SecondNodeParams{ + nodeConfig: replicaConfig, + useExecutionClientOnly: true, + executionClientMode: executionClientMode, + } + replicaTestClient, replicaCleanup := builder.Build2ndNode(t, replicaParams) + defer replicaCleanup() + _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployCounter) _, receipt := callOnContract(t, builder, auth, contract.NoSpecials) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + + // Wait for replica to sync the transaction + _, err := WaitForTx(ctx, replicaTestClient.Client, receipt.TxHash, time.Second*15) + Require(t, err) + + // Call debug_traceTransaction on the replica + traceResult := callDebugTraceTransactionWithLogger(t, ctx, replicaTestClient, receipt.TxHash) // Validate each log entry for i, log := range traceResult.DimensionLogs { @@ -73,6 +91,26 @@ func TestDimLogComputationOnlyOpcodes(t *testing.T) { } } +// TestDimLogComputationOnlyOpcodesInternal tests with internal geth execution client on a replica node +func TestDimLogComputationOnlyOpcodesInternal(t *testing.T) { + testDimLogComputationOnlyOpcodes(t, ExecutionClientModeInternal) +} + +// TestDimLogComputationOnlyOpcodesExternal tests with external Nethermind execution client on a replica node +// Requires Nethermind to be running with environment variables: +// - PR_NETH_RPC_CLIENT_URL (default: http://localhost:20545) +// - PR_NETH_WS_CLIENT_URL (default: ws://localhost:28551) +func TestDimLogComputationOnlyOpcodesExternal(t *testing.T) { + testDimLogComputationOnlyOpcodes(t, ExecutionClientModeExternal) +} + +// TestDimLogComputationOnlyOpcodesComparison tests comparing internal geth and external Nethermind on a replica node +// Runs both execution clients in parallel and compares all results for correctness +// Requires Nethermind to be running (same as TestDimLogComputationOnlyOpcodesExternal) +func TestDimLogComputationOnlyOpcodesComparison(t *testing.T) { + testDimLogComputationOnlyOpcodes(t, ExecutionClientModeComparison) +} + // ######################################################################################################### // ######################################################################################################### // HELPER FUNCTIONS @@ -161,26 +199,20 @@ func callOnContractWithOneArg[A any, F func(auth *bind.TransactOpts, arg1 A) (*t func callDebugTraceTransactionWithLogger( t *testing.T, ctx context.Context, - builder *NodeBuilder, + testClient *TestClient, txHash common.Hash, ) TraceResult { t.Helper() - // Call debug_traceTransaction with txGasDimensionLogger tracer - rpcClient := builder.L2.ConsensusNode.Stack.Attach() - var result json.RawMessage - err := rpcClient.CallContext(ctx, &result, "debug_traceTransaction", txHash, map[string]interface{}{ + + // Call debug_traceTransaction via the execution client (geth, nethermind, or comparison) + tracerConfig := map[string]interface{}{ "tracer": "txGasDimensionLogger", "tracerConfig": map[string]interface{}{ "debug": true, }, - }) - Require(t, err) - - // Parse the result - var traceResult TraceResult - if err := json.Unmarshal(result, &traceResult); err != nil { - Fatal(t, err) } + traceResult, err := testClient.DebugTraceTransaction(ctx, txHash, tracerConfig) + Require(t, err) // Validate basic structure if traceResult.GasUsed == 0 { diff --git a/system_tests/gas_dim_log_call_test.go b/system_tests/gas_dim_log_call_test.go index 7494f4e2ab..9025e5fdfe 100644 --- a/system_tests/gas_dim_log_call_test.go +++ b/system_tests/gas_dim_log_call_test.go @@ -57,7 +57,7 @@ func TestDimLogCallColdNoTransferNoCodeVirginMemUnchanged(t *testing.T) { noCodeVirginAddress := common.HexToAddress("0x00000000000000000000000000000000DeaDBeef") receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdNoTransferMemUnchanged, noCodeVirginAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALL") expected := ExpectedGasCosts{ @@ -89,7 +89,7 @@ func TestDimLogCallColdNoTransferNoCodeVirginMemExpansion(t *testing.T) { noCodeVirginAddress := common.HexToAddress("0x00000000000000000000000000000000DeaDBeef") receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdNoTransferMemExpansion, noCodeVirginAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALL") expected := ExpectedGasCosts{ @@ -124,7 +124,7 @@ func TestDimLogCallColdNoTransferNoCodeFundedMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdNoTransferMemUnchanged, calleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALL") expected := ExpectedGasCosts{ @@ -159,7 +159,7 @@ func TestDimLogCallColdNoTransferNoCodeFundedMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdNoTransferMemExpansion, calleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALL") expected := ExpectedGasCosts{ @@ -191,7 +191,7 @@ func TestDimLogCallColdNoTransferContractFundedMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdNoTransferMemUnchanged, calleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALL") expected := ExpectedGasCosts{ @@ -223,7 +223,7 @@ func TestDimLogCallColdNoTransferContractFundedMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdNoTransferMemExpansion, calleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALL") expected := ExpectedGasCosts{ @@ -257,7 +257,7 @@ func TestDimLogCallColdPayingNoCodeVirginMemUnchanged(t *testing.T) { noCodeVirginAddress := common.HexToAddress("0x00000000000000000000000000000000DeaDBeef") receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdPayableMemUnchanged, noCodeVirginAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALL") expected := ExpectedGasCosts{ @@ -291,7 +291,7 @@ func TestDimLogCallColdPayingNoCodeVirginMemExpansion(t *testing.T) { noCodeVirginAddress := common.HexToAddress("0x00000000000000000000000000000000DeaDBeef") receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdPayableMemExpansion, noCodeVirginAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALL") expected := ExpectedGasCosts{ @@ -325,7 +325,7 @@ func TestDimLogCallColdPayingNoCodeFundedMemUnchanged(t *testing.T) { builder.L2.TransferBalanceTo(t, "Owner", noCodeFundedAddress, big.NewInt(1e17), builder.L2Info) receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdPayableMemUnchanged, noCodeFundedAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALL") expected := ExpectedGasCosts{ @@ -359,7 +359,7 @@ func TestDimLogCallColdPayingNoCodeFundedMemExpansion(t *testing.T) { builder.L2.TransferBalanceTo(t, "Owner", noCodeFundedAddress, big.NewInt(1e17), builder.L2Info) receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdPayableMemExpansion, noCodeFundedAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALL") expected := ExpectedGasCosts{ @@ -396,7 +396,7 @@ func TestDimLogCallColdPayingContractFundedMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdPayableMemUnchanged, calleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALL") expected := ExpectedGasCosts{ @@ -433,7 +433,7 @@ func TestDimLogCallColdPayingContractFundedMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdPayableMemExpansion, calleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALL") expected := ExpectedGasCosts{ @@ -465,7 +465,7 @@ func TestDimLogCallWarmNoTransferNoCodeVirginMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmNoTransferMemUnchanged, noCodeVirginAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALL") expected := ExpectedGasCosts{ @@ -497,7 +497,7 @@ func TestDimLogCallWarmNoTransferNoCodeVirginMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmNoTransferMemExpansion, noCodeVirginAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALL") expected := ExpectedGasCosts{ @@ -532,7 +532,7 @@ func TestDimLogCallWarmNoTransferNoCodeFundedMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmNoTransferMemUnchanged, calleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALL") expected := ExpectedGasCosts{ @@ -567,7 +567,7 @@ func TestDimLogCallWarmNoTransferNoCodeFundedMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmNoTransferMemExpansion, calleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALL") expected := ExpectedGasCosts{ @@ -599,7 +599,7 @@ func TestDimLogCallWarmNoTransferContractFundedMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmNoTransferMemUnchanged, calleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALL") expected := ExpectedGasCosts{ @@ -634,7 +634,7 @@ func TestDimLogCallWarmNoTransferContractFundedMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmNoTransferMemExpansion, calleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALL") expected := ExpectedGasCosts{ @@ -670,7 +670,7 @@ func TestDimLogCallWarmPayingNoCodeVirginMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmPayableMemUnchanged, noCodeVirginAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALL") expected := ExpectedGasCosts{ @@ -706,7 +706,7 @@ func TestDimLogCallWarmPayingNoCodeVirginMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmPayableMemExpansion, noCodeVirginAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALL") expected := ExpectedGasCosts{ @@ -743,7 +743,7 @@ func TestDimLogCallWarmPayingNoCodeFundedMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmPayableMemUnchanged, noCodeFundedAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALL") expected := ExpectedGasCosts{ @@ -780,7 +780,7 @@ func TestDimLogCallWarmPayingNoCodeFundedMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmPayableMemExpansion, noCodeFundedAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALL") expected := ExpectedGasCosts{ @@ -817,7 +817,7 @@ func TestDimLogCallWarmPayingContractFundedMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmPayableMemUnchanged, calleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALL") expected := ExpectedGasCosts{ @@ -854,7 +854,7 @@ func TestDimLogCallWarmPayingContractFundedMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmPayableMemExpansion, calleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALL") expected := ExpectedGasCosts{ @@ -900,7 +900,7 @@ func TestDimLogCallCodeColdNoTransferNoCodeVirginMemUnchanged(t *testing.T) { noCodeVirginAddress := common.HexToAddress("0x00000000000000000000000000000000DeaDBeef") receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdNoTransferMemUnchanged, noCodeVirginAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALLCODE") expected := ExpectedGasCosts{ @@ -932,7 +932,7 @@ func TestDimLogCallCodeColdNoTransferNoCodeVirginMemExpansion(t *testing.T) { noCodeVirginAddress := common.HexToAddress("0x00000000000000000000000000000000DeaDBeef") receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdNoTransferMemExpansion, noCodeVirginAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALLCODE") expected := ExpectedGasCosts{ @@ -967,7 +967,7 @@ func TestDimLogCallCodeColdNoTransferNoCodeFundedMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdNoTransferMemUnchanged, calleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALLCODE") expected := ExpectedGasCosts{ @@ -1002,7 +1002,7 @@ func TestDimLogCallCodeColdNoTransferNoCodeFundedMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdNoTransferMemExpansion, calleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALLCODE") var expectedMemExpansionCost uint64 = 6 @@ -1035,7 +1035,7 @@ func TestDimLogCallCodeColdNoTransferContractFundedMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdNoTransferMemUnchanged, calleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALLCODE") expected := ExpectedGasCosts{ @@ -1067,7 +1067,7 @@ func TestDimLogCallCodeColdNoTransferContractFundedMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdNoTransferMemExpansion, calleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALLCODE") expected := ExpectedGasCosts{ @@ -1101,7 +1101,7 @@ func TestDimLogCallCodeColdPayingNoCodeVirginMemUnchanged(t *testing.T) { noCodeVirginAddress := common.HexToAddress("0x00000000000000000000000000000000DeaDBeef") receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdPayableMemUnchanged, noCodeVirginAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALLCODE") expected := ExpectedGasCosts{ @@ -1135,7 +1135,7 @@ func TestDimLogCallCodeColdPayingNoCodeVirginMemExpansion(t *testing.T) { noCodeVirginAddress := common.HexToAddress("0x00000000000000000000000000000000DeaDBeef") receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdPayableMemExpansion, noCodeVirginAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALLCODE") var expectedMemExpansionCost uint64 = 6 @@ -1170,7 +1170,7 @@ func TestDimLogCallCodeColdPayingNoCodeFundedMemUnchanged(t *testing.T) { builder.L2.TransferBalanceTo(t, "Owner", noCodeFundedAddress, big.NewInt(1e17), builder.L2Info) receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdPayableMemUnchanged, noCodeFundedAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALLCODE") expected := ExpectedGasCosts{ @@ -1204,7 +1204,7 @@ func TestDimLogCallCodeColdPayingNoCodeFundedMemExpansion(t *testing.T) { builder.L2.TransferBalanceTo(t, "Owner", noCodeFundedAddress, big.NewInt(1e17), builder.L2Info) receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdPayableMemExpansion, noCodeFundedAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALLCODE") var expectedMemExpansionCost uint64 = 6 @@ -1243,7 +1243,7 @@ func TestDimLogCallCodeColdPayingContractFundedMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdPayableMemUnchanged, calleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALLCODE") expected := ExpectedGasCosts{ @@ -1280,7 +1280,7 @@ func TestDimLogCallCodeColdPayingContractFundedMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdPayableMemExpansion, calleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALLCODE") expected := ExpectedGasCosts{ @@ -1312,7 +1312,7 @@ func TestDimLogCallCodeWarmNoTransferNoCodeVirginMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmNoTransferMemUnchanged, noCodeVirginAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALLCODE") expected := ExpectedGasCosts{ @@ -1344,7 +1344,7 @@ func TestDimLogCallCodeWarmNoTransferNoCodeVirginMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmNoTransferMemExpansion, noCodeVirginAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALLCODE") var expectedMemExpansionCost uint64 = 6 @@ -1381,7 +1381,7 @@ func TestDimLogCallCodeWarmNoTransferNoCodeFundedMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmNoTransferMemUnchanged, calleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALLCODE") expected := ExpectedGasCosts{ @@ -1416,7 +1416,7 @@ func TestDimLogCallCodeWarmNoTransferNoCodeFundedMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmNoTransferMemExpansion, calleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALLCODE") var expectedMemExpansionCost uint64 = 6 @@ -1449,7 +1449,7 @@ func TestDimLogCallCodeWarmNoTransferContractFundedMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmNoTransferMemUnchanged, calleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALLCODE") expected := ExpectedGasCosts{ @@ -1484,7 +1484,7 @@ func TestDimLogCallCodeWarmNoTransferContractFundedMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmNoTransferMemExpansion, calleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALLCODE") expected := ExpectedGasCosts{ @@ -1520,7 +1520,7 @@ func TestDimLogCallCodeWarmPayingNoCodeVirginMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmPayableMemUnchanged, noCodeVirginAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALLCODE") expected := ExpectedGasCosts{ @@ -1556,7 +1556,7 @@ func TestDimLogCallCodeWarmPayingNoCodeVirginMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmPayableMemExpansion, noCodeVirginAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALLCODE") expected := ExpectedGasCosts{ @@ -1593,7 +1593,7 @@ func TestDimLogCallCodeWarmPayingNoCodeFundedMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmPayableMemUnchanged, noCodeFundedAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALLCODE") expected := ExpectedGasCosts{ @@ -1630,7 +1630,7 @@ func TestDimLogCallCodeWarmPayingNoCodeFundedMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmPayableMemExpansion, noCodeFundedAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALLCODE") expected := ExpectedGasCosts{ @@ -1667,7 +1667,7 @@ func TestDimLogCallCodeWarmPayingContractFundedMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmPayableMemUnchanged, calleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALLCODE") expected := ExpectedGasCosts{ @@ -1704,7 +1704,7 @@ func TestDimLogCallCodeWarmPayingContractFundedMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmPayableMemExpansion, calleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALLCODE") expected := ExpectedGasCosts{ @@ -1734,7 +1734,7 @@ func TestDimLogNestedCall(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.Entrypoint, calleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) callLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CALL") var callChildExecutionCost uint64 = 25921 // from the struct logger output diff --git a/system_tests/gas_dim_log_create_test.go b/system_tests/gas_dim_log_create_test.go index 5891b3d464..2f5997bd14 100644 --- a/system_tests/gas_dim_log_create_test.go +++ b/system_tests/gas_dim_log_create_test.go @@ -81,7 +81,7 @@ func TestDimLogCreateNoTransferMemUnchanged(t *testing.T) { _, receipt := callOnContract(t, builder, auth, creator.CreateNoTransferMemUnchanged) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) createLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CREATE") _, expectedInitCodeCost, expectedCodeDepositCost := getCodeInitAndDepositCosts(memUnchangedContractInitCodeSize, memUnchangedContractDeployedCodeSize) @@ -110,7 +110,7 @@ func TestDimLogCreateNoTransferMemExpansion(t *testing.T) { _, receipt := callOnContract(t, builder, auth, creator.CreateNoTransferMemExpansion) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) createLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CREATE") _, expectedInitCodeCost, expectedCodeDepositCost := getCodeInitAndDepositCosts(memExpansionContractInitCodeSize, memExpansionContractDeployedCodeSize) @@ -144,7 +144,7 @@ func TestDimLogCreatePayingMemUnchanged(t *testing.T) { _, receipt := callOnContract(t, builder, auth, creator.CreatePayableMemUnchanged) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) createLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CREATE") _, expectedInitCodeCost, expectedCodeDepositCost := getCodeInitAndDepositCosts(memUnchangedContractInitCodeSize, memUnchangedContractDeployedCodeSize) @@ -175,7 +175,7 @@ func TestDimLogCreatePayingMemExpansion(t *testing.T) { _, receipt := callOnContract(t, builder, auth, creator.CreatePayableMemExpansion) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) createLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CREATE") _, expectedInitCodeCost, expectedCodeDepositCost := getCodeInitAndDepositCosts(memExpansionContractInitCodeSize, memExpansionContractDeployedCodeSize) @@ -233,7 +233,7 @@ func TestDimLogCreate2NoTransferMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, creator.CreateTwoNoTransferMemUnchanged, [32]byte{0x13, 0x37}) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) createLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CREATE2") minimumWordSize, expectedInitCodeCost, expectedCodeDepositCost := getCodeInitAndDepositCosts(memUnchangedContractInitCodeSize, memUnchangedContractDeployedCodeSize) @@ -264,7 +264,7 @@ func TestDimLogCreate2NoTransferMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, creator.CreateTwoNoTransferMemExpansion, [32]byte{0x13, 0x37}) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) createLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CREATE2") minimumWordSize, expectedInitCodeCost, expectedCodeDepositCost := getCodeInitAndDepositCosts(memExpansionContractInitCodeSize, memExpansionContractDeployedCodeSize) @@ -298,7 +298,7 @@ func TestDimLogCreate2PayingMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, creator.CreateTwoNoTransferMemUnchanged, [32]byte{0x13, 0x37}) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) createLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CREATE2") minimumWordSize, expectedInitCodeCost, expectedCodeDepositCost := getCodeInitAndDepositCosts(memUnchangedContractInitCodeSize, memUnchangedContractDeployedCodeSize) @@ -331,7 +331,7 @@ func TestDimLogCreate2PayingMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, creator.CreateTwoPayableMemExpansion, [32]byte{0x13, 0x37}) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) createLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "CREATE2") minimumWordSize, expectedInitCodeCost, expectedCodeDepositCost := getCodeInitAndDepositCosts(memExpansionContractInitCodeSize, memExpansionContractDeployedCodeSize) diff --git a/system_tests/gas_dim_log_extcodecopy_test.go b/system_tests/gas_dim_log_extcodecopy_test.go index 8fdc633c84..30c495f28e 100644 --- a/system_tests/gas_dim_log_extcodecopy_test.go +++ b/system_tests/gas_dim_log_extcodecopy_test.go @@ -100,7 +100,7 @@ func TestDimLogExtCodeCopyColdMemUnchanged(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployExtCodeCopy) _, receipt := callOnContract(t, builder, auth, contract.ExtCodeCopyColdNoMemExpansion) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) extCodeCopyLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "EXTCODECOPY") expected := ExpectedGasCosts{ @@ -138,7 +138,7 @@ func TestDimLogExtCodeCopyColdMemExpansion(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployExtCodeCopy) _, receipt := callOnContract(t, builder, auth, contract.ExtCodeCopyColdMemExpansion) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) extCodeCopyLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "EXTCODECOPY") expected := ExpectedGasCosts{ @@ -174,7 +174,7 @@ func TestDimLogExtCodeCopyWarmMemUnchanged(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployExtCodeCopy) _, receipt := callOnContract(t, builder, auth, contract.ExtCodeCopyWarmNoMemExpansion) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) extCodeCopyLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "EXTCODECOPY") expected := ExpectedGasCosts{ @@ -212,7 +212,7 @@ func TestDimLogExtCodeCopyWarmMemExpansion(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployExtCodeCopy) _, receipt := callOnContract(t, builder, auth, contract.ExtCodeCopyWarmMemExpansion) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) extCodeCopyLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "EXTCODECOPY") expected := ExpectedGasCosts{ diff --git a/system_tests/gas_dim_log_invalid_test.go b/system_tests/gas_dim_log_invalid_test.go index 35f90839dc..d4a42be945 100644 --- a/system_tests/gas_dim_log_invalid_test.go +++ b/system_tests/gas_dim_log_invalid_test.go @@ -48,7 +48,7 @@ func TestDimLogInvalid(t *testing.T) { receipt := EnsureTxFailed(t, ctx, builder.L2.Client, tx) CheckEqual(t, receipt.Status, types.ReceiptStatusFailed) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) invalidLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "INVALID") // the invalid log should be the absolute last log in the trace result @@ -103,7 +103,7 @@ func TestDimLogInvalidInTryCatch(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployInvalid) _, receipt := callOnContract(t, builder, auth, contract.RevertInTryCatch) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) revertLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "REVERT") // revert has memory expansion cost but it has 0 base cost @@ -129,7 +129,7 @@ func TestDimLogInvalidInTryCatchWithMemoryExpansion(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployInvalid) _, receipt := callOnContract(t, builder, auth, contract.RevertInTryCatchWithMemoryExpansion) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) revertLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "REVERT") // the memory expansion cost is 12 @@ -174,7 +174,7 @@ func TestDimLogRevert(t *testing.T) { receipt := EnsureTxFailed(t, ctx, builder.L2.Client, tx) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) revertLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "REVERT") // revert has memory expansion cost but it has 0 base cost @@ -216,7 +216,7 @@ func TestDimLogRevertWithMessage(t *testing.T) { receipt := EnsureTxFailed(t, ctx, builder.L2.Client, tx) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) revertLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "REVERT") // revert has memory expansion cost but it has 0 base cost @@ -261,7 +261,7 @@ func TestDimLogRevertWithMemoryExpansion(t *testing.T) { // Check the receipt status CheckEqual(t, receipt.Status, types.ReceiptStatusFailed) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) revertLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "REVERT") // the memory expansion cost is 12 @@ -304,7 +304,7 @@ func TestDimLogInvalidJump(t *testing.T) { receipt := EnsureTxFailed(t, ctx, builder.L2.Client, tx) CheckEqual(t, receipt.Status, types.ReceiptStatusFailed) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) // the invalid log should be the absolute last log in the trace result lastLog := traceResult.DimensionLogs[len(traceResult.DimensionLogs)-1] if lastLog.Op != "JUMP" { diff --git a/system_tests/gas_dim_log_log_test.go b/system_tests/gas_dim_log_log_test.go index 99d59f628f..849fdebac2 100644 --- a/system_tests/gas_dim_log_log_test.go +++ b/system_tests/gas_dim_log_log_test.go @@ -56,7 +56,7 @@ func TestDimLogLog0TopicsOnlyMemUnchanged(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployLogEmitter) _, receipt := callOnContract(t, builder, auth, contract.EmitZeroTopicEmptyData) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) log0Log := getSpecificDimensionLog(t, traceResult.DimensionLogs, "LOG0") expected := ExpectedGasCosts{ @@ -89,7 +89,7 @@ func TestDimLogLog0ExtraDataMemUnchanged(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployLogEmitter) _, receipt := callOnContract(t, builder, auth, contract.EmitZeroTopicNonEmptyData) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) log0Log := getSpecificDimensionLog(t, traceResult.DimensionLogs, "LOG0") var numBytesWritten uint64 = 7 @@ -126,7 +126,7 @@ func TestDimLogLog1TopicsOnlyMemUnchanged(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployLogEmitter) _, receipt := callOnContract(t, builder, auth, contract.EmitOneTopicEmptyData) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) log1Log := getSpecificDimensionLog(t, traceResult.DimensionLogs, "LOG1") var numTopics uint64 = 1 @@ -162,7 +162,7 @@ func TestDimLogLog1ExtraDataMemUnchanged(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployLogEmitter) _, receipt := callOnContract(t, builder, auth, contract.EmitOneTopicNonEmptyData) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) log1Log := getSpecificDimensionLog(t, traceResult.DimensionLogs, "LOG1") var numBytesWritten uint64 = 9 @@ -198,7 +198,7 @@ func TestDimLogLog2TopicsOnlyMemUnchanged(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployLogEmitter) _, receipt := callOnContract(t, builder, auth, contract.EmitTwoTopics) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) log2Log := getSpecificDimensionLog(t, traceResult.DimensionLogs, "LOG2") var numTopics uint64 = 2 @@ -236,7 +236,7 @@ func TestDimLogLog2ExtraDataMemUnchanged(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployLogEmitter) _, receipt := callOnContract(t, builder, auth, contract.EmitTwoTopicsExtraData) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) log2Log := getSpecificDimensionLog(t, traceResult.DimensionLogs, "LOG2") var numBytesWritten uint64 = 32 // address is 20 bytes, but encoded as a uint256 so 32 bytes @@ -272,7 +272,7 @@ func TestDimLogLog3TopicsOnlyMemUnchanged(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployLogEmitter) _, receipt := callOnContract(t, builder, auth, contract.EmitThreeTopics) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) log3Log := getSpecificDimensionLog(t, traceResult.DimensionLogs, "LOG3") var numTopics uint64 = 3 @@ -310,7 +310,7 @@ func TestDimLogLog3ExtraDataMemUnchanged(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployLogEmitter) _, receipt := callOnContract(t, builder, auth, contract.EmitThreeTopicsExtraData) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) log3Log := getSpecificDimensionLog(t, traceResult.DimensionLogs, "LOG3") var numBytesWritten uint64 = 32 @@ -346,7 +346,7 @@ func TestDimLogLog4TopicsOnlyMemUnchanged(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployLogEmitter) _, receipt := callOnContract(t, builder, auth, contract.EmitFourTopics) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) log4Log := getSpecificDimensionLog(t, traceResult.DimensionLogs, "LOG4") var numTopics uint64 = 4 @@ -384,7 +384,7 @@ func TestDimLogLog4ExtraDataMemUnchanged(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployLogEmitter) _, receipt := callOnContract(t, builder, auth, contract.EmitFourTopicsExtraData) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) log4Log := getSpecificDimensionLog(t, traceResult.DimensionLogs, "LOG4") var numBytesWritten uint64 = 32 @@ -441,7 +441,7 @@ func TestDimLogLog0ExtraDataMemExpansion(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployLogEmitter) _, receipt := callOnContract(t, builder, auth, contract.EmitZeroTopicNonEmptyDataAndMemExpansion) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) log0Log := getSpecificDimensionLog(t, traceResult.DimensionLogs, "LOG0") var numBytesWritten uint64 = 64 @@ -481,7 +481,7 @@ func TestDimLogLog1ExtraDataMemExpansion(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployLogEmitter) _, receipt := callOnContract(t, builder, auth, contract.EmitOneTopicNonEmptyDataAndMemExpansion) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) log1Log := getSpecificDimensionLog(t, traceResult.DimensionLogs, "LOG1") var numBytesWritten uint64 = 64 @@ -522,7 +522,7 @@ func TestDimLogLog2ExtraDataMemExpansion(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployLogEmitter) _, receipt := callOnContract(t, builder, auth, contract.EmitTwoTopicsExtraDataAndMemExpansion) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) log2Log := getSpecificDimensionLog(t, traceResult.DimensionLogs, "LOG2") var numBytesWritten uint64 = 64 @@ -563,7 +563,7 @@ func TestDimLogLog3ExtraDataMemExpansion(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployLogEmitter) _, receipt := callOnContract(t, builder, auth, contract.EmitThreeTopicsExtraDataAndMemExpansion) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) log3Log := getSpecificDimensionLog(t, traceResult.DimensionLogs, "LOG3") var numBytesWritten uint64 = 64 @@ -604,7 +604,7 @@ func TestDimLogLog4ExtraDataMemExpansion(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployLogEmitter) _, receipt := callOnContract(t, builder, auth, contract.EmitFourTopicsExtraDataAndMemExpansion) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) log4Log := getSpecificDimensionLog(t, traceResult.DimensionLogs, "LOG4") var numBytesWritten uint64 = 64 diff --git a/system_tests/gas_dim_log_precompiles_test.go b/system_tests/gas_dim_log_precompiles_test.go index 50bb172a14..6260938d37 100644 --- a/system_tests/gas_dim_log_precompiles_test.go +++ b/system_tests/gas_dim_log_precompiles_test.go @@ -25,7 +25,7 @@ func TestDimLogArbSysBlockNumberForSload(t *testing.T) { _, receipt := callOnContract(t, builder, auth, precompileTestContract.TestArbSysArbBlockNumber) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) // We expect an SLOAD with 0 gas, which is the SLOAD fired inside the precompile @@ -76,7 +76,7 @@ func TestDimLogActivateProgramForSstoreAndCall(t *testing.T) { receipt, err := EnsureTxSucceeded(ctx, l2client, tx) Require(t, err) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) // We expect an SSTORE with 0 gas, which is the SSTORE fired inside the precompile sstoreLog := getSpecificDimensionLogAtIndex(t, traceResult.DimensionLogs, "SSTORE", 4, 1) diff --git a/system_tests/gas_dim_log_read_call_test.go b/system_tests/gas_dim_log_read_call_test.go index 141b95f19a..4dad787ac1 100644 --- a/system_tests/gas_dim_log_read_call_test.go +++ b/system_tests/gas_dim_log_read_call_test.go @@ -57,7 +57,7 @@ func TestDimLogDelegateCallColdNoCodeMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, delegateCaller.TestDelegateCallEmptyCold, emptyAccountAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) delegateCallLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "DELEGATECALL") expected := ExpectedGasCosts{ @@ -93,7 +93,7 @@ func TestDimLogDelegateCallWarmNoCodeMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, delegateCaller.TestDelegateCallEmptyWarm, emptyAccountAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) delegateCallLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "DELEGATECALL") expected := ExpectedGasCosts{ @@ -131,7 +131,7 @@ func TestDimLogDelegateCallColdContractMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, delegateCaller.TestDelegateCallNonEmptyCold, delegateCalleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) delegateCallLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "DELEGATECALL") expected := ExpectedGasCosts{ @@ -169,7 +169,7 @@ func TestDimLogDelegateCallWarmContractMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, delegateCaller.TestDelegateCallNonEmptyWarm, delegateCalleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) delegateCallLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "DELEGATECALL") expected := ExpectedGasCosts{ @@ -208,7 +208,7 @@ func TestDimLogDelegateCallColdNoCodeMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, delegateCaller.TestDelegateCallEmptyColdMemExpansion, emptyAccountAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) delegateCallLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "DELEGATECALL") expected := ExpectedGasCosts{ @@ -245,7 +245,7 @@ func TestDimLogDelegateCallWarmNoCodeMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, delegateCaller.TestDelegateCallEmptyWarmMemExpansion, emptyAccountAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) delegateCallLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "DELEGATECALL") expected := ExpectedGasCosts{ @@ -284,7 +284,7 @@ func TestDimLogDelegateCallColdContractMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, delegateCaller.TestDelegateCallNonEmptyColdMemExpansion, delegateCalleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) delegateCallLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "DELEGATECALL") expected := ExpectedGasCosts{ @@ -323,7 +323,7 @@ func TestDimLogDelegateCallWarmContractMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, delegateCaller.TestDelegateCallNonEmptyWarmMemExpansion, delegateCalleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) delegateCallLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "DELEGATECALL") expected := ExpectedGasCosts{ @@ -357,7 +357,7 @@ func TestDimLogStaticCallColdNoCodeMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, staticCaller.TestStaticCallEmptyCold, emptyAccountAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) staticCallLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "STATICCALL") expected := ExpectedGasCosts{ @@ -391,7 +391,7 @@ func TestDimLogStaticCallWarmNoCodeMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, staticCaller.TestStaticCallEmptyWarm, emptyAccountAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) staticCallLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "STATICCALL") expected := ExpectedGasCosts{ @@ -424,7 +424,7 @@ func TestDimLogStaticCallColdContractMemUnchanged(t *testing.T) { staticCalleeAddress, _ := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployStaticCallee) receipt := callOnContractWithOneArg(t, builder, auth, staticCaller.TestStaticCallNonEmptyCold, staticCalleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) staticCallLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "STATICCALL") expected := ExpectedGasCosts{ @@ -457,7 +457,7 @@ func TestDimLogStaticCallWarmContractMemUnchanged(t *testing.T) { staticCalleeAddress, _ := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployStaticCallee) receipt := callOnContractWithOneArg(t, builder, auth, staticCaller.TestStaticCallNonEmptyWarm, staticCalleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) staticCallLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "STATICCALL") expected := ExpectedGasCosts{ @@ -492,7 +492,7 @@ func TestDimLogStaticCallColdNoCodeMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, staticCaller.TestStaticCallEmptyColdMemExpansion, emptyAccountAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) staticCallLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "STATICCALL") expected := ExpectedGasCosts{ @@ -527,7 +527,7 @@ func TestDimLogStaticCallWarmNoCodeMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, staticCaller.TestStaticCallEmptyWarmMemExpansion, emptyAccountAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) staticCallLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "STATICCALL") expected := ExpectedGasCosts{ @@ -562,7 +562,7 @@ func TestDimLogStaticCallColdContractMemExpansion(t *testing.T) { staticCalleeAddress, _ := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployStaticCallee) receipt := callOnContractWithOneArg(t, builder, auth, staticCaller.TestStaticCallNonEmptyColdMemExpansion, staticCalleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) staticCallLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "STATICCALL") expected := ExpectedGasCosts{ @@ -597,7 +597,7 @@ func TestDimLogStaticCallWarmContractMemExpansion(t *testing.T) { staticCalleeAddress, _ := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployStaticCallee) receipt := callOnContractWithOneArg(t, builder, auth, staticCaller.TestStaticCallNonEmptyWarmMemExpansion, staticCalleeAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) staticCallLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "STATICCALL") expected := ExpectedGasCosts{ diff --git a/system_tests/gas_dim_log_selfdestruct_test.go b/system_tests/gas_dim_log_selfdestruct_test.go index cf4c00fd0a..ad34b0e4a7 100644 --- a/system_tests/gas_dim_log_selfdestruct_test.go +++ b/system_tests/gas_dim_log_selfdestruct_test.go @@ -54,7 +54,7 @@ func TestDimLogSelfdestructColdNoTransferVirgin(t *testing.T) { // call selfDestructor.warmSelfDestructor(0xdeadbeef) receipt := callOnContractWithOneArg(t, builder, auth, selfDestructor.SelfDestruct, emptyAccountAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) selfDestructLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "SELFDESTRUCT") expected := ExpectedGasCosts{ @@ -93,7 +93,7 @@ func TestDimLogSelfdestructColdNoTransferFunded(t *testing.T) { // call selfDestructor.warmSelfDestructor(payableCounterAddress) receipt := callOnContractWithOneArg(t, builder, auth, selfDestructor.SelfDestruct, payableCounterAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) selfDestructLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "SELFDESTRUCT") expected := ExpectedGasCosts{ @@ -132,7 +132,7 @@ func TestDimLogSelfdestructColdPayingVirgin(t *testing.T) { // call selfDestructor.SelfDestruct(emptyAccountAddress) - which is cold receipt := callOnContractWithOneArg(t, builder, auth, selfDestructor.SelfDestruct, emptyAccountAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) selfDestructLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "SELFDESTRUCT") expected := ExpectedGasCosts{ @@ -172,7 +172,7 @@ func TestDimLogSelfdestructColdPayingFunded(t *testing.T) { // call selfDestructor.SelfDestruct(emptyAccountAddress) - which is cold receipt := callOnContractWithOneArg(t, builder, auth, selfDestructor.SelfDestruct, emptyAccount) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) selfDestructLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "SELFDESTRUCT") expected := ExpectedGasCosts{ @@ -207,7 +207,7 @@ func TestDimLogSelfdestructWarmNoTransferVirgin(t *testing.T) { // call selfDestructor.warmSelfDestructor(0xdeadbeef) receipt := callOnContractWithOneArg(t, builder, auth, selfDestructor.WarmEmptySelfDestructor, emptyAccountAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) selfDestructLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "SELFDESTRUCT") expected := ExpectedGasCosts{ @@ -246,7 +246,7 @@ func TestDimLogSelfdestructWarmNoTransferFunded(t *testing.T) { // call selfDestructor.warmSelfDestructor(payableCounterAddress) receipt := callOnContractWithOneArg(t, builder, auth, selfDestructor.WarmSelfDestructor, payableCounterAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) selfDestructLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "SELFDESTRUCT") expected := ExpectedGasCosts{ @@ -285,7 +285,7 @@ func TestDimLogSelfdestructWarmPayingVirgin(t *testing.T) { // call selfDestructor.warmSelfDestructor(0xdeadbeef) receipt := callOnContractWithOneArg(t, builder, auth, selfDestructor.WarmEmptySelfDestructor, emptyAccountAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) selfDestructLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "SELFDESTRUCT") expected := ExpectedGasCosts{ @@ -323,7 +323,7 @@ func TestDimLogSelfdestructWarmPayingFunded(t *testing.T) { // call selfDestructor.warmSelfDestructor(payableCounterAddress) receipt := callOnContractWithOneArg(t, builder, auth, selfDestructor.WarmSelfDestructor, payableCounterAddress) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) selfDestructLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "SELFDESTRUCT") expected := ExpectedGasCosts{ diff --git a/system_tests/gas_dim_log_sstore_test.go b/system_tests/gas_dim_log_sstore_test.go index e4244c145f..6856a650b4 100644 --- a/system_tests/gas_dim_log_sstore_test.go +++ b/system_tests/gas_dim_log_sstore_test.go @@ -49,7 +49,7 @@ func TestDimLogSstoreColdZeroToZero(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySstore) _, receipt := callOnContract(t, builder, auth, contract.SstoreColdZeroToZero) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) sstoreLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "SSTORE") expected := ExpectedGasCosts{ @@ -79,7 +79,7 @@ func TestDimLogSstoreColdZeroToNonZeroValue(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySstore) _, receipt := callOnContract(t, builder, auth, contract.SstoreColdZeroToNonZero) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) sstoreLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "SSTORE") expected := ExpectedGasCosts{ @@ -109,7 +109,7 @@ func TestDimLogSstoreColdNonZeroValueToZero(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySstore) _, receipt := callOnContract(t, builder, auth, contract.SstoreColdNonZeroValueToZero) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) sstoreLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "SSTORE") expected := ExpectedGasCosts{ @@ -140,7 +140,7 @@ func TestDimLogSstoreColdNonZeroToSameNonZeroValue(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySstore) _, receipt := callOnContract(t, builder, auth, contract.SstoreColdNonZeroToSameNonZeroValue) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) sstoreLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "SSTORE") expected := ExpectedGasCosts{ @@ -171,7 +171,7 @@ func TestDimLogSstoreColdNonZeroToDifferentNonZeroValue(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySstore) _, receipt := callOnContract(t, builder, auth, contract.SstoreColdNonZeroToDifferentNonZeroValue) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) sstoreLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "SSTORE") expected := ExpectedGasCosts{ @@ -200,7 +200,7 @@ func TestDimLogSstoreWarmZeroToZero(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySstore) _, receipt := callOnContract(t, builder, auth, contract.SstoreWarmZeroToZero) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) sstoreLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "SSTORE") expected := ExpectedGasCosts{ @@ -229,7 +229,7 @@ func TestDimLogSstoreWarmZeroToNonZeroValue(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySstore) _, receipt := callOnContract(t, builder, auth, contract.SstoreWarmZeroToNonZeroValue) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) sstoreLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "SSTORE") expected := ExpectedGasCosts{ @@ -259,7 +259,7 @@ func TestDimLogSstoreWarmNonZeroValueToZero(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySstore) _, receipt := callOnContract(t, builder, auth, contract.SstoreWarmNonZeroValueToZero) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) sstoreLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "SSTORE") expected := ExpectedGasCosts{ @@ -289,7 +289,7 @@ func TestDimLogSstoreWarmNonZeroToSameNonZeroValue(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySstore) _, receipt := callOnContract(t, builder, auth, contract.SstoreWarmNonZeroToSameNonZeroValue) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) sstoreLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "SSTORE") expected := ExpectedGasCosts{ @@ -319,7 +319,7 @@ func TestDimLogSstoreWarmNonZeroToDifferentNonZeroValue(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySstore) _, receipt := callOnContract(t, builder, auth, contract.SstoreWarmNonZeroToDifferentNonZeroValue) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) sstoreLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "SSTORE") expected := ExpectedGasCosts{ @@ -352,7 +352,7 @@ func TestDimLogSstoreMultipleWarmNonZeroToNonZeroToNonZero(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySstore) _, receipt := callOnContract(t, builder, auth, contract.SstoreMultipleWarmNonZeroToNonZeroToNonZero) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) sstoreLog := getLastOfTwoDimensionLogs(t, traceResult.DimensionLogs, "SSTORE") expected := ExpectedGasCosts{ @@ -386,7 +386,7 @@ func TestDimLogSstoreMultipleWarmNonZeroToNonZeroToSameNonZero(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySstore) _, receipt := callOnContract(t, builder, auth, contract.SstoreMultipleWarmNonZeroToNonZeroToSameNonZero) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) sstoreLog := getLastOfTwoDimensionLogs(t, traceResult.DimensionLogs, "SSTORE") expected := ExpectedGasCosts{ @@ -421,7 +421,7 @@ func TestDimLogSstoreMultipleWarmNonZeroToZeroToNonZero(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySstore) _, receipt := callOnContract(t, builder, auth, contract.SstoreMultipleWarmNonZeroToZeroToNonZero) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) sstoreLog := getLastOfTwoDimensionLogs(t, traceResult.DimensionLogs, "SSTORE") expected := ExpectedGasCosts{ @@ -456,7 +456,7 @@ func TestDimLogSstoreMultipleWarmNonZeroToZeroToSameNonZero(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySstore) _, receipt := callOnContract(t, builder, auth, contract.SstoreMultipleWarmNonZeroToZeroToSameNonZero) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) sstoreLog := getLastOfTwoDimensionLogs(t, traceResult.DimensionLogs, "SSTORE") expected := ExpectedGasCosts{ @@ -489,7 +489,7 @@ func TestDimLogSstoreMultipleWarmZeroToNonZeroToNonZero(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySstore) _, receipt := callOnContract(t, builder, auth, contract.SstoreMultipleWarmZeroToNonZeroToNonZero) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) sstoreLog := getLastOfTwoDimensionLogs(t, traceResult.DimensionLogs, "SSTORE") expected := ExpectedGasCosts{ @@ -523,7 +523,7 @@ func TestDimLogSstoreMultipleWarmZeroToNonZeroBackToZero(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySstore) _, receipt := callOnContract(t, builder, auth, contract.SstoreMultipleWarmZeroToNonZeroBackToZero) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) sstoreLog := getLastOfTwoDimensionLogs(t, traceResult.DimensionLogs, "SSTORE") expected := ExpectedGasCosts{ diff --git a/system_tests/gas_dim_log_state_lookup_test.go b/system_tests/gas_dim_log_state_lookup_test.go index 8bfb3d3183..a73bfdbb93 100644 --- a/system_tests/gas_dim_log_state_lookup_test.go +++ b/system_tests/gas_dim_log_state_lookup_test.go @@ -40,7 +40,7 @@ func TestDimLogBalanceCold(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployBalance) _, receipt := callOnContract(t, builder, auth, contract.CallBalanceCold) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) balanceLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "BALANCE") expected := ExpectedGasCosts{ @@ -72,7 +72,7 @@ func TestDimLogBalanceWarm(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployBalance) _, receipt := callOnContract(t, builder, auth, contract.CallBalanceWarm) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) balanceLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "BALANCE") expected := ExpectedGasCosts{ @@ -109,7 +109,7 @@ func TestDimLogExtCodeSizeCold(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployExtCodeSize) _, receipt := callOnContract(t, builder, auth, contract.GetExtCodeSizeCold) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) extCodeSizeLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "EXTCODESIZE") expected := ExpectedGasCosts{ @@ -141,7 +141,7 @@ func TestDimLogExtCodeSizeWarm(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployExtCodeSize) _, receipt := callOnContract(t, builder, auth, contract.GetExtCodeSizeWarm) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) extCodeSizeLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "EXTCODESIZE") expected := ExpectedGasCosts{ @@ -178,7 +178,7 @@ func TestDimLogExtCodeHashCold(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployExtCodeHash) _, receipt := callOnContract(t, builder, auth, contract.GetExtCodeHashCold) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) extCodeHashLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "EXTCODEHASH") expected := ExpectedGasCosts{ @@ -210,7 +210,7 @@ func TestDimLogExtCodeHashWarm(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployExtCodeHash) _, receipt := callOnContract(t, builder, auth, contract.GetExtCodeHashWarm) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) extCodeHashLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "EXTCODEHASH") expected := ExpectedGasCosts{ @@ -250,7 +250,7 @@ func TestDimLogSloadCold(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySload) _, receipt := callOnContract(t, builder, auth, contract.ColdSload) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) sloadLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "SLOAD") expected := ExpectedGasCosts{ @@ -283,7 +283,7 @@ func TestDimLogSloadWarm(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySload) _, receipt := callOnContract(t, builder, auth, contract.WarmSload) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) sloadLog := getSpecificDimensionLog(t, traceResult.DimensionLogs, "SLOAD") expected := ExpectedGasCosts{ diff --git a/system_tests/gas_dim_log_stylus_test.go b/system_tests/gas_dim_log_stylus_test.go index b532986c77..2cdcd42b76 100644 --- a/system_tests/gas_dim_log_stylus_test.go +++ b/system_tests/gas_dim_log_stylus_test.go @@ -25,7 +25,7 @@ func TestDimLogStylusKeccakForSload(t *testing.T) { receipt, err := EnsureTxSucceeded(ctx, l2client, tx) Require(t, err) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) // We expect an SLOAD with 0 gas, which is the SLOAD fired inside the precompile @@ -63,7 +63,7 @@ func TestDimLogStylusKeccakForSloadFromProxy(t *testing.T) { receipt, err := EnsureTxSucceeded(ctx, l2client, tx) Require(t, err) - traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder, receipt.TxHash) + traceResult := callDebugTraceTransactionWithLogger(t, ctx, builder.L2, receipt.TxHash) // We expect an SLOAD with 0 gas, which is the SLOAD fired inside the precompile sloadLog := getLastOfTwoDimensionLogs(t, traceResult.DimensionLogs, "SLOAD") diff --git a/system_tests/gas_dim_tx_op_a_common_test.go b/system_tests/gas_dim_tx_op_a_common_test.go index 708ee57742..354a11d852 100644 --- a/system_tests/gas_dim_tx_op_a_common_test.go +++ b/system_tests/gas_dim_tx_op_a_common_test.go @@ -5,14 +5,15 @@ package arbtest import ( "context" - "encoding/json" "fmt" "testing" + "time" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/eth/tracers/native" + "github.com/offchainlabs/nitro/arbnode" "github.com/offchainlabs/nitro/solgen/go/gas_dimensionsgen" ) @@ -24,18 +25,53 @@ type OpcodeSumTraceResult = native.TxGasDimensionByOpcodeExecutionResult // ######################################################################################################### // ######################################################################################################### -// this test tests if the tracer calculates the same gas -// used for a transaction as the TX receipt, for -// computation-only opcodes. -func TestDimTxOpComputationOnlyOpcodes(t *testing.T) { +// Core test function that tests if the tracer calculates the same gas +// used for a transaction as the TX receipt, for computation-only opcodes. +// Runs on a replica node with the specified execution client mode. +func testDimTxOpComputationOnlyOpcodes(t *testing.T, executionClientMode ExecutionClientMode) { ctx, cancel, builder, auth, cleanup := gasDimensionTestSetup(t, false) defer cancel() defer cleanup() + // Build replica node with specified execution client mode + replicaConfig := arbnode.ConfigDefaultL1NonSequencerTest() + replicaParams := &SecondNodeParams{ + nodeConfig: replicaConfig, + useExecutionClientOnly: true, + executionClientMode: executionClientMode, + } + replicaTestClient, replicaCleanup := builder.Build2ndNode(t, replicaParams) + defer replicaCleanup() + _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployCounter) _, receipt := callOnContract(t, builder, auth, contract.NoSpecials) - TxOpTraceAndCheck(t, ctx, builder, receipt) + // Wait for replica to sync the transaction + _, err := WaitForTx(ctx, replicaTestClient.Client, receipt.TxHash, time.Second*15) + Require(t, err) + + // Call trace and check on the replica + TxOpTraceAndCheck(t, ctx, replicaTestClient, receipt) +} + +// TestDimTxOpComputationOnlyOpcodesInternal tests with internal geth execution client on a replica node +func TestDimTxOpComputationOnlyOpcodesInternal(t *testing.T) { + testDimTxOpComputationOnlyOpcodes(t, ExecutionClientModeInternal) +} + +// TestDimTxOpComputationOnlyOpcodesExternal tests with external Nethermind execution client on a replica node +// Requires Nethermind to be running with environment variables: +// - PR_NETH_RPC_CLIENT_URL (default: http://localhost:20545) +// - PR_NETH_WS_CLIENT_URL (default: ws://localhost:28551) +func TestDimTxOpComputationOnlyOpcodesExternal(t *testing.T) { + testDimTxOpComputationOnlyOpcodes(t, ExecutionClientModeExternal) +} + +// TestDimTxOpComputationOnlyOpcodesComparison tests comparing internal geth and external Nethermind on a replica node +// Runs both execution clients in parallel and compares all results for correctness +// Requires Nethermind to be running (same as TestDimTxOpComputationOnlyOpcodesExternal) +func TestDimTxOpComputationOnlyOpcodesComparison(t *testing.T) { + testDimTxOpComputationOnlyOpcodes(t, ExecutionClientModeComparison) } // ######################################################################################################### @@ -49,26 +85,20 @@ func TestDimTxOpComputationOnlyOpcodes(t *testing.T) { func callDebugTraceTransactionWithTxGasDimensionByOpcodeTracer( t *testing.T, ctx context.Context, - builder *NodeBuilder, + testClient *TestClient, txHash common.Hash, ) OpcodeSumTraceResult { t.Helper() - // Call debug_traceTransaction with txGasDimensionLogger tracer - rpcClient := builder.L2.ConsensusNode.Stack.Attach() - var result json.RawMessage - err := rpcClient.CallContext(ctx, &result, "debug_traceTransaction", txHash, map[string]interface{}{ + + // Call debug_traceTransaction via the execution client (geth, nethermind, or comparison) + tracerConfig := map[string]interface{}{ "tracer": "txGasDimensionByOpcode", "tracerConfig": map[string]interface{}{ "debug": true, }, - }) - Require(t, err) - - // Parse the result - var traceResult OpcodeSumTraceResult - if err := json.Unmarshal(result, &traceResult); err != nil { - Fatal(t, err) } + traceResult, err := testClient.DebugTraceTransactionByOpcode(ctx, txHash, tracerConfig) + Require(t, err) // Validate basic structure if traceResult.GasUsed == 0 { @@ -123,8 +153,8 @@ func sumUpDimensionalGasCosts( } // basically all of the TxOp tests do the same checks, the only difference is the setup. -func TxOpTraceAndCheck(t *testing.T, ctx context.Context, builder *NodeBuilder, receipt *types.Receipt) { - traceResult := callDebugTraceTransactionWithTxGasDimensionByOpcodeTracer(t, ctx, builder, receipt.TxHash) +func TxOpTraceAndCheck(t *testing.T, ctx context.Context, testClient *TestClient, receipt *types.Receipt) { + traceResult := callDebugTraceTransactionWithTxGasDimensionByOpcodeTracer(t, ctx, testClient, receipt.TxHash) if receipt.Status != traceResult.Status { Fatal(t, "Transaction success/failure status mismatch", receipt.Status, traceResult.Status) diff --git a/system_tests/gas_dim_tx_op_call_test.go b/system_tests/gas_dim_tx_op_call_test.go index f9ac57d2af..a75090bee6 100644 --- a/system_tests/gas_dim_tx_op_call_test.go +++ b/system_tests/gas_dim_tx_op_call_test.go @@ -48,7 +48,7 @@ func TestDimTxOpCallColdNoTransferNoCodeVirginMemUnchanged(t *testing.T) { noCodeVirginAddress := common.HexToAddress("0x00000000000000000000000000000000DeaDBeef") receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdNoTransferMemUnchanged, noCodeVirginAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -64,7 +64,7 @@ func TestDimTxOpCallColdNoTransferNoCodeVirginMemExpansion(t *testing.T) { noCodeVirginAddress := common.HexToAddress("0x00000000000000000000000000000000DeaDBeef") receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdNoTransferMemExpansion, noCodeVirginAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -83,7 +83,7 @@ func TestDimTxOpCallColdNoTransferNoCodeFundedMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdNoTransferMemUnchanged, calleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -102,7 +102,7 @@ func TestDimTxOpCallColdNoTransferNoCodeFundedMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdNoTransferMemExpansion, calleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -118,7 +118,7 @@ func TestDimTxOpCallColdNoTransferContractFundedMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdNoTransferMemUnchanged, calleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -134,7 +134,7 @@ func TestDimTxOpCallColdNoTransferContractFundedMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdNoTransferMemExpansion, calleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -152,7 +152,7 @@ func TestDimTxOpCallColdPayingNoCodeVirginMemUnchanged(t *testing.T) { noCodeVirginAddress := common.HexToAddress("0x00000000000000000000000000000000DeaDBeef") receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdPayableMemUnchanged, noCodeVirginAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -170,7 +170,7 @@ func TestDimTxOpCallColdPayingNoCodeVirginMemExpansion(t *testing.T) { noCodeVirginAddress := common.HexToAddress("0x00000000000000000000000000000000DeaDBeef") receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdPayableMemExpansion, noCodeVirginAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -188,7 +188,7 @@ func TestDimTxOpCallColdPayingNoCodeFundedMemUnchanged(t *testing.T) { builder.L2.TransferBalanceTo(t, "Owner", noCodeFundedAddress, big.NewInt(1e17), builder.L2Info) receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdPayableMemUnchanged, noCodeFundedAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -206,7 +206,7 @@ func TestDimTxOpCallColdPayingNoCodeFundedMemExpansion(t *testing.T) { builder.L2.TransferBalanceTo(t, "Owner", noCodeFundedAddress, big.NewInt(1e17), builder.L2Info) receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdPayableMemExpansion, noCodeFundedAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -227,7 +227,7 @@ func TestDimTxOpCallColdPayingContractFundedMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdPayableMemUnchanged, calleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -248,7 +248,7 @@ func TestDimTxOpCallColdPayingContractFundedMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdPayableMemExpansion, calleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -264,7 +264,7 @@ func TestDimTxOpCallWarmNoTransferNoCodeVirginMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmNoTransferMemUnchanged, noCodeVirginAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -280,7 +280,7 @@ func TestDimTxOpCallWarmNoTransferNoCodeVirginMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmNoTransferMemExpansion, noCodeVirginAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -299,7 +299,7 @@ func TestDimTxOpCallWarmNoTransferNoCodeFundedMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmNoTransferMemUnchanged, calleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -318,7 +318,7 @@ func TestDimTxOpCallWarmNoTransferNoCodeFundedMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmNoTransferMemExpansion, calleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -334,7 +334,7 @@ func TestDimTxOpCallWarmNoTransferContractFundedMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmNoTransferMemUnchanged, calleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -353,7 +353,7 @@ func TestDimTxOpCallWarmNoTransferContractFundedMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmNoTransferMemExpansion, calleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -373,7 +373,7 @@ func TestDimTxOpCallWarmPayingNoCodeVirginMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmPayableMemUnchanged, noCodeVirginAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -393,7 +393,7 @@ func TestDimTxOpCallWarmPayingNoCodeVirginMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmPayableMemExpansion, noCodeVirginAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -414,7 +414,7 @@ func TestDimTxOpCallWarmPayingNoCodeFundedMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmPayableMemUnchanged, noCodeFundedAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -435,7 +435,7 @@ func TestDimTxOpCallWarmPayingNoCodeFundedMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmPayableMemExpansion, noCodeFundedAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -456,7 +456,7 @@ func TestDimTxOpCallWarmPayingContractFundedMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmPayableMemUnchanged, calleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -477,7 +477,7 @@ func TestDimTxOpCallWarmPayingContractFundedMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmPayableMemExpansion, calleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // ######################################################################################################### @@ -507,7 +507,7 @@ func TestDimTxOpCallCodeColdNoTransferNoCodeVirginMemUnchanged(t *testing.T) { noCodeVirginAddress := common.HexToAddress("0x00000000000000000000000000000000DeaDBeef") receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdNoTransferMemUnchanged, noCodeVirginAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -523,7 +523,7 @@ func TestDimTxOpCallCodeColdNoTransferNoCodeVirginMemExpansion(t *testing.T) { noCodeVirginAddress := common.HexToAddress("0x00000000000000000000000000000000DeaDBeef") receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdNoTransferMemExpansion, noCodeVirginAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -542,7 +542,7 @@ func TestDimTxOpCallCodeColdNoTransferNoCodeFundedMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdNoTransferMemUnchanged, calleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -561,7 +561,7 @@ func TestDimTxOpCallCodeColdNoTransferNoCodeFundedMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdNoTransferMemExpansion, calleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -577,7 +577,7 @@ func TestDimTxOpCallCodeColdNoTransferContractFundedMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdNoTransferMemUnchanged, calleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -593,7 +593,7 @@ func TestDimTxOpCallCodeColdNoTransferContractFundedMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdNoTransferMemExpansion, calleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -611,7 +611,7 @@ func TestDimTxOpCallCodeColdPayingNoCodeVirginMemUnchanged(t *testing.T) { noCodeVirginAddress := common.HexToAddress("0x00000000000000000000000000000000DeaDBeef") receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdPayableMemUnchanged, noCodeVirginAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -629,7 +629,7 @@ func TestDimTxOpCallCodeColdPayingNoCodeVirginMemExpansion(t *testing.T) { noCodeVirginAddress := common.HexToAddress("0x00000000000000000000000000000000DeaDBeef") receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdPayableMemExpansion, noCodeVirginAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -647,7 +647,7 @@ func TestDimTxOpCallCodeColdPayingNoCodeFundedMemUnchanged(t *testing.T) { builder.L2.TransferBalanceTo(t, "Owner", noCodeFundedAddress, big.NewInt(1e17), builder.L2Info) receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdPayableMemUnchanged, noCodeFundedAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -665,7 +665,7 @@ func TestDimTxOpCallCodeColdPayingNoCodeFundedMemExpansion(t *testing.T) { builder.L2.TransferBalanceTo(t, "Owner", noCodeFundedAddress, big.NewInt(1e17), builder.L2Info) receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdPayableMemExpansion, noCodeFundedAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -686,7 +686,7 @@ func TestDimTxOpCallCodeColdPayingContractFundedMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdPayableMemUnchanged, calleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -707,7 +707,7 @@ func TestDimTxOpCallCodeColdPayingContractFundedMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.ColdPayableMemExpansion, calleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -723,7 +723,7 @@ func TestDimTxOpCallCodeWarmNoTransferNoCodeVirginMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmNoTransferMemUnchanged, noCodeVirginAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -739,7 +739,7 @@ func TestDimTxOpCallCodeWarmNoTransferNoCodeVirginMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmNoTransferMemExpansion, noCodeVirginAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -758,7 +758,7 @@ func TestDimTxOpCallCodeWarmNoTransferNoCodeFundedMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmNoTransferMemUnchanged, calleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -777,7 +777,7 @@ func TestDimTxOpCallCodeWarmNoTransferNoCodeFundedMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmNoTransferMemExpansion, calleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -793,7 +793,7 @@ func TestDimTxOpCallCodeWarmNoTransferContractFundedMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmNoTransferMemUnchanged, calleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -812,7 +812,7 @@ func TestDimTxOpCallCodeWarmNoTransferContractFundedMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmNoTransferMemExpansion, calleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -832,7 +832,7 @@ func TestDimTxOpCallCodeWarmPayingNoCodeVirginMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmPayableMemUnchanged, noCodeVirginAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -852,7 +852,7 @@ func TestDimTxOpCallCodeWarmPayingNoCodeVirginMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmPayableMemExpansion, noCodeVirginAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -873,7 +873,7 @@ func TestDimTxOpCallCodeWarmPayingNoCodeFundedMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmPayableMemUnchanged, noCodeFundedAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -894,7 +894,7 @@ func TestDimTxOpCallCodeWarmPayingNoCodeFundedMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmPayableMemExpansion, noCodeFundedAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -915,7 +915,7 @@ func TestDimTxOpCallCodeWarmPayingContractFundedMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmPayableMemUnchanged, calleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -936,7 +936,7 @@ func TestDimTxOpCallCodeWarmPayingContractFundedMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.WarmPayableMemExpansion, calleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // This tests a call that does another call, @@ -951,5 +951,5 @@ func TestDimTxOpCallNestedCall(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, caller.Entrypoint, calleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } diff --git a/system_tests/gas_dim_tx_op_create_test.go b/system_tests/gas_dim_tx_op_create_test.go index a67e40dded..d27cd2fd2e 100644 --- a/system_tests/gas_dim_tx_op_create_test.go +++ b/system_tests/gas_dim_tx_op_create_test.go @@ -35,7 +35,7 @@ func TestDimTxOpCreateNoTransferMemUnchanged(t *testing.T) { _, receipt := callOnContract(t, builder, auth, creator.CreateNoTransferMemUnchanged) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -50,7 +50,7 @@ func TestDimTxOpCreateNoTransferMemExpansion(t *testing.T) { _, receipt := callOnContract(t, builder, auth, creator.CreateNoTransferMemExpansion) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -67,7 +67,7 @@ func TestDimTxOpCreatePayingMemUnchanged(t *testing.T) { _, receipt := callOnContract(t, builder, auth, creator.CreatePayableMemUnchanged) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -84,7 +84,7 @@ func TestDimTxOpCreatePayingMemExpansion(t *testing.T) { _, receipt := callOnContract(t, builder, auth, creator.CreatePayableMemExpansion) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // ######################################################################################################### @@ -103,7 +103,7 @@ func TestDimTxOpCreate2NoTransferMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, creator.CreateTwoNoTransferMemUnchanged, [32]byte{0x13, 0x37}) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -118,7 +118,7 @@ func TestDimTxOpCreate2NoTransferMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, creator.CreateTwoNoTransferMemExpansion, [32]byte{0x13, 0x37}) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -133,7 +133,7 @@ func TestDimTxOpCreate2PayingMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, creator.CreateTwoNoTransferMemUnchanged, [32]byte{0x13, 0x37}) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -150,5 +150,5 @@ func TestDimTxOpCreate2PayingMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, creator.CreateTwoPayableMemExpansion, [32]byte{0x13, 0x37}) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } diff --git a/system_tests/gas_dim_tx_op_extcodecopy_test.go b/system_tests/gas_dim_tx_op_extcodecopy_test.go index 6bcc972c70..606fbe5308 100644 --- a/system_tests/gas_dim_tx_op_extcodecopy_test.go +++ b/system_tests/gas_dim_tx_op_extcodecopy_test.go @@ -34,7 +34,7 @@ func TestDimTxOpExtCodeCopyColdMemUnchanged(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployExtCodeCopy) _, receipt := callOnContract(t, builder, auth, contract.ExtCodeCopyColdNoMemExpansion) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -49,7 +49,7 @@ func TestDimTxOpExtCodeCopyColdMemExpansion(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployExtCodeCopy) _, receipt := callOnContract(t, builder, auth, contract.ExtCodeCopyColdMemExpansion) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -64,7 +64,7 @@ func TestDimTxOpExtCodeCopyWarmMemUnchanged(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployExtCodeCopy) _, receipt := callOnContract(t, builder, auth, contract.ExtCodeCopyWarmNoMemExpansion) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -79,5 +79,5 @@ func TestDimTxOpExtCodeCopyWarmMemExpansion(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployExtCodeCopy) _, receipt := callOnContract(t, builder, auth, contract.ExtCodeCopyWarmMemExpansion) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } diff --git a/system_tests/gas_dim_tx_op_invalid_test.go b/system_tests/gas_dim_tx_op_invalid_test.go index 53360aec7a..44d36ff554 100644 --- a/system_tests/gas_dim_tx_op_invalid_test.go +++ b/system_tests/gas_dim_tx_op_invalid_test.go @@ -51,7 +51,7 @@ func TestDimTxOpInvalid(t *testing.T) { CheckEqual(t, receipt.Status, types.ReceiptStatusFailed) // Check the trace result - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // this test tests a transaction that has a revert @@ -65,7 +65,7 @@ func TestDimTxOpRevertInTryCatch(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployInvalid) _, receipt := callOnContract(t, builder, auth, contract.RevertInTryCatch) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // this test tests a transaction that has a revert @@ -80,7 +80,7 @@ func TestDimTxOpRevertInTryCatchWithMemoryExpansion(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployInvalid) _, receipt := callOnContract(t, builder, auth, contract.RevertInTryCatchWithMemoryExpansion) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // this test should force the revert opcode to be used @@ -117,7 +117,7 @@ func TestDimTxOpRevert(t *testing.T) { CheckEqual(t, receipt.Status, types.ReceiptStatusFailed) // Check the trace result - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // this test should force the revert opcode to be used @@ -154,7 +154,7 @@ func TestDimTxOpRevertWithMessage(t *testing.T) { CheckEqual(t, receipt.Status, types.ReceiptStatusFailed) // Check the trace result - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } func TestDimTxOpRevertWithMemoryExpansion(t *testing.T) { @@ -187,7 +187,7 @@ func TestDimTxOpRevertWithMemoryExpansion(t *testing.T) { CheckEqual(t, receipt.Status, types.ReceiptStatusFailed) // Check the trace result - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // this test will cause an invalid jump destination error @@ -214,5 +214,5 @@ func TestDimTxOpInvalidJump(t *testing.T) { receipt := EnsureTxFailed(t, ctx, builder.L2.Client, tx) CheckEqual(t, receipt.Status, types.ReceiptStatusFailed) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } diff --git a/system_tests/gas_dim_tx_op_log_test.go b/system_tests/gas_dim_tx_op_log_test.go index 6560404333..5c5b01c67d 100644 --- a/system_tests/gas_dim_tx_op_log_test.go +++ b/system_tests/gas_dim_tx_op_log_test.go @@ -43,7 +43,7 @@ func TestDimTxOpLog0TopicsOnlyMemUnchanged(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployLogEmitter) _, receipt := callOnContract(t, builder, auth, contract.EmitZeroTopicEmptyData) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -57,7 +57,7 @@ func TestDimTxOpLog0ExtraDataMemUnchanged(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployLogEmitter) _, receipt := callOnContract(t, builder, auth, contract.EmitZeroTopicNonEmptyData) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -71,7 +71,7 @@ func TestDimTxOpLog1TopicsOnlyMemUnchanged(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployLogEmitter) _, receipt := callOnContract(t, builder, auth, contract.EmitOneTopicEmptyData) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -85,7 +85,7 @@ func TestDimTxOpLog1ExtraDataMemUnchanged(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployLogEmitter) _, receipt := callOnContract(t, builder, auth, contract.EmitOneTopicNonEmptyData) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -99,7 +99,7 @@ func TestDimTxOpLog2TopicsOnlyMemUnchanged(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployLogEmitter) _, receipt := callOnContract(t, builder, auth, contract.EmitTwoTopics) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -113,7 +113,7 @@ func TestDimTxOpLog2ExtraDataMemUnchanged(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployLogEmitter) _, receipt := callOnContract(t, builder, auth, contract.EmitTwoTopicsExtraData) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -127,7 +127,7 @@ func TestDimTxOpLog3TopicsOnlyMemUnchanged(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployLogEmitter) _, receipt := callOnContract(t, builder, auth, contract.EmitThreeTopics) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -141,7 +141,7 @@ func TestDimTxOpLog3ExtraDataMemUnchanged(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployLogEmitter) _, receipt := callOnContract(t, builder, auth, contract.EmitThreeTopicsExtraData) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -155,7 +155,7 @@ func TestDimTxOpLog4TopicsOnlyMemUnchanged(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployLogEmitter) _, receipt := callOnContract(t, builder, auth, contract.EmitFourTopics) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -169,7 +169,7 @@ func TestDimTxOpLog4ExtraDataMemUnchanged(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployLogEmitter) _, receipt := callOnContract(t, builder, auth, contract.EmitFourTopicsExtraData) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -183,7 +183,7 @@ func TestDimTxOpLog0ExtraDataMemExpansion(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployLogEmitter) _, receipt := callOnContract(t, builder, auth, contract.EmitZeroTopicNonEmptyDataAndMemExpansion) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -197,7 +197,7 @@ func TestDimTxOpLog1ExtraDataMemExpansion(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployLogEmitter) _, receipt := callOnContract(t, builder, auth, contract.EmitOneTopicNonEmptyDataAndMemExpansion) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -211,7 +211,7 @@ func TestDimTxOpLog2ExtraDataMemExpansion(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployLogEmitter) _, receipt := callOnContract(t, builder, auth, contract.EmitTwoTopicsExtraDataAndMemExpansion) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -225,7 +225,7 @@ func TestDimTxOpLog3ExtraDataMemExpansion(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployLogEmitter) _, receipt := callOnContract(t, builder, auth, contract.EmitThreeTopicsExtraDataAndMemExpansion) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -239,5 +239,5 @@ func TestDimTxOpLog4ExtraDataMemExpansion(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployLogEmitter) _, receipt := callOnContract(t, builder, auth, contract.EmitFourTopicsExtraDataAndMemExpansion) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } diff --git a/system_tests/gas_dim_tx_op_precompiles_test.go b/system_tests/gas_dim_tx_op_precompiles_test.go index c0acad48e0..a5e2b1a1b3 100644 --- a/system_tests/gas_dim_tx_op_precompiles_test.go +++ b/system_tests/gas_dim_tx_op_precompiles_test.go @@ -23,7 +23,7 @@ func TestDimTxOpArbSysBlockNumberForSload(t *testing.T) { _, receipt := callOnContract(t, builder, auth, precompileTestContract.TestArbSysArbBlockNumber) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // this test calls a testActivateProgram function on a test contract @@ -51,7 +51,7 @@ func TestDimTxOpArbWasmActivateProgramForSstoreAndCallFromProxy(t *testing.T) { receipt, err := EnsureTxSucceeded(ctx, l2client, tx) Require(t, err) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // this test calls the ActivateProgram function on the ArbWasm precompile @@ -76,7 +76,7 @@ func TestDimTxOpActivateProgramForSstoreAndCall(t *testing.T) { receipt, err := EnsureTxSucceeded(ctx, l2client, tx) Require(t, err) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // ****************************************************** diff --git a/system_tests/gas_dim_tx_op_read_call_test.go b/system_tests/gas_dim_tx_op_read_call_test.go index 131334d86d..4c37599198 100644 --- a/system_tests/gas_dim_tx_op_read_call_test.go +++ b/system_tests/gas_dim_tx_op_read_call_test.go @@ -42,7 +42,7 @@ func TestDimTxOpDelegateCallColdNoCodeMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, delegateCaller.TestDelegateCallEmptyCold, emptyAccountAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -58,7 +58,7 @@ func TestDimTxOpDelegateCallWarmNoCodeMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, delegateCaller.TestDelegateCallEmptyWarm, emptyAccountAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -74,7 +74,7 @@ func TestDimTxOpDelegateCallColdContractMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, delegateCaller.TestDelegateCallNonEmptyCold, delegateCalleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -90,7 +90,7 @@ func TestDimTxOpDelegateCallWarmContractMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, delegateCaller.TestDelegateCallNonEmptyWarm, delegateCalleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } @@ -107,7 +107,7 @@ func TestDimTxOpDelegateCallColdNoCodeMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, delegateCaller.TestDelegateCallEmptyColdMemExpansion, emptyAccountAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -123,7 +123,7 @@ func TestDimTxOpDelegateCallWarmNoCodeMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, delegateCaller.TestDelegateCallEmptyWarmMemExpansion, emptyAccountAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -139,7 +139,7 @@ func TestDimTxOpDelegateCallColdContractMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, delegateCaller.TestDelegateCallNonEmptyColdMemExpansion, delegateCalleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -155,7 +155,7 @@ func TestDimTxOpDelegateCallWarmContractMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, delegateCaller.TestDelegateCallNonEmptyWarmMemExpansion, delegateCalleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -171,7 +171,7 @@ func TestDimTxOpStaticCallColdNoCodeMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, staticCaller.TestStaticCallEmptyCold, emptyAccountAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -187,7 +187,7 @@ func TestDimTxOpStaticCallWarmNoCodeMemUnchanged(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, staticCaller.TestStaticCallEmptyWarm, emptyAccountAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -202,7 +202,7 @@ func TestDimTxOpStaticCallColdContractMemUnchanged(t *testing.T) { staticCalleeAddress, _ := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployStaticCallee) receipt := callOnContractWithOneArg(t, builder, auth, staticCaller.TestStaticCallNonEmptyCold, staticCalleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -217,7 +217,7 @@ func TestDimTxOpStaticCallWarmContractMemUnchanged(t *testing.T) { staticCalleeAddress, _ := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployStaticCallee) receipt := callOnContractWithOneArg(t, builder, auth, staticCaller.TestStaticCallNonEmptyWarm, staticCalleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -233,7 +233,7 @@ func TestDimTxOpStaticCallColdNoCodeMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, staticCaller.TestStaticCallEmptyColdMemExpansion, emptyAccountAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -249,7 +249,7 @@ func TestDimTxOpStaticCallWarmNoCodeMemExpansion(t *testing.T) { receipt := callOnContractWithOneArg(t, builder, auth, staticCaller.TestStaticCallEmptyWarmMemExpansion, emptyAccountAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -264,7 +264,7 @@ func TestDimTxOpStaticCallColdContractMemExpansion(t *testing.T) { staticCalleeAddress, _ := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployStaticCallee) receipt := callOnContractWithOneArg(t, builder, auth, staticCaller.TestStaticCallNonEmptyColdMemExpansion, staticCalleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -279,5 +279,5 @@ func TestDimTxOpStaticCallWarmContractMemExpansion(t *testing.T) { staticCalleeAddress, _ := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployStaticCallee) receipt := callOnContractWithOneArg(t, builder, auth, staticCaller.TestStaticCallNonEmptyWarmMemExpansion, staticCalleeAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } diff --git a/system_tests/gas_dim_tx_op_selfdestruct_test.go b/system_tests/gas_dim_tx_op_selfdestruct_test.go index d1c2a23ca3..3b49b278ab 100644 --- a/system_tests/gas_dim_tx_op_selfdestruct_test.go +++ b/system_tests/gas_dim_tx_op_selfdestruct_test.go @@ -46,7 +46,7 @@ func TestDimTxOpSelfdestructColdNoTransferVirgin(t *testing.T) { // call selfDestructor.warmSelfDestructor(0xdeadbeef) receipt := callOnContractWithOneArg(t, builder, auth, selfDestructor.SelfDestruct, emptyAccountAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -67,7 +67,7 @@ func TestDimTxOpSelfdestructColdNoTransferFunded(t *testing.T) { // call selfDestructor.warmSelfDestructor(payableCounterAddress) receipt := callOnContractWithOneArg(t, builder, auth, selfDestructor.SelfDestruct, payableCounterAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -87,7 +87,7 @@ func TestDimTxOpSelfdestructColdPayingVirgin(t *testing.T) { // call selfDestructor.SelfDestruct(emptyAccountAddress) - which is cold receipt := callOnContractWithOneArg(t, builder, auth, selfDestructor.SelfDestruct, emptyAccountAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -108,7 +108,7 @@ func TestDimTxOpSelfdestructColdPayingFunded(t *testing.T) { // call selfDestructor.SelfDestruct(emptyAccountAddress) - which is cold receipt := callOnContractWithOneArg(t, builder, auth, selfDestructor.SelfDestruct, emptyAccount) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -125,7 +125,7 @@ func TestDimTxOpSelfdestructWarmNoTransferVirgin(t *testing.T) { // call selfDestructor.warmSelfDestructor(0xdeadbeef) receipt := callOnContractWithOneArg(t, builder, auth, selfDestructor.WarmEmptySelfDestructor, emptyAccountAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -146,7 +146,7 @@ func TestDimTxOpSelfdestructWarmNoTransferFunded(t *testing.T) { // call selfDestructor.warmSelfDestructor(payableCounterAddress) receipt := callOnContractWithOneArg(t, builder, auth, selfDestructor.WarmSelfDestructor, payableCounterAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -166,7 +166,7 @@ func TestDimTxOpSelfdestructWarmPayingVirgin(t *testing.T) { // call selfDestructor.warmSelfDestructor(0xdeadbeef) receipt := callOnContractWithOneArg(t, builder, auth, selfDestructor.WarmEmptySelfDestructor, emptyAccountAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -188,5 +188,5 @@ func TestDimTxOpSelfdestructWarmPayingFunded(t *testing.T) { // call selfDestructor.warmSelfDestructor(payableCounterAddress) receipt := callOnContractWithOneArg(t, builder, auth, selfDestructor.WarmSelfDestructor, payableCounterAddress) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } diff --git a/system_tests/gas_dim_tx_op_sstore_test.go b/system_tests/gas_dim_tx_op_sstore_test.go index 6aa5cf2f88..214a3e2910 100644 --- a/system_tests/gas_dim_tx_op_sstore_test.go +++ b/system_tests/gas_dim_tx_op_sstore_test.go @@ -34,7 +34,7 @@ func TestDimTxOpSstoreColdZeroToZero(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySstore) _, receipt := callOnContract(t, builder, auth, contract.SstoreColdZeroToZero) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -48,7 +48,7 @@ func TestDimTxOpSstoreColdZeroToNonZeroValue(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySstore) _, receipt := callOnContract(t, builder, auth, contract.SstoreColdZeroToNonZero) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -62,7 +62,7 @@ func TestDimTxOpSstoreColdNonZeroValueToZero(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySstore) _, receipt := callOnContract(t, builder, auth, contract.SstoreColdNonZeroValueToZero) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -76,7 +76,7 @@ func TestDimTxOpSstoreColdNonZeroToSameNonZeroValue(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySstore) _, receipt := callOnContract(t, builder, auth, contract.SstoreColdNonZeroToSameNonZeroValue) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -90,7 +90,7 @@ func TestDimTxOpSstoreColdNonZeroToDifferentNonZeroValue(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySstore) _, receipt := callOnContract(t, builder, auth, contract.SstoreColdNonZeroToDifferentNonZeroValue) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -104,7 +104,7 @@ func TestDimTxOpSstoreWarmZeroToZero(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySstore) _, receipt := callOnContract(t, builder, auth, contract.SstoreWarmZeroToZero) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -118,7 +118,7 @@ func TestDimTxOpSstoreWarmZeroToNonZeroValue(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySstore) _, receipt := callOnContract(t, builder, auth, contract.SstoreWarmZeroToNonZeroValue) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -132,7 +132,7 @@ func TestDimTxOpSstoreWarmNonZeroValueToZero(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySstore) _, receipt := callOnContract(t, builder, auth, contract.SstoreWarmNonZeroValueToZero) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -146,7 +146,7 @@ func TestDimTxOpSstoreWarmNonZeroToSameNonZeroValue(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySstore) _, receipt := callOnContract(t, builder, auth, contract.SstoreWarmNonZeroToSameNonZeroValue) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -160,7 +160,7 @@ func TestDimTxOpSstoreWarmNonZeroToDifferentNonZeroValue(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySstore) _, receipt := callOnContract(t, builder, auth, contract.SstoreWarmNonZeroToDifferentNonZeroValue) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -174,7 +174,7 @@ func TestDimTxOpSstoreMultipleWarmNonZeroToNonZeroToNonZero(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySstore) _, receipt := callOnContract(t, builder, auth, contract.SstoreMultipleWarmNonZeroToNonZeroToNonZero) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -188,7 +188,7 @@ func TestDimTxOpSstoreMultipleWarmNonZeroToNonZeroToSameNonZero(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySstore) _, receipt := callOnContract(t, builder, auth, contract.SstoreMultipleWarmNonZeroToNonZeroToSameNonZero) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -202,7 +202,7 @@ func TestDimTxOpSstoreMultipleWarmNonZeroToZeroToNonZero(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySstore) _, receipt := callOnContract(t, builder, auth, contract.SstoreMultipleWarmNonZeroToZeroToNonZero) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -216,7 +216,7 @@ func TestDimTxOpSstoreMultipleWarmNonZeroToZeroToSameNonZero(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySstore) _, receipt := callOnContract(t, builder, auth, contract.SstoreMultipleWarmNonZeroToZeroToSameNonZero) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -230,7 +230,7 @@ func TestDimTxOpSstoreMultipleWarmZeroToNonZeroToNonZero(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySstore) _, receipt := callOnContract(t, builder, auth, contract.SstoreMultipleWarmZeroToNonZeroToNonZero) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -244,5 +244,5 @@ func TestDimTxOpSstoreMultipleWarmZeroToNonZeroBackToZero(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySstore) _, receipt := callOnContract(t, builder, auth, contract.SstoreMultipleWarmZeroToNonZeroBackToZero) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } diff --git a/system_tests/gas_dim_tx_op_state_lookup_test.go b/system_tests/gas_dim_tx_op_state_lookup_test.go index 8ba284f76a..c3c7edee9f 100644 --- a/system_tests/gas_dim_tx_op_state_lookup_test.go +++ b/system_tests/gas_dim_tx_op_state_lookup_test.go @@ -33,7 +33,7 @@ func TestDimTxOpBalanceCold(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployBalance) _, receipt := callOnContract(t, builder, auth, contract.CallBalanceCold) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -47,7 +47,7 @@ func TestDimTxOpBalanceWarm(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployBalance) _, receipt := callOnContract(t, builder, auth, contract.CallBalanceWarm) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // ############################################################ @@ -65,7 +65,7 @@ func TestDimTxOpExtCodeSizeCold(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployExtCodeSize) _, receipt := callOnContract(t, builder, auth, contract.GetExtCodeSizeCold) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -79,7 +79,7 @@ func TestDimTxOpExtCodeSizeWarm(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployExtCodeSize) _, receipt := callOnContract(t, builder, auth, contract.GetExtCodeSizeWarm) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // ############################################################ @@ -97,7 +97,7 @@ func TestDimTxOpExtCodeHashCold(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployExtCodeHash) _, receipt := callOnContract(t, builder, auth, contract.GetExtCodeHashCold) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -111,7 +111,7 @@ func TestDimTxOpExtCodeHashWarm(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeployExtCodeHash) _, receipt := callOnContract(t, builder, auth, contract.GetExtCodeHashWarm) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // ############################################################ @@ -131,7 +131,7 @@ func TestDimTxOpSloadCold(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySload) _, receipt := callOnContract(t, builder, auth, contract.ColdSload) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // Tests that the total gas used by the transaction matches the expected value in the receipt, @@ -145,5 +145,5 @@ func TestDimTxOpSloadWarm(t *testing.T) { _, contract := deployGasDimensionTestContract(t, builder, auth, gas_dimensionsgen.DeploySload) _, receipt := callOnContract(t, builder, auth, contract.WarmSload) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } diff --git a/system_tests/gas_dim_tx_op_stylus_test.go b/system_tests/gas_dim_tx_op_stylus_test.go index 21db4f98e9..9c29919e3a 100644 --- a/system_tests/gas_dim_tx_op_stylus_test.go +++ b/system_tests/gas_dim_tx_op_stylus_test.go @@ -25,7 +25,7 @@ func TestDimTxOpStylus(t *testing.T) { receipt, err := EnsureTxSucceeded(ctx, l2client, tx) Require(t, err) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) } // This test calls the Keccak wasm program indirectly via @@ -46,5 +46,5 @@ func TestDimTxOpStylusKeccakForSloadFromProxy(t *testing.T) { receipt, err := EnsureTxSucceeded(ctx, l2client, tx) Require(t, err) - TxOpTraceAndCheck(t, ctx, builder, receipt) + TxOpTraceAndCheck(t, ctx, builder.L2, receipt) }