Skip to content
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

exceeded CUs meter at BPF instruction #3478

Open
cxp-13 opened this issue Jan 11, 2025 · 1 comment
Open

exceeded CUs meter at BPF instruction #3478

cxp-13 opened this issue Jan 11, 2025 · 1 comment

Comments

@cxp-13
Copy link

cxp-13 commented Jan 11, 2025

  'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 6173 of 46904 compute units',
    'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success',
    'Program HWy1jotHpo6UqeQxx49dpYYdQB8wj9Qk9MdxwjLvDHB8 invoke [2]',
    'Program HWy1jotHpo6UqeQxx49dpYYdQB8wj9Qk9MdxwjLvDHB8 consumed 32679 of 32679 compute units',
    'Program HWy1jotHpo6UqeQxx49dpYYdQB8wj9Qk9MdxwjLvDHB8 failed: exceeded CUs meter at BPF instruction',
    'Program QoB7dVkkZr3oLb95DMpSptvUF8mTygDHNjFQh5y5RAb consumed 200000 of 200000 compute units',
    'Program QoB7dVkkZr3oLb95DMpSptvUF8mTygDHNjFQh5y5RAb failed: Program failed to complete'

even I set the CU limit to 5_000_000 stiil not work

preInstructions([
        ComputeBudgetProgram.setComputeUnitLimit({ units: 50000000 }),
      ])
@cxp-13
Copy link
Author

cxp-13 commented Jan 11, 2025

solved:
if use .instruction(); as the end of ix building, the extend CU ix should miss adding to the final tx, and should add it on outer logic.

const depositIx = await buildRaydiumDepositIx(
        orbitlenProgram,
        userKeypair,
        getTokenMintAddress(coinToken),
        coinAmount,
        pcAmount
      );

      const transaction = new anchor.web3.Transaction();
      let extendCUIx = ComputeBudgetProgram.setComputeUnitLimit({ units: 1_400_000 });

      transaction.add(extendCUIx, depositIx);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant