-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate proof check on sync #6501
Integrate proof check on sync #6501
Conversation
@@ -90,6 +91,10 @@ func createShardDataPools() dataRetriever.PoolsHolder { | |||
pools.CurrBlockTxsCalled = func() dataRetriever.TransactionCacher { | |||
return &mock.TxForCurrentBlockStub{} | |||
} | |||
pools.ProofsCalled = func() dataRetriever.ProofsPool { | |||
return &dataRetrieverMock.ProofsPoolMock{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the mocked component should return by default this mocked proofs pool, so this would be avoided
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"called" fields are not set in this mocked component, so we have to set them here
@@ -68,6 +74,12 @@ func (hip *HdrInterceptorProcessor) Save(data process.InterceptedData, _ core.Pe | |||
|
|||
hip.headers.AddHeader(interceptedHdr.Hash(), interceptedHdr.HeaderHandler()) | |||
|
|||
// TODO: check for equivalent flag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added flag check
process/sync/baseSync.go
Outdated
|
||
log.Trace("baseBootstrap.handleEquivalentProof: did not have proof for header, will try again", "headerHash", headerHash) | ||
|
||
// TODO: evaluate adding a wait here, or request for next header if missing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure this would work as expected, to be seen in tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed TODO for now, requesting for next header is already implemented
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the integration test is working in this case, will see with more testing if there are other edge cases here
@@ -293,7 +294,7 @@ func (hsv *HeaderSigVerifier) VerifyPreviousBlockProof(header data.HeaderHandler | |||
return fmt.Errorf("%w, received header without leader signature after flag activation", process.ErrInvalidHeader) | |||
} | |||
|
|||
return nil | |||
return hsv.VerifyHeaderProof(previousProof) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some refactoring in this area, we should check after merge.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feat/equivalent-messages #6501 +/- ##
============================================================
- Coverage 78.74% 78.70% -0.04%
============================================================
Files 769 769
Lines 101810 102005 +195
============================================================
+ Hits 80167 80284 +117
- Misses 16215 16271 +56
- Partials 5428 5450 +22 ☔ View full report in Codecov by Sentry. |
Reasoning behind the pull request
Testing procedure
Pre-requisites
Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:
feat
branch created?feat
branch merging, do all satellite projects have a proper tag insidego.mod
?