-
Notifications
You must be signed in to change notification settings - Fork 640
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
Change in memory limit calculation #865
Comments
Hi Dani! Yes I probably had a misunderstanding about memory limit when I worked on this, I'm sorry. Right now it checks that, between all contexts, the amount of memory allocated does not overcome Looking at the original code it seems that you're allowed to allocate up to 32MiB in every context, which is different than the behavior of the current shared memory. If you agree I can make a little PR to fix this: as you said we should be checking |
|
@rakita It would be awesome to revert this change as since foundry-rs/foundry#6281 is now merged and all my commits in snekmate will now fail (I use foundry nightly builds) with these 2 specific failures. Maybe as a background why I do such crazy tests: Snekmate is a Vyper library and in Vyper you statically allocate memory at compile time for e.g. dynamic arrays. Since snekmate should be a generic module essentially I put high placeholders there in |
Solution could be for foundry to expose memory limit as a config or just bump current value to 256mb or 512mb, that would solve the problem. |
I'm indifferent to how it's solved and leave that to you guys; I just need a solution that works :) |
We believe the new behavior makes more sense, so we're bumping the default memory limit to 128MiB in foundry-rs/foundry#6338. Both config ( |
We've encountered a memory limit while bumping Revm from 3.5.0 to 1609e07 (v26...1609e07) in foundry-rs/foundry#6281 while testing pcaversaccio/snekmate's Multicall.
Some calls to
Multicall::multicall_self
in these tests use about 60MiB in total, but split across multiple internal calls. Foundry by default uses 32MiB memory limit, so these calls failed after updating Revm withMemoryLimitOOG
.I believe the root cause is in this commit: b5aa4c9
Since it's the only one that changed this logic.
Before:
After:
I'm not sure if this is correct. Should this just be checking
new_size
only again?cc @rakita @lorenzofero @pcaversaccio
The text was updated successfully, but these errors were encountered: