-
Notifications
You must be signed in to change notification settings - Fork 992
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
Evict transaction from transaction pool #2797
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.
Looks good - one comment about the actual remove
step.
// Get last transaction and remove it | ||
match bucket_transactions.last() { | ||
Some(evictable_transaction) => { | ||
// Remove transaction |
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.
We should be able use entries.remove()
here I think.
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.
I'm not sure this is doable since we are comparing a PoolEntry
with a Transaction
.
If both were PoolEntry
a remove_item(...)
would be possible
(or there is a cheap way to get the index of the PoolEntry
that I am missing).
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.
Ah good point.
Replace #2706 and fix #1417.
Thanks to #2758 we can drastically simplify the eviction process when the transaction pool is full:
bucket_transactions
and remove the last one (No other tx depends on it, it has low fee_to_weight and is unlikely to participate in any cut-through).