-
Notifications
You must be signed in to change notification settings - Fork 235
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
Improve tx pool index for different sorting strategies #3971
Improve tx pool index for different sorting strategies #3971
Conversation
1ae9352
to
6d9b2ea
Compare
37c6f61
to
fb1e262
Compare
@@ -90,7 +91,7 @@ impl TxEntry { | |||
} | |||
|
|||
/// Returns a sorted_key | |||
pub fn as_sorted_key(&self) -> AncestorsScoreSortKey { | |||
pub fn as_score_key(&self) -> AncestorsScoreSortKey { |
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.
Do we need to change this method's comment?
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 think as_score_key
maybe a better name, since we may have other sort keys.
self.sorted_index.insert(desc_entry.as_sorted_key()); | ||
} | ||
} | ||
self.update_descendants_index_key(&entry, EntryOp::Remove); |
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.
How about change EntryOp::Remove
to EntryOp::Sub
, since its purpose isn't "remove something" but "decrease weight".
What problem does this PR solve?
Issue Number: close #3942
Problem Summary:
What is changed and how it works?
What's Changed:
Related changes
SortedTxMap
for other sorting strategies.Check List
Tests
Side effects
There is a performance penalty for
Add
,Remove
entries inSortedTxMap
:before:
after:
No
Release note