You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 15, 2023. It is now read-only.
As pointed out by @jumpsiegel and @tbjump, it's technically possible to retrieve the incorrect block from an RPC node when fetching by height since blocks are finalized once 66% of the network accepts them. Therefore, if we somehow hit a node with a different history, the same block height may point to a different (unfinalized!) block. In addition, NEAR sometimes has gaps of permanently unfinalized blocks, disallowing a naive iteration over blocks heights.
Since there is no way to check if a specific block is finalized or not by block height, a possible solution may be to grab the hash of the latest finalized block and walk backwards to fromBlock using the prev_hash field.
The text was updated successfully, but these errors were encountered:
As pointed out by @jumpsiegel and @tbjump, it's technically possible to retrieve the incorrect block from an RPC node when fetching by height since blocks are finalized once 66% of the network accepts them. Therefore, if we somehow hit a node with a different history, the same block height may point to a different (unfinalized!) block. In addition, NEAR sometimes has gaps of permanently unfinalized blocks, disallowing a naive iteration over blocks heights.
Since there is no way to check if a specific block is finalized or not by block height, a possible solution may be to grab the hash of the latest finalized block and walk backwards to
fromBlock
using theprev_hash
field.The text was updated successfully, but these errors were encountered: