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
verify header hash #5836
verify header hash #5836
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## rc/sirius-patch-2 #5836 +/- ##
==================================================
Coverage 80.15% 80.15%
==================================================
Files 708 708
Lines 94077 94079 +2
==================================================
+ Hits 75404 75408 +4
Misses 13328 13328
+ Partials 5345 5343 -2 ☔ View full report in Codecov by Sentry. |
@@ -484,6 +486,11 @@ func (wrk *Worker) doJobOnMessageWithHeader(cnsMsg *consensus.Message) error { | |||
"nbTxs", header.GetTxCount(), | |||
"val stats root hash", valStatsRootHash) | |||
|
|||
if !wrk.verifyHeaderHash(headerHash, cnsMsg.Header) { |
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.
for debugging reasons, can we move this on L478?
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.
it will be caught as a log.Debug by the p2pAntiflooder
@@ -508,6 +515,11 @@ func (wrk *Worker) doJobOnMessageWithHeader(cnsMsg *consensus.Message) error { | |||
return nil | |||
} | |||
|
|||
func (wrk *Worker) verifyHeaderHash(hash []byte, marshalledHeader []byte) bool { |
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.
typo: marshaledHeader
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.
Normal allin test: v1.6.11-dev-config-ace90ef010 -> verify-hash-96d32fb1ca
--- Specific errors ---
block hash does not match 6885
wrong nonce in block 2494
miniblocks does not match 0
num miniblocks does not match 0
miniblock hash does not match 0
block bodies does not match 0
receipts hash missmatch 0
/------/
--- Statistics ---
Nr. of all ERRORS: 1
Nr. of all WARNS: 1145
Nr. of new ERRORS: 1
Nr. of new WARNS: 4
Nr. of PANICS: 0
/------/
--- ERRORS ---
do-ams-observer-3 :
Error: error calling SaveBlock, will retry driver = *dataindexer.dataIndexer retrial in = error = { "index": "id": "statusCode": "errorType": "version_conflict_engine_exception", "reason": version conflict, document already exists (current version "causedBy": { "type": "", "reason": "" }}\n when saving transactions, block hash nonce 1
/------/
--- WARNINGS ---
/------/
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:
feat
branch created?feat
branch merging, do all satellite projects have a proper tag insidego.mod
?