Fix the calculation for estimated gas price#3117
Merged
Conversation
🦋 Changeset detectedLatest commit: 7249a73 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
@piersy is attempting to deploy a commit to the Wevm Team on Vercel. A member of the Team first needs to authorize it. |
819f98b to
af51ad9
Compare
The gas price returned by the rpc is base_fee + max_priority_fee. So we shouldn't add the max_priority_fee onto that value since it's already included. Also the logic used by viem for applying the multiplier is to only apply the multiplier to the base fee and not the priority fee, so we match that approach here.
5cb2631 to
b7163c2
Compare
Merged
ezdac
added a commit
to celo-org/op-geth
that referenced
this pull request
May 27, 2025
Upstream viem recently merged a fix to the `estimateFeesPerGas` function (wevm/viem#3117), and the recent updates to the e2e tests npm packages now includes the fixed version of viem. With this the asserted values in the viem e2e test are no longer a reflection of what es expected to be returned from the viem library and had to be adjusted.
ezdac
added a commit
to celo-org/op-geth
that referenced
this pull request
May 27, 2025
Upstream viem recently merged a fix to the `estimateFeesPerGas` function (wevm/viem#3117), and the recent updates to the e2e tests npm packages now includes the fixed version of viem. With this the asserted values in the viem e2e test are no longer a reflection of what es expected to be returned from the viem library and had to be adjusted.
ezdac
added a commit
to celo-org/op-geth
that referenced
this pull request
May 27, 2025
Upstream viem recently merged a fix to the `estimateFeesPerGas` function (wevm/viem#3117), and the recent updates to the e2e tests npm packages now includes the fixed version of viem. With this the asserted values in the viem e2e test are no longer a reflection of what es expected to be returned from the viem library and had to be adjusted.
ezdac
added a commit
to celo-org/op-geth
that referenced
this pull request
May 27, 2025
Upstream viem recently merged a fix to the `estimateFeesPerGas` function (wevm/viem#3117), and the recent updates to the e2e tests npm packages now includes the fixed version of viem. With this the asserted values in the viem e2e test are no longer a reflection of what es expected to be returned from the viem library and had to be adjusted.
ezdac
added a commit
to celo-org/op-geth
that referenced
this pull request
Jun 3, 2025
* chore(ci): update foundry version to v1.1.0 * chore(ci): use new op-stack-base image runner * chore: set default TERM in e2e test for tput * chore(ci): determine npm version from package.json * chore(ci): put setup in composite action * chore: update e2e test js dependencies * Adapt viem e2e test's asserts to upstream fix Upstream viem recently merged a fix to the `estimateFeesPerGas` function (wevm/viem#3117), and the recent updates to the e2e tests npm packages now includes the fixed version of viem. With this the asserted values in the viem e2e test are no longer a reflection of what es expected to be returned from the viem library and had to be adjusted. * Loosen error check condition in e2e-test Due to possible expansion of the responses error string in potential proxy setups on a live RPC endpoint, the strict error check in the e2e viem test caused the test to fail, although the error condition was expected.
Kourin1996
pushed a commit
to celo-org/op-geth
that referenced
this pull request
Jul 20, 2025
* chore(ci): update foundry version to v1.1.0 * chore(ci): use new op-stack-base image runner * chore: set default TERM in e2e test for tput * chore(ci): determine npm version from package.json * chore(ci): put setup in composite action * chore: update e2e test js dependencies * Adapt viem e2e test's asserts to upstream fix Upstream viem recently merged a fix to the `estimateFeesPerGas` function (wevm/viem#3117), and the recent updates to the e2e tests npm packages now includes the fixed version of viem. With this the asserted values in the viem e2e test are no longer a reflection of what es expected to be returned from the viem library and had to be adjusted. * Loosen error check condition in e2e-test Due to possible expansion of the responses error string in potential proxy setups on a live RPC endpoint, the strict error check in the e2e viem test caused the test to fail, although the error condition was expected.
Kourin1996
pushed a commit
to celo-org/op-geth
that referenced
this pull request
Jul 21, 2025
* chore(ci): update foundry version to v1.1.0 * chore(ci): use new op-stack-base image runner * chore: set default TERM in e2e test for tput * chore(ci): determine npm version from package.json * chore(ci): put setup in composite action * chore: update e2e test js dependencies * Adapt viem e2e test's asserts to upstream fix Upstream viem recently merged a fix to the `estimateFeesPerGas` function (wevm/viem#3117), and the recent updates to the e2e tests npm packages now includes the fixed version of viem. With this the asserted values in the viem e2e test are no longer a reflection of what es expected to be returned from the viem library and had to be adjusted. * Loosen error check condition in e2e-test Due to possible expansion of the responses error string in potential proxy setups on a live RPC endpoint, the strict error check in the e2e viem test caused the test to fail, although the error condition was expected.
Kourin1996
pushed a commit
to celo-org/op-geth
that referenced
this pull request
Jul 26, 2025
* chore(ci): update foundry version to v1.1.0 * chore(ci): use new op-stack-base image runner * chore: set default TERM in e2e test for tput * chore(ci): determine npm version from package.json * chore(ci): put setup in composite action * chore: update e2e test js dependencies * Adapt viem e2e test's asserts to upstream fix Upstream viem recently merged a fix to the `estimateFeesPerGas` function (wevm/viem#3117), and the recent updates to the e2e tests npm packages now includes the fixed version of viem. With this the asserted values in the viem e2e test are no longer a reflection of what es expected to be returned from the viem library and had to be adjusted. * Loosen error check condition in e2e-test Due to possible expansion of the responses error string in potential proxy setups on a live RPC endpoint, the strict error check in the e2e viem test caused the test to fail, although the error condition was expected.
Kourin1996
pushed a commit
to celo-org/op-geth
that referenced
this pull request
Jul 26, 2025
* chore(ci): update foundry version to v1.1.0 * chore(ci): use new op-stack-base image runner * chore: set default TERM in e2e test for tput * chore(ci): determine npm version from package.json * chore(ci): put setup in composite action * chore: update e2e test js dependencies * Adapt viem e2e test's asserts to upstream fix Upstream viem recently merged a fix to the `estimateFeesPerGas` function (wevm/viem#3117), and the recent updates to the e2e tests npm packages now includes the fixed version of viem. With this the asserted values in the viem e2e test are no longer a reflection of what es expected to be returned from the viem library and had to be adjusted. * Loosen error check condition in e2e-test Due to possible expansion of the responses error string in potential proxy setups on a live RPC endpoint, the strict error check in the e2e viem test caused the test to fail, although the error condition was expected.
Kourin1996
pushed a commit
to celo-org/op-geth
that referenced
this pull request
Jul 28, 2025
* chore(ci): update foundry version to v1.1.0 * chore(ci): use new op-stack-base image runner * chore: set default TERM in e2e test for tput * chore(ci): determine npm version from package.json * chore(ci): put setup in composite action * chore: update e2e test js dependencies * Adapt viem e2e test's asserts to upstream fix Upstream viem recently merged a fix to the `estimateFeesPerGas` function (wevm/viem#3117), and the recent updates to the e2e tests npm packages now includes the fixed version of viem. With this the asserted values in the viem e2e test are no longer a reflection of what es expected to be returned from the viem library and had to be adjusted. * Loosen error check condition in e2e-test Due to possible expansion of the responses error string in potential proxy setups on a live RPC endpoint, the strict error check in the e2e viem test caused the test to fail, although the error condition was expected.
Kourin1996
pushed a commit
to celo-org/op-geth
that referenced
this pull request
Jul 30, 2025
* chore(ci): update foundry version to v1.1.0 * chore(ci): use new op-stack-base image runner * chore: set default TERM in e2e test for tput * chore(ci): determine npm version from package.json * chore(ci): put setup in composite action * chore: update e2e test js dependencies * Adapt viem e2e test's asserts to upstream fix Upstream viem recently merged a fix to the `estimateFeesPerGas` function (wevm/viem#3117), and the recent updates to the e2e tests npm packages now includes the fixed version of viem. With this the asserted values in the viem e2e test are no longer a reflection of what es expected to be returned from the viem library and had to be adjusted. * Loosen error check condition in e2e-test Due to possible expansion of the responses error string in potential proxy setups on a live RPC endpoint, the strict error check in the e2e viem test caused the test to fail, although the error condition was expected.
Kourin1996
pushed a commit
to celo-org/op-geth
that referenced
this pull request
Jul 30, 2025
* chore: set default TERM in e2e test for tput * chore: update e2e test js dependencies * Adapt viem e2e test's asserts to upstream fix Upstream viem recently merged a fix to the `estimateFeesPerGas` function (wevm/viem#3117), and the recent updates to the e2e tests npm packages now includes the fixed version of viem. With this the asserted values in the viem e2e test are no longer a reflection of what es expected to be returned from the viem library and had to be adjusted. * Loosen error check condition in e2e-test Due to possible expansion of the responses error string in potential proxy setups on a live RPC endpoint, the strict error check in the e2e viem test caused the test to fail, although the error condition was expected.
Kourin1996
pushed a commit
to celo-org/op-geth
that referenced
this pull request
Jul 30, 2025
* chore: update e2e test js dependencies * Adapt viem e2e test's asserts to upstream fix Upstream viem recently merged a fix to the `estimateFeesPerGas` function (wevm/viem#3117), and the recent updates to the e2e tests npm packages now includes the fixed version of viem. With this the asserted values in the viem e2e test are no longer a reflection of what es expected to be returned from the viem library and had to be adjusted.
Kourin1996
pushed a commit
to celo-org/op-geth
that referenced
this pull request
Jul 31, 2025
Upstream viem recently merged a fix to the `estimateFeesPerGas` function (wevm/viem#3117), and the recent updates to the e2e tests npm packages now includes the fixed version of viem. With this the asserted values in the viem e2e test are no longer a reflection of what es expected to be returned from the viem library and had to be adjusted.
Kourin1996
pushed a commit
to celo-org/op-geth
that referenced
this pull request
Jul 31, 2025
Upstream viem recently merged a fix to the `estimateFeesPerGas` function (wevm/viem#3117), and the recent updates to the e2e tests npm packages now includes the fixed version of viem. With this the asserted values in the viem e2e test are no longer a reflection of what es expected to be returned from the viem library and had to be adjusted.
Kourin1996
pushed a commit
to celo-org/op-geth
that referenced
this pull request
Jul 31, 2025
Upstream viem recently merged a fix to the `estimateFeesPerGas` function (wevm/viem#3117), and the recent updates to the e2e tests npm packages now includes the fixed version of viem. With this the asserted values in the viem e2e test are no longer a reflection of what es expected to be returned from the viem library and had to be adjusted.
Kourin1996
pushed a commit
to celo-org/op-geth
that referenced
this pull request
Aug 1, 2025
Upstream viem recently merged a fix to the `estimateFeesPerGas` function (wevm/viem#3117), and the recent updates to the e2e tests npm packages now includes the fixed version of viem. With this the asserted values in the viem e2e test are no longer a reflection of what es expected to be returned from the viem library and had to be adjusted.
Kourin1996
pushed a commit
to celo-org/op-geth
that referenced
this pull request
Aug 1, 2025
Upstream viem recently merged a fix to the `estimateFeesPerGas` function (wevm/viem#3117), and the recent updates to the e2e tests npm packages now includes the fixed version of viem. With this the asserted values in the viem e2e test are no longer a reflection of what es expected to be returned from the viem library and had to be adjusted.
Kourin1996
pushed a commit
to celo-org/op-geth
that referenced
this pull request
Aug 1, 2025
Upstream viem recently merged a fix to the `estimateFeesPerGas` function (wevm/viem#3117), and the recent updates to the e2e tests npm packages now includes the fixed version of viem. With this the asserted values in the viem e2e test are no longer a reflection of what es expected to be returned from the viem library and had to be adjusted.
Kourin1996
pushed a commit
to celo-org/op-geth
that referenced
this pull request
Aug 3, 2025
Upstream viem recently merged a fix to the `estimateFeesPerGas` function (wevm/viem#3117), and the recent updates to the e2e tests npm packages now includes the fixed version of viem. With this the asserted values in the viem e2e test are no longer a reflection of what es expected to be returned from the viem library and had to be adjusted.
karlb
added a commit
to celo-org/op-geth
that referenced
this pull request
Sep 10, 2025
This brings a celoSepolia definition and staying up to date is generally a good idea. Due to wevm/viem#3117 being merged in view, we can (and have to) remove a changed assert in the "test gas price difference for fee currency" test.
karlb
added a commit
to celo-org/op-geth
that referenced
this pull request
Sep 10, 2025
This brings a celoSepolia definition and staying up to date is generally a good idea. Due to wevm/viem#3117 being merged in view, we can (and have to) remove a changed assert in the "test gas price difference for fee currency" test.
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.
Updates
estimateFeesPerGasto handle both the valuesreturned by the Celo L1 and also the values that will be returned
by the L2 Celo implementation.
Also removes the use of the viem multiplier for Celo L1 gas
calculations since the Celo L1 node already doubles the base fee.
Changes explained in detail:
Note the default
viemMultiplieris 1.2 and the defaultceloMultiplieris 2.The current gas
maxFeePerGassuggested by viem (before this PR) is this:((baseFee * celoMultiplier) * viemMultiplier) + suggestedTip((baseFee+suggestedTip) * viemMultiplier) + suggestedTipWith this PR we get:
(baseFee * celoMultiplier) + suggestedTip(baseFee * viemMultiplier) + suggestedTip