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

[TieredStorage] Add IndexOffset type #33929

Merged
merged 1 commit into from
Nov 7, 2023

Conversation

yhchiang-sol
Copy link
Contributor

@yhchiang-sol yhchiang-sol commented Oct 30, 2023

Problem

TieredStorage conceptually has different offsets. However, the current code directly
uses the same primitive type for accessing offsets, which is error-prone as one could
easily use one offset to access data that should be accessed with a different offset
type.

Summary of Changes

This PR adds IndexOffset type -- a struct for obtaining the ith entry inside the
index-block to obtain account's offset and address.

@codecov
Copy link

codecov bot commented Oct 30, 2023

Codecov Report

Merging #33929 (2770d74) into master (ec0ddc9) will decrease coverage by 0.1%.
The diff coverage is 75.0%.

@@            Coverage Diff            @@
##           master   #33929     +/-   ##
=========================================
- Coverage    81.9%    81.9%   -0.1%     
=========================================
  Files         811      811             
  Lines      219333   219337      +4     
=========================================
- Hits       179762   179712     -50     
- Misses      39571    39625     +54     

@yhchiang-sol yhchiang-sol changed the title [TieredStorage] Add IndexPosition type [TieredStorage] Add IndexOffset type Nov 7, 2023
@yhchiang-sol
Copy link
Contributor Author

Given this is a smaller PR, let me rebase it as we only have one comment here.

Copy link
Contributor

@brooksprumo brooksprumo left a comment

Choose a reason for hiding this comment

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

lgtm

@yhchiang-sol yhchiang-sol merged commit b013c03 into solana-labs:master Nov 7, 2023
32 checks passed
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