Skip to content

pr35351 clean characterization - #276

Closed
l0rinc wants to merge 5 commits into
masterfrom
l0rinc/pr35351-clean-characterization
Closed

l0rinc wants to merge 5 commits into
masterfrom
l0rinc/pr35351-clean-characterization

Conversation

@l0rinc

@l0rinc l0rinc commented Aug 10, 2026

Copy link
Copy Markdown
Owner

No description provided.

hodlinator and others added 5 commits August 10, 2026 14:31
The node currently continues low-work headers presync and requests more headers when its clock is more than `MAX_FUTURE_BLOCK_TIME` behind the chain-start MTP.

Record this behavior before the follow-up rejects the invalid elapsed-time calculation.

Co-authored-by: Lőrinc <[email protected]>
Move the time-dependent calculation into a deterministic helper that receives the sampled node time while keeping constructor behavior unchanged.

Use an Expected result so the later fix can add an error without replacing the new test seam.

Co-authored-by: Lőrinc <[email protected]>
Pin the extracted calculation at the exact future-MTP boundary and one second below it.

The below-boundary expectation records the current invalid result and is marked for the behavioral fix to flip.

Co-authored-by: Lőrinc <[email protected]>
Compute the commitment bound before constructing HeadersSyncState and pass the unsigned result into the constructor.

This externalizes the later error-handling boundary without changing behavior.

Co-authored-by: Lőrinc <[email protected]>
Being more than 2 hours (MAX_FUTURE_BLOCK_TIME) behind the starting block MTP will currently already cause VerifyLoadedChainstate() to abort initialization. Having a system clock which disagrees this badly with the most recently accepted and stored block should prompt the operator to investigate.

In case we ever get past chain state loading before entering this situation and proceed to syncing headers, we now also shut down. The alternative of clamping max commitments to an arbitrary value would just paper over the issue.

Co-authored-by: Lőrinc <[email protected]>
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.

2 participants