feat(storage): Add package internal/storage#4511
Merged
alesforz merged 4 commits intofeature/remove-cometbftdbfrom Nov 19, 2024
Merged
feat(storage): Add package internal/storage#4511alesforz merged 4 commits intofeature/remove-cometbftdbfrom
internal/storage#4511alesforz merged 4 commits intofeature/remove-cometbftdbfrom
Conversation
Package `storage`: - exports the `DB`, `Batch`, and `Iterator` interfaces that database backends must implement to work with CometBFT. Previously, they offered by cometbft-db. - exports the pebbledb implementation of the above interfaces.
9 tasks
added 2 commits
November 18, 2024 15:27
The linter was failing with the following error: `import 'github.com/cockroachdb/pebble' is not allowed from list 'main'`. even though we are not importing github.com/cockroachdb/pebble in the `main` pkg. I think this happened because the `depguard` linter configuration treats all files in the project as belonging to the `main` package due to the `$all` rule in its configuration. That is all files (except test files) are evaluated with the "main rules", even if they belong to sub-packages.
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Partially addresses #4486.
Context
CometBFT will stop importing cometbft-db as a dependency to support multiple database backends. Instead, it will use pebble by default.
Changes
This PR adds package
storageto theinternalpackages:DB,Batch, andIteratorinterfaces that database backends must implement to work with CometBFT. Previously, they were offered by cometbft-db.Users can provide their own implementation of these interfaces using a different database under the hood. However, we will support and maintain only the pebble implementation that CometBFT will use.
Note: this PR ports the code currently provided by cometbft-db. It does not add new functionalities to either the interfaces or their implementation using pebble. What it does:
ifstatements for readabilityPR checklist
[] Tests written/updated[ ] Changelog entry added in.changelog(we use unclog to manage our changelog)docs/orspec/) and code comments