5

Note there's a similar question at solana token program 0xc Invalid Instruction - but the 'answer' is to simply downgrade metaplex. I (and probably many other people on Solana) would like to use fixes in current version of metaplex

I'm using createMint() from @solana/spl-token 0.3.4 and it works fine:


import { createMint } from "@solana/spl-token";
const mintAccountPublicKey = await createMint(
  connection,
  payer,
  mintAuthority,
  null, 
  decimals
);

Again, this works fine and creates a mint.

When I upgrade @solana/spl-token to 0.3.5 (or upgrade Metaplex which upgrades spl-token) createMint() breaks:

ERRROR failed to send transaction: Transaction simulation failed: Error processing Instruction 1: custom program error: 0xc

I know from error.rs that 0xc is Invalid instruction.

Update: I have filed the bug with spl. Also note this question was originally tagged with metaplex - the issue only relates to metaplex because metaplex updates spl-token to 0.3.5 or newer. I have removed the metaplex tag as metaplex is not at fault, and edited the question accordingly.

0

1 Answer 1

3

Answering my own question to help others. Thanks to joncinque for solving this.

You need to regularly update your local validator, which includes a newer version of the Solana and the spl-token on-chain programs, to match your @solana/web3.js and @solana/spl-token updates.

Ledger location: test-ledger
Log: test-ledger/validator.log
⠤ Initializing...
Identity: HATCjKKDuCS547rmVH1t31zpiJShXnffRqLwR8fAYwZC
Genesis Hash: 82Qc3cFQUTDCYfLZEDGynywx2EhXzeHat4G1bWQV6pg7
Version: 1.9.30

1.9.30 is too old. You can see the current version of Solana used in production with the command solana validators:

Stake By Version:
1.15.3  -    0 current validators ( 0.00%)   1 delinquent validators ( 0.00%)
1.15.2  -    0 current validators ( 0.00%)   1 delinquent validators ( 0.01%)
1.15.1  -    0 current validators ( 0.00%)   1 delinquent validators ( 0.02%)
1.15.0  -    1 current validators ( 0.02%)
1.14.15 -  435 current validators (10.35%)  29 delinquent validators ( 0.30%)
1.14.13 -    4 current validators ( 0.05%)   4 delinquent validators ( 0.00%)
1.14.11 -    1 current validators ( 0.00%)
1.14.10 -    1 current validators ( 0.01%)
1.14.5  -    0 current validators ( 0.00%)   5 delinquent validators ( 0.09%)
1.13.7  -    1 current validators ( 0.13%)
1.13.6  - 1199 current validators (32.70%)  34 delinquent validators ( 0.26%)
1.13.5  -  723 current validators (54.54%)  20 delinquent validators ( 0.04%)
1.13.4  -   10 current validators ( 0.53%)   1 delinquent validators ( 0.02%)
1.13.3  -   12 current validators ( 0.36%)
1.13.1  -    0 current validators ( 0.00%)   1 delinquent validators ( 0.00%)
1.9.12  -    0 current validators ( 0.00%)   1 delinquent validators ( 0.00%)
1.8.14  -    0 current validators ( 0.00%)   1 delinquent validators ( 0.00%)
unknown -    1 current validators ( 0.00%) 614 delinquent validators ( 0.56%)

After upgrading:

Ledger location: test-ledger
Log: test-ledger/validator.log
⠁ Initializing...
Waiting for fees to stabilize 1...
Identity: 6uDKZaJJyYdJ2m12DJZAoqfhoshfSXCgRxxz8DswNgwZ
Genesis Hash: 8borh5LdxMdB126h4pX1sisEMANqAeeueEkiSDvJcBRx
Version: 1.15.2

And re-running the test above, 1.15.2 solves the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.