Skip to content

refactor(runtime): remove applied storage migrations - #117

Merged
nol4lej merged 1 commit into
mainfrom
chore/remove-applied-migrations
Aug 4, 2026
Merged

refactor(runtime): remove applied storage migrations#117
nol4lej merged 1 commit into
mainfrom
chore/remove-applied-migrations

Conversation

@nol4lej

@nol4lej nol4lej commented Aug 4, 2026

Copy link
Copy Markdown
Member

Every live chain is already at the target storage version — verified on-chain against testnet at block 283941: shielded-pool is at v2 and zk-verifier at v1. A fresh chain starts there via genesis, so all three entries in the Migrations tuple were no-ops guarded by their version checks.

Keeping MigrateToV1 was a liability rather than a safety net. It rebuilds the entire Merkle tree inside a single on_runtime_upgrade, which cannot be split across blocks, and the returned Weight is computed after the work is already done — so it documents the cost instead of bounding it. At the testnet's current 134201 leaves that is a ~4 MB Vec and ~270k writes in one block; at the 2^20 tree cap it would exhaust the Wasm heap and produce a block no validator can import. Leaving it importable as pub mod migrations meant it could be wired back into the tuple by anyone unaware of that cost.

Storage version history stays documented on each pallet's STORAGE_VERSION const, with a pointer to git history if an old chain ever needs the code. The merkle helpers the migration used (get_zero_hash_cached, hash_pair_poseidon) stay — merkle.rs uses them. try-runtime features are untouched; they back try_state, not migrations.

Verified: cargo check on both pallets and the runtime, 283 + 104 tests green.

@nol4lej
nol4lej merged commit 9dfdffd into main Aug 4, 2026
6 checks passed
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.

1 participant