electrs icon indicating copy to clipboard operation
electrs copied to clipboard

Fallback to getblock when getrawtransaction fails on Genesis TX

Open junderw opened this issue 8 months ago • 7 comments

In light mode, the block summary /txs for genesis block is borked thanks to RPC error.

junderw avatar Apr 14 '25 15:04 junderw

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

nymkappa avatar Apr 15 '25 01:04 nymkappa

How about when using dark mode

wiz avatar Apr 15 '25 05:04 wiz

How about when using dark mode

get out

nymkappa avatar Apr 15 '25 06:04 nymkappa

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.

portlandhodl avatar Apr 15 '25 06:04 portlandhodl

why don't we fetch the whole genesis block, extract the coinbase transaction, and then cache it somewhere?

mononaut avatar Apr 15 '25 06:04 mononaut

  1. I agree that fetching the genesis block (which seems to work) and pulling out the genesis tx is much more........ less trust-y.
  2. 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.

junderw avatar Apr 15 '25 16:04 junderw

Just don't use light mode and this isn't an issue

wiz avatar Apr 16 '25 03:04 wiz