5

Trying to get early (~2021 March) blocks either with public RPC, QuickNode RPC or Alchemy RPC results in almost 1/3 blocks being missing (not skipped!). Why is that so? Can those blocks be retrieved from somewhere else? And does this happen in more recent slots as well?

1 Answer 1

6

It's up to the RPC node operator to decide how much historical ledger data they will serve. I don't think many serve very old data. It's a large amount of data to store and the demand for this data is low, so RPC node resources are typically dedicated to more recent data.

The full history of the block chain is stored in at least one place: a Google bigtables instance that the Solana Foundation manages. It is not available to the public, you have to get special permission to access it from the Foundation.

At least one RPC node operator has made a duplicate of this full history, GenesysGo. I have tried some sample queries and it appears to me that the full block history is available from their RPC node.

Also, the block you specifically mentioned, 80006252, was skipped and so is not available from any source.

3
  • Thank you for you answer! However, an error code you receive for a skipped block is 32007, when trying to get this block you receive 32009 (which is when a block is missing on RPC). That's why I assumed it was missing. Is there any other way to tell whether block is missing or skipped? Also I tried to use GenesysGo endpoint, and it always returned error code: 1020 error message on any block I tried. So I'm not sure it is even working
    – RowanStone
    Oct 4, 2022 at 17:49
  • Well if you don't trust the error codes of the RPC node you can fetch forward until you find the first available block later than the block you want, and the look at its parent. If they block you are interested in is skipped, then the parent of the later block will be a block earlier than the skipped block. In terms of errors, the Solana JSON RPC API is underspecified here. There is some documentation of a Rust enum that contains errors but I'm pretty sure these aren't the exact error codes returned via JSON API.
    – Zantetsu
    Oct 5, 2022 at 18:37
  • Also I still have no problems fetching blocks from ssc-dao.genesysgo.net so I don't know what your specific issue is there.
    – Zantetsu
    Oct 5, 2022 at 18:39

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.