-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Anvil does not recover block number from state after restart. #5460
Comments
Also running into this |
I see this only dumps the state foundry/crates/anvil/src/eth/backend/db.rs Line 335 in 0232ee5
maybe we should consider also including the block number etc? |
Yeah this would be awesome feature to have. For my use case I need to maintain transactions and block number between restarts. If someone can pointing me to right direction, I can open a PR/. |
totally, forgot about this sorry. |
Had problem with this bug. I want to launch anvil on a separate server and connect subgraph to it, so we can use it as a private dev testnet, but I use state file to deploy contracts and setup state (20k tx) |
I would really love to see this fixed. It would make it possible for me to run Anvil instead of Ganache or Hardhat for my application. |
hi - would love to see this fixed as well. Our use case uses block number as checkpointing so being able to restore state including block number on restart would be huge |
fixing as we speak, very sorry for the delay |
Component
Anvil
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (35f2070 2023-07-24T15:04:54.605528057Z)
What command(s) is the bug in?
No response
Operating System
Linux
Describe the bug
After restart, anvil loads state from previously stored one, but starts count blocks from 1 again. I am running it as:
anvil --port 7545 --accounts 200 --mnemonic '........' --block-time 12 --state ./state.json --gas-limit 30000000
The text was updated successfully, but these errors were encountered: