Aurora Engine crashes before hitting the EVM call stack limit #627
Labels
A-evm-compatibility
Area: EVM compatibility changes or fixes.
C-bug
Category: Something isn't working.
P-high
Pririoty: high
The EVM has a call stack limit of 1024. If there are more nested calls than this, then no call is performed and the failure is propagated back up the call chain. However, when executing a contract on Aurora that makes deeply nested calls, then it crashes before hitting this limit. This is an incompatibility with Ethereum and therefore must be addressed.
The core issue actually arises from SputnikVM, the EVM interpreter used by Aurora Engine. The way nested calls are executed is by literally recursively calling the
call_inner
function, thus using Rust's call stack to implement the EVM call stack. The problem with this approach is that the Rust call stack can (and does) run out of space before hitting the EVM limit.A better approach would be to have a data structure to model the EVM call stack and handle nested EVM calls in a loop rather than with recursive Rust function calls.
The text was updated successfully, but these errors were encountered: