mirror of
https://github.com/luxfi/indexer.git
synced 2026-10-30 16:22:36 +00:00
The index could hold a block without its transactions. Before v1.5.9 a null receipt became an empty transaction, stored under the empty hash, and every later miss merged into that one row. The blocks stayed and counted their transactions, and nothing read them again, so Zoo mainnet holds 800 blocks and 2 of 811 transactions. - A transaction without a hash is refused with its block. - The block row is written last, after its transactions, logs and transfers. Rows at that height under another block hash are deleted. - indexBlock can be repeated. Transactions are replaced, and address counts and token balances move only for rows not already stored. - The audit deletes hashless rows, then reads again every block whose transaction rows do not match its tx_count or its hash. Totals are compared first, so a consistent index costs two range reads. A repair runs 256 heights per pass, with a pass after every head poll. - A node that answers eth_getBlockReceipts with MethodNotFound (zood) is read per transaction with eth_getTransactionReceipt, and never asked for block receipts again. A null receipt is still ErrNoBlock. Any other receipt error is retried instead of storing transactions without their results. - The transports return JSON-RPC errors as transport.RPCError with their code. - An empty index starts at StartBlock. An index holding only block 0 resumes at 1 instead of re-reading block 0 on every poll. Co-authored-by: Hanzo Dev <[email protected]>