feat(levm): opcodes gas consumption#584
Merged
Merged
Conversation
- Check if gas is enough before executing each one of them. - Write new `Memory::expansion_cost` function to calculate its cost. - Add related constants.
Closed
- Add new `is_empty` function for `Account`. - Save `warm_addresses` in `VM`. - `code_execution_cost` for `CALL` is still missing. - Fix a `CALL` test.
belfortep
reviewed
Sep 30, 2024
belfortep
reviewed
Sep 30, 2024
belfortep
reviewed
Sep 30, 2024
belfortep
reviewed
Sep 30, 2024
belfortep
reviewed
Sep 30, 2024
belfortep
left a comment
Contributor
There was a problem hiding this comment.
Great work! everything looks nice, just asked for some minor changes
Co-authored-by: Paolo Belforte <75280184+belfortep@users.noreply.github.com>
jrchatruc
approved these changes
Oct 2, 2024
emirongrr
pushed a commit
to emirongrr/ethrex
that referenced
this pull request
Nov 10, 2024
**Motivation** Implement `GAS` opcode, which requires a first global handling of gas consumption. <!-- Why does this pull request exist? What are its goals? --> **Description** - Uses `VM::gas_limit` and `VM::consumed_gas` for handling all opcodes static and dynamic gas consumption. - Check if gas is enough before executing each one of them. - Save `warm_addresses` in `VM`. - Fixes a `jump` bug and a `CALL` test. - Adds gas checks to the tests. - `CALL`'s `code_execution_cost` is still to be implemented (lambdaclass#605). <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves lambdaclass#111, Resolves lambdaclass#222 --> Closes lambdaclass#493 and lambdaclass#587. --------- Co-authored-by: Paolo Belforte <75280184+belfortep@users.noreply.github.com> Co-authored-by: iinaki <llorensinaki22@gmail.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Implement
GASopcode, which requires a first global handling of gas consumption.Description
VM::gas_limitandVM::consumed_gasfor handling all opcodes static and dynamic gas consumption.warm_addressesinVM.jumpbug and aCALLtest.CALL'scode_execution_costis still to be implemented (ImplementCALL'scode_execution_cost#605).Closes #493 and #587.