proper implementation for dynamic subround boundaries#7894
Conversation
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
| 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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
i can be considered in a next PR
There was a problem hiding this comment.
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
roundparameter fromGenerateSubrounds, and configure the block subround’s signature deadline percentage explicitly. - Move “timing boundary change” handling from the proxy
SubroundsHandlerintochronology, 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.
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?