-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fix the calculation for estimated gas price #20
base: main
Are you sure you want to change the base?
Conversation
size-limit report 📦
|
bab6984
to
f4b6e8d
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.
28006e8
to
3ed6e3d
Compare
ok. learning more. so thanks for the find @piersy |
Hey @aaronmgdr me too 😃
Note the default So the current gas
With this PR we get:
So this change is fixing the gas price suggestion for the Op L2 stack but not for the Celo L1. Although it is arguably improving the situation since the estimate will be lower and given that the baseFee would already be doubled by the server we probably want to minimize any further increases, I suspect that could be why our viem modifications were not using the So I'm not sure what to do here, do we want to support different logic for the different networks or do we want just a single approach? If we did want to support different logic for mainnet then we might also want to have that logic switch base on when the cel2 fork occurs, however I don't currently have a clear idea about how best achieve that. |
Hi @shazarre, I've made the changes we discussed to switch based on whether the chain is L1 or L2. BTW when I try to commit I get a bunch of errors from the linter for code that I didn't touch, and I'm wondering how I can configure the project to avoid that? |
@piersy thanks so much for your help on this |
Hi @aaronmgdr I've fixed the linter errors here, what's the next stage for this PR? |
open against the wevm/viem repo |
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.