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).
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!
Component
Anvil
Have you ensured that all of these are up to date?
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
, themax_fee_per_gas
parameter included in the tx ends up overwriting theblock.basefee
. Is there a reason for this? This makes it harder to estimate gas for contracts that rely on the value ofblock.basefee
(although I see it's not a common issue).the FeeDetails is created based on the transaction params, then https://github.com/foundry-rs/foundry/blob/5af9d16ecb620192d4fe5ae61d33e429b7f5aff3/crates/anvil/src/eth/api.rs#L2344-L2350
used in this line to override the block's
basefee
. https://github.com/foundry-rs/foundry/blob/5af9d16ecb620192d4fe5ae61d33e429b7f5aff3/crates/anvil/src/eth/backend/mem/mod.rs#L1155-L1157Given 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!