Skip to content

Pin discriminants for LidoInstruction enum #376

Description

@ruuda

Currently the LidoInstruction enum uses a generated borsh serializer. This makes it difficult to know for any external non-Rust program to parse the instruction bytes, which is an obstacle for e.g. block explorers to integrate.

It is possible to select a discriminant explicitly for each of the enum variants. This is a good idea anyway to have a stable interface across versions. At the moment it is only possible for enum variants without fields, and LidoInstruction does have a few variants with fields. However, from Rust 1.56 onwards this should be possible. We should investigate whether it’s possible to use that. Or maybe we should just write serializers by hand, or generate the enum with some IDL that can also generate serializers for other languages (similar to what Anchor does).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions