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

Derives Pod for tiered storage types #34414

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

brooksprumo
Copy link
Contributor

Problem

Related to #34121, we'd like to eliminate all undefined behavior in Tiered Storage w.r.t. reading and writing bytes from files/mmaps.

The bytemuck crate provides traits for guaranteeing data layout that ensures there will not be undefined behavior. Tiered Storage is missing some of those traits that would make UB go away.

Summary of Changes

Derive the appropriate bytemuck traits on the Tiered Storage types that are written to files. Also add constant asserts to ensure the invariants for Pod are not broken.

@brooksprumo brooksprumo self-assigned this Dec 12, 2023
@brooksprumo brooksprumo marked this pull request as ready for review December 12, 2023 17:01
Copy link

codecov bot commented Dec 12, 2023

Codecov Report

Merging #34414 (e37b602) into master (39a3566) will decrease coverage by 0.1%.
Report is 1 commits behind head on master.
The diff coverage is 83.3%.

Additional details and impacted files
@@            Coverage Diff            @@
##           master   #34414     +/-   ##
=========================================
- Coverage    81.9%    81.8%   -0.1%     
=========================================
  Files         819      819             
  Lines      220984   220991      +7     
=========================================
- Hits       181015   180984     -31     
- Misses      39969    40007     +38     

Copy link
Contributor

@yhchiang-sol yhchiang-sol left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for making it safer.

@brooksprumo brooksprumo merged commit a2d7be0 into solana-labs:master Dec 12, 2023
34 checks passed
@brooksprumo brooksprumo deleted the ts/ub/pod branch December 12, 2023 19:59
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