-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Cleanup Elastic Scaling Checks for FeatureIndex::ElasticScalingMVP #7286
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
Changes from all commits
96e3958
e70f289
d06e7eb
9a71dcd
bb909f5
95ab02d
5a3e4a3
f1d8c32
10a2f5f
e0414c5
5a6bf60
17ddcc5
ee1ad6b
ab9ac31
6113661
78acbc8
7ae4c73
cc6bc04
4619ada
5628011
7906fad
1a394a7
0cd23d7
0d5a2a9
cbf0f27
3d17827
ffa4373
3af93ad
f13c67b
b7ec29c
199c1e9
6008e8f
aef66af
5f48a70
5242e47
2f36dbf
eaf9ea1
568545b
8e4aa95
4220f91
4cae3d5
6fe0d82
f22e322
4dc36e0
b2cc899
537c98f
59663a4
6c30c2b
4048ac3
b9ec3b9
27d2e83
a2bae77
3f91fb0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,7 +27,6 @@ use polkadot_node_subsystem::{ | |
| }; | ||
| use polkadot_node_subsystem_test_helpers::mock::new_leaf; | ||
| use polkadot_primitives::{ | ||
| node_features, | ||
| vstaging::{CoreState, MutateDescriptorV2, OccupiedCore}, | ||
| BlockNumber, CandidateDescriptor, GroupRotationInfo, HeadData, Header, PersistedValidationData, | ||
| ScheduledCore, SessionIndex, LEGACY_MIN_BACKING_VOTES, | ||
|
|
@@ -37,7 +36,6 @@ use polkadot_primitives_test_helpers::{ | |
| dummy_committed_candidate_receipt_v2, dummy_hash, validator_pubkeys, | ||
| }; | ||
| use polkadot_statement_table::v2::Misbehavior; | ||
| use rstest::rstest; | ||
| use sp_application_crypto::AppCrypto; | ||
| use sp_keyring::Sr25519Keyring; | ||
| use sp_keystore::Keystore; | ||
|
|
@@ -780,19 +778,9 @@ fn backing_second_works() { | |
| } | ||
|
|
||
| // Test that the candidate reaches quorum successfully. | ||
| #[rstest] | ||
| #[case(true)] | ||
| #[case(false)] | ||
| fn backing_works(#[case] elastic_scaling_mvp: bool) { | ||
| #[test] | ||
| fn backing_works() { | ||
| let mut test_state = TestState::default(); | ||
| if elastic_scaling_mvp { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you can remove the same bit of code from
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alright, hey, @alindima. Just a heads up: I may take some time to complete this. I will get started in the next four hours, as I am tied up with interviews.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure, that's ok. take your time
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hey @alindima, I've completed the changes. However, even though running
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks to be failing on a completely unrelated toml file (cumulus/bin/pov-validator/Cargo.toml). I've no idea why |
||
| test_state | ||
| .node_features | ||
| .resize((node_features::FeatureIndex::ElasticScalingMVP as u8 + 1) as usize, false); | ||
| test_state | ||
| .node_features | ||
| .set(node_features::FeatureIndex::ElasticScalingMVP as u8 as usize, true); | ||
| } | ||
|
|
||
| test_harness(test_state.keystore.clone(), |mut virtual_overseer| async move { | ||
| let para_id = activate_initial_leaf(&mut virtual_overseer, &mut test_state).await; | ||
|
|
@@ -917,12 +905,9 @@ fn backing_works(#[case] elastic_scaling_mvp: bool) { | |
| assert_eq!(candidates[0].validity_votes().len(), 3); | ||
|
|
||
| let (validator_indices, maybe_core_index) = | ||
| candidates[0].validator_indices_and_core_index(elastic_scaling_mvp); | ||
| if elastic_scaling_mvp { | ||
| assert_eq!(maybe_core_index.unwrap(), CoreIndex(0)); | ||
| } else { | ||
| assert!(maybe_core_index.is_none()); | ||
| } | ||
| candidates[0].validator_indices_and_core_index(true); | ||
|
|
||
| assert_eq!(maybe_core_index.unwrap(), CoreIndex(0)); | ||
|
|
||
| assert_eq!( | ||
| validator_indices, | ||
|
|
@@ -941,13 +926,6 @@ fn backing_works(#[case] elastic_scaling_mvp: bool) { | |
| #[test] | ||
| fn get_backed_candidate_preserves_order() { | ||
| let mut test_state = TestState::default(); | ||
| test_state | ||
| .node_features | ||
| .resize((node_features::FeatureIndex::ElasticScalingMVP as u8 + 1) as usize, false); | ||
| test_state | ||
| .node_features | ||
| .set(node_features::FeatureIndex::ElasticScalingMVP as u8 as usize, true); | ||
|
|
||
| // Set a single validator as the first validator group. It simplifies the test. | ||
| test_state.validator_groups.0[0] = vec![ValidatorIndex(2)]; | ||
| // Add another validator group for the third core. | ||
|
|
@@ -1575,8 +1553,11 @@ fn backing_works_while_validation_ongoing() { | |
| .validity_votes() | ||
| .contains(&ValidityAttestation::Explicit(signed_c.signature().clone()))); | ||
| assert_eq!( | ||
| candidates[0].validator_indices_and_core_index(false), | ||
| (bitvec::bitvec![u8, bitvec::order::Lsb0; 1, 0, 1, 1].as_bitslice(), None) | ||
| candidates[0].validator_indices_and_core_index(true), | ||
| ( | ||
| bitvec::bitvec![u8, bitvec::order::Lsb0; 1, 0, 1, 1].as_bitslice(), | ||
| Some(CoreIndex(0)) | ||
| ) | ||
| ); | ||
|
|
||
| virtual_overseer | ||
|
|
@@ -2225,7 +2206,7 @@ fn candidate_backing_reorders_votes() { | |
| group_id: core_idx, | ||
| }; | ||
|
|
||
| let backed = table_attested_to_backed(attested, &table_context, false).unwrap(); | ||
| let backed = table_attested_to_backed(attested, &table_context).unwrap(); | ||
|
|
||
| let expected_bitvec = { | ||
| let mut validator_indices = BitVec::<u8, bitvec::order::Lsb0>::with_capacity(6); | ||
|
|
@@ -2243,8 +2224,8 @@ fn candidate_backing_reorders_votes() { | |
| vec![fake_attestation(1).into(), fake_attestation(3).into(), fake_attestation(5).into()]; | ||
|
|
||
| assert_eq!( | ||
| backed.validator_indices_and_core_index(false), | ||
| (expected_bitvec.as_bitslice(), None) | ||
| backed.validator_indices_and_core_index(true), | ||
| (expected_bitvec.as_bitslice(), Some(CoreIndex(10))) | ||
| ); | ||
| assert_eq!(backed.validity_votes(), expected_attestations); | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.