Fallback to getblock when getrawtransaction fails on Genesis TX
In light mode, the block summary /txs for genesis block is borked thanks to RPC error.
Fixes the issue described, but I will let other electrs champions actually review the PR.
electrs
DEBUG - Adding 2 transactions to Mempool
INFO - handle GET /block-height/0
INFO - handle GET /block/000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
DEBUG - Adding 2 transactions to Mempool
mempool backend
000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
Apr 15 10:23:02 [42564] NOTICE: [Mining] Blocks summaries indexing completed: indexed 1 blocks
How about when using dark mode
How about when using dark mode
get out
Approach Nack, (Too magical)
I am not in favor of this solution because at the end of the day this only solves for a single network Mainnet. For an application that supports various networks, Signet, Testnet, etc ... This would lead to inconsistent behavior across use cases.
why don't we fetch the whole genesis block, extract the coinbase transaction, and then cache it somewhere?
- I agree that fetching the genesis block (which seems to work) and pulling out the genesis tx is much more........ less trust-y.
- Does every network have only one genesis tx? (A custom signet can be pretty weird, no? What about regtest?) If not, then really either way, we're only doing this hack for mainnet anyways.
Just don't use light mode and this isn't an issue