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

Ordinals-api incorrectly handles re-org #369

Open
duyquoc1508 opened this issue Jun 19, 2024 · 0 comments
Open

Ordinals-api incorrectly handles re-org #369

duyquoc1508 opened this issue Jun 19, 2024 · 0 comments
Assignees

Comments

@duyquoc1508
Copy link

Describe the bug
Ordinals-api incorrectly handles re-org at block 848477.

Current Behavior:

  1. Run ordinals-api and stream blocks from ordhook
  2. Encounter a re-org event at block 848477:
    Original block hash: 00000000000000000002ad15f6680bf74febab1020128641fab0da4bdfa5b4bd
    New block hash after re-org: 000000000000000000017304ab1e44edd5f2e80802a2ab3735a9399f2beb4023
  3. Ordinals-api logs the rollback:
{"level":"info","time":"2024-06-18T13:11:38.538Z","pid":1,"hostname":"8dfc6bf8456e","name":"api","msg":"PgStore rolling back block 848477"}
  1. Rollback is initiated and new block is applied (I think inscription number wrong from here)
  2. However, subsequent block (848478) encounters an error.
{"level":"error","time":"2024-06-18T13:14:54.374Z","pid":1,"hostname":"8dfc6bf8456e","name":"chainhook-client","err":{"type":"BadPayloadRequestError","message":"Block inscription gap detected: Attempting to insert #71734219 (848478) but current max is #71734220. Chain tip is at 848477.","stack":"BadPayloadRequestError: Block inscription gap detected: Attempting to insert #71734219 (848478) but current max is #71734220. Chain tip is at 848477.\n at assertNoBlockInscriptionGap (/app/dist/src/pg/helpers.js:23:19)\n at /app/dist/src/pg/pg-store.js:85:59\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async scope (/app/node_modules/postgres/cjs/src/index.js:226:18)\n at async Function.begin (/app/node_modules/postgres/cjs/src/index.js:213:14)\n at async PgStore.updateInscriptions (/app/dist/src/pg/pg-store.js:52:9)\n at async /app/dist/src/ordhook/server.js:57:9\n at async Object.<anonymous> (/app/node_modules/@hirosystems/chainhook-client/dist/server.js:177:17)","name":"BadPayloadRequestError"},"msg":"ChainhookEventObserver bad payload"}

Expected Behavior:
The latest inscription number of block 848477 should be 71734218

Additional context

  1. I think the API at https://docs.hiro.so/ordinals/list-of-inscriptions may also have same issue, because inscription data on 848478 returns no data.
image
  1. Compare with other indexer (inscription number # 71734219)
image image image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants