gnolang / tx-indexer

A minimal Tendermint2 indexer capable of serving chain data
Apache License 2.0
9 stars 13 forks source link

feat: index genesis transactions #34

Closed n0izn0iz closed 1 month ago

n0izn0iz commented 6 months ago

Depends on https://github.com/gnolang/gno/pull/1941

Screenshot 2024-06-11 at 15 11 01
jefft0 commented 5 months ago

Related to https://github.com/gnolang/gno/pull/1941

zivkovicmilos commented 4 months ago

@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

n0izn0iz commented 4 months ago

agree, would simplify, was planning on doing that

n0izn0iz commented 3 months ago

added tests in 763c68ac29fa7f90b43673205e0d9ba82bb6039f

n0izn0iz commented 3 months ago

improved tests in 0a31d61

it helped me catch nil deref corner cases, thanks

n0izn0iz commented 2 months ago

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)

zivkovicmilos commented 2 months ago

@n0izn0iz I'll fix up the tests on this branch 🙏

zivkovicmilos commented 1 month ago

@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