Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'eichhorl/fix-share-counter' into 'master'
fix(consensus): Don't increment random beacon & tape share counter for invalid shares For performance reasons, https://gitlab.com/dfinity-lab/public/ic/-/merge_requests/8312 introduced a change with which we only ever validate at most `f+1` Random Beacon and Tape shares (which is the minimum number needed to create the aggregate). To do this, when validating these shares, we initialize a counter with the current number of artifacts in the validated pool, and increment it whenever a change action for a new share is generated. Once the counter reaches the threshold, we stop validating shares. However, incrementing the counter whenever a new change action is generated is wrong, since that change action could also be `HandleInvalid` (i.e. when the signature is invalid, see `compute_action_from_sig_verification`). In case we continuously receive shares with invalid signatures and comparatively small hashes (such that they are looked at first), this could lead to a replica no longer validating random beacon or tape shares. With this MR we make sure to only increment the share counter if the change action is `MoveToValidated`. See merge request dfinity-lab/public/ic!12916
- Loading branch information