SNS SDK "Program Panicked" when registering a Devnet domain

SNS SDK "Program Panicked" when registering a Devnet domain

Manage alerts

Loading saved threads...

Eduardo Chongkan · External communityPost link
External question — Solana Stack Exchange Author: Eduardo Chongkan Original post: https://solana.stackexchange.com/questions/13468 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. When trying to get started with the SNS JS SDK, attempting to register a new domain in DEVNET produces an error. const createDevnetDomain = async () => { const [, ixs] = await devnet.bindings.registerDomainName( connection, "boooooo", // The name of the domain you want to register 1_000, window.solana.publicKey, // PublicKey of fee payer getAssociatedTokenAddressSync(NATIVE_MINT, window.solana.publicKey, true), // import from @solana/spl-token NATIVE_MINT ); console.log(ixs); const tx = new Transaction(); tx.feePayer = window.solana.publicKey; tx.recentBlockhash = (await connection.getLatestBlockhash('finalized')).blockhash; tx.add(...ixs); console.log(tx); const signedTx = await window.solana.signTransaction(tx); console.log(signedTx); const signature = await connection.sendRawTransaction(signedTx.serialize()); console.log(signature); } Note: The instruction being generated contains 15 keys and matches the structure of the createNameRegistry() method ( https://github.com/Bonfida/sns-sdk/blob/main/js/src/bindings.ts#L77 ), rather than reflecting those defined for the function being called. Transaction Instruction being generated IXs: [ { "keys": [ { "pubkey": "namesLPneVptA9Z5rqUDD9tMTWEJwofgaYwp8cawRkX", "isSigner": false, "isWritable": false }, { "pubkey": "5eoDkP6vCQBXqDV9YN2NdUs3nmML3dMRNmEYpiyVNBm2", "isSigner": false, "isWritable": false }, { "pubkey": "4sKwnTgwZKjvgNecE7eGPgPw4o6VB2xmH4i2PCVNcTTt", "isSigner": false, "isWritable": true }, { "pubkey": "BNVnHvxL2G5Mm1jMD6rEGd8UYLsFY6sXr7ZyP4iXMwth", "isSigner": false, "isWritable": true }, { "pubkey": "11111111111111111111111111111111", "isSigner": false, "isWritable": false }, { "pubkey": "7NbD1vprif6apthEZAqhRfYuhrqnuderB8qpnfXGCc8H", "isSigner": false, "isWritable": false }, { "pubkey": "3Js7k6xYQbvXv6qUYLapYV7Sptfg37Tss9GcAyVEuUqk", "isSigner": true, "isWritable": true }, { "pubkey": "9zZpV9wsCT7AbxcWP4xZxywkPBMq9uL86Vmn6yERAXNT", "isSigner": false, "isWritable": true }, { "pubkey": "BmA9Z6FjioHJPpjT39QazZyhDRUdZy2ezwx4GiDdE2u2", "isSigner": false, "isWritable": false }, { "pubkey": "3Mnn2fX6rQyUsyELYms1sBJyChWofzSNRoqYzvgMVz5E", "isSigner": false, "isWritable": false }, { "pubkey": "J83w4HKfqxwcq3BEMMkPFSppX3gqekLyLJBexebFVkix", "isSigner": false, "isWritable": false }, { "pubkey": "CK4GgmwCq1Bcz8dgGSLz5bueJbPdBwNfHPRfWQezgXTU", "isSigner": false, "isWritable": true }, { "pubkey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", "isSigner": false, "isWritable": false }, { "pubkey": "SysvarRent111111111111111111111111111111111", "isSigner": false, "isWritable": false }, { "pubkey": "7X2FuvVr3Ji2VpmknqBW1mC4uEo7dapGPHxVARzWf9mR", "isSigner": false, "isWritable": false } ], "programId": "snshBoEQ9jx4QoHBpZDQPYdNCtw7RMxJvYrKFEhwaPJ", "data": [ 13, 7, 0, 0, 0, 98, 111, 111, 111, 111, 111, 111, 232, 3, 0, 0, 0 ] } ] The Transaction itself (TX) { "recentBlockhash": "8zsaDAYGJaAtq2WYGiuTZto8biiarKTJCsDapPx3dbfH", "feePayer": "3Js7k6xYQbvXv6qUYLapYV7Sptfg37Tss9GcAyVEuUqk", "nonceInfo": null, "instructions": [ { "keys": [], "programId": "ComputeBudget111111111111111111111111111111", "data": [ 3, 160, 134, 1, 0, 0, 0, 0, 0 ] }, { "keys": [], "programId": "ComputeBudget111111111111111111111111111111", "data": [ 2, 64, 13, 3, 0 ] }, { "keys": [ { "pubkey": "namesLPneVptA9Z5rqUDD9tMTWEJwofgaYwp8cawRkX", "isSigner": false, "isWritable": false }, { "pubkey": "5eoDkP6vCQBXqDV9YN2NdUs3nmML3dMRNmEYpiyVNBm2", "isSigner": false, "isWritable": false }, { "pubkey": "4sKwnTgwZKjvgNecE7eGPgPw4o6VB2xmH4i2PCVNcTTt", "isSigner": false, "isWritable": true }, { "pubkey": "BNVnHvxL2G5Mm1jMD6rEGd8UYLsFY6sXr7ZyP4iXMwth", "isSigner": false, "isWritable": true }, { "pubkey": "11111111111111111111111111111111", "isSigner": false, "isWritable": false }, { "pubkey": "7NbD1vprif6apthEZAqhRfYuhrqnuderB8qpnfXGCc8H", "isSigner": false, "isWritable": false }, { "pubkey": "3Js7k6xYQbvXv6qUYLapYV7Sptfg37Tss9GcAyVEuUqk", "isSigner": true, "isWritable": true }, { "pubkey": "9zZpV9wsCT7AbxcWP4xZxywkPBMq9uL86Vmn6yERAXNT", "isSigner": false, "isWritable": true }, { "pubkey": "BmA9Z6FjioHJPpjT39QazZyhDRUdZy2ezwx4GiDdE2u2", "isSigner": false, "isWritable": false }, { "pubkey": "3Mnn2fX6rQyUsyELYms1sBJyChWofzSNRoqYzvgMVz5E", "isSigner": false, "isWritable": false }, { "pubkey": "J83w4HKfqxwcq3BEMMkPFSppX3gqekLyLJBexebFVkix", "isSigner": false, "isWritable": false }, { "pubkey": "CK4GgmwCq1Bcz8dgGSLz5bueJbPdBwNfHPRfWQezgXTU", "isSigner": false, "isWritable": true }, { "pubkey": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", "isSigner": false, "isWritable": false }, { "pubkey": "SysvarRent111111111111111111111111111111111", "isSigner": false, "isWritable": false }, { "pubkey": "7X2FuvVr3Ji2VpmknqBW1mC4uEo7dapGPHxVARzWf9mR", "isSigner": false, "isWritable": false } ], "programId": "snshBoEQ9jx4QoHBpZDQPYdNCtw7RMxJvYrKFEhwaPJ", "data": [ 13, 7, 0, 0, 0, 98, 111, 111, 111, 111, 111, 111, 232, 3, 0, 0, 0 ] } ], "signers": [ "3Js7k6xYQbvXv6qUYLapYV7Sptfg37Tss9GcAyVEuUqk" ] } RPC Network call Payload: { "method": "sendTransaction", "jsonrpc": "2.0", "params": [ "AXA/ImeY3fiVES+UcP+LuHMmKggqu4ajVwmRJiJpL4oKokNscAR6uPUT5skbSCsnG2BDd7kNZZRwDK4JWNyiJwIBAAwRIkrqC+g88eamANb3tU6OiBJW21IjBWP85MhI4XKkOsc5d4WbWmYH8fhqLWTqMompnC+A9oXPUBQV4d5zciDhx4WctbNAygdk9tKGFr03nHe7J1ijlLLEVmDp2WjE2Eycmhab4eVCClwyaH/AotPoLH/YlY6KOekiv6h/pIByLK6oELVqgd52Dz2CgCIU9Dv4pGJ8XKz7HGSRpuLMccajPwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIwq/4Ow7RgvVX8T7NjVnFjKZFRRUlyArjri/Gvago7lFHX+fdQm0mYbsdlUlyURme8kZqMr23pOMUhetFcJSKV6t/ykp0Zd9U3s5mafl2NR9T8eJrtd3MJqW/fCdDkr6YNb3nby5Y2mVYVGKQ3ND4rKVzoF6atHcJVjVbDABxxCf5MSXwer3YQwufcN6J3kn5mELJuOfeinC0NETCwlNdQMGRm/lIRcy/+ytunLDm+e8jOW7xfcSayxDmzpAAAAA/mUPA2fUp++YFaWT6hXTZZPwZDqq8BSbsEvmerhR3s0LrVH0E8HzqZRg2QDYvy7Wkn7KNNe3hCv4EKlzCC0e3A0C6Q3cyyuuI6c7B9PC+lCenSzLyvl/yllu8RVj4XZBBqfVFxksXFEhjMlMPUrxf1ja7gibof1E49vZigAAAAAG3fbh12Whk9nL4UbO63msHLSF7V9bN5E6jPWFfv8AqXbVGOI7wTVt+4m5U9vreETf4pI2ubHSSjjkPyl8EvSUAwsACQOghgEAAAAAAAsABQJADQMADg8NBwEDBQgAAgoGDAQQDwkRDQcAAABib29vb29v6AMAAAA=", { "encoding": "base64", "preflightCommitment": "finalized" } ], "id": "2cade21a-5a69-434d-b27a-1b84372cd000" } **FULL RESPONSE FROM RPC ** { "jsonrpc": "2.0", "error": { "code": -32002, "message": "Transaction simulation failed: Error processing Instruction 2: Program failed to complete", "data": { "accounts": null, "err": { "InstructionError": [ 2, "ProgramFailedToComplete" ] }, "innerInstructions": null, "logs": [ "Program ComputeBudget111111111111111111111111111111 invoke [1]", "Program ComputeBudget111111111111111111111111111111 success", "Program ComputeBudget111111111111111111111111111111 invoke [1]", "Program ComputeBudget111111111111111111111111111111 success", "Program snshBoEQ9jx4QoHBpZDQPYdNCtw7RMxJvYrKFEhwaPJ invoke [1]", "Program log: Entrypoint", "Program log: Beginning processing", "Program log: Instruction unpacked", "Program log: Instruction: Create v3", "Program log: Found product in mapping.", "Program log: Found correct price account in product.", "Program log: panicked at 'range end index 165 out of range for slice of length 0', src/state.rs:131:19", "Program snshBoEQ9jx4QoHBpZDQPYdNCtw7RMxJvYrKFEhwaPJ consumed 47020 of 199700 compute units", "Program snshBoEQ9jx4QoHBpZDQPYdNCtw7RMxJvYrKFEhwaPJ failed: SBF program panicked" ], "returnData": null, "unitsConsumed": 47320 } }, "id": "2cade21a-5a69-434d-b27a-1b84372cd000" } UPDATE: After creating ATAs for wSOL, I am now getting a different error ( Insufficient funds ) { "jsonrpc": "2.0", "error": { "code": -32002, "message": "Transaction simulation failed: Error processing Instruction 0: custom program error: 0x1", "data": { "accounts": null, "err": { "InstructionError": [ 0, { "Custom": 1 } ] }, "innerInstructions": null, "logs": [ "Program snshBoEQ9jx4QoHBpZDQPYdNCtw7RMxJvYrKFEhwaPJ invoke [1]", "Program log: Entrypoint", "Program log: Beginning processing", "Program log: Instruction unpacked", "Program log: Instruction: Create v3", "Program log: Found product in mapping.", "Program log: Found correct price account in product.", "Program log: Pyth FP32 price value: 550826466", "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]", "Program log: Instruction: Transfer", "Program log: Error: insufficient funds", "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4302 of 147304 compute units", "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA failed: custom program error: 0x1", "Program snshBoEQ9jx4QoHBpZDQPYdNCtw7RMxJvYrKFEhwaPJ consumed 56998 of 200000 compute units", "Program snshBoEQ9jx4QoHBpZDQPYdNCtw7RMxJvYrKFEhwaPJ failed: custom program error: 0x1" ], "returnData": null, "unitsConsumed": 56998 } }, "id": "dcdd3973-2329-4498-9497-297f4a139be2" }
Quote
Report
Eduardo Chongkan · External communityPost link
External answer — Solana Stack Exchange Author: Eduardo Chongkan Original post: https://solana.stackexchange.com/a/13506 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. Solution: TLDR; Create a wSOL ATA and fund it. I had to write the answer and replicate the steps to realize what the solution was :-p I got a clue when I extracted the instruction getAssociatedTokenAddressSync(), it returned an account that according to the explorer, did not exist. I had to load the KeyPair, So I have it in the Phantom Wallet, but also configured in the Solana CLI config: solana config set --keypair <Path to my KeyPair> solana balance spl-token balance So11111111111111111111111111111111111111112 Then I used the CLI to wrap Sol since the Phantom wallet doesn't provide that functionality. ( replace the 1 with some valid amount based on your regular SOL balance in Devnet for that wallet. ) So I airdropped some more SOL to it, and then wrapped it to get wSol. spl-token --url devnet wrap 1 Output: (This ATA is from my previous wallet) Wrapping 1 SOL into Knzf7k5tHxYBqtpANNNnzDD37hPHEUT4FumNY18LQA6 Signature: 3y6AGbUxyjXEskmkGd5bLgxbEFc7166MrYf6CDVSHVmvgvwSz4HLceusWvfmVzL39SdN4AYx4gxGFCandQG91dLF Now The account was Initialized and had wSol on it. Then I retried, Signed the Transaction ( with the Phantom Wallet ) Went to check the TX Signature and it worked: https://explorer.solana.com/tx/hzsxSa8PopAc4z3NukxJSGgHp8u4u8S6LpJXDnDBn2s6L2TspM4oG45Lh9aiCR29865zKBJ3rbDaT3pDqQ4cmkF?cluster=devnet ##EXTRA TIP: Verifying the Domain. ## Now, I wen and checked the Transaction and could not find the Domain anywhere, it worked but I could not tell which Publick Key was the domain name. So I remembered the devnet.bindings.* had several other methods and used this one devnet.bindings.getDomainKeySync('my-domain-name') const pubkey = devnet.utils.getDomainKeySync(domainName); Then, using the Domain Public Key to check if the domain name is the one I registered: const domainKey = new PublicKey("EmXhygaKUQJbFs37DSdxwtHYgtMgQdp4e6Pnk1QkPsVn"); const domainNameReverse = await devnet.utils.reverseLookup(connection, domainKey); console.log(domainNameReverse);
Quote
Report

Post Reply

Checking account access…