Skip to content
Cosmopediaby Unity Nodes
Documentationcosmos/cosmos-sdk-migration-mcpcosmos/cosmos-sdk-migration-mcp › src › cosmos_migration_mcp › migration_spec › v50-to-v54View on cosmos/cosmos-sdk-migration-mcp ↗

store v2

id: store-v2-migration title: Store v2 imports and removed BaseApp store helpers version: v50+ -> v54 description: | Cosmos SDK v0.54 moves store imports to github.com/cosmos/cosmos-sdk/store/v2 and removes several BaseApp store helpers:

  • BaseApp.NewUncachedContext()
  • BaseApp.SimWriteState()
  • BaseApp.SetStoreMetrics()

This spec rewrites store imports, removes the two dead helper calls, and rewrites straightforward NewUncachedContext call sites mechanically:

  • app.NewUncachedContext(false, header) -> app.NewNextBlockContext(header)
  • app.NewUncachedContext(true, header) -> app.NewContext(true)

Some tests relied on uncached-write semantics rather than just the helper name. Review any rewritten call sites that mutate state between Commit and FinalizeBlock, because store-v2 now enforces commit/rollback isolation.

upstream_sources:

  • docs://upgrading/v0.54
  • docs://changelog/v0.54-breaking

depends_on:

  • core-sdk-migration

detection: sdk_version: max_exclusive: v0.54.0-0 imports: - cosmossdk.io/store patterns: - NewUncachedContext( - SimWriteState( - SetStoreMetrics( go_mod: - cosmossdk.io/store

changes: go_mod: remove: - cosmossdk.io/store

imports: rewrites: # Rewrite the main store types import. Use all_packages so that # sub-packages like cosmossdk.io/store/types are also rewritten. - old: cosmossdk.io/store new: github.com/cosmos/cosmos-sdk/store/v2 all_packages: true # The metrics sub-package does not exist under store/v2. The # all_packages rewrite above produces the invalid path # github.com/cosmos/cosmos-sdk/store/v2/metrics. This second # pass undoes that by removing the broken import entirely. # Chains that used storemetrics.NewNoOpMetrics() will need to # update call sites as part of the manual step below. removals: - github.com/cosmos/cosmos-sdk/store/v2/metrics

statement_removals: - call_pattern: SimWriteState - call_pattern: SetStoreMetrics

special_cases: - uncached_context

manual_steps:

  • id: store-v2-followup description: | Review rewritten NewUncachedContext call sites. Some tests need semantic follow-up beyond the mechanical method rename because store-v2 no longer permits writes to bypass cache/branch isolation.
  • id: store-metrics-removal description: | The cosmossdk.io/store/metrics package does not exist in store/v2. Files that imported storemetrics (typically test helpers) had the import removed. Update any remaining storemetrics.NewNoOpMetrics() call sites — in v0.54, use coretesting.NewNopLogger() or remove the metrics argument entirely if the keeper no longer requires it.

verification: must_not_import: - cosmossdk.io/store - github.com/cosmos/cosmos-sdk/store/v2/metrics must_not_contain: # Exclude baseapp/test_helpers.go which defines the deprecated function - pattern: NewUncachedContext( exclude_file_match: baseapp/test_helpers.go - pattern: SimWriteState( - pattern: SetStoreMetrics(