This repository has been archived by the owner on Jan 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Switch confirmed_unrooted_slots from Vec<_> to HashSet<_> #33311
Merged
Conversation
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
9c10ad4
to
bd6300c
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.
Seems like a fair trade-off. Bump me when this is past CI and I'll approve
The container is only used to check for inclusion of slots with the .contains() method. This method is O(n) on a Vec<_> but O(1) on a HashSet<_>.
bd6300c
to
89dbed9
Compare
Codecov Report
@@ Coverage Diff @@
## master #33311 +/- ##
=======================================
Coverage 81.9% 81.9%
=======================================
Files 796 796
Lines 215745 215752 +7
=======================================
+ Hits 176789 176809 +20
+ Misses 38956 38943 -13 |
Shoot, my bad; I thought I had seen greens before adding you but that obviously wasn't the case. Rebase on tip of master did the trick |
CriesofCarrots
approved these changes
Sep 21, 2023
SwenSchaeferjohann
pushed a commit
to ananas-block/solana
that referenced
this pull request
Sep 23, 2023
Switch confirmed_unrooted_slots from Vec<_> to HashSet<_> (solana-labs#33311) The container is only used to check for inclusion of slots with the .contains() method. This method is O(n) on a Vec<_> but O(1) on a HashSet<_>. add Restart structs for disk index (solana-labs#33361) use bytemuck for disk bucket restart (solana-labs#33371) disk bucket: init restart path (solana-labs#33375) simple cleanup in bucket map (solana-labs#33376) add disk bucket get_restart_file (solana-labs#33373) * add disk bucket get_restart_file * add get_restartable_buckets pass RestartableBucket through disk index (solana-labs#33377) data bucket holds RestartableBucket (solana-labs#33381) Feature - better error codes for tx lamport check (solana-labs#33343) Replaces `TransactionError::InstructionError(0, InstructionError::UnbalancedInstruction)` with `TransactionError::UnbalancedTransaction`. Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net> DiskIdx: reuse disk bucket file if possible (solana-labs#33379) diskidx: stats for created vs reused (solana-labs#33385) solana-program - altbn128: add g1 & g2 compression still fixing tests for point of infinity feat: proof compression syscall working add rust test to ci remove prints added c test added sycall pricing fixed ci checks refactored altbn128 and compression
jeffwashington
pushed a commit
to jeffwashington/solana
that referenced
this pull request
Sep 25, 2023
…s#33311) The container is only used to check for inclusion of slots with the .contains() method. This method is O(n) on a Vec<_> but O(1) on a HashSet<_>.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The container is only used to check for inclusion of slots with
the .contains() method. This method is O(n) on a Vec<> but O(1) on a
HashSet<>.
The container should be fairly small given that it is populated with confirmed slots that are newer than the most recent root. So, in normal network conditions, should be around the lockout length. Regardless, still a more proper change to make