Skip to content

chore: remove support for separate parity-db instances#1612

Draft
m2ux wants to merge 1 commit into
mainfrom
chore/1464-remove-separate-parity-db-instances
Draft

chore: remove support for separate parity-db instances#1612
m2ux wants to merge 1 commit into
mainfrom
chore/1464-remove-separate-parity-db-instances

Conversation

@m2ux
Copy link
Copy Markdown
Contributor

@m2ux m2ux commented May 29, 2026

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):

  • node crate — delete StorageSeparation enum, MidnightCfg.storage_separation, StorageInit.separation, the Separate arm in custom_parity_db::open, the IncompatibleColumnConfig → storage_separation error mapping in backend.rs, and the separate_storage_init test helper + its unit test
  • primitives/ledger — collapse LedgerStorageDb to a single Arc<parity_db::Db> wrapper; delete LedgerStorage::new_separate
  • ledger crate — delete the SeparateDb arm in Bridge::set_default_storage, the DbSeparate type alias and its cleanup branch in drop_default_storage_if_exists, the is_unified helper, and every if is_unified { DbUnified } else { DbSeparate } branch in host_api/ledger_7.rs and host_api/ledger_8.rs
  • pallets — add a test-only init_storage_paritydb_unified_in_dir helper to the ledger crate; migrate pallets/midnight/src/tests.rs and pallets/cnight-observation/tests/tests.rs to the new helper; delete init_storage_paritydb_separate
  • tests — delete the two cross-mode scenarios in node/tests/storage_migration.rs; rewrite scenario 1 as a single unified-only smoke test
  • config / changelog — drop the storage_separation field from res/cfg/default.toml; delete export STORAGE_SEPARATION=unified from two local-environment/.../entrypoint.sh files; update the changes/node/changed/storage-unification.md changelog entry to record the removal and the operator-facing implication

📌 Submission Checklist

  • Changes are backward-compatible (or flagged if breaking)
  • Pull request description explains why the change is needed
  • Self-reviewed the diff
  • I have included a change file, or skipped for this reason: [reason]
  • If the changes introduce a new feature, I have bumped the node minor version
  • Update documentation (if relevant)
  • No new todos introduced

🔱 Fork Strategy

  • Node Runtime Update
  • Node Client Update
  • Other
  • N/A

🗹 TODO before merging

  • Ready for review

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>
@m2ux m2ux self-assigned this May 29, 2026
@gilescope
Copy link
Copy Markdown
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).

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