hirosystems / ordhook

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

scan process stuck at a specific block #316

Closed phill-beyond closed 3 months ago

phill-beyond commented 3 months ago

I am running ordhook on testnet. Found the scan blocks process stuck at some blocks from time to time.

Here is the recent 1 instance: ordhook scan blocks --interval 2820937:2820937 --post-to=http://... --config-path=./Ordhook.toml Jun 12 01:08:01.883 INFO A fully synchronized bitcoind node is required for retrieving inscriptions content. Jun 12 01:08:01.883 INFO Checking http://0.0.0.0:18332... Jun 12 01:08:01.884 INFO Starting scan Jun 12 01:08:01.885 INFO Starting predicate evaluation on 1 Bitcoin blocks

I checked the block 2820937 is only 4.3KB in block size, but above takes forever to finish. I had to manually skip that block to make it continue processing. Couple blocks happened before.

I dug a bit, it seems ordhook stuck at following function all, but I could not figure out what it is doing and how to solve the issue:

bitcoin.rs consolidate_block_with_pre_computed_ordinals_data( &mut block, &inscriptions_db_tx, true, &Context::empty(), );

Please kindly help. Thanks!

phill-beyond commented 3 months ago

I dug a bit further, found the following condition triggered and the log did not logout any information, so it's in dead loop. if results.len() != expected_inscriptions_count { ctx.try_log(|logger| { warn!( logger, "Database retuning {} results instead of the expected {expected_inscriptions_count}", results.len() ); }); continue; }

lgalabru commented 3 months ago

Thanks for the context @phill-beyond! I'll close this issue, Testnet support is already tracked here https://github.com/hirosystems/ordhook/issues/292.