Skip to content

feat: use a single shared parity-db instance for all chain data#1278

Merged
gilescope merged 15 commits into
mainfrom
ozgb-one-parity-db-instance
Apr 24, 2026
Merged

feat: use a single shared parity-db instance for all chain data#1278
gilescope merged 15 commits into
mainfrom
ozgb-one-parity-db-instance

Conversation

@ozgb

@ozgb ozgb commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Overview

Uses the Custom database type to initialize a shared instance of ParityDb with custom config.

Ledger storage can either be stored separately to Substrate storage (default, for backwards compatibility) or can be stored in the same ParityDb instance. This is controlled via a new config option, storage_separation.

Using the unified option requires nodes to re-sync from genesis.

Resolves: https://github.com/midnightntwrk/midnight-security/issues/66
Resolves #1297

🗹 TODO before merging

📌 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:
  • If the changes introduce a new feature, I have bumped the node minor version
  • Update documentation (if relevant)
  • Updated AGENTS.md if build commands, architecture, or workflows changed
  • No new todos introduced

🧪 Testing Evidence

Please describe any additional testing aside from CI:

  • Added unit tests + integration tests for initializing storage in both separate and unified modes
  • Nodes 4 and 5 (block producers) in local-env are set to use unified mode

🔱 Fork Strategy

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

Links

Signed-off-by: Oscar Bailey <79094698+ozgb@users.noreply.github.com>
ozgb added 5 commits April 22, 2026 14:41
Signed-off-by: Oscar Bailey <79094698+ozgb@users.noreply.github.com>
Signed-off-by: Oscar Bailey <79094698+ozgb@users.noreply.github.com>
Signed-off-by: Oscar Bailey <79094698+ozgb@users.noreply.github.com>
…atibility

Signed-off-by: Oscar Bailey <79094698+ozgb@users.noreply.github.com>
Signed-off-by: Oscar Bailey <79094698+ozgb@users.noreply.github.com>
@ozgb ozgb marked this pull request as ready for review April 24, 2026 11:10
@ozgb ozgb requested a review from a team as a code owner April 24, 2026 11:10
@ozgb ozgb marked this pull request as draft April 24, 2026 11:15
ozgb added 6 commits April 24, 2026 12:23
Signed-off-by: Oscar Bailey <79094698+ozgb@users.noreply.github.com>
Signed-off-by: Oscar Bailey <79094698+ozgb@users.noreply.github.com>
Signed-off-by: Oscar Bailey <79094698+ozgb@users.noreply.github.com>
Signed-off-by: Oscar Bailey <79094698+ozgb@users.noreply.github.com>
Signed-off-by: Oscar Bailey <79094698+ozgb@users.noreply.github.com>
Signed-off-by: Oscar Bailey <79094698+ozgb@users.noreply.github.com>
@ozgb ozgb marked this pull request as ready for review April 24, 2026 12:23
Signed-off-by: Oscar Bailey <79094698+ozgb@users.noreply.github.com>
@gilescope gilescope added this pull request to the merge queue Apr 24, 2026
Merged via the queue into main with commit 2fa05b7 Apr 24, 2026
32 of 33 checks passed
@gilescope gilescope deleted the ozgb-one-parity-db-instance branch April 24, 2026 15:08
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.

Use a single instance of ParityDB for both Ledger and Substrate strorage [Node] shutdown appears to be able to occur before ledger post-block updates

2 participants