Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(base_layer): checkpoint quorum validation (#4303)
Description --- Refactored the base layer committee validation for checkpoints: * Now it's based on `HashSet` of VNC public keys: one for the constitution and other for the checkpoint * Surprisingly, clippy warns about `mutable_key_type` for using `PublicKey` types as the keys in the `HashSet`. I'm not sure where the mutability comes from. I decided to ignore that rule for the validation function * The existing validation of members is now done by checking the _difference_ of the public key sets * The new quorum validation is done by checking the _intersection_ of the public key sets Motivation and Context --- The base layer need to validate if the quorum of an incoming checkpoint is met. The minimum quorum for checkpoints is specified in the `ContractConstitution`, in the `checkpoint_params.minimum_quorum_required field` How Has This Been Tested? --- New unit test to check both successful and failing scenarios regarding quorum conditions
- Loading branch information
Showing
3 changed files
with
124 additions
and
35 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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