Description
Problem
Contract upgrades can introduce changes to stored data structures. Existing storage values may no longer match the new expected schema, but there is no standardized migration framework for transforming existing state safely.
Without validation and rollback capabilities, an unsuccessful migration can leave applications with inconsistent or unusable state.
Solution
Create a versioned storage migration framework.
A migration should define a source schema/version, target schema/version, transformation function, validation step, and rollback strategy.
The framework should track migration progress and prevent the same migration from being applied repeatedly.
Acceptance Criteria
Note for Contributors
Do not treat arbitrary rollback as automatically possible for destructive transformations. Define clear migration guarantees and validate state before mutating it.
Description
Problem
Contract upgrades can introduce changes to stored data structures. Existing storage values may no longer match the new expected schema, but there is no standardized migration framework for transforming existing state safely.
Without validation and rollback capabilities, an unsuccessful migration can leave applications with inconsistent or unusable state.
Solution
Create a versioned storage migration framework.
A migration should define a source schema/version, target schema/version, transformation function, validation step, and rollback strategy.
The framework should track migration progress and prevent the same migration from being applied repeatedly.
Acceptance Criteria
src/soroban/index.tsandsrc/index.ts.Note for Contributors
Do not treat arbitrary rollback as automatically possible for destructive transformations. Define clear migration guarantees and validate state before mutating it.