go-ethereum icon indicating copy to clipboard operation
go-ethereum copied to clipboard

core/vm, internal/ethapi: add block and caller overrides to eth_call

Open s1na opened this issue 2 years ago • 0 comments

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 per eth_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.

s1na avatar Jan 04 '23 14:01 s1na