-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(levm): change gas consumption order and some logic (#1414)
**Motivation** <!-- Why does this pull request exist? What are its goals? --> - Gas consumption order is wrong, we are substracting balance from the user at the end of the transaction and that's not how it should be. - There are some things to fix and organize related to gas usage so this PR can address that. **Description** - Contemplates gas refunds for coinbase fee - Substracts up-front cost from user pre-execution and returns unused gas contemplating gas refunds post-execution. - Changes behavior when reverting create post execution -> If revert reason is the RevertOpcode don't consume remaining gas. - `validate_transaction` is now named `prepare_execution` because it both validates and makes pre-execution changes (that are very related with validations). Is has added functionalities like adding the value to the receiver's balance. - It creates method `post_execution_changes()` for organizing `transact()` method <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 --> Tests Passing: 1584 total
- Loading branch information
Showing
2 changed files
with
97 additions
and
64 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
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