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
This made sense when the program was first written, since all mint extensions were meant to be initialized before the mint. With the token metadata and token group extensions, however, the program does initialize extensions after the mint. This makes the current strict behavior tedious for users, and always requires multiple allocations.
Proposed Solution
Look through all the code and make sure that there aren't any problems with overallocated mints. For example, we'll still need to make sure that the account doesn't have a length of Multisig::LEN, or that it isn't underallocated.
After that, write some tests exercising the new behavior, then relax the length check.
My two cents, the Multisig::LEN bit might be where things get tricky, but otherwise I think this change makes sense. It's a pretty annoying devex to be a few bytes overallocated and get an error.
Additionally, we don't allow overallocation for the Token Metadata extension, because it's a variable-length extension and will realloc itself. I think it would be nice to rope that into the relaxed constraints as well, so I could have enough space allocated for Token Metadata and it would just skip the realloc instead of erroring.
Problem
Token-2022 is very strict on the size of mint accounts, prohibiting mints that are overallocated:
solana-program-library/token/program-2022/src/processor.rs
Lines 88 to 90 in 3adf4b8
This made sense when the program was first written, since all mint extensions were meant to be initialized before the mint. With the token metadata and token group extensions, however, the program does initialize extensions after the mint. This makes the current strict behavior tedious for users, and always requires multiple allocations.
Proposed Solution
Look through all the code and make sure that there aren't any problems with overallocated mints. For example, we'll still need to make sure that the account doesn't have a length of
Multisig::LEN
, or that it isn't underallocated.After that, write some tests exercising the new behavior, then relax the length check.
cc @lorisleiva
The text was updated successfully, but these errors were encountered: