Skip to content

Account version #4268

@hrls

Description

@hrls

As part of further migration support, I have a design question.
Are account versions intended to be handled using discriminators? I think that's a reasonable approach, and we already have a custom discriminator in the account attribute. Should it be updated every time as supposed migration flow?

Sometimes upgrading to the next discriminator isn't an option. In the current migration scheme, I see a potential issue where an un-migrated account could be mistaken for a new one if the discriminators match.

Are there any plans to add explicit version field to an account while preserving the discriminator? I'm imagining something like #[account(version: u8 = 1)]. (Effectively a 9-byte discriminator where the last byte is the version, but I think that's a cleaner approach.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions