-
Notifications
You must be signed in to change notification settings - Fork 97
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
Set maxFeePerGas to gasCap #2295
Conversation
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.
Are we gonna cleanup MAX_FEE_FACTOR in a follow up PR?
// Use the lowest max_fee_per_gas of all mempools as the max_fee_per_gas | ||
let max_fee_per_gas = mempools | ||
.iter() | ||
.map(|mempool| eth::U256::from_f64_lossy(mempool.gas_price_cap)) |
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.
gas_price_cap
should be probably updated to U256
, not related to this PR
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.
It's being remove as part of #2294 |
@@ -42,9 +43,16 @@ impl GasPriceEstimator { | |||
mempool.additional_tip_percentage, | |||
) | |||
}); | |||
// Use the lowest max_fee_per_gas of all mempools as the max_fee_per_gas |
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.
Either the comment is wrong or you should be using .min()
, no?
// Use the lowest max_fee_per_gas of all mempools as the max_fee_per_gas | |
// Use the highest max_fee_per_gas of all mempools as the max_fee_per_gas |
Turns out that this PR isn't having the desired effect yet, since we are overriding our services/crates/solver/src/settlement_submission/submitter.rs Lines 155 to 171 in 6b4a053
Will change once we move to native solution submission |
Description
Our gas estimation logic was written prior to EIP1559 which changed Ethereum's transaction fee mechanism from a "pay as bid" to a "truthful bidding" mechanism. Before, users would need to think
They would always get charged 2.
Now, people only have to answer 1. and can rely on Ethereum's elastic base fee to make sure they are only getting charged as much as needed (the current base fee).
Priority fees remain a "pay as bid" part of the pricing, however those values tend to be very small (1-3 gwei) compared to the base fee (20-500 gwei).
This PR start to bid truthfully with regards to the maximum fee we are willing to pay. This simplifies a bunch of the solution submission logic as we now longer have to predict the maximum base fee in the future.
Changes
maxFeePerGas
togas_price_cap
How to test
Run e2e test, see settlements are now submitted with very high cap.
Related Issues
Fixes #1874