Skip to content

[TieredStorage] Refactor file_size() code path#400

Merged
yhchiang-sol merged 1 commit intoanza-xyz:masterfrom
yhchiang-sol:ts-len
Mar 22, 2024
Merged

[TieredStorage] Refactor file_size() code path#400
yhchiang-sol merged 1 commit intoanza-xyz:masterfrom
yhchiang-sol:ts-len

Conversation

@yhchiang-sol
Copy link
Copy Markdown

@yhchiang-sol yhchiang-sol commented Mar 22, 2024

Problem

TieredStorage::file_size() essentially supports AccountsFile::len(),
but its API is inconsistent with AccountsFile's.

Summary of Changes

Refactor TieredStorage::file_size() to ::len() and share the same API
as AccountsFile's.

Test Plan

Build
Existing unit-tests.

Copy link
Copy Markdown

@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.

:shipit:

Comment on lines +363 to +364
pub fn len(&self) -> usize {
self.mmap.len()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Yay, thanks for making this return usize!

@brooksprumo
Copy link
Copy Markdown

In the future, please do not merge PRs before they've completed CI.

@yhchiang-sol
Copy link
Copy Markdown
Author

In the future, please do not merge PRs before they've completed CI.

Sure thing. Merging this because it passed the syntax check, and the PR itself doesn't expose any functionalities to other code paths.

@yhchiang-sol yhchiang-sol deleted the ts-len branch March 22, 2024 21:36
OliverNChalk pushed a commit to OliverNChalk/agave that referenced this pull request Nov 11, 2025
`replay_stage_attack.rs` is already big and individual attack
configurations are mostly unrelated and do not have to reside directly
in the `replay_stage_attack` module.

And I would like to add more attack configurations.

This split also makes the dependencies more explicit, as the individual
attack configuration dependencies are often very different from the
dependencies of the `replay_stage_attack::ReplayStageAttack` meta attack
itself.
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