Skip to content

core: simplify effectiveTip calculation #31771

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

Merged
merged 2 commits into from
Jun 19, 2025

Conversation

zhiqiangxu
Copy link
Contributor

In buyGas, GasPrice is used to conduct the gas cost.

However when computing effectiveTip, GasFeeCap is used instead.

In theory, GasFeeCap >= GasPrice, so it may happen that the tip fee is larger than it should be.

This PR tries to reduce such confusion by computing effectiveTip by GasPrice - BaseFee instead of GasFeeCap - BaseFee.

Note that for all tx types, GasFeeCap == GasPrice always holds, so there's no problem for tx. But it's still better to make it consistent .

@zhiqiangxu zhiqiangxu requested a review from rjl493456442 as a code owner May 6, 2025 16:34
lightclient
lightclient previously approved these changes May 6, 2025
Copy link
Member

@lightclient lightclient left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine to me.

@fjl fjl changed the title core: effectiveTip = GasPrice - BaseFee instead of GasFeeCap - BaseFee core: simplify effectiveTip calculation Jun 17, 2025
@fjl fjl added this to the 1.15.12 milestone Jun 19, 2025
@fjl fjl merged commit 6762006 into ethereum:master Jun 19, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants