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

Add purge-db-safe flag which requires manual confirmation #5088

Closed
wants to merge 1 commit into from

Conversation

macladson
Copy link
Member

Issue Addressed

#5028

Proposed Changes

Add a new flag called --purge-db-safe which functions like --purge-db but requires manual confirmation. As such it is not suitable for environments that are designed to be automated.

Additional Info

I moved the stdin-inputs flag to be a global flag under the lighthouse command, as I felt this is a cleaner solution than currently, even if not every subcommand will use it. Happy to change it back if someone has a different opinion.

@macladson macladson added enhancement New feature or request ready-for-review The code is ready for review UX-and-logs labels Jan 19, 2024
@dapplion
Copy link
Collaborator

What about waiting for 5.0.0 and sliding a breaking change to make --purge-db require confirmation?

@macladson
Copy link
Member Author

What about waiting for 5.0.0 and sliding a breaking change to make --purge-db require confirmation?

Yeah happy to do that. I do think we should have two flags regardless, so automated setups have an option.
Something like --purge-db-auto? It's definitely more natural for --purge-db to be the safe one. Depends if the breaking change is worth it though.

let blobs_db = client_config.get_blobs_db_path();
purge_db(chain_db, freezer_db, blobs_db)?;
} else {
eprintln!("Database was not deleted.");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should you error exit here instead of ignoring the request to purge the DB?

@jimmygchen jimmygchen added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Apr 24, 2024
@macladson
Copy link
Member Author

Closed in favour of #6154

@macladson macladson closed this Aug 21, 2024
@macladson macladson deleted the safe-purge branch August 21, 2024 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request UX-and-logs waiting-on-author The reviewer has suggested changes and awaits thier implementation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants