Repository navigation
Conversation
|
Measurements against main f46d16d on a Ryzen 9 5950X, Release builds. Peak RSS and memory system calls (
evmone-bench: geomean change of the best of 3 alternating runs on a pinned core; instructions and cycles from perf counters. The default gas limit is INT64_MAX, so every benchmark takes the full 8 GiB reservation in an extra segment.
Checks beyond CI: valgrind on all unit tests (0 errors); ASan + UBSan on all execution-specs tests (the stack overflows of deep-recursion tests in a local Debug libstdc++ build, as on main, pass with a 1 GiB stack); a build with the 64 MiB reservation cap forced on 64-bit Linux and assertions enabled passes ctest and the execution-specs tests; evmone-fuzzer, about 3.6M inputs with no mismatches. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## evm/vm-context-enter #1878 +/- ##
=====================================================
Coverage 98.23% 98.23%
=====================================================
Files 191 192 +1
Lines 17423 17520 +97
Branches 3977 3994 +17
=====================================================
+ Hits 17115 17211 +96
- Misses 237 238 +1
Partials 71 71
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
The VM context gives each execution a frame: its EVM stack space and then a reservation of the largest EVM memory its gas can pay for, at most 64 MiB. The frame starts where the memory of the execution it is nested in ends. The first segment, 8 MiB allocated with the context, holds the frames of executions with real gas limits. A frame that doesn't fit starts the next segment, twice its size so that the nested frames fit too. The context keeps the segments for reuse. The EVM memory never moves, so its growth needs no reallocation. A growth beyond 64 MiB, which costs over 8e9 gas, aborts the process. Previously, each call depth had its own 32 KiB stack, zeroed on creation, and its own memory, reallocated as it grew and kept at its largest size. In the execution-specs tests with deep calls, this lowers the peak memory up to 2 times and the memory system calls up to 18 times.
1f97aff to
97c7d10
Compare
1b906d1 to
01fbe7f
Compare
The VM context gives each execution a frame: its EVM stack space and then a reservation of the largest EVM memory its gas can pay for, at most 64 MiB. The frame starts where the memory of the execution it is nested in ends. The first segment, 8 MiB allocated with the context, holds the frames of executions with real gas limits. A frame that doesn't fit starts the next segment, twice its size so that the nested frames fit too. The context keeps the segments for reuse. The EVM memory never moves, so its growth needs no reallocation. A growth beyond 64 MiB, which costs over 8e9 gas, aborts the process. Previously, each call depth had its own 32 KiB stack, zeroed on creation, and its own memory, reallocated as it grew and kept at its largest size.
In the execution-specs tests with deep calls, this lowers the peak memory up to 2 times and the memory system calls up to 18 times.