solana-foundation / developer-content

Collection of Developer content for exploring, learning, and building in the Solana ecosystem.
https://solana.com/developers
81 stars 96 forks source link

fix: last valid block height value #251

Open nathandem opened 1 week ago

nathandem commented 1 week ago

Problem

A mistake sneaked in about the last valid block height (for tx validity). Slots are way ahead of blockHeights, as the blockHeight count doesn't increase when no block is produced during a slot.

Summary of Changes

PS: it'd be great to update the lastValidBlockHeight number returned from getLatestBlockhash such that it's just 150 ahead of getBlockHeight. I'm sure it's confusing more devs writing the tx retry logic of their apps.