[Supanode](https://supanode.xyz/)[Learn](https://supanode.xyz/learn)Solana slots and block height: use the right counter

# Solana slots and block height: use the right counter

Distinguish event positions, produced blocks and transaction-expiry checks.

**On this page**[A slot can pass without a block](https://supanode.xyz/learn/solana-slot-vs-block-height#a-slot-can-pass-without-a-block)[Read both counters explicitly](https://supanode.xyz/learn/solana-slot-vs-block-height#read-both-counters-explicitly)[Apply the distinction to expiry](https://supanode.xyz/learn/solana-slot-vs-block-height#apply-the-distinction-to-expiry)[Avoid time conversion shortcuts](https://supanode.xyz/learn/solana-slot-vs-block-height#avoid-time-conversion-shortcuts)[Sources](https://supanode.xyz/learn/solana-slot-vs-block-height#sources)

## A slot can pass without a block

A slot identifies a scheduled opportunity for block production. Block height counts produced blocks. Skipped slots mean the two counters do not advance together. Do not subtract a slot from a block height or use the difference as a latency measurement.

## Read both counters explicitly

```
[{"jsonrpc":"2.0","id":"slot","method":"getSlot","params":[{"commitment":"confirmed"}]},{"jsonrpc":"2.0","id":"height","method":"getBlockHeight","params":[{"commitment":"confirmed"}]}]
```

Even this batch is not a promise of one atomic snapshot. For diagnostics, retain the commitment and response time. Use slot-based positions for block lookups and stream checkpoints, and block-height-based checks when the API returns lastValidBlockHeight.

## Apply the distinction to expiry

1.  Request getLatestBlockhash at your chosen commitment. Save its blockhash and lastValidBlockHeight together.
2.  Sign the transaction with that blockhash.
3.  Track getBlockHeight using a consistent commitment.
4.  When the valid height is exceeded, reconcile signature status before deciding whether to rebuild and sign again.

## Avoid time conversion shortcuts

A fixed multiplication such as slots times 400 milliseconds is an estimate, not a wall-clock guarantee. Network behavior and skipped slots change the relationship. For actual elapsed time, record a local monotonic timestamp; for ledger placement, keep slots; for human reporting, use observed block times with their possible missing values. Clear field names prevent a subtle counter mix-up from becoming a transaction retry bug.

## Sources

-   [Solana: getSlot](https://solana.com/docs/rpc/http/getslot)
-   [Solana: getBlockHeight](https://solana.com/docs/rpc/http/getblockheight)
-   [Solana: getLatestBlockhash](https://solana.com/docs/rpc/http/getlatestblockhash)

## Continue reading

[Solana streaming guide](https://supanode.xyz/blog/solana-data-streaming-guide)[Solana product Docs](https://supanode.xyz/docs/solana/quickstart)[Learn library](https://supanode.xyz/learn)

---
Source: https://supanode.xyz/learn/solana-slot-vs-block-height
