0

Attempting to build a LUT fails with 33 is not a recent slot when running on localnet:

        const slot = await provider.connection.getSlot();
        const [createLookupIx, lookupTableKey] =
          AddressLookupTableProgram.createLookupTable({
            authority: wallet.publicKey,
            payer: wallet.publicKey,
            recentSlot: slot,
          });
        await provider.sendAndConfirm(
          new Transaction().add(createLookupIx)
        );

Looking at the recent blocks with const slots = await conn.getBlocks(slot - 10); shows that all of them are valid (23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33), so what's up?

Solana tools version 1.16.8, web3.js version 1.87.5

2
  • recentSlot: slot-1 works, which is odd!
    – Whiteseal
    Nov 10, 2023 at 0:13
  • Depending on how your connection is configured, getSlot might be getting a current bank that hasn't been replayed just yet. Stick with something slightly in the past -- your solution is perfect!
    – Jon C
    Nov 13, 2023 at 18:45

0

Your Answer

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

Browse other questions tagged or ask your own question.