Skip to content

bug(anvil): can't start anvil from old forked dumped state #10363

Open
@Raneet10

Description

@Raneet10

While starting up anvil from a dumped state, it throws the following error :

anvil --port 9545 --host 0.0.0.0 --state /opt/goerli/ethereum/shadow-fork-foundry/fork-state/  --block-time 12
Error: failed to load init state

Context:
- Rpc error RpcError { code: InternalError, message: "Best hash not found for best number 10832770", data: None }

There was apparently no best_hash stored
cat ethereum/shadow-fork-foundry/fork-state/state.json | grep "best_hash"

The anvil version :

anvil --version
anvil Version: 1.0.0-stable
Commit SHA: e144b82070619b6e10485c38734b4d4d45aebe04
Build Timestamp: 2025-02-13T20:03:31.026474817Z (1739477011)
Build Profile: maxperf

Backgroundt: We forked the Goerli state with Anvil just after it was deprecated and let it run for a while to do some stuff. We would like to run the anvil fork now from that state. Any idea what could be causing that error ? Another tidbit is that we had, obviously, used an older version of anvil to fork Goerli:

    0.2.0 (79dd88c 2024-04-19T00:18:58.900561015Z)
    https://github.com/foundry-rs/foundry

Not sure how much that matters here but any insights would be useful. Thanks!

EDIT: I actually tried installing v0.2.0 but that fails :

foundryup --install v0.2.0


.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx

 ╔═╗ ╔═╗ ╦ ╦ ╔╗╔ ╔╦╗ ╦═╗ ╦ ╦         Portable and modular toolkit
 ╠╣  ║ ║ ║ ║ ║║║  ║║ ╠╦╝ ╚╦╝    for Ethereum Application Development
 ╚   ╚═╝ ╚═╝ ╝╚╝ ═╩╝ ╩╚═  ╩                 written in Rust.

.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx

Repo       : https://github.com/foundry-rs/foundry
Book       : https://book.getfoundry.sh/
Chat       : https://t.me/foundry_rs/
Support    : https://t.me/foundry_support/
Contribute : https://github.com/foundry-rs/foundry/blob/master/CONTRIBUTING.md

.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx.xOx

foundryup: installing foundry (version v0.2.0, tag v0.2.0)
foundryup: downloading forge, cast, anvil, and chisel for v0.2.0 version
############################################################################################################################################################################################################### 100.0%
tar: This does not look like a tar archive

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
foundryup: command failed: tar tf /tmp/tmp.Cv8gEqGKLc/foundry.tar.gz

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions