Open luzzif opened 1 year ago
A bit of delay on this but... I just implemented the same logic on eth_call
on a local fork, but using a slightly different way. I made the readyNextBlock
in the blockchain
class public and when latest
is passed as the block I use that instead of the standard built RuntimeBlock
. I wonder if we could simplify the implementation of the eth_estimateGas
logic by doing the same here. The only thing we probably need to change is that I noticed that in the eth_estimateGas
case the gas limit defaults to the miner's call gas limit instead of the default block gas limit used in the standard readyNextBlock
function.
When estimating gas, use the adjusted timestamp in case the
latest
block tag is being used. This helps avoid some errors in time-dependent contracts when using Ganache in fork mode.Should fix https://github.com/trufflesuite/ganache/issues/3528.
This is my first PR here, would love some guidance.