Skip to content
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

Merged
merged 2 commits into from Jan 16, 2024
Merged

verify header hash #5836

merged 2 commits into from Jan 16, 2024

Conversation

AdoAdoAdo
Copy link
Contributor

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?

Copy link

codecov bot commented Jan 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7177707) 80.15% compared to head (fa3adb1) 80.15%.

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.
📢 Have feedback on the report? Share it here.

@@ -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) {
Copy link
Contributor

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?

Copy link
Contributor

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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: marshaledHeader

Copy link
Collaborator

@gabi-vuls gabi-vuls left a 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 ---

/------/

@iulianpascalau iulianpascalau merged commit daa6651 into rc/sirius-patch-2 Jan 16, 2024
8 checks passed
@iulianpascalau iulianpascalau deleted the verify-hash branch January 16, 2024 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants