chore: remove support for separate parity-db instances#1612
Draft
m2ux wants to merge 1 commit into
Draft
Conversation
Closes #1464 Scaffold commit for the work package to remove support for separate parity-db instances for substrate and ledger storage. Implementation commits will follow. Signed-off-by: Mike Clay <mike.clay@shielded.io>
Contributor
|
We might want to punt this to the next release to allow overlap time where people can do both? We definitely do want people using the unified database this release (and testing it, and perf testing it). |
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.
Summary
Remove the legacy separate parity-db storage layout entirely — the node now runs unified-only, collapsing the storage-init switch, the per-host-call dispatch in the ledger crate, and the migration test surface into a single code path.
🐛 Issue 📐 Engineering
Motivation
The Midnight node has supported two parity-db storage layouts since the unified layout was introduced (PR #1278): a "separate" layout with one parity-db per workload (substrate / ledger) and a "unified" layout that puts both in additional columns of a single parity-db instance. Unified has been the long-term target and is what every actively-maintained deployment runs, but the separate path has remained in tree, adding a configuration knob to reason about, a runtime branch in every host-API call, and a duplicated singleton storage registry inside the ledger crate.
Issue #1464 records the intent to delete the separate path once unified is the established default. Removing it now reduces ongoing maintenance burden, eliminates a class of "did you remember to handle both arms?" mistakes in new host-API methods, and lets the compiler dead-code-eliminate the formerly-runtime-selected separate code path. Operators on unified see no functional change; operators with an on-disk separate-mode database must already have been resyncing onto a fresh data directory (the existing cross-mode guard already established this), and the change notes will say so explicitly.
Changes
Implementation (coming next):
StorageSeparationenum,MidnightCfg.storage_separation,StorageInit.separation, theSeparatearm incustom_parity_db::open, theIncompatibleColumnConfig → storage_separationerror mapping inbackend.rs, and theseparate_storage_inittest helper + its unit testLedgerStorageDbto a singleArc<parity_db::Db>wrapper; deleteLedgerStorage::new_separateSeparateDbarm inBridge::set_default_storage, theDbSeparatetype alias and its cleanup branch indrop_default_storage_if_exists, theis_unifiedhelper, and everyif is_unified { DbUnified } else { DbSeparate }branch inhost_api/ledger_7.rsandhost_api/ledger_8.rsinit_storage_paritydb_unified_in_dirhelper to the ledger crate; migratepallets/midnight/src/tests.rsandpallets/cnight-observation/tests/tests.rsto the new helper; deleteinit_storage_paritydb_separatenode/tests/storage_migration.rs; rewrite scenario 1 as a single unified-only smoke teststorage_separationfield fromres/cfg/default.toml; deleteexport STORAGE_SEPARATION=unifiedfrom twolocal-environment/.../entrypoint.shfiles; update thechanges/node/changed/storage-unification.mdchangelog entry to record the removal and the operator-facing implication📌 Submission Checklist
🔱 Fork Strategy
🗹 TODO before merging