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

feat: add storage consistency checks on CLI commands #8667

Merged
merged 2 commits into from
Jun 10, 2024
Merged

Conversation

joshieDo
Copy link
Collaborator

@joshieDo joshieDo commented Jun 7, 2024

Adds storage consistency checks on all CLI commands.

If it's a read-only environment, then print a warning, but does not exit.
If it's a read-write environment, attempts to heal.

@joshieDo joshieDo requested a review from onbjerg as a code owner June 7, 2024 10:11
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

smol suggestions

db: Arc<DatabaseEnv>,
static_file_provider: StaticFileProvider,
) -> eyre::Result<ProviderFactory<Arc<DatabaseEnv>>> {
let has_receipt_pruning = config.prune.as_ref().map_or(false, |a| a.has_receipts_pruning());
Copy link
Collaborator

Choose a reason for hiding this comment

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

this should be a function of th prune type

return Ok(factory)
}

let prune_modes = config.prune.clone().map(|prune| prune.segments).unwrap_or_default();
Copy link
Collaborator

Choose a reason for hiding this comment

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

same, should be fn prune_segments

@joshieDo joshieDo added this pull request to the merge queue Jun 10, 2024
Merged via the queue into main with commit ab8b458 Jun 10, 2024
29 checks passed
@joshieDo joshieDo deleted the joshie/cli-check branch June 10, 2024 09:49
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.

3 participants