Repository navigation
Conversation
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]>
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.
No description provided.