-
Notifications
You must be signed in to change notification settings - Fork 29
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
Adapt gasPrice to post-London/EIP1559 fees parameters #2953
Conversation
Latest.gasPrice becomes an object (or undefined) to be spread into tx's `overrides`, and by default should contain post-london `maxFeePerGas` and `maxPriorityFeePerGas`, as given by `Provider.getFeeData`; `config.gasPriceFactor` then gets applied only over `maxPriorityFeePerGas`, to tweak priority fees only. Default leaves it as `undefined`, and let Metamask/provider guess the best gas parameters.
since now this is an object containing overrides (or undefined), instead of a fixed value.
Codecov Report
@@ Coverage Diff @@
## master #2953 +/- ##
==========================================
+ Coverage 93.32% 93.34% +0.01%
==========================================
Files 207 207
Lines 8830 8841 +11
Branches 1382 1389 +7
==========================================
+ Hits 8241 8253 +12
+ Misses 488 487 -1
Partials 101 101
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
15feb25
to
4bcb833
Compare
Tested it on the mainnet with a deposit. Works |
Ok this observation also needs to be taken care of, the transactions take almost 15 to 20 minutes to get confirmed and this |
@agatsoh you sure you didn't edit the gas price on Metamask? Your pending TX contains a quite low |
@andrevmatos I absolutely did not edit anything on metamask. I have seen that is pretty odd actually. Mostly in other transaction the |
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, only a small formatting fix in the changelog necessary.
4bcb833
to
a6c8b0c
Compare
Fixes #2952
Short description
London hardfork replaced the previous guess-based
gasPrice
parameter for transactions with amaxFeePerGas
andmaxPriorityFeePerGas
pair. Recentethers
versions (5.4+) supports this through aprovider.getFeeData()
method and the respective tx overrides parameters. We update theLatest.gasPrice
observable to receive an object (possibly undefined) to be spread intooverrides
, containing either legacy (if needed) or new properties, and nowconfig.gasPriceFactor
(used by CLI to set priority txs) acts only uponmaxPriorityFeePerGas
.An undefined gas price overrides should ensure ethers is left to do the right thing™ on its own, and we try to meddle with these values as little as possible through only the priority fee on CLI only.
This should make suggested tx fee parameters more deterministic and also less wasteful, as the legacy
gasPrice
-only value often caused issues when trying to guesstimate a the price for a new tx.Possibly, this may also help with #2914, but we may want a mechanism to force the prices there to be zero, or whatever Arbitrum nodes require. At least we remove the hardcoded minimum of
1 Gwei
(although ethers still hardcodes a defaultmaxPriorityFeePerGas
of2.5 Gwei
, but this is going to get smarter in the near future).Definition of Done
Steps to manually test the change (dApp)