execution/stagedsync: fix parallel-exec "limit" log underflow - #21953
Merged
Merged
Conversation
The "parallel starting" log computed limit as startBlockNum+blockLimit-1. When blockLimit == 0 (no per-cycle limit, e.g. integration stage_exec from 0) this underflows to 18446744073709551615 (max uint64) in the log. Log the effective last block instead: maxBlockNum when unlimited, else min(startBlockNum+blockLimit-1, maxBlockNum). Log-only; execution unaffected.
Giulio2002
approved these changes
Jun 23, 2026
Giulio2002
left a comment
Contributor
There was a problem hiding this comment.
LGTM — log-only fix for an obvious blockLimit==0 underflow in the reported limit value.
Giulio2002
approved these changes
Jun 23, 2026
Giulio2002
left a comment
Contributor
There was a problem hiding this comment.
LGTM — trivial logging fix for the computed limit upper bound in parallel exec.
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes an underflow in the parallel execution “parallel starting” log line when blockLimit == 0 (the “no per-cycle limit” case), which previously produced math.MaxUint64 as a garbage limit value.
Changes:
- Compute a
lastBlockvalue for logging that equalsmaxBlockNumwhenblockLimit == 0. - When
blockLimit > 0, loglastBlock = min(startBlockNum+blockLimit-1, maxBlockNum)to avoid underflow and reflect the effective cycle end.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
yperbasis
approved these changes
Jun 23, 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
parallel startinglog line prints a garbagelimit:18446744073709551615ismath.MaxUint64: the log computedlimitasstartBlockNum+blockLimit-1, which underflows whenblockLimit == 0(the "no per-cycle limit" case — e.g.integration stage_execfrom block 0, whereLoopBlockLimitis 0).Fix
Log the effective last block of the cycle:
maxBlockNumwhen there's no per-cycle limit (blockLimit == 0),min(startBlockNum+blockLimit-1, maxBlockNum).This mirrors how the serial path already computes
toBlockNum(exec3_serial.go). Log-only change — execution behavior is unaffected.Now logs: