getLatestBlockhash
RPC call.A timeslot allocated for a potential block.
96542804
.
So if we take a few blocks before that, we’ll see that there are empty slots with not blocks produced:
You can also run a getBlock | Solana call and provide the slot number and you’ll see that it’s missing. Note that you need a Chainstack Solana archive node to be able to make the call, since it’s a slot far in the past:
311118891
289445888
getLatestBlockhash
methodgetLatestBlockhash
RPC method returns three key pieces of data:
slot
: The slot number at which the block hash was produced.blockhash
: The latest block hash to use for a new transaction.lastValidBlockHeight
: The block height until which the transaction is considered valid before expiring (150 blocks from the “current” block height)."slot": 311115149
matches the slot height."lastValidBlockHeight": 289442306
is about 22 million behind the slot number.lastValidBlockHeight
. After 150 blocks have passed from the latest block height at the time of your transaction creation, your transaction is dropped if it wasn’t included.
Importantly:
lastValidBlockHeight
, it’s really telling you: “You have until block N + 150 to have your transaction included on-chain.”
getBlock
getBlock
call using the slot number from our getLatestBlockhash
example above:
311115149
.289442156
.289442156
with our lastValidBlockHeight
(289442306
), you’ll see there’s exactly a difference of 150 blocks—just as expected for the transaction validity window.
block/311115149
, but that number is a slot.block/311115149
, but again, it’s a slot, not a block.getBlock
method uses a slot number as its parameter. But the response includes the block height (blockHeight
). Don’t let the naming fool you—this is a “fetch block by slot” call.