added minimum block creation time check - #7966
Merged
Merged
Conversation
ssd04
approved these changes
Aug 18, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Updates consensus block-creation time budgeting so block creation is capped at a fixed percentage of the block subround (leaving remaining time for finalization/sending), and aligns scheduled miniblock extra-time to match the new timing expectations.
Changes:
- Reduce the extra-time window for creating scheduled miniblocks from 150ms to 70ms (with clarifying inline comments).
- Cap block creation to 90% of the block subround duration (instead of allowing up to the subround end).
- Add unit tests covering the new constants and the 90% cutoff behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| process/common.go | Adjusts the scheduled miniblock extra-time constant and adds explanatory comments. |
| process/common_internal_test.go | Adds an internal test asserting the scheduled miniblock extra-time constant value. |
| consensus/spos/bls/v2/subroundBlock.go | Changes block creation time budget to 90% of the block subround window. |
| consensus/spos/bls/v2/subroundBlock_test.go | Adds tests validating the 90% time-budget behavior across header versions/round durations. |
| consensus/spos/bls/v2/constants.go | Introduces a named constant for the 90% block-creation time cap. |
Suppressed comments (1)
process/common.go:964
- The doc comment for HaveAdditionalTime is misleading: the returned closure evaluates to true while the additional time has NOT elapsed (i.e., while it is still available), but the comment says it returns whether the time "is elapsed". Please reword the comment to match the actual semantics (e.g., "returns whether there is still additional time available").
// HaveAdditionalTime returns if the additional time allocated for scheduled mini blocks is elapsed
func HaveAdditionalTime() func() bool {
startTime := time.Now()
return func() bool {
return additionalTimeForCreatingScheduledMiniBlocks > time.Since(startTime)
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+10
to
+15
| func TestHaveAdditionalTimeShouldUseSeventyMilliseconds(t *testing.T) { | ||
| t.Parallel() | ||
|
|
||
| require.Equal(t, 70*time.Millisecond, additionalTimeForCreatingScheduledMiniBlocks) | ||
| require.True(t, HaveAdditionalTime()()) | ||
| } |
AdoAdoAdo
approved these changes
Aug 18, 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.
Reasoning behind the pull request
Proposed changes
Testing procedure
Pre-requisites
Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:
featbranch created?featbranch merging, do all satellite projects have a proper tag insidego.mod?