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

blockchain: Reject params with shared mask bits. #3077

Merged

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented Mar 9, 2023

This requires #3076.

This adds an additional validation check to the chain initialization process to validate that the masks of votes in the same deployment versions in the given chain params do not have any shared bits along with a test for the new validation logic.

Since some of the tests violate this condition, it also introduces a helper func to the tests that updates the masks and choice bits for all votes in a provided test agenda so that they are non-overlapping and then updates a couple of the tests that merge votes into the same agenda to make use of the func so they no longer involve overlapping bits.

@davecgh davecgh added the test coverage Discussion and pull requests for improving test coverage. label Mar 9, 2023
@davecgh davecgh added this to the 1.8.0 milestone Mar 9, 2023
This introduces a helper func to the tests that updates the masks and
choice bits for all votes in a provided test agenda so that they are
non-overlapping.

It then updates a couple of the tests that merge votes into the same
agenda to make use of the func so they no longer involve overlapping
bits.
This adds an additional validation check to the chain initialization
process to validate that the masks of votes in the same deployment
versions in the given chain params do not have any shared bits.

It also adds a test for the new validation logic.
@davecgh davecgh force-pushed the blockchain_reject_params_with_shared_mask_bits branch from 1f7930a to 491d178 Compare March 13, 2023 18:12
@davecgh davecgh merged commit 491d178 into decred:master Mar 13, 2023
@davecgh davecgh deleted the blockchain_reject_params_with_shared_mask_bits branch March 13, 2023 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test coverage Discussion and pull requests for improving test coverage.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants