fix(node): publish latest_block{block_hash} at startup - #18
Merged
Merged
Conversation
…mport `latest_block_index` was already republished from the stored block at boot, after a synced node holding 24,000 blocks reported height 0 until the next block arrived. The hash-labelled `latest_block` series was left behind in that fix and is still written only by `add_block_to_chain`. That matters more than it sounds, because the explorer's indexer reads BOTH series and refuses the chain head unless it has both (`explorer/ingestion.rs::fetch_head` -> "latest_block metrics missing"). On a healthy chain the gap closes within one slot. On a halted chain it never does: a restart leaves the indexer permanently blind, so the explorer shows nothing regardless of what the chain is doing. That is how the stage halt of 2026-09-14 was first reported -- three layers below the actual fault. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
What
Blockchain::newrepublisheslatest_block_indexfrom the stored block at startup. It does not republishlatest_block{block_hash}, which is still written only byadd_block_to_chain.Why it matters
The explorer's indexer requires both series and refuses the chain head if either is missing:
On a healthy chain the missing series appears within one slot, so this is invisible. On a halted chain it never appears — a node restart leaves the indexer permanently blind, and the explorer shows nothing regardless of what the chain is doing.
That is exactly how the stage halt of 2026-09-14 surfaced: reported as "the explorer has no data", three layers below the real fault.
Change
One statement in the startup arm that already publishes the index.
🤖 Generated with Claude Code