Skip to content

feat(storage): Top level commands create a new database using config.DefaultDBProvider()#4697

Merged
melekes merged 3 commits intoalesforz/code-uses-storage-pkgfrom
alesforz/use-defaultdbprovider
Jan 13, 2025
Merged

feat(storage): Top level commands create a new database using config.DefaultDBProvider()#4697
melekes merged 3 commits intoalesforz/code-uses-storage-pkgfrom
alesforz/use-defaultdbprovider

Conversation

@alesforz
Copy link
Collaborator

Context

As part of the work in #4601, we want to allow users to use their own database if they don't like pebble. As CometBFT will use the same DB interface that cometbft-db uses, users can provide their own implementation of the interface that uses a different database under the hood. They will, therefore, have to change the config.DefaultDBProvider function to return their implementation instead of our default.

To minimize the places in the code to change, we think that users should only change the config.DefaultDBProvider to user thei DB. Therefore, some places in the code must change to user this function rather than calling db.NewDB() directly.

This PR

This PR changes the commands in the cmd folder to use config.DefaultDBProvider() to create databases.


PR checklist

  • Tests written/updated
  • [ ] Changelog entry added in .changelog (we use unclog to manage our changelog)
  • [] Updated relevant documentation (docs/ or spec/) and code comments

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale For use by stalebot label Dec 31, 2024
@github-actions github-actions bot closed this Jan 5, 2025
@melekes melekes reopened this Jan 13, 2025
@melekes melekes marked this pull request as ready for review January 13, 2025 07:01
@melekes melekes requested a review from a team as a code owner January 13, 2025 07:01
@melekes melekes requested a review from a team January 13, 2025 07:01
@melekes melekes removed the stale For use by stalebot label Jan 13, 2025
@melekes melekes self-assigned this Jan 13, 2025
@melekes melekes merged commit ac120c9 into alesforz/code-uses-storage-pkg Jan 13, 2025
@melekes melekes deleted the alesforz/use-defaultdbprovider branch January 13, 2025 10:25
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