[Chronik] Add reverse lookup index, allow hashes in /block/:hash_or_height
Summary:
Currently, we can only query blocks by height, because we only index by height. To query by hash, we need an index from hash -> height. However, since we already store the hash in the blk column family, this would be redundant. While this seems trivial for blocks, this would incur not an insignificant redundant space for the equivalent index for txs, or other future reverse indices.
We therefore add the ReverseLookup struct, which (instead of storing a hash -> height) stores a cheaphash(hash) -> [height] column family, which stores a list of heights for each entry to allow for collisions. See details in reverse_lookup.rs.
Test Plan: ninja check-crates && ninja && ./test/functional/test_runner.py chronik_block
Reviewers: Fabien, #bitcoin_abc
Reviewed By: Fabien, #bitcoin_abc
Differential Revision: https://reviews.bitcoinabc.org/D13422