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] =
            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

  • recentSlot: slot-1 works, which is odd!
    – Whiteseal
    Nov 10 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 at 18:45


Your Answer

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

Browse other questions tagged or ask your own question.