foundry: Anvil seems to hang/crash when submitting transactions through Metamask on a forked network.

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 (dc83894 2022-06-11T00:06:34.928765727Z)

What command(s) is the bug in?

anvil

Operating System

Linux

Describe the bug

I’m trying to test submitting transactions through Metamask connected to anvil (localhost:8545).

This is the example anvil command I’m running:

anvil --fork-url="https://eth-mainnet.alchemyapi.io/v2/XXXXXXXXXXXXXXXXXXXXXXXXX" --fork-block-number=14812197 --port=8545 -b=5 --chain-id=1

Example steps I’ve done to reproduce:

  1. I fork a specific block, set the block time to be a certain interval
  2. Launch opensea.io and sign in with one of my wallets that has an NFT
  3. List the item and in the process, calling setApprovalForAll on the NFT
  4. Notice that the transaction never goes through and anvil just freezes up (No blocks are getting produced anymore every 5s, it just seems to completely freeze and hang)

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 5
  • Comments: 26 (9 by maintainers)

Most upvoted comments

thanks, makes sense.

will do a more thorough investigation tonight.

I’m using alchemy yes. And we’re using the exact same block and alchemy endpoint that we’re using for our same tests that are using Hardhat and Hardhat handles it fine for the most part, so it does seem like an underlying Anvil issue