Skip to content

added minimum block creation time check - #7966

Merged
AdoAdoAdo merged 1 commit into
fix-full-hystory-syncfrom
block-creation-max-time
Aug 18, 2026
Merged

added minimum block creation time check#7966
AdoAdoAdo merged 1 commit into
fix-full-hystory-syncfrom
block-creation-max-time

Conversation

@raduchis

Copy link
Copy Markdown
Contributor

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:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
AdoAdoAdo merged commit e07d18c into fix-full-hystory-sync Aug 18, 2026
8 of 9 checks passed
@AdoAdoAdo
AdoAdoAdo deleted the block-creation-max-time branch August 18, 2026 15:42
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.

4 participants