Skip to content
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

Uses IntSet for dead slots #33529

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

brooksprumo
Copy link
Contributor

@brooksprumo brooksprumo commented Oct 4, 2023

Problem

When purging dead accounts, we also track dead slots. That is done by keeping a list, currently as a HashSet, of slots. This list could even be a vector, as we don't need the cryptographic security of the default HashSet's hashing function. Since we do lookups, a HashSet is nice. We can use IntSet to keep the nice lookups and remove the slow hashing, as the slot itself if sufficiently unique.

Summary of Changes

Use IntSet for dead slots

@brooksprumo brooksprumo self-assigned this Oct 4, 2023
@brooksprumo brooksprumo marked this pull request as ready for review October 4, 2023 20:03
@codecov
Copy link

codecov bot commented Oct 4, 2023

Codecov Report

Merging #33529 (b738e63) into master (f714a44) will increase coverage by 0.0%.
The diff coverage is 100.0%.

@@           Coverage Diff           @@
##           master   #33529   +/-   ##
=======================================
  Coverage    81.7%    81.7%           
=======================================
  Files         805      805           
  Lines      218111   218111           
=======================================
+ Hits       178360   178367    +7     
+ Misses      39751    39744    -7     

Copy link
Contributor

@HaoranYi HaoranYi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@brooksprumo brooksprumo merged commit 3b93041 into solana-labs:master Oct 4, 2023
16 checks passed
@brooksprumo brooksprumo deleted the nohash/dead-slots branch October 4, 2023 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants