Skip to main content

Module migrate

Module migrate 

Source
Expand description

Migration helpers – safe version upgrades for on-chain accounts.

Hopper’s migration system supports three patterns:

  1. Append-safe: New fields appended to the end, realloc to larger size
  2. Segment-safe: New segments added to the segment table
  3. Full migration: Data reshuffled between versions

§Safety

  • Migration always validates the source layout_id before touching data
  • The destination version must be strictly greater than the source
  • Realloc is rent-safe (payer provides lamports for the delta)

Structs§

MigrationDescriptor
Migration descriptor for schema export.

Enums§

MigrationKind
The kind of migration.

Functions§

is_append_compatible
Check if a migration from OldLayout to NewLayout would be append-compatible.
migrate_append
Migrate an account in-place by appending new fields.