Skip to content

Commit

Permalink
Backport: patch transaction pool ordering zero tip (#2642)
Browse files Browse the repository at this point in the history
## Description
Before this fix when tip is zero, transactions that use 30M have the
same priority as transactions with 1M gas. Now they are correctly
ordered

## Checklist
- [x] Breaking changes are clearly marked as such in the PR description
and changelog
- [x] New behavior is reflected in tests
- [x] [The specification](https://github.com/FuelLabs/fuel-specs/)
matches the implemented behavior (link update PR if changes are needed)

### Before requesting review
- [x] I have reviewed the code myself
- [x] I have created follow-up issues caused by this PR and linked them
here
  • Loading branch information
AurelienFT authored Jan 28, 2025
1 parent 8252dc6 commit c6216d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

- [2638](https://github.com/FuelLabs/fuel-core/pull/2638): Optimize the `cumulative_percent_change` function used in estimation of gas price, convert multiple async functions to sync.
- [2641](https://github.com/FuelLabs/fuel-core/pull/2641): Remove `txPoolStats` requirement from fuel core client
- [2642](https://github.com/FuelLabs/fuel-core/pull/2642): Before this fix when tip is zero, transactions that use 30M have the same priority as transactions with 1M gas. Now they are correctly ordered.

## [Version 0.40.3]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ where

fn key(store_entry: &StorageData) -> Key {
let transaction = &store_entry.transaction;
let tip_gas_ratio = RatioTipGas::new(transaction.tip(), transaction.max_gas());
let tip_gas_ratio =
RatioTipGas::new(transaction.tip().saturating_add(1), transaction.max_gas());

Key {
ratio: tip_gas_ratio,
Expand Down

0 comments on commit c6216d0

Please sign in to comment.