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
recentSlot: slot-1
works, which is odd!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!