-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(levm): prevent unsafe arithmetic (#1095)
**Motivation** The idea is to prevent arithmetic overflows and underflows in the levm code. **Description** Design desitions: - For the gas increment I used `checked_add` and added a `ConsumedGasOverflow` error. - For depth used `checked_add` and the `StackOverflow` error - In the `VM::execute` method I decided to do not raise an error, because the previous behavior was to do not raise errors, so used the saturating functions - For opcode operations used `InvalidOpcode` error Closes #1075 --------- Co-authored-by: JereSalo <[email protected]> Co-authored-by: Juani Medone <[email protected]> Co-authored-by: Javier Chatruc <[email protected]> Co-authored-by: Ivan Litteri <[email protected]> Co-authored-by: ilitteri <[email protected]> Co-authored-by: Jeremías Salomón <[email protected]>
- Loading branch information
1 parent
15cf7e2
commit 108163a
Showing
24 changed files
with
1,340 additions
and
633 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
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
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
Oops, something went wrong.