mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 15:47:21 +00:00
The struct-based tracing added in #29189 seems to have caused an issue with the benchmark `BenchmarkTracerStepVsCallFrame`. On master we see the following panic: ```console BenchmarkTracerStepVsCallFrame panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x2 addr=0x40 pc=0x1019782f0] goroutine 37 [running]: github.com/ethereum/go-ethereum/eth/tracers/js.(*jsTracer).OnOpcode(0x140004c4000, 0x0, 0x10?, 0x989680, 0x1, {0x101ea2298, 0x1400000e258}, {0x1400000e258?, 0x14000155928?, 0x10173020c?}, ...) /Users/matt/dev/go-ethereum/eth/tracers/js/goja.go:328 +0x140 github.com/ethereum/go-ethereum/core/vm.(*EVMInterpreter).Run(0x14000307da0, 0x140003cc0d0, {0x0, 0x0, 0x0}, 0x0) ... FAIL github.com/ethereum/go-ethereum/core/vm/runtime 0.420s FAIL ``` The issue seems to be that `OnOpcode` expects that `OnTxStart` has already been called to initialize the `env` value in the tracer. The JS tracer uses it in `OnOpcode` for the `GetRefund()` method. This patch resolves the issue by reusing the `Call` method already defined in `runtime_test.go` which correctly calls `OnTxStart`. |
||
|---|---|---|
| .. | ||
| runtime | ||
| testdata | ||
| analysis.go | ||
| analysis_test.go | ||
| common.go | ||
| contract.go | ||
| contracts.go | ||
| contracts_fuzz_test.go | ||
| contracts_test.go | ||
| doc.go | ||
| eips.go | ||
| errors.go | ||
| evm.go | ||
| gas.go | ||
| gas_table.go | ||
| gas_table_test.go | ||
| instructions.go | ||
| instructions_test.go | ||
| interface.go | ||
| interpreter.go | ||
| interpreter_test.go | ||
| jump_table.go | ||
| jump_table_export.go | ||
| jump_table_test.go | ||
| memory.go | ||
| memory_table.go | ||
| memory_test.go | ||
| opcodes.go | ||
| operations_acl.go | ||
| operations_verkle.go | ||
| stack.go | ||
| stack_table.go | ||