Ethereum Search Ranges

This page gives information about the searched range for various combinations of lowBlockNum and highBlockNum when using our search engine as well as the implications of using a cursor or deciding about the sort order, either ascending (ASC) or descending (DESC).

To complicate things a bit more, the actual resolution is different between a search query versus a search subscription (i.e. streaming).

You will notice that not all possible combinations are displayed here, mainly because the matrix of all combinations is too big for quick understanding of boundaries resolution. We put the most important cases, the resolution for all other combinations can be inferred easily based on the table below. For example, values lowBlockNum: -50, highBlockNum: -1 would mean the range [HEAD - 50, HEAD] so the last 50 blocks of the chain at time of query.

Note

All the boundaries are inclusive, so a range [HEAD, HEAD] will only check a single block, the HEAD block.

Warning

Not all combinations are valid, trying to query an upper boundary that is below boundary yields an invalid range error, for example trying lowBlockNum: -1, highBlockNum: -50 is doomed to failed as it would always resolves to [HEAD, HEAD - 50] which means the upper boundary is below the lower one.

In the tables that follow, we use a few semantics to make the table easier to read:

  • The value None means the field was not present at all
  • The value Any means can be any valid value for this field
  • Variable C represents the block number encoded in the cursor
  • Variable L represents a dynamic value passed in lowBlockNum field, could be positive or negative
  • Variable H represents a dynamic value passed in highBlockNum field, could be positive or negative
  • Special variable HEAD means the head block of the chain, as seen by our search engine

Search Transactions (Query)

SortCursorLowHighRange
AnyNoneNoneNone[0, HEAD]
AnyNoneLH[L, H]
AnyNone00[0, 0]
AnyNone-1-1[HEAD, HEAD]
AnyNone-L-H[HEAD - L, HEAD - H]
ASCCNoneNone[C, HEAD]
ASCCLH[C, H]
ASCC00[C, 0]
ASCC-1-1[C, HEAD]
ASCC-L-H[C, HEAD - H]
DESCCNoneNone[0, C]
DESCCLH[L, C]
DESCC00[0, C]
DESCC-1-1[HEAD, C]
DESCC-L-H[HEAD - L, C]

Search Transactions (Subscription)

SortCursorLowHighRange
ASCNoneNoneNone[0, ∞
ASCNoneLH[L, H]
ASCNone00[0, 0]
ASCNone-1-1[HEAD, HEAD]
ASCNone-L-H[HEAD - L, HEAD - H]
ASCCNoneNone[C, ∞
ASCCLH[C, H]
ASCC00[C, 0]
ASCC-1-1[C, HEAD]
ASCC-L-H[C, HEAD - H]
DESCNoneNoneNone[0, HEAD]
DESCNoneLH[L, H]
DESCNone00[0, 0]
DESCNone-1-1[HEAD, HEAD]
DESCNone-L-H[HEAD - L, HEAD - H]
DESCCNoneNone[0, C]
DESCCLH[L, C]
DESCC00[0, C]
DESCC-1-1[HEAD, C]
DESCC-L-H[HEAD - L, C]