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

abnormally large tmp files #3699

Closed
2 tasks done
cyberthirst opened this issue Nov 16, 2022 · 3 comments · Fixed by #8412
Closed
2 tasks done

abnormally large tmp files #3699

cyberthirst opened this issue Nov 16, 2022 · 3 comments · Fixed by #8412
Labels
C-anvil Command: anvil D-average Difficulty: average good first issue Good for newcomers T-bug Type: bug
Milestone

Comments

@cyberthirst
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 (903a073 2022-11-14T00:07:04.292547Z)

What command(s) is the bug in?

anvil

Operating System

macOS (Apple Silicon)

Describe the bug

Anvil creates abnormally large tmp files.

xx@mac ~ % du -sh ~/.foundry
220G /Users/xx/.foundry

The scenario that lead to 220GB anvil tmp file:

  1. at the beginning, we create a snapshot X of an empty chain
  2. we run our fuzz tests (lower thousands of transactions)
  3. we revert to the snapshot X
  4. we start fuzzing again from the initial state but with a different seed

The tmp files get very large even when using anvil more normal scenarios (less txs, no snapshoting)

A few thoughts on how to improve anvil:

  1. remove the logs (cache) after reverting to a snapshot
  2. remove the logs after anvil_reset
  3. implement anvil_reset without parameters (ie a simple reset to a clean dev chain)
  4. prune the logs from unnecessary data - even basic tests without reverting generates huge tmp files (this might be hard to implement but would be nice to have)
@cyberthirst cyberthirst added the T-bug Type: bug label Nov 16, 2022
@rkrasiuk rkrasiuk added C-anvil Command: anvil good first issue Good for newcomers D-average Difficulty: average labels Nov 18, 2022
@NikitaBerezhnoy
Copy link

NikitaBerezhnoy commented Dec 6, 2023

Same happened to me, it took a while to understand why my system ran out of memory. Also on masOS/Apple Silicon. I tried to setup a big state with a lot of transactions (18k txs with complex logic) and dump it to a file. I suppose those tmp files are also really slow down the node because it needs to write so much data in the process.

@dcb9
Copy link
Contributor

dcb9 commented Apr 17, 2024

Hi @rkrasiuk, I have set up the dev environment, and would like to implement this feature. Could you assign this to me?

@dpaiton
Copy link

dpaiton commented May 27, 2024

same issue as #4251

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-anvil Command: anvil D-average Difficulty: average good first issue Good for newcomers T-bug Type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants