-
Notifications
You must be signed in to change notification settings - Fork 92
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
feat(forks): Add gas costs functions #779
Merged
marioevz
merged 12 commits into
main
from
update-to-gas-cost-functions-in-prep-for-eip-7623
Nov 4, 2024
Merged
feat(forks): Add gas costs functions #779
marioevz
merged 12 commits into
main
from
update-to-gas-cost-functions-in-prep-for-eip-7623
Nov 4, 2024
Conversation
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
…_transaction_data_cost`
marioevz
force-pushed
the
update-to-gas-cost-functions-in-prep-for-eip-7623
branch
from
October 31, 2024 22:43
b933107
to
3e2ec92
Compare
marioevz
added
scope:forks
Scope: ethereum_test_forks package
scope:tests
Scope: Test cases
type:refactor
Type: Refactor
type:feat
type: Feature
labels
Oct 31, 2024
11 tasks
danceratopz
approved these changes
Nov 4, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really impressive!
marioevz
deleted the
update-to-gas-cost-functions-in-prep-for-eip-7623
branch
November 4, 2024 15:56
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
scope:forks
Scope: ethereum_test_forks package
scope:tests
Scope: Test cases
type:feat
type: Feature
type:refactor
Type: Refactor
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.
🗒️ Description
Introduce gas-calculating functions in the fork object, which are updated for each fork:
memory_expansion_gas_calculator
: Calculates the cost of expanding the memory from a starting memory length to a new memory length. Unchanged since Frontier fork.calldata_gas_calculator
: Calculates the intrinsic gas cost of a transaction calldata, given the amount of zero and non-zero bytes in it. Changed in Istanbul fork (not directly but duegas_costs().G_TX_DATA_NON_ZERO
reduction).transaction_intrinsic_cost_calculator
: Calculates the intrinsic gas cost of a transaction given the calldata, whether the transaction is contract creating, the access list, and the number of authorizations. Updated for Homestead, Berlin and Prague forks.gas_costs
: returns an Enum containing all gas-related constants.This PR should make the implementation of the
TransactionTest
spec type easier (#933).🔗 Related Issues
✅ Checklist
mkdocs serve
locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.