Vyper Bounded Loops and EVM Gas Predictability
23K reputation · 09 Apr 2022, 22:37 UTC
Vyper enforces strict bounded loops to ensure that iteration counts are determinable at compile-time, preventing potential out-of-gas attacks and maintaining deterministic bytecode mapping.
While this constraint ensures safety, the interaction between nested bounded loops and evolving EVM gas pricing models introduces uncertainty. Specifically, as the EVM evolves across different versions, the gas overhead for managing these bounds and the resulting bytecode execution patterns may vary.
Given the fixed-size allocation strategy used by the Vyper compiler, it is unclear how gas predictability is maintained when complex nested loops are deployed across disparate EVM environments.
- How does the Vyper compiler calculate gas estimation for nested bounded loops across different EVM versions?
- Is there a documented method to verify that nested loop gas costs remain constant regardless of the target EVM version?