You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
However, eth_estimateGas just uses the parent block's timestamp:
constblock=newRuntimeBlock(Quantity.from((parentHeader.number.toBigInt()||0n)+1n),parentHeader.parentHash,parentHeader.miner,tx.gas.toBuffer(),parentHeader.gasUsed.toBuffer(),parentHeader.timestamp,options.miner.difficulty,parentHeader.totalDifficulty,0n// no baseFeePerGas for estimates);
This is particularly annoying if you are using Truffle to test a contract that is time dependent because truffle calls an eth_estimateGas before sending your actual transaction. If you use evm_setTime to the time needed for your contract to do what it needs to do, the actual transaction would pass, but Truffle doesn't let you get that far because the eth_estimateGas fails beforehand.
The text was updated successfully, but these errors were encountered:
In the blockchain, when a block is being prepared to be mined, the timestamp is adjusted by the chain's internal offset:
However,
eth_estimateGas
just uses the parent block's timestamp:This is particularly annoying if you are using Truffle to test a contract that is time dependent because truffle calls an
eth_estimateGas
before sending your actual transaction. If you useevm_setTime
to the time needed for your contract to do what it needs to do, the actual transaction would pass, but Truffle doesn't let you get that far because theeth_estimateGas
fails beforehand.The text was updated successfully, but these errors were encountered: