fix: stop sync health check claiming a rebuild on a built index; 0.11.1:16 → 0.11.1:17 - #80
Merged
Merged
Conversation
….1:16 → 0.11.1:17 The sync check confirms sync positively — only a real JSON-RPC result from server.banner counts — because electrs services RPC only between indexing batches, so silence during a build is the norm and reading it as success reported "Fully synced" all through the initial build (0354ef8). The converse was never handled: silence was read as an unbuilt index. Past the first success that is wrong. Indexing one block, or the RocksDB compaction behind it, blocks the RPC loop past the 10s read timeout on modest hardware, and the check flipped a fully-synced server to "Electrs is building its address index. This can take several hours on first run." A customer's aarch64 box with a 62 GB index did this 53 times in six days, once for 118 minutes — while electrs was up and answering wallet queries the whole time. The message invites reindexing a perfectly good index. Record the first success in store.json (everSynced) and branch on it: retry before concluding, since one blip is not a sync regression, and never claim a rebuild once the index exists — report that electrs is busy instead. Behaviour before the first success is unchanged, so the property 0354ef8 established still holds. Also corrects the health-check docs in README.md and instructions.md, which described a cookie-aware "Waiting for Bitcoin to finish syncing" fallback on the Electrum Server check that main.ts does not implement, and claimed the Electrum port is not served until sync completes — electrs binds the listener before it connects to bitcoind.
MattDHill
approved these changes
Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
synchealth check confirms sync positively — only a real JSON-RPCresultfromserver.bannercounts — because electrs services RPC only between indexing batches, so silence during a build is the norm. Reading silence as success reported "Fully synced" all through the initial build, which is what0354ef8fixed.The converse was never handled: silence was read as an unbuilt index. Past the first success that is wrong. Indexing a single block, or the RocksDB compaction behind it, blocks the RPC loop past the 10 s read timeout on modest hardware, and the check flipped a fully-synced server to:
Found while diagnosing a customer report of electrs "getting stuck". On their aarch64 box with a 62 GB index this fired 53 times in six days, once for 118 minutes — while electrs was up and answering wallet queries throughout. 9 of 20 flaps on one day landed while electrs was merely mid-
indexing. The message invites the user to reindex a perfectly good index, which on that hardware is days of pointless work.Fix
Record the first success in
store.json(everSynced) and branch on it:Behaviour before the first success is unchanged, so the property
0354ef8established still holds: silence is still never reported as synced.New string translated for all four non-default languages; release notes in all five.
Docs
README.mdandinstructions.mddescribed a cookie-aware "Waiting for Bitcoin to finish syncing" / "Waiting for Bitcoin to start" fallback on the Electrum Server check thatmain.tsdoes not implement, and claimed the Electrum port is not served until sync completes — electrs binds the listener before it connects to bitcoind. Both corrected here alongside the new message, since they sit in the section this change rewrites.Test plan
mainvolume) with Bitcoin still in IBD, and start Electrs.:16.everSyncedis nowtrue:cat /media/startos/data/package-data/volumes/electrs/data/store.jsonstart-cli package attach electrs -n electrs -- kill -STOP <electrs pid>for ~40 s and then-CONT.everSyncedwas re-seeded fromstore.jsonrather than reset.Notes
blockchain.scripthash.get_historyon unsubscribed scripthashes starves the chain-following loop. That is upstream electrs architecture, not packageable. This PR only stops StartOS misreporting the result.current.tsis edited in place.🤖 Generated with Claude Code