-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 stops producing blocks and then mines a bunch of blocks at once #6036
Comments
I see this is in forking mode, are you making any requests during that time? |
This happened again and I think it is happening when metamask makes requests to node in order to get info about a newly imported account. The RAM consumption raised from ~500 MiB to 1.2 GiB after this particular delay Additional context: RAM limit on pod is 4 GiB, anvil is running for 46 hours |
Yeah, it looks like anvil is not able to handle all the incoming requests from metamask + backend. But the stange thing tho is that it working good then account is not newly imported, so I think when you importing a new account metamask makes a ton of requests |
I see there are a few eth_call requests I wonder if this has something to do with rpc rate limits, |
Sure, I'll add a flag, redeploy the pod and report back with results |
Unfortunately disabling rate-limits didnt fix the problem, here is the new logs |
Hello, I am still experiencing this issue on ghcr.io/foundry-rs/foundry:nightly image :( |
looking at the logs, I'm pretty sure this is an issue with tx execution in forked mode, which delays block production. |
Hmmm, I use 12 seconds to mock Ethereum, what are your suggestions? |
By the way, the reason is actually metamask, we don't experience any problems while not creating new accounts/adding anvil as a new network |
I meant in anvil we should delay missed blocks (for what ever reason) and if a block is late, still target the next block for 12s because rn I think we just mined all missed blocks in bulk |
hmm, interesting, I guess the call chainId blocknumber a lot, need to check those if they somehow interfere with blockproduction in forking mode |
I had a similar issue but in a non-fork mode with Metamask. I was getting a lot of frustrating I also tried using the prefix If I was proficient in rust and understood anvil enough, I would have attempted solving this issue. |
Thank you @mattsse . Hoping to test this soon |
I have built anvil from your branch. With a block time of 5s I get the internal RPC error once in a while. I suspect I might be sending too many requests to anvil. I am wondering about anvil keeping unprocessed txns in a pool until they're mined. |
Tentatively marking as resolved by #7328 @golden-expiriensu / @KELs7 feel free to re-open with additional details / minimal reproduction if this is still an issue |
Just adding to this thread incase useful. MM does the following eth_call when importing a new account. It's a massive request that attempts to load token balances for many different tokens. For me running anvil locally it takes between 3–6 minutes to respond to that request, during which time anvil cannot respond to other requests — other requests timeout. It does |
Component
Anvil
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (f8a07c3 2023-08-22T21:43:06.347698566Z)
What command(s) is the bug in?
anvil
Operating System
Linux
Describe the bug
I am running anvil in the kubernetes with following dockerfile and entrypoint:
Dockerfile:
entrypoint.sh
Sometimes the anvil hangs up and stops producing blocks for about 5 minutes. During this time it does not respond to most requests and just hangs. The amount of RAM consumption does not increase, the process does not crash. After this delay, the anvil produces a bunch of blocks at a time and starts responding to some requests. After 2-3 such delays, the node starts responding steadily, and nothing crashes
In the attached logs the bug starts at 2023-10-13T09:31:54.519257387Z
anvil.log
The text was updated successfully, but these errors were encountered: