Skip to content

Comments

feat: add storage consistency checks on CLI commands#8667

Merged
joshieDo merged 2 commits intomainfrom
joshie/cli-check
Jun 10, 2024
Merged

feat: add storage consistency checks on CLI commands#8667
joshieDo merged 2 commits intomainfrom
joshie/cli-check

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