-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(levm): reserve gas for subcall in CREATE (#1532)
**Motivation** The gas for the subcall should be reserved before checking the validity of the create, and shouldn't be returned in case we get an address collision. **Description** - After doing the checks that can cause an OOG, we reserve the gas_limit for the create subcall, if a check that shouldn't consume this reserved gas fails, we return the gas, push a 0 and return. If the the address of a new account has nonce or code, we don't return the gas, increment nonce, push 0 and return. - The address of the account to create should be inserted into the "warm" account set, and remain even if we return because of a failed check, so it is now done earlier and only removed from the set if the new_call_frame results in a revert. --------- Co-authored-by: Jeremías Salomón <[email protected]>
- Loading branch information
Showing
1 changed file
with
40 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters