Description
Component
Anvil
Have you ensured that all of these are up to date?
- Foundry
- Foundryup
What version of Foundry are you on?
forge 0.2.0 (e903484 2024-07-19T00:18:41.070490000Z)
What command(s) is the bug in?
anvil
Operating System
macOS (Apple Silicon)
Describe the bug
Opened an issue since I'm not sure if this is intended behavior.
when calling eth_estimateGas
, the max_fee_per_gas
parameter included in the tx ends up overwriting the block.basefee
. Is there a reason for this? This makes it harder to estimate gas for contracts that rely on the value of block.basefee
(although I see it's not a common issue).
the FeeDetails is created based on the transaction params, then
foundry/crates/anvil/src/eth/api.rs
Lines 2344 to 2350 in 5af9d16
used in this line to override the block's basefee
.
foundry/crates/anvil/src/eth/backend/mem/mod.rs
Lines 1155 to 1157 in 5af9d16
Given the spec here, I would expect that all that eth_estimateGas
does is set the block gas limit if unspecified, not change anything about the block otherwise. Curious if this is intended behavior? Thanks in advance!