Skip to content

chore: remove KEY_DATA migration code after next release #2815

@sanity

Description

@sanity

Context

PR #2814 migrated the store indexes (contracts, delegates, secrets) from the custom KEY_DATA append-only file format to ReDb. This fixes a stale file handle bug where data was lost after background compaction.

The PR includes migration code that:

  1. Reads existing KEY_DATA files on startup
  2. Writes all entries to the new ReDb tables
  3. Renames KEY_DATA to KEY_DATA.migrated

Task

After the next release (giving users time to upgrade and migrate their data), remove the migration code:

Files to clean up

  1. crates/core/src/wasm_runtime/contract_store.rs

    • Remove migrate_from_legacy() function
    • Remove call to migration in new()
    • Remove legacy_key_data_path from struct if unused
  2. crates/core/src/wasm_runtime/delegate_store.rs

    • Remove migrate_from_legacy() function
    • Remove call to migration in new()
  3. crates/core/src/wasm_runtime/secrets_store.rs

    • Remove migrate_from_legacy() function
    • Remove call to migration in new()
  4. crates/core/src/wasm_runtime/store.rs

    • Remove or mark as dead code the legacy SafeWriter, KeyDataReader, and related structs/functions that were only kept for migration
    • Remove the KEY_DATA constant if unused elsewhere

Verification

Before removing migration code, verify that:

  • At least one release has shipped with the migration code
  • Users have had reasonable time to upgrade (check release date)
  • No reports of migration failures

[AI-assisted - Claude]

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-contractsArea: Contract runtime, SDK, and executionE-mediumExperience needed to fix/implement: Medium / intermediateT-enhancementType: Improvement to existing functionality

    Type

    No type

    Projects

    Status

    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions