Skip to content

fix: check_head_age() to avoid bogus OutOfSync when latest block is missing#736

Open
phrwlk wants to merge 1 commit intoa16z:masterfrom
phrwlk:fix/check-head-age-outofsync-misuse
Open

fix: check_head_age() to avoid bogus OutOfSync when latest block is missing#736
phrwlk wants to merge 1 commit intoa16z:masterfrom
phrwlk:fix/check-head-age-outofsync-misuse

Conversation

@phrwlk
Copy link
Copy Markdown

@phrwlk phrwlk commented Nov 22, 2025

The previous implementation returned OutOfSync with the current epoch seconds when the Latest block was missing, which misrepresented the delay as an enormous number of seconds behind and produced misleading RPC errors. OutOfSync(u64) is meant to carry the computed delay, not a timestamp. This change treats the absence of the Latest block as BlockNotFound(latest), preserving accurate semantics while leaving the computed-delay path intact for cases where a head timestamp exists. Callers do not rely on the numeric delay value in this branch, so the change is behaviorally correct and improves diagnostics.

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

Successfully merging this pull request may close these issues.

1 participant