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

Support custom discriminators #3097

Closed
26 tasks done
acheroncrypto opened this issue Jul 20, 2024 · 0 comments
Closed
26 tasks done

Support custom discriminators #3097

acheroncrypto opened this issue Jul 20, 2024 · 0 comments

Comments

@acheroncrypto
Copy link
Collaborator

acheroncrypto commented Jul 20, 2024

Problem

There are several problems regarding Anchor discriminators:

  • Due to the transaction size limits enforced by the Solana runtime (1232 bytes), 8 bytes can be too high for some use cases (e.g. Allow Optionally Reducing The Instruction Sighash Length Or Matched Bytes #2006)
  • The Discriminator trait has a fixed size type field ([u8; 8]) which means we can't implement it for non-Anchor programs (e.g. in declare_program!)
  • Discriminators are not customizable
  • Changing the name of the data type the discriminator was derived from results in a different discriminator

Solution

Don't make assumptions about the discriminator size and allow users to override the default Anchor discriminator. To do so, we need to complete the following tasks:

@acheroncrypto acheroncrypto self-assigned this Jul 20, 2024
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