-
Notifications
You must be signed in to change notification settings - Fork 587
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
runtime cache size #2527
Comments
Wasm contract size is limited here: https://github.com/nearprotocol/nearcore/blob/05a82d8dd74531b21567623ab0e7e75946afea19/runtime/near-vm-logic/src/config.rs#L68 The size of the compiled contract should be proportional to the Wasm contract, at least on x86 architecture. CC @olonho to correct me if I am wrong. |
So potentially this cache can be 4GB large? That seems a bit too much. |
What is our target hardware? |
I think the minimum requirement is 4GB of memory https://docs.nearprotocol.com/docs/roles/validator/hardware |
Indeed if we'll get rather large contract, it may exhaust our resources, and it's indeed unlikely that non-optimizing compilers may produce binaries disproportionally non-linear from input+dependencies size. |
Okay, let's cut it down to 128 size and deal with it later, if it turns out too small. In the future, we can back the cache with the disk rather than memory only. |
We cache compiled wasm modules in near-vm-runner and cache size is 1024. However, there does not seem to be a size limit of the compiled wasm module, which means that this cache can potentially be very large, if exploited by an adversary. While there is a
no_cache
flag, it is not turned on by default and also I assume it will compromise performance.The text was updated successfully, but these errors were encountered: