You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add global storage version for data migrations (#3469)
* feat(storage): add global storage versioning and helpers
Introduce a global storage version key to the database, enabling versioned
migrations for breaking changes in stored data structures. Add helper
functions to get and set the storage version, and provide unit tests to
verify versioning logic. This lays the groundwork for safe, enclave-only
data migrations by allowing detection and management of storage schema
versions.
* feat(storage): add storage versioning and migration test
Introduce global storage versioning to enable future database migrations.
Add an example migration in `init_storage` that checks and updates the
storage version. Implement a unit test demonstrating a struct migration
from version 0 to 1 using SCALE encoding, ensuring data compatibility
across schema changes.
* refactor(storage): restrict storage version API visibility
Change `get_storage_version` and `set_storage_version` functions from
public to private, as they are only used internally. Add a `dead_code`
allowance to `set_storage_version` for future migration use.
0 commit comments