Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

baseFeePerGas of the first mined block after anvil_reset equals block before anvil_reset #6640

Closed
1 of 2 tasks
vlad-blana opened this issue Dec 20, 2023 · 1 comment · Fixed by #6645
Closed
1 of 2 tasks
Labels
T-bug Type: bug

Comments

@vlad-blana
Copy link

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 (eb2141c 2023-12-20T00:44:21.180725100Z)

What command(s) is the bug in?

No response

Operating System

Windows

Describe the bug

After any "anvil_reset" rpc call, the first block that gets mined doesn't use the EIP1559 formula for the baseFeePerGas, but instead uses the last block baseFeePerGas value before anvil_reset.

The next blocks use the EIP1559 formula.
This causes not enough balance issues when mining transactions expecting the EIP1559 formula to be used for the first block after every anvil_reset

Here is an example on ethereum mainnet

image

anvil started with command: .\anvil.exe --fork-url "https://rpc.flashbots.net" --no-mining
eth mainnet

@mattsse
Copy link
Member

mattsse commented Dec 21, 2023

thanks for flagging,

this was indeed an oversight in the reset impl that used the base fee of the targeted block and not the next basefee

@github-project-automation github-project-automation bot moved this from Todo to Done in Foundry Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants