Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to fetch litecoin genesis block #1195

Closed
drunkirishcoder opened this issue Jan 30, 2025 · 5 comments
Closed

unable to fetch litecoin genesis block #1195

drunkirishcoder opened this issue Jan 30, 2025 · 5 comments

Comments

@drunkirishcoder
Copy link

fetching litecoin genesis block seems to fail.

% curl -v http://localhost/api/v2/block/0
...
...
* Request completely sent off
< HTTP/2 500
< content-type: application/json; charset=utf-8
< date: Thu, 30 Jan 2025 19:41:46 GMT
< content-length: 34
< alt-svc: h3=":8443";ma=60;
<
{"error":"Internal server error"}

underlying cause seems to be Transaction '97ddfbbae6be97fd6cdf3e7ca13232a3afff2353e29badfab7f73011edd4ced9' not found

see it here as well, https://ltc1.trezor.io/block/0

@martinboehm
Copy link
Contributor

Litecoin backend is not returning the genesis block...

@Asara
Copy link

Asara commented Feb 5, 2025

Not sure this issue should be closed, nor do I think the issue is with litecoind itself.

Are we saying that none of the litecoind nodes that the trezor blockbook instances are connected to are returning the genesis block? ltc{1..5}.trezor.io all fail on this.

Looking at the the litecoind node itself and using the rpc endpoint, we are able to get the genesis block as well.

litecoin-cli getblock 12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2
{
  "hash": "12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2",
  "confirmations": 2840214,
  "strippedsize": 280,
  "size": 280,
  "weight": 1120,
  "height": 0,
  "version": 1,
  "versionHex": "00000001",
  "merkleroot": "97ddfbbae6be97fd6cdf3e7ca13232a3afff2353e29badfab7f73011edd4ced9",
  "tx": [
    "97ddfbbae6be97fd6cdf3e7ca13232a3afff2353e29badfab7f73011edd4ced9"
  ],
  "time": 1317972665,
  "mediantime": 1317972665,
  "nonce": 2084524493,
  "bits": "1e0ffff0",
  "difficulty": 0.000244140625,
  "chainwork": "0000000000000000000000000000000000000000000000000000000000100010",
  "nTx": 1,
  "nextblockhash": "80ca095ed10b02e53d769eb6eaf92cd04e9e0759e5be4a8477b42911ba49c78f"
}

On the blockbook side our logs show:

W0205 16:45:34.880203       1 worker.go:1237] DB inconsistency:  tx 97ddfbbae6be97fd6cdf3e7ca13232a3afff2353e29badfab7f73011edd4ced9: not found in txAddresses
E0205 16:45:34.880729       1 html_templates.go:148] explorerBlock error: getTransaction 97ddfbbae6be97fd6cdf3e7ca13232a3afff2353e29badfab7f73011edd4ced9: Transaction '97ddfbbae6be97fd6cdf3e7ca13232a3afff2353e29badfab7f73011edd4ced9' not found

@martinboehm
Copy link
Contributor

Understood. But it is returning txid 97ddfbbae6be97fd6cdf3e7ca13232a3afff2353e29badfab7f73011edd4ced9 which cannot be fetched from the backend.

@Asara
Copy link

Asara commented Feb 5, 2025

Okay then following up...
On bitcoin the block shows up: https://btc1.trezor.io/block/0
But the coinbase transaction also fails: https://btc1.trezor.io/tx/4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b

@arnaud-dfns
Copy link

If we query the block with level 2 verbosity, get should have enough data to index the block

litecoin-cli  getblock 12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2 2
{
  "hash": "12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2",
  "confirmations": 2840227,
  "strippedsize": 280,
  "size": 280,
  "weight": 1120,
  "height": 0,
  "version": 1,
  "versionHex": "00000001",
  "merkleroot": "97ddfbbae6be97fd6cdf3e7ca13232a3afff2353e29badfab7f73011edd4ced9",
  "tx": [
    {
      "txid": "97ddfbbae6be97fd6cdf3e7ca13232a3afff2353e29badfab7f73011edd4ced9",
      "hash": "97ddfbbae6be97fd6cdf3e7ca13232a3afff2353e29badfab7f73011edd4ced9",
      "version": 1,
      "size": 199,
      "vsize": 199,
      "weight": 796,
      "locktime": 0,
      "vin": [
        {
          "ismweb": false,
          "coinbase": "04ffff001d0104404e592054696d65732030352f4f63742f32303131205374657665204a6f62732c204170706c65e280997320566973696f6e6172792c2044696573206174203536",
          "sequence": 4294967295
        }
      ],
      "vout": [
        {
          "ismweb": false,
          "value": 50.00000000,
          "n": 0,
          "scriptPubKey": {
            "asm": "040184710fa689ad5023690c80f3a49c8f13f8d45b8c857fbcbc8bc4a8e4d3eb4b10f4d4604fa08dce601aaf0f470216fe1b51850b4acf21b179c45070ac7b03a9 OP_CHECKSIG",
            "hex": "41040184710fa689ad5023690c80f3a49c8f13f8d45b8c857fbcbc8bc4a8e4d3eb4b10f4d4604fa08dce601aaf0f470216fe1b51850b4acf21b179c45070ac7b03a9ac",
            "type": "pubkey"
          }
        }
      ],
      "hex": "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4804ffff001d0104404e592054696d65732030352f4f63742f32303131205374657665204a6f62732c204170706c65e280997320566973696f6e6172792c2044696573206174203536ffffffff0100f2052a010000004341040184710fa689ad5023690c80f3a49c8f13f8d45b8c857fbcbc8bc4a8e4d3eb4b10f4d4604fa08dce601aaf0f470216fe1b51850b4acf21b179c45070ac7b03a9ac00000000"
    }
  ],
  "time": 1317972665,
  "mediantime": 1317972665,
  "nonce": 2084524493,
  "bits": "1e0ffff0",
  "difficulty": 0.000244140625,
  "chainwork": "0000000000000000000000000000000000000000000000000000000000100010",
  "nTx": 1,
  "nextblockhash": "80ca095ed10b02e53d769eb6eaf92cd04e9e0759e5be4a8477b42911ba49c78f"
}

To me the difference between bitcoin (working) and litecoin is around here
https://github.com/trezor/blockbook/blob/master/bchain/coins/btc/bitcoinrpc.go#L563-L565
https://github.com/trezor/blockbook/blob/master/bchain/coins/litecoin/litecoinrpc.go#L75-L79

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants