-
Notifications
You must be signed in to change notification settings - Fork 268
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
Add EIP-7623 implementation #934
Conversation
This is meant for Prague right? We have our Prague branch at Feel free to move this over there (both changing the base branch and editing the |
Fix: wrong tx type(0x03) and link to EIP4844
How "set" are the changes in src/ethereum/prague? |
Add more retroactive EIPs
We don't need to merge the pull request until it's ready according to ACDE. I'm suggesting that you make the base branch of your pull request |
handle `to` address in transaction being None
Signed-off-by: cuibuwei <cuibuwei@gmail.com>
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.
Looks like you're still modifying the shanghai fork files, and not prague's
@@ -635,7 +636,13 @@ def process_transaction( | |||
|
|||
output = process_message_call(message, env) | |||
|
|||
gas_used = tx.gas - output.gas_left | |||
floor = tokens_in_calldata * TOTAL_COST_FLOOR_PER_TOKEN + TX_BASE_COST | |||
if gas_used + tokens_in_calldata * STANDARD_TOKEN_COST < floor: |
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.
Would it be more readable if gas_used + tokens_in_calldata * STANDARD_TOKEN_COST
was stored in an intermediate variable?
@@ -699,7 +706,7 @@ def validate_transaction(tx: Transaction) -> bool: | |||
verified : `bool` | |||
True if the transaction can be executed, or False otherwise. | |||
""" | |||
if calculate_intrinsic_cost(tx) > tx.gas: | |||
if calculate_intrinsic_cost(tx)[0] > tx.gas: |
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.
if calculate_intrinsic_cost(tx)[0] > tx.gas: | |
intrinsic_gas = calculate_intrinsic_cost(tx)[0] | |
if intrinsic_gas > tx.gas: |
verified : `ethereum.base_types.Uint` | ||
The calldata tokens used. |
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.
You'll probably want to use better names for the tuple elements.
return Uint(TX_BASE_COST + | ||
data_cost + | ||
create_cost + access_list_cost), tokens_in_calldata |
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.
You'll need to update the return type of the function to Tuple[Uint, Uint]
I think.
TOTAL_COST_FLOOR_PER_TOKEN = 12 | ||
STANDARD_TOKEN_COST = 4 |
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.
TOTAL_COST_FLOOR_PER_TOKEN = 12 | |
STANDARD_TOKEN_COST = 4 | |
TOTAL_COST_FLOOR_PER_CALLDATA_TOKEN = 12 | |
CALLDATA_TOKEN_COST = 4 |
Unless there's a compelling reason to say "STANDARD" here, I'd prefer not including it.
How do you feel about making it explicit these are calldata related constants?
I've merged them here, @SamWilsn : https://github.com/ethereum/execution-specs/pull/959/files I'm not sure why the changelog includes other files/changes that I didn't touch. |
Reopened for #897