Skip to content

proper implementation for dynamic subround boundaries#7894

Merged
sstanculeanu merged 3 commits into
feat/testnet-fixesfrom
proper-round-timing-transition
Jul 2, 2026
Merged

proper implementation for dynamic subround boundaries#7894
sstanculeanu merged 3 commits into
feat/testnet-fixesfrom
proper-round-timing-transition

Conversation

@sstanculeanu

Copy link
Copy Markdown
Collaborator

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?

@sstanculeanu sstanculeanu self-assigned this Jul 1, 2026
@sstanculeanu sstanculeanu added the type:bug Something isn't working label Jul 1, 2026
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.72165% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.69%. Comparing base (f93bba8) to head (d1243a9).

Files with missing lines Patch % Lines
consensus/spos/subround.go 75.00% 6 Missing ⚠️
consensus/chronology/chronology.go 85.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@                  Coverage Diff                   @@
##           feat/testnet-fixes    #7894      +/-   ##
======================================================
- Coverage               77.70%   77.69%   -0.01%     
======================================================
  Files                     885      885              
  Lines                  125781   125797      +16     
======================================================
+ Hits                    97742    97744       +2     
- Misses                  21569    21582      +13     
- Partials                 6470     6471       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

func (sr *subroundEndRound) isOutOfTime() bool {
startTime := sr.GetRoundTimeStamp()
maxTime := sr.RoundHandler().TimeDuration() * time.Duration(sr.processingThresholdPercentage) / 100
maxTime := sr.RoundHandler().TimeDuration() * time.Duration(sr.ProcessingThresholdPercent()) / 100

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.

i think that besides processingThresholdPercent we might want to include to other variables (waitingAllSigsMaxTimeThreshold, competingBlockSignDelay, competingProofSendDelay) into the config, i think they might need to be adapted as well with these changes, especially waitingAllSigsMaxTimeThreshold

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.

i can be considered in a next PR

Comment thread consensus/chronology/chronology.go Outdated
Comment thread consensus/chronology/chronology.go Outdated

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

This PR refactors how consensus subround timing boundaries are applied, moving dynamic timing reconciliation into the chronology layer and adding setter APIs on subround handlers so timing/thresholds can be updated without re-generating all subrounds.

Changes:

  • Add mutable timing/threshold fields to spos.Subround (base duration, start/end percentages, signature-subround deadline percentage, processing threshold) plus corresponding getters/setters and tests.
  • Update BLS v1/v2 subrounds and factories to store processing threshold on the base subround, remove the round parameter from GenerateSubrounds, and configure the block subround’s signature deadline percentage explicitly.
  • Move “timing boundary change” handling from the proxy SubroundsHandler into chronology, with new tests covering timing reconciliation and boundary reset on subround regeneration.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
factory/consensus/consensusComponents.go Removes RoundNotifier wiring from subrounds handler args.
consensus/spos/subround.go Adds baseDuration + timing/threshold fields and setter APIs.
consensus/spos/subround_test.go Adds unit tests for new Subround setters/getters.
consensus/spos/bls/v2/subroundStartRound.go Stores processing threshold on base subround; reads it via Subround API.
consensus/spos/bls/v2/subroundEndRound.go Stores processing threshold on base subround; reads it via Subround API.
consensus/spos/bls/v2/subroundBlock.go Removes ctor signature deadline param; uses Subround API for threshold + signature deadline.
consensus/spos/bls/v2/subroundBlock_test.go Updates tests to set signature deadline percentage explicitly.
consensus/spos/bls/v2/blsSubroundsFactory.go Generates using base-round timing and relies on chronology reconciliation; sets block signature deadline percent.
consensus/spos/bls/v2/blsSubroundsFactory_test.go Updates tests for new GenerateSubrounds(epoch) signature and base-round timing usage.
consensus/spos/bls/v1/subroundStartRound.go Stores processing threshold on base subround; reads it via Subround API.
consensus/spos/bls/v1/subroundEndRound.go Stores processing threshold on base subround; reads it via Subround API.
consensus/spos/bls/v1/subroundBlock.go Stores processing threshold on base subround; reads it via Subround API.
consensus/spos/bls/v1/blsSubroundsFactory.go Generates using base-round timing and relies on chronology reconciliation.
consensus/spos/bls/v1/blsSubroundsFactory_test.go Updates tests for new GenerateSubrounds(epoch) signature.
consensus/spos/bls/proxy/subroundsHandler.go Drops round notifier + per-boundary re-generation; delegates dynamic boundary handling to chronology.
consensus/spos/bls/proxy/subroundsHandler_test.go Removes tests for round-boundary re-generation behavior in proxy handler.
consensus/spos/bls/proxy/errors.go Removes ErrNilRoundNotifier.
consensus/mock/subroundHandlerMock.go Extends mock with new SubroundHandler setter methods.
consensus/interface.go Extends SubroundHandler interface with new timing/threshold setter APIs.
consensus/chronology/chronology.go Adds timing-boundary reconciliation on round changes (updates subround timing + thresholds).
consensus/chronology/chronology_test.go Adds tests for timing reconciliation on boundary changes and for boundary reset on subround regeneration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread consensus/spos/bls/v2/subroundBlock.go
Comment thread consensus/chronology/chronology.go
@sstanculeanu sstanculeanu merged commit 468c3ce into feat/testnet-fixes Jul 2, 2026
11 checks passed
@sstanculeanu sstanculeanu deleted the proper-round-timing-transition branch July 2, 2026 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants