Skip to content
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

Aurora Engine crashes before hitting the EVM call stack limit #627

Open
birchmd opened this issue Oct 21, 2022 · 0 comments
Open

Aurora Engine crashes before hitting the EVM call stack limit #627

birchmd opened this issue Oct 21, 2022 · 0 comments
Assignees
Labels
A-evm-compatibility Area: EVM compatibility changes or fixes. C-bug Category: Something isn't working. P-high Pririoty: high

Comments

@birchmd
Copy link
Member

birchmd commented Oct 21, 2022

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.

@birchmd birchmd added C-bug Category: Something isn't working. P-high Pririoty: high A-evm-compatibility Area: EVM compatibility changes or fixes. labels Oct 21, 2022
@birchmd birchmd self-assigned this Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-evm-compatibility Area: EVM compatibility changes or fixes. C-bug Category: Something isn't working. P-high Pririoty: high
Projects
None yet
Development

No branches or pull requests

1 participant