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

Fix chain_test: Committee and witnesses initialization in genesis #1835

Merged
merged 2 commits into from
Aug 2, 2019

Conversation

OpenLedgerApp
Copy link
Contributor

This issue was caused by a sporadic fail of the htlc_expires test on our CI. However, later this test was fixed. While we were researching the problem, we found out that committee proposals aren't always authorized. In the case of htlc_expires this was caused by installing updatable_htlc_options in global parameters. As a result, it was decided to write a unit test which demonstrates the problem and also to make a correction that fixes it.

There are oddity checks in database::init_genesis():

FC_ASSERT( (genesis_state.immutable_parameters.min_witness_count & 1) == 1, "min_witness_count must be odd" );
FC_ASSERT( (genesis_state.immutable_parameters.min_committee_member_count & 1) == 1, "min_committee_member_count must be odd" );

But size of containers genesis_state.initial_witness_candidates and genesis_state.initial_committee_candidates are not checked. So, all candidates become witnesses and committee members. In database_fixture these containers are initialized with 10 elements. In some tests committee can't make decision without correct initialization.

@abitmore abitmore added this to the 3.3.0 - Feature Release milestone Jun 28, 2019
Copy link
Member

@abitmore abitmore left a comment

Choose a reason for hiding this comment

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

Good job. Thanks.

tests/tests/block_tests.cpp Outdated Show resolved Hide resolved
@abitmore abitmore changed the title Committee and witnesses initialization in genesis Fix chain_test: Committee and witnesses initialization in genesis Jun 28, 2019
@abitmore
Copy link
Member

abitmore commented Aug 2, 2019

FWIW this PR is relate to #183.

@abitmore abitmore merged commit 6dd0935 into bitshares:develop Aug 2, 2019
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.

2 participants