core, eth, node: break rawdb -> {leveldb, pebble} dependency #30689
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.
The
rawdb
package is a generic package that can operate on arbitrary ethdb.KeyValueStore types. It's purpose was always to be data store agnostic. At some point however we sprinkled a few LevelDB and Pebble references in there, making it all of a sudden depend on both of them.Looking through the code however, that dependency was mostly moot:
node
package, which is kind of the nobrainer good choice for this logic either way. I moved it there.rawdb.Open
as a shorthand, but these call sites are so simple, that the inlining of the actual call content is just 1 line longer than what Open was originally, however, by inlining, the dependency on pebble moves into the code blockchain tests, out of rawdb. Wonderful.With this PR:
Without this PR:
FWIW, I left the memorydb dependency in since it was used quite heavily in tests as a shorthand and it's a tiny dep-free package anyway, so no point in making it harder for us.