-
Notifications
You must be signed in to change notification settings - Fork 11
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
fix: change inner AddressPrioQueue #240
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #240 +/- ##
==========================================
- Coverage 74.78% 74.29% -0.49%
==========================================
Files 23 23
Lines 916 922 +6
Branches 916 922 +6
==========================================
Hits 685 685
- Misses 187 193 +6
Partials 44 44 ☔ View full report in Codecov by Sentry. |
b123cb8
to
9f6467f
Compare
- pop_front in Vec is O(n). - should be private to protect invariant.
9f6467f
to
e2cc261
Compare
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.
Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ayeletstarkware and @giladchase)
crates/mempool/src/priority_queue.rs
line 67 at r1 (raw file):
// Assumption: Transactions are provided in the correct order. #[derive(Default)] pub struct AddressPriorityQueue(VecDeque<ThinTransaction>);
I believe we should use a HashMap<Nonce, ThinTransaction>
, as @elintul also suggested. This will support nonce gaps, which will be added soon
Code quote:
VecDeque
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.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @ayeletstarkware and @giladchase)
crates/mempool/src/priority_queue.rs
line 67 at r1 (raw file):
// Assumption: Transactions are provided in the correct order. #[derive(Default)] pub struct AddressPriorityQueue(VecDeque<ThinTransaction>);
I think it's not a good name.
These transactions are not priority transactions.
Code quote:
AddressPriorityQueue
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.
Reviewed all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @elintul and @giladchase)
crates/mempool/src/priority_queue.rs
line 67 at r1 (raw file):
Previously, MohammadNassar1 (mohammad-starkware) wrote…
I believe we should use a
HashMap<Nonce, ThinTransaction>
, as @elintul also suggested. This will support nonce gaps, which will be added soon
Why not implement this in the future or the next version?
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.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @elintul and @MohammadNassar1)
crates/mempool/src/priority_queue.rs
line 67 at r1 (raw file):
Previously, ayeletstarkware (Ayelet Zilber) wrote…
Why not implement this in the future or the next version?
Already fixed on Ayelet's PR, if i change it here as well she'll hit a conflict
crates/mempool/src/priority_queue.rs
line 67 at r1 (raw file):
Previously, MohammadNassar1 (mohammad-starkware) wrote…
I think it's not a good name.
These transactions are not priority transactions.
Already fixed on Ayelet's PR, if i change it here as well she'll hit a conflict
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.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @elintul and @MohammadNassar1)
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.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @giladchase)
This change is