Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

[TieredStorage] Add AccountOffset type #33927

Merged
merged 2 commits into from
Nov 6, 2023

Conversation

yhchiang-sol
Copy link
Contributor

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 introduces the AccountOffset type, which allows static-check to on different
type of TieredStorage offsets.

@codecov
Copy link

codecov bot commented Oct 30, 2023

Codecov Report

Merging #33927 (eb13327) into master (1c00d5d) will decrease coverage by 0.1%.
Report is 14 commits behind head on master.
The diff coverage is 71.4%.

@@            Coverage Diff            @@
##           master   #33927     +/-   ##
=========================================
- Coverage    81.9%    81.9%   -0.1%     
=========================================
  Files         809      809             
  Lines      218403   218406      +3     
=========================================
- Hits       178910   178906      -4     
- Misses      39493    39500      +7     

@yhchiang-sol yhchiang-sol changed the title [TieredStorage] AccountOffset type [TieredStorage] Add AccountOffset type Oct 30, 2023
@yhchiang-sol yhchiang-sol merged commit da130b8 into solana-labs:master Nov 6, 2023
yhchiang-sol added a commit that referenced this pull request Nov 9, 2023
#### Problem
#33927 introduced a new type AccountOffset, but HotStorageReader
still uses `usize` to access accounts.

#### Summary of Changes
This PR makes HotStorageReader use the new AccountOffset type.
yhchiang-sol added a commit to yhchiang-sol/solana that referenced this pull request Feb 13, 2024
…labs#33964)

#### Problem
solana-labs#33927 introduced a new type AccountOffset, but HotStorageReader
still uses `usize` to access accounts.

#### Summary of Changes
This PR makes HotStorageReader use the new AccountOffset type.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants