hirosystems / ordhook

Build indexers, standards and protocols on top of Ordinals and Inscriptions (BRC20, etc).
Apache License 2.0
190 stars 56 forks source link

ERRO Block start / end block spec invalid #307

Closed phill-beyond closed 4 months ago

phill-beyond commented 5 months ago

After setting up testnet environment and freshly start db sync, got an block spec invalid error which looks like a bug.

ordhook db sync --config-path=./Ordhook.toml Jun 01 01:45:19.298 INFO Indexing inscriptions from block #767430 to block #2819136 Jun 01 01:45:19.299 ERRO Block start / end block spec invalid

phill-beyond commented 5 months ago

I think the issue is: chainhook-sdk/src/utils/mod.rs pub const MAX_BLOCK_HEIGHTS_ENTRIES: u64 = 1_000_000; impl BlockHeights { pub fn get_sorted_entries(&self) -> Result<VecDeque, BlockHeightsError> { let mut entries = VecDeque::new(); match &self { BlockHeights::BlockRange(start, end) => { if start > end { return Err(BlockHeightsError::StartLargerThanEnd); } if (end - start) > MAX_BLOCK_HEIGHTS_ENTRIES { return Err(BlockHeightsError::ExceedsMaxEntries( MAX_BLOCK_HEIGHTS_ENTRIES, end - start, )); } There is a MAX_BLOCK_HEIGHTS_ENTRIES, but my progress need to sync db from #767430 to block #2819136 which is more than 1M.

phill-beyond commented 5 months ago

So the question comes to: How can I index on the testnet? Since no prebuilt db download available? Thanks!

lgalabru commented 4 months ago

Hi @phill-beyond, thanks for your feedback. I'll close this issue, as we're already tracking the lack of Testnet support here: https://github.com/hirosystems/ordhook/issues/292