Skip to content

Commit

Permalink
[TieredStorage] Rename owners_offset to owners_block_offset (solana-l…
Browse files Browse the repository at this point in the history
…abs#34047)

#### Problem
TieredStorageFooter::owners_offset refers to the offset to the
owners block, which looks very similar to OwnerOffset that
has a completely different concept -- the offset to access the
address of an owner in the owners-block.

#### Summary of Changes
Similar to the previous renaming index_offset to index_block_offset,
this PR renames owners_offset to owners_block_offset to
avoid confusion.
  • Loading branch information
yhchiang-sol authored Nov 14, 2023
1 parent e9135e2 commit 2877b81
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions accounts-db/src/tiered_storage/footer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ pub struct TieredStorageFooter {
/// The offset pointing to the first byte of the account index block.
pub index_block_offset: u64,
/// The offset pointing to the first byte of the owners block.
pub owners_offset: u64,
pub owners_block_offset: u64,

// account range
/// The smallest account address in this file.
Expand Down Expand Up @@ -157,7 +157,7 @@ impl Default for TieredStorageFooter {
owner_count: 0,
owner_entry_size: 0,
index_block_offset: 0,
owners_offset: 0,
owners_block_offset: 0,
hash: Hash::new_unique(),
min_account_address: Pubkey::default(),
max_account_address: Pubkey::default(),
Expand Down Expand Up @@ -249,7 +249,7 @@ mod tests {
owner_count: 250,
owner_entry_size: 32,
index_block_offset: 1069600,
owners_offset: 1081200,
owners_block_offset: 1081200,
hash: Hash::new_unique(),
min_account_address: Pubkey::default(),
max_account_address: Pubkey::new_unique(),
Expand Down Expand Up @@ -286,7 +286,7 @@ mod tests {
assert_eq!(offset_of!(TieredStorageFooter, owner_count), 0x18);
assert_eq!(offset_of!(TieredStorageFooter, owner_entry_size), 0x1C);
assert_eq!(offset_of!(TieredStorageFooter, index_block_offset), 0x20);
assert_eq!(offset_of!(TieredStorageFooter, owners_offset), 0x28);
assert_eq!(offset_of!(TieredStorageFooter, owners_block_offset), 0x28);
assert_eq!(offset_of!(TieredStorageFooter, min_account_address), 0x30);
assert_eq!(offset_of!(TieredStorageFooter, max_account_address), 0x50);
assert_eq!(offset_of!(TieredStorageFooter, hash), 0x70);
Expand Down
2 changes: 1 addition & 1 deletion accounts-db/src/tiered_storage/hot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ pub mod tests {
owner_count: 250,
owner_entry_size: 32,
index_block_offset: 1069600,
owners_offset: 1081200,
owners_block_offset: 1081200,
hash: Hash::new_unique(),
min_account_address: Pubkey::default(),
max_account_address: Pubkey::new_unique(),
Expand Down

0 comments on commit 2877b81

Please sign in to comment.