Unboxed-Software / solana-course

A complete course for learning Solana, including creating and transferring tokens, making NFTs, on-chain app development, and more.
https://solana.com/developers
Mozilla Public License 2.0
395 stars 134 forks source link

Extends Versioned Transaction will not work without ComputeBudgetProgram.setComputeUnitLimit #376

Closed 0xk2 closed 2 months ago

0xk2 commented 4 months ago

In this article https://www.soldev.app/course/versioned-transaction

If I seperate the create & extend LUT instructions into 2 transactions then it always returns 'Computational Budget Exceed' in the extending transaction, example It seems that the client always miscalculate the required compute budget for extending LUT. Solution is adding a ComputeBudgetProgram.setComputeUnitLimit instruction within the extending transaction, like this The fixed code:

const extendLookupTableTxid = await sendV0Transaction(connection, user, [
  extendInstruction,
  ComputeBudgetProgram.setComputeUnitLimit({
    units: 200000,
  }),
]);
mikemaccana commented 2 months ago

Hi @0xk2 ! The soldev course has moved to solana.com. Can you please send a PR to the new repository? The code is at https://github.com/solana-foundation/developer-content/blob/main/content/courses/program-optimization/lookup-tables.md

mikemaccana commented 2 months ago

Closing as I've filed this in the other repo