request epoch start block#7885
Open
miiu96 wants to merge 2 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feat/testnet-fixes #7885 +/- ##
===================================================
Coverage 77.62% 77.62%
===================================================
Files 885 885
Lines 125425 125444 +19
===================================================
+ Hits 97357 97378 +21
+ Misses 21585 21583 -2
Partials 6483 6483 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
AdoAdoAdo
approved these changes
Jun 19, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves shard block proposal processing by adding an active retry/request mechanism for missing epoch start data (epoch start metablock header and proof), instead of immediately failing when the data is not yet present in pools.
Changes:
- Replaces the passive
checkEpochStartInfoAvailableIfNeededcall inProcessBlockProposalwith a new retrying/requesting helper (ensureEpochStartInfoAvailable). - Adds
ensureEpochStartInfoAvailableto request missing epoch start meta header / proof and re-check availability within the proposal time budget. - Adds unit tests covering the new retry behavior and exposes the helper via
export_test.gofor testing.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| process/block/shardblockProposal.go | Switches proposal processing to use the new retrying epoch start info mechanism. |
| process/block/shardblock.go | Introduces ensureEpochStartInfoAvailable which requests missing epoch start header/proof and retries until the time budget is exhausted. |
| process/block/shardblock_test.go | Adds tests for EnsureEpochStartInfoAvailable covering success and timeout paths, including proof-related cases. |
| process/block/export_test.go | Exposes ensureEpochStartInfoAvailable to tests via EnsureEpochStartInfoAvailable. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+315
to
+329
| requestCount := 0 | ||
| for haveTime() > 0 { | ||
| requestCount++ | ||
| if requestCount%5 == 1 { | ||
| go sp.requestHandler.RequestMetaHeader(header.GetEpochStartMetaHash()) | ||
| sp.requestEpochStartProofIfNeeded(header.GetEpochStartMetaHash(), header.GetEpoch()) | ||
| } | ||
|
|
||
| time.Sleep(timeBetweenCheckForEpochStart) | ||
|
|
||
| err = sp.checkEpochStartInfoAvailableIfNeeded(header) | ||
| if err == nil { | ||
| return nil | ||
| } | ||
| } |
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
ensureEpochStartInfoAvailable, which replaces the oldcheckEpochStartInfoAvailableIfNeededcall in ProcessBlockProposal and actively requests the missing data, then retries within the available time budget.This resolves an existing TODO in
shardblockProposal.goPre-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?