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

Indexed false for old txs #4179

Open
gregdhill opened this issue Jan 13, 2025 · 3 comments
Open

Indexed false for old txs #4179

gregdhill opened this issue Jan 13, 2025 · 3 comments

Comments

@gregdhill
Copy link

We're running an instance of the Ord JSON API and as discussed here we're trying to have our front-end logic depend on checking Ord which UTXOs are cardinals. If then esplora reports some unconfirmed txs not indexed by Ord what we will do is the following:

  1. Check if it is newly inscribing something
  2. Check if it is indexed by Ord, if so check if it contains ordinals
  3. Else we fallback to checking if the (confirmed) parent inputs contain ordinals (and repeat)

The problem is we depend on Ord having indexed=true for txs processed before this block but for some ancient txs it is still false, see for example:

curl -s -H "Accept: application/json" "https://ordinals-mainnet.gobob.xyz/output/1f0d0105794800e328403f99c87db5503a957a7aab834dda0423bdbc75fc8bfe:0"

For this to be production-safe we need to trust that the output of this call is always indexed or the flag is correct.

@gregdhill
Copy link
Author

Just to be clear, the root of the issue is that indexed=false for confirmed txs which I would not expect. We need to be able to prove the non-existence of inscriptions and runes on an output.

@raphjaph
Copy link
Collaborator

raphjaph commented Jan 17, 2025

A quick fix would be to run your server with either --index-sats or --index-addresses or both. These both start indexing from block 0 (compared to just indexing inscriptions, which starts at around block 767430). This way you can be sure that all current UTXOs have been indexed.

Additionally, if ord and Bitcoin Core are synced up (same block height) and you're running in only --index-inscriptions and --index-runes mode, then indexed=false basically says: This UTXO was created before block 767430 so I haven't indexed the contents but since runes and inscriptions didn't exist before that block it will not contain either asset type.

I recommend running the full index (with all --index--... flags) to be on the safe side. This also provides you with useful endpoints like /address or /outputs/address?type=cardinal. Let me know if this helps, otherwise we can also think about how to do add ad-hoc output checking on every request or something.

@gregdhill
Copy link
Author

I'll defer to @ns212 but we have all those flags enabled. For what it's worth, Ordiscan also has indexed=false for many older txs but not sure if they're using Ord under-the-hood.

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

2 participants