-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: mempool fetch_highest_priority_txs (#5551)
Description --- Fix the `fetch_highest_priority_txs`. The process of selection is as follows: Assume that all transaction have the same weight for simplicity. A(20)->B(2) means A depends on B and A has fee 20 and B has fee 2. A(20)->B(2)->C(14), D(12) 1) A will be selected first, but B and C will be piggybacked on A, because overall fee_per_byte is 12, so we store it temporarily. 2) We look at transaction C with fee per byte 14, it's good, nothing is better. 3) We come back to transaction A with fee per byte 12, but now that C is already in, we recompute it's fee per byte to 11, and again we store it temporarily. 4) Next we process transaction D, it's good, nothing is better. 5) And now we proceed finally to transaction A, because there is no other possible better option. Motivation and Context --- As it was it was easy to piggyback heavy transaction with low fee_per_byte on light transaction with high fee per byte. How Has This Been Tested? --- There are two tests for zero conf, one is for the piggybacking. What process can a PR reviewer use to test or verify this change? --- <!-- Checklist --> <!-- 1. Is the title of your PR in the form that would make nice release notes? The title, excluding the conventional commit tag, will be included exactly as is in the CHANGELOG, so please think about it carefully. --> Breaking Changes --- - [x] None - [ ] Requires data directory on base node to be deleted - [ ] Requires hard fork - [ ] Other - Please specify <!-- Does this include a breaking change? If so, include this line as a footer --> <!-- BREAKING CHANGE: Description what the user should do, e.g. delete a database, resync the chain -->
- Loading branch information
Showing
3 changed files
with
275 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters