Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pin discriminants for LidoInstruction enum #376

Open
ruuda opened this issue Aug 19, 2021 · 0 comments
Open

Pin discriminants for LidoInstruction enum #376

ruuda opened this issue Aug 19, 2021 · 0 comments

Comments

@ruuda
Copy link
Contributor

ruuda commented Aug 19, 2021

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).

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

No branches or pull requests

1 participant