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

Nightly consumes much more memory #6733

Closed
2 tasks done
lnist opened this issue Jan 9, 2024 · 3 comments · Fixed by #6734
Closed
2 tasks done

Nightly consumes much more memory #6733

lnist opened this issue Jan 9, 2024 · 3 comments · Fixed by #6734
Labels
T-bug Type: bug

Comments

@lnist
Copy link

lnist commented Jan 9, 2024

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 (d46bcb3 2024-01-09T00:21:10.755521772Z)

What command(s) is the bug in?

No response

Operating System

Linux

Describe the bug

When running our test suite we see a significant increase in memory consumption from anvil, to the point where tests start consuming >40gb and anvil dies due to out of memory while previously they used <2gb (tested with eye-inspection of htop and prior and latest nightly builds).
The prior version which works is nightly-02292f2d2caa547968bd039c06dc53d98b72bf39.

Note the tests in question are TypeScript tests running via ethers.js 5.

@lnist lnist added the T-bug Type: bug label Jan 9, 2024
@mattsse
Copy link
Member

mattsse commented Jan 9, 2024

this could be a regression caused by #6219

could you perhaps provide more info about what kind of requests you send to anvil?

this could be a tracing issue

@lnist
Copy link
Author

lnist commented Jan 9, 2024

Thanks for the quick reply :)

Yes, I indeed think it is a regression caused by that PR.

The tests are integration tests, so they do quite a lot of things to set up an environment of contracts.

The tests that fail with out of memory are sending TXs that consume almost an entire block of 30.000.000 gas, while in parallel invoking get_logs to keep caches up to date from events. Some TXs have quite large calldata.
If I disable the get_logs calls the tests just barely succeed, but still consume a lot more memory than before ~30gb.

I'll happily send a trace of all the requests to anvil if it helps - in that case, does anvil have a way to log all RPC calls in a replayable format?

The sure way to repro this is to git clone https://github.com/mangrovedao/mangrove.js.git then yarn install && yarn build, start an anvil on port 8546 and run MGV_NODE_SPAWN=false yarn test:integration --jobs 0 -- -g "Kandel MaxOffersInChunk verification" (if you have yarn)

@lnist
Copy link
Author

lnist commented Jan 9, 2024

Fix confirmed, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants