Skip to content

bug(anvil): nonce too low after anvil restarts with state #9053

@0xbok

Description

@0xbok

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 (8905af3 2024-10-07T03:18:50.978938000Z)

What command(s) is the bug in?

No response

Operating System

macOS (Apple Silicon)

Describe the bug

Steps to reproduce the bug:

  1. anvil -f https://eth.llamarpc.com --chain-id 31337 --state anvil-state where anvil-state is an empty directory.
  2. cast send 0x9276449EaC5b4f7Bc17cFC6700f7BeeB86F9bCd0 --value "1 ether" --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --rpc-url http://127.0.0.1:8545
  3. cast balance 0x9276449EaC5b4f7Bc17cFC6700f7BeeB86F9bCd0 --rpc-url http://127.0.0.1:8545 shows corect balance

Now restart anvil with the same command.

  1. cast balance 0x9276449EaC5b4f7Bc17cFC6700f7BeeB86F9bCd0 --rpc-url http://127.0.0.1:8545 shows 0 balance. This should show the same balance as before since it loads the dumped state.
  2. cast send 0x9276449EaC5b4f7Bc17cFC6700f7BeeB86F9bCd0 --value "1 ether" --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --rpc-url http://127.0.0.1:8545 says:

server returned an error response: error code -32003: nonce too low

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Completed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions