-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
1559: Removes unnecessary max #3640
Conversation
We can prove that the `parent_base_fee_per_gas - base_fee_per_gas_delta > 0`, so flooring to 0 is unnecessary.
expected_base_fee_per_gas = max(parent_base_fee_per_gas - base_fee_per_gas_delta, 0) | ||
expected_base_fee_per_gas = parent_base_fee_per_gas - base_fee_per_gas_delta |
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.
(parent_gas_target - parent_gas_used) / parent_gas_target
is always between 0 and 1 sinceparent_gas_used < parent_gas_target
in this code path and both numbers are always positive.- This means that
base_fee_per_gas_delta
will be between0/8
andparent_base_fee_per_gas/8
in this code path. - Which means
base_fee_per_gas_delta
will always be greater than or equal to 0.
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 correct to me.
@MicahZoltu @lightclient looks like the bot is also expecting author review, does editor review override lack of author in this case? |
@alita-moore no, I was just approving to share my opinion. It's up to the authors to merge. |
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 good to me
Ping @MicahZoltu. |
Pull request was closed
We can prove that the `parent_base_fee_per_gas - base_fee_per_gas_delta > 0`, so flooring to 0 is unnecessary.
We can prove that the
parent_base_fee_per_gas - base_fee_per_gas_delta > 0
, so flooring to 0 is unnecessary.