refactor(runtime): remove applied storage migrations - #117
Merged
Conversation
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.
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
Migrationstuple were no-ops guarded by their version checks.Keeping
MigrateToV1was a liability rather than a safety net. It rebuilds the entire Merkle tree inside a singleon_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 aspub mod migrationsmeant 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.