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

bug(anvil): --fork-url and --load-state are incompatible #8493

Open
2 tasks done
Tracked by #8269
ericbrown99 opened this issue Jul 22, 2024 · 2 comments
Open
2 tasks done
Tracked by #8269

bug(anvil): --fork-url and --load-state are incompatible #8493

ericbrown99 opened this issue Jul 22, 2024 · 2 comments
Assignees
Labels
C-anvil Command: anvil T-bug Type: bug
Milestone

Comments

@ericbrown99
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 (fe2acca 2024-07-22T00:23:01.187259000Z)

What command(s) is the bug in?

anvil --fork-url https://mainnet.infura.io/v3/$WEB3_INFURA_PROJECT_ID --chain-id 31337 --dump-state state.json --load-state state.json

Operating System

None

Describe the bug

When forking from mainnet and attempting to load previous state, the previous state isn't loaded successfully. From the command above you can see that anvil is instructed to dump the state which it does successfully and the previous state is available when the new instance of anvil begins. But seemingly due to the use of --fork-url the previous state isn't properly loaded

@ericbrown99 ericbrown99 added the T-bug Type: bug label Jul 22, 2024
@zerosnacks zerosnacks added the C-anvil Command: anvil label Jul 22, 2024
@zerosnacks zerosnacks changed the title Anvil: fork-url and load-state incompatible bug(anvil): --fork-url and --load-state are incompatible Jul 23, 2024
@zerosnacks zerosnacks added this to the v1.0.0 milestone Jul 26, 2024
@jenpaff jenpaff self-assigned this Sep 26, 2024
@jenpaff
Copy link
Collaborator

jenpaff commented Sep 26, 2024

--fork-url and --load-state are not supposed to work together, will add a CLI flag to make sure conflicting flags are communicated to user

@ericbrown99
Copy link
Author

okay, thanks for the update. To confirm, this means its not possible to use a fork's data (e.g. DEX contracts with liquidity) while also loading in data from recent user sessions to simulate the over time use of our smart contracts locally?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-anvil Command: anvil T-bug Type: bug
Projects
None yet
Development

No branches or pull requests

3 participants