metaplex-foundation / metaplex-program-library

Smart contracts maintained by the Metaplex team
Other
580 stars 510 forks source link

[Bug]: Program failed to complete: exceeded maximum number of instructions allowed (12781) at instruction #31041 in metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s #951

Closed MirekR closed 1 year ago

MirekR commented 1 year ago

Which package is this bug report for?

candy-machine

Which Type of Package is this bug report for?

Rust Contract

Issue description

Hi, we're trying to call metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s program from our program it has worked until yesterday fine on the devnet. You can see example of a transaction from yesterday here: https://explorer.solana.com/tx/3nChhUgfL3EUo6v4f41TVDb6S3iejVVMJT5xtSG3GtNqd3L15mwxikTVScnMgWFSyNWNquVDfJzGaCg9PQvPZPMp?cluster=devnet

But today transaction simulation fails with Program failed to complete: exceeded maximum number of instructions allowed (12781) at instruction #31041', see the full logs below.

Example of failed transaction: {"recentBlockhash":"BLnYpnBpT3qjC1dc73cpFyHJ6jzotmtJEMm2rJSvu4nU","feePayer":"6Ckt9z51g3ubcBSMN4LCEGQUx6uPXT8FDVSkcfXnPs3k","nonceInfo":null,"instructions":[{"keys":[{"pubkey":"57CPxQ2voBLTYUMLUNeWNeBgnHW15tPDDrDhC8Hv4S9n","isSigner":false,"isWritable":false},{"pubkey":"6kpuQa931CPH6YCK87Z27T5a18T6omT7oEa3xtPspWj7","isSigner":false,"isWritable":true},{"pubkey":"6Ckt9z51g3ubcBSMN4LCEGQUx6uPXT8FDVSkcfXnPs3k","isSigner":true,"isWritable":true},{"pubkey":"11111111111111111111111111111111","isSigner":false,"isWritable":false}],"programId":"91L9t9gwA2o75PUx9RYc9BUm4XYWjDhs3fj55ajvNvoP","data":[36,132,152,60,215,57,216,93,44,0,0,0,72,51,102,117,49,71,54,48,52,115,52,118,98,83,52,115,98,81,73,112,55,84,116,69,72,54,52,57,108,52,111,113,54,113,110,116,86,65,85,116,88,111,65,61,60,0,0,0,1,0,167,46,41,185,147,66,125,254,178,67,209,84,73,20,45,26,125,224,58,56,19,86,43,93,142,4,116,237,46,170,198,228]},{"keys":[{"pubkey":"6Ckt9z51g3ubcBSMN4LCEGQUx6uPXT8FDVSkcfXnPs3k","isSigner":true,"isWritable":true},{"pubkey":"57CPxQ2voBLTYUMLUNeWNeBgnHW15tPDDrDhC8Hv4S9n","isSigner":true,"isWritable":true}],"programId":"11111111111111111111111111111111","data":[0,0,0,0,96,77,22,0,0,0,0,0,82,0,0,0,0,0,0,0,6,221,246,225,215,101,161,147,217,203,225,70,206,235,121,172,28,180,133,237,95,91,55,145,58,140,245,133,126,255,0,169]},{"keys":[{"pubkey":"57CPxQ2voBLTYUMLUNeWNeBgnHW15tPDDrDhC8Hv4S9n","isSigner":false,"isWritable":true},{"pubkey":"SysvarRent111111111111111111111111111111111","isSigner":false,"isWritable":false}],"programId":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA","data":[0,0,62,100,74,56,101,57,157,32,104,6,103,26,74,121,224,109,159,59,216,42,91,252,85,190,204,64,232,134,88,167,230,30,1,62,100,74,56,101,57,157,32,104,6,103,26,74,121,224,109,159,59,216,42,91,252,85,190,204,64,232,134,88,167,230,30]},{"keys":[{"pubkey":"6Ckt9z51g3ubcBSMN4LCEGQUx6uPXT8FDVSkcfXnPs3k","isSigner":true,"isWritable":true},{"pubkey":"374wZ6iLhx6pWyHsVnrAYU89TeZGwEY7PaV3hKAWef8B","isSigner":false,"isWritable":true},{"pubkey":"5CYyW8j7QCz1mhbtSEw3BymaoqLkdPXLxZ51x8sSwtVT","isSigner":false,"isWritable":false},{"pubkey":"57CPxQ2voBLTYUMLUNeWNeBgnHW15tPDDrDhC8Hv4S9n","isSigner":false,"isWritable":false},{"pubkey":"11111111111111111111111111111111","isSigner":false,"isWritable":false},{"pubkey":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA","isSigner":false,"isWritable":false}],"programId":"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL","data":[]},{"keys":[{"pubkey":"57CPxQ2voBLTYUMLUNeWNeBgnHW15tPDDrDhC8Hv4S9n","isSigner":false,"isWritable":true},{"pubkey":"374wZ6iLhx6pWyHsVnrAYU89TeZGwEY7PaV3hKAWef8B","isSigner":false,"isWritable":true},{"pubkey":"5CYyW8j7QCz1mhbtSEw3BymaoqLkdPXLxZ51x8sSwtVT","isSigner":true,"isWritable":false}],"programId":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA","data":[7,1,0,0,0,0,0,0,0]}],"signers":["6Ckt9z51g3ubcBSMN4LCEGQUx6uPXT8FDVSkcfXnPs3k","57CPxQ2voBLTYUMLUNeWNeBgnHW15tPDDrDhC8Hv4S9n","5CYyW8j7QCz1mhbtSEw3BymaoqLkdPXLxZ51x8sSwtVT"]}

I can see the program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s was updated about 14hrs ago, is that causing it?

Relevant log output

logs: [
'Program Drop9NhG6Mm6oQmPnzr8FQP6rWaPiwFkin59SeAKApLc invoke [1]',
'Program log: Instruction: MintNft',
'Program CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR invoke [2]',
'Program log: Instruction: Mint',
'Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s invoke [3]',
'Program log: Instruction: Create Metadata Accounts v2',
'Program log: Transfer 5616720 lamports to the new account',
'Program 11111111111111111111111111111111 invoke [4]',
'Program 11111111111111111111111111111111 success',
'Program log: Allocate space for the account',
'Program 11111111111111111111111111111111 invoke [4]',
'Program 11111111111111111111111111111111 success',
'Program log: Assign the account to the owning program',
'Program 11111111111111111111111111111111 invoke [4]',
'Program 11111111111111111111111111111111 success',
'Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s consumed 39977 of 136042 compute units',
'Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s success',
'Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s invoke [3]',
'Program log: V3 Create Master Edition',
'Program log: Transfer 2853600 lamports to the new account',
'Program 11111111111111111111111111111111 invoke [4]',
'Program 11111111111111111111111111111111 success',
'Program log: Allocate space for the account',
'Program 11111111111111111111111111111111 invoke [4]',
'Program 11111111111111111111111111111111 success',
'Program log: Assign the account to the owning program',
'Program 11111111111111111111111111111111 invoke [4]',
'Program 11111111111111111111111111111111 success',
'Program log: Setting mint authority',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [4]',
'Program log: Instruction: SetAuthority',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 3090 of 50336 compute units',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success',
'Program log: Setting freeze authority',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [4]',
'Program log: Instruction: SetAuthority',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 3250 of 44056 compute units',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success',
'Program log: Finished setting freeze authority',
'Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s consumed 51972 of 91417 compute units',
'Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s success',
'Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s invoke [3]',
'Program log: Instruction: Update Metadata Accounts v2',
'Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s consumed 19819 of 37306 compute units',
'Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s success',
'Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s invoke [3]',
'Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s consumed 12781 of 12781 compute units',
'Program failed to complete: exceeded maximum number of instructions allowed (12781) at instruction #31041',
'Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s failed: Program failed to complete',
'Program CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR consumed 165519 of 165519 compute units',
'Program CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR failed: Program failed to complete',
'Program Drop9NhG6Mm6oQmPnzr8FQP6rWaPiwFkin59SeAKApLc consumed 200000 of 200000 compute units',
'Program Drop9NhG6Mm6oQmPnzr8FQP6rWaPiwFkin59SeAKApLc failed: Program failed to complete'
]

Priority this issue should have

Medium (should be fixed soon)

MirekR commented 1 year ago

Apologies, we've figured it out. Using ComputeBudgetProgram.setComputeUnitLimit solved our issue -> closing the ticket.