Skip to content
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

feat: higher priority fee when late #186

Merged
merged 162 commits into from
Feb 5, 2025

Conversation

segfault-magnet
Copy link
Contributor

closes: #180

Analyzed our worst offenders and it seems there is nothing else to do but bump the priority fee more as we get more desperate.

For context:
The priority fee percentage mentioned in the PR is explained nicely here:

 * @param args.percentiles - A set of numbers between 1 and 100 which will dictate how
 * `priorityFeesByPercentile` in each returned block will be formed. When Ethereum runs the
 * `eth_feeHistory` method, for each block it is considering, it will first sort all transactions by
 * the priority fee. It will then go through each transaction and add the total amount of gas paid
 * for that transaction to a bucket which maxes out at the total gas used for the whole block. As
 * the bucket fills, it will cross percentages which correspond to the percentiles specified here,
 * and the priority fees of the first transactions which cause it to reach those percentages will be
 * recorded. Hence, `priorityFeesByPercentile` represents the priority fees of transactions at key
 * gas used contribution levels, where earlier levels have smaller contributions and later levels
 * have higher contributions.

The default priority fee estimator in Alloy requests the 20th percentile for the last 10 blocks and calculates the median max priority fee per gas from that.

This PR makes the percentile configurable by setting the min and max value. The percentile will increase between those as we get more and more behind reaching the max percentile on max_l2_blocks_behind.

e2e/src/committer.rs Show resolved Hide resolved
MujkicA
MujkicA previously approved these changes Jan 14, 2025
Base automatically changed from feat/price_optimizing_algo to master January 16, 2025 10:10
@hal3e hal3e dismissed MujkicA’s stale review January 16, 2025 10:10

The base branch was changed.

@segfault-magnet segfault-magnet force-pushed the feat/higher_priority_fee_when_late branch 3 times, most recently from a746294 to 4214585 Compare January 27, 2025 09:35
@segfault-magnet segfault-magnet merged commit 847a195 into master Feb 5, 2025
13 checks passed
@segfault-magnet segfault-magnet deleted the feat/higher_priority_fee_when_late branch February 5, 2025 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

improve chances of tx inclusion
3 participants