go-ethereum
go-ethereum copied to clipboard
core/vm, internal/ethapi: add block and caller overrides to eth_call
Adds an optional config parameter to eth_call
which allows users to:
- Override block context fields (same functionality that was added to
traceCall
in https://github.com/ethereum/go-ethereum/pull/24871) - Mock caller in the evm for certain calls. The calls will be selected based on a filter of
[from, to, input]
. Currently only possible to set one filter and mock caller pereth_call
I've hidden the mock caller check behind vmConfig.Debug
to make sure it doesn't run in main chain processing.
Also I've integrated some of the changes from https://github.com/ethereum/go-ethereum/pull/25743, specially some test cases and modification to GetEVM
.
Fixes #24025 and #26277.