Open sideninja opened 7 months ago
After going through the relevant source code on Geth (https://github.com/ethereum/go-ethereum/blob/master/internal/ethapi/api.go#L1545-L1549), we will need to expose this method through the EVM
contract.
Context:
// Apply the transaction with the access list tracer
tracer := logger.NewAccessListTracer(accessList, args.from(), to, precompiles)
config := vm.Config{Tracer: tracer.Hooks(), NoBaseFee: true}
vmenv := b.GetEVM(ctx, msg, statedb, header, &config, nil)
res, err := core.ApplyMessage(vmenv, msg, new(core.GasPool).AddGas(msg.GasLimit))
The EVM Gateway does not have access to the Geth VM, so I think this is something that should be exposed as a Cadence function from the EVM
contract. In turn, the EVM Gateway should call this new Cadence function, through a Cadence transaction.
The implementation of this optimization feature should be done in the next phase.
@m-Peter after we build local state will this be doable?
@sideninja Good question, I need to do some exploration on this, and see what needs to be done in order to support this.
@sideninja After checking this again, it seems that having a StateDB
in EVM Gateway won't be enough to support the eth_createAccessList
endpoint. We still need an instance of *gethVM.EVM
, to be able to apply the message from the given transaction arguments.
Relevant info: