Access nodes only have data from the current spork, and return errors when queried for data they don't have in their local dbs.
Currently, queries for heights before the root height results in generic NotFound errors. Since the start height never changes, nodes could check and return a more user friendly error in this case.
Proposed Solution
When querying based on block height (e.g. ExecuteScriptByHeight, GetBlockByHeight, GetBlockHeaderByHeight, GetEventsForHeightRange, GetAccountAtBlockHeight), if the block is not found, check the the height. It should be in one of these 3 categories
Less than the spork root block height. The caller should try using a historic node.
Less than the node's root block height (if the node was started after a spork). The caller should try using a different Access node.
Greater than the node's finalized height. We don't need to handle this case, just adding it for completeness.
For 1 and 2, include in the error message the context so the caller knows how to respond.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Problem Definition
Access nodes only have data from the current spork, and return errors when queried for data they don't have in their local dbs.
Currently, queries for heights before the root height results in generic
NotFound
errors. Since the start height never changes, nodes could check and return a more user friendly error in this case.Proposed Solution
When querying based on block height (e.g.
ExecuteScriptByHeight
,GetBlockByHeight
,GetBlockHeaderByHeight
,GetEventsForHeightRange
,GetAccountAtBlockHeight
), if the block is not found, check the the height. It should be in one of these 3 categoriesFor 1 and 2, include in the error message the context so the caller knows how to respond.