-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
lang: Consider removing associated keyword #491
Comments
|
|
Seems fine to me to remove the I do think the most annoying part about using PDAs is dealing with the bump seed, which just seems awkward to pass through. I like the idea of including space for the bump seed in the account header, perhaps for all accounts since its just one byte. That way for account initialization, anchor could use |
We should consider removing the associated keyword. I'm a little worried the automagic of adding the
__nonce
field will cause problems when upgrading account layouts. For example, if one were to add fields to an account, then it's possible one overwrites the __nonce field.Instead of removing, we can also consider adding a header to the account layout to store such metadata. For example,
discriminator || metadata || borsh(struct)
or some variant.Note that
seeds
can do everythingassociated
can, although it requires manual nonce management/storage. So it's recommended to useseeds
until the future ofassociated
is decided.The text was updated successfully, but these errors were encountered: