You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Problem
There are several problems regarding Anchor discriminators:
Discriminator
trait has a fixed size type field ([u8; 8]
) which means we can't implement it for non-Anchor programs (e.g. indeclare_program!
)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:
declare_program!
(lang: Add non-8-byte discriminator support indeclare_program!
#3103)dispatch
function to support dynamic discriminators (lang: Updatedispatch
function to support dynamic discriminators #3104)try_entry
function (lang: Remove the fallback function shortcut intry_entry
function #3109)Discriminator
trait impl when using thezero
constraint (lang: RequireDiscriminator
trait impl when using thezero
constraint #3118)#[instruction]
attribute proc-macro #3137)#[account]
attribute arguments withsyn
#3140)#[account]
#3144)#[account]
struct has generics #3148)discriminator
argument (lang: Adddiscriminator
argument to#[account]
attribute #3149)discriminator
argument to#[event]
attribute #3152)Discriminator::discriminator
(lang: Removediscriminator
method fromDiscriminator
trait #3163)#[instruction]
attribute (lang: Deprecate#[interface]
attribute #3195)The text was updated successfully, but these errors were encountered: