forked from ethereum-optimism/op-geth
-
Notifications
You must be signed in to change notification settings - Fork 15
Use different intrinsic-gas for fee-currencies in gas-estimation #356
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
gastonponti
merged 15 commits into
celo-rebase-12
from
gastonponti/fix-gas-estimation-with-fee-currency
Apr 4, 2025
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
7551d5a
Fix gas estimation for txs with feeCurrency
gastonponti ced578a
Better shortcut for gasEstimation with a feeCurrency
gastonponti 103755b
Refactor gasestimator. Cleaner and avoid unnecessary contract calls
gastonponti ab58a31
e2e test for gasEstimation with different currency
gastonponti 2c85b7e
make the test local
gastonponti 889835f
Merge branch 'celo-rebase-12' into gastonponti/fix-gas-estimation-wit…
gastonponti 3d7c40d
Change nwtwork endpoints to avoid flakyness
gastonponti 17f1793
Set default intrinsic gas
gastonponti 497adc4
Fix indent
gastonponti 2fa6afb
ws for e2e testnets
gastonponti 6b8a5ed
Fix webSocket configuration
gastonponti bdf197b
Fix correct transport
gastonponti e2aad6a
Fix transport
gastonponti 6d1bdbd
fix indent
gastonponti 8151593
Fix indent 2
gastonponti File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| #!/usr/bin/env node | ||
| import { publicClient, account } from "./viem_setup.mjs" | ||
|
|
||
| const [chainId, celoValue, feeCurrency] = process.argv.slice(2); | ||
|
|
||
| async function main() { | ||
| let bigCeloValue = BigInt(celoValue) | ||
|
|
||
| let result = await publicClient.estimateGas({ | ||
| account, | ||
| to: "0x00000000000000000000000000000000DeaDBeef", | ||
| value: bigCeloValue, | ||
| feeCurrency | ||
| }); | ||
| console.log(result.toString()) | ||
|
|
||
| return result; | ||
| } | ||
|
|
||
| await main(); | ||
| process.exit(0); |
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| #!/bin/bash | ||
| #shellcheck disable=SC2086 | ||
| set -eo pipefail | ||
|
|
||
| source shared.sh | ||
| source debug-fee-currency/lib.sh | ||
|
|
||
| fee_currency=$(deploy_fee_currency false false false 70000) | ||
| gas=$(estimate_tx 20 $fee_currency) | ||
|
|
||
| cleanup_fee_currency $fee_currency | ||
|
|
||
| # intrinsic of fee_currency: 70000 | ||
| # intrinsic of tx: 21000 | ||
| # total: 91000 | ||
| if [ $gas -ne 91000 ]; then exit 1; fi | ||
|
|
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.