Closed n0izn0iz closed 1 month ago
Related to https://github.com/gnolang/gno/pull/1941
@n0izn0iz I think you can just add a special "genesis" fetch before we start the main run routines for fetching blocks / block result chunks, since for the genesis block we only need the block results (block 0 is unfetchable) as part of https://github.com/gnolang/gno/pull/1941
agree, would simplify, was planning on doing that
added tests in 763c68ac29fa7f90b43673205e0d9ba82bb6039f
improved tests in 0a31d61
it helped me catch nil deref corner cases, thanks
there is one remaining problem, maybe the indexer should ignore genesis result if the node returns the well known "height must be greater than 0" otherwise we can't index test4 anymore
btw just saw that test3 returns "Height must be greater than 0" (yes the error message lost capitalization on "height" in test4)
@n0izn0iz I'll fix up the tests on this branch 🙏
@n0izn0iz
I think we got the PR to a working state -- but there is a problem:
The indexer will break for networks that don't have the genesis results in their storage.
I've circumvented this problem by providing the genesis state fetch error as a soft one, which doesn't derail the indexer: ca459d3
Depends on https://github.com/gnolang/gno/pull/1941