-
Notifications
You must be signed in to change notification settings - Fork 337
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
guest memory: place stack below text/code #950
Conversation
The previous memory layout was prone to a security vulnerability because the stack could collide with the heap. This change places the stack below TEXT_START with enough space for 2 MB of stack. This also results in increased locality of memory which will result in less page faults for small programs.
@intoverflow I'm not sure if 2MB is large enough for zeth... Feel free to chime in and let us know if it's not enough! |
Benchmark for Linux-cuda 29d0914Click to hide benchmark
Benchmark for Linux-default 29d0914Click to hide benchmark
Benchmark for macOS-default
Benchmark for macOS-metal
|
There is a test https://github.com/risc0/zeth/blob/main/testing/ef-tests/tests/executor.rs that attempts to run an artificial transaction that should require a lot of stack in the guest. It might be worth checking these changes against this test. If it passes, I think we are pretty sure that it should work for real Ethereum blocks as well. |
The previous memory layout was prone to a security vulnerability because the
stack could collide with the heap. This change places the stack below
TEXT_START with enough space for 2 MB of stack. This also results in increased
locality of memory which will result in less page faults for small programs.