-
Notifications
You must be signed in to change notification settings - Fork 221
Improve AddTx in list for sender #7525
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
base: feat/supernova-async-exec
Are you sure you want to change the base?
Improve AddTx in list for sender #7525
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feat/supernova-async-exec #7525 +/- ##
==========================================================
Coverage 77.60% 77.60%
==========================================================
Files 874 875 +1
Lines 119875 119897 +22
==========================================================
+ Hits 93031 93049 +18
- Misses 20749 20754 +5
+ Partials 6095 6094 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ersx/mx-chain-go into improve-add-tx-in-list-for-sender
| return (node.Key).(*list.Element), nil | ||
| } | ||
|
|
||
| return nil, nil |
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.
return nil, nil should not happen.
|
|
||
| if insertionPlace == nil { | ||
| listForSender.items.PushFront(tx) | ||
| element := listForSender.items.PushFront(tx) |
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 get this is how it was used, but returning nil, nil from findInsertionPlace is a bad design, you could return and extra bool, and solve with that.
Reasoning behind the pull request
This PR introduces a new data structure, a Red Black Tree (a balanced BST) which allows us finding the insertion place of a new element in O(log n).
Proposed changes
Testing procedure
Pre-requisites
Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:
featbranch created?featbranch merging, do all satellite projects have a proper tag insidego.mod?