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

Fixed wrong multikey backup machine step-in #5840

Merged
merged 7 commits into from Jan 23, 2024

Conversation

iulianpascalau
Copy link
Contributor

Reasoning behind the pull request

  • fixed wrong multikey backup machine step-in by correctly resetting counters at commit block time.

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?

@iulianpascalau iulianpascalau self-assigned this Jan 16, 2024
@@ -593,5 +593,5 @@ var ErrEmptyAddress = errors.New("empty Address")
// ErrInvalidNodeOperationMode signals that an invalid node operation mode has been provided
var ErrInvalidNodeOperationMode = errors.New("invalid node operation mode")

// ErrNilTxExecutionOrderHandler signals that a nil tx execution order handler has been provided
var ErrNilTxExecutionOrderHandler = errors.New("nil tx execution order handler")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ErrNilTxExecutionOrderHandler was unused

process/block/baseProcess.go Outdated Show resolved Hide resolved
process/block/baseProcess_test.go Outdated Show resolved Hide resolved
process/block/export_test.go Outdated Show resolved Hide resolved
Copy link

codecov bot commented Jan 16, 2024

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (c84a6e6) 80.19% compared to head (7cab217) 80.19%.

Files Patch % Lines
factory/processing/processComponents.go 60.00% 1 Missing and 1 partial ⚠️
factory/processing/processComponentsHandler.go 75.00% 1 Missing and 1 partial ⚠️
process/block/baseProcess.go 77.77% 1 Missing and 1 partial ⚠️
process/block/metablock.go 50.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@                Coverage Diff                 @@
##           rc/sirius-patch-2    #5840   +/-   ##
==================================================
  Coverage              80.19%   80.19%           
==================================================
  Files                    708      709    +1     
  Lines                  94094    94128   +34     
==================================================
+ Hits                   75454    75484   +30     
- Misses                 13295    13297    +2     
- Partials                5345     5347    +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

)

// ComputeConsensusGroup will compute the consensus group that assembled the provided block
func ComputeConsensusGroup(header data.HeaderHandler, nodesCoordinator nodesCoordinator.NodesCoordinator) (validatorsGroup []nodesCoordinator.Validator, err error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

missing nil checks on parameters

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

validatorsPKs = append(validatorsPKs, validator.PubKey())
}

bp.sentSignaturesTracker.ResetCountersManagedBlockSigners(validatorsPKs)
Copy link
Contributor

Choose a reason for hiding this comment

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

perhaps ResetCountersManagedBlockSigner, thus no need for second iteration on sentSignaturesTracker component?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

interesting. Yes, I think we can refactor this to gain performance. Thanks

sstanculeanu
sstanculeanu previously approved these changes Jan 17, 2024
@AdoAdoAdo AdoAdoAdo self-requested a review January 17, 2024 13:12
AdoAdoAdo
AdoAdoAdo previously approved these changes Jan 17, 2024
@@ -80,7 +81,7 @@ func checkNewFactoryParams(
return spos.ErrNilAppStatusHandler
}
if check.IfNil(sentSignaturesTracker) {
return spos.ErrNilSentSignatureTracker
return errors.ErrNilSentSignatureTracker
Copy link
Contributor

Choose a reason for hiding this comment

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

any reason to use the error in errors package?
it adds a new package dependency

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

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: master-06f147d698 -> fix-wrong-backup-step-in-2bc1c58b8d

--- Specific errors ---

block hash does not match 9766
wrong nonce in block 3351
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: 18
Nr. of all WARNS: 6595
Nr. of new ERRORS: 18
Nr. of new WARNS: 75
Nr. of PANICS: 0

/------/

--- ERRORS ---

/------/

@iulianpascalau iulianpascalau merged commit 4cea6b5 into rc/sirius-patch-2 Jan 23, 2024
8 checks passed
@iulianpascalau iulianpascalau deleted the fix-wrong-backup-step-in branch January 23, 2024 12:15
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