|
20 | 20 | import difflib |
21 | 21 | import random |
22 | 22 |
|
| 23 | +from util.consts import CHECKPOINT_SEQUENCES |
23 | 24 | from util.test_base import ApolloTest, parameterize |
24 | 25 | from util import skvbc as kvbc |
25 | | -from util.bft import with_trio, with_bft_network, KEY_FILE_PREFIX, TestConfig |
| 26 | +from util.bft import with_trio, with_bft_network, KEY_FILE_PREFIX, TestConfig, ConsensusPathType |
26 | 27 | from util import operator |
27 | 28 | from util.object_store import ObjectStore, start_replica_cmd_prefix |
28 | 29 | import sys |
@@ -657,6 +658,40 @@ async def test_key_exchange_no_single_signature_scheme(self, bft_network): |
657 | 658 | """ |
658 | 659 | await self._test_key_exchange(bft_network) |
659 | 660 |
|
| 661 | + @with_trio |
| 662 | + @with_bft_network(start_replica_cmd=\ |
| 663 | + lambda builddir, replica_id: start_replica_cmd(builddir, replica_id) + |
| 664 | + ["--key-exchange-on-start", "True"] + ['--no-single-signature-scheme'], |
| 665 | + selected_configs=lambda n, f, c: n == 7, publish_master_keys=True) |
| 666 | + async def test_single_signature_scheme_to_no_single_signature_scheme(self, bft_network): |
| 667 | + """ |
| 668 | + Ensure that the network can |
| 669 | + """ |
| 670 | + bft_network.start_all_replicas() |
| 671 | + skvbc = kvbc.SimpleKVBCProtocol(bft_network) |
| 672 | + sequences_to_use_new_key = (CHECKPOINT_SEQUENCES * 3) + 1 |
| 673 | + await skvbc.send_n_kvs_sequentially(sequences_to_use_new_key, description='Make progress including initial consensus key exchange') |
| 674 | + |
| 675 | + skvbc = kvbc.SimpleKVBCProtocol(bft_network) |
| 676 | + client = bft_network.random_client() |
| 677 | + op = operator.Operator(bft_network.config, client, bft_network.builddir) |
| 678 | + await op.add_remove_with_wedge('new_configuration_n_7_f_2_c_0', bft=False, restart=False) |
| 679 | + await self.validate_stop_on_wedge_point(bft_network, skvbc, fullWedge=True) |
| 680 | + conf = TestConfig(n=7, f=2, c=0, num_clients=10, |
| 681 | + key_file_prefix=KEY_FILE_PREFIX, |
| 682 | + start_replica_cmd=lambda builddir, replica_id: start_replica_cmd(builddir, replica_id) + |
| 683 | + ["--key-exchange-on-start", "True"], |
| 684 | + stop_replica_cmd=None, num_ro_replicas=0) |
| 685 | + await bft_network.change_configuration(conf, generate_tls=False) |
| 686 | + |
| 687 | + bft_network.restart_clients(restart_replicas=True) |
| 688 | + await self.validate_epoch_number(bft_network, epoch_number=1, replica_ids=bft_network.all_replicas()) |
| 689 | + await bft_network.wait_for_consensus_path( |
| 690 | + path_type=ConsensusPathType.OPTIMISTIC_FAST, run_ops= |
| 691 | + lambda: skvbc.send_n_kvs_sequentially(sequences_to_use_new_key, |
| 692 | + description='Progress after restarting with different main and consensus keys'), |
| 693 | + threshold=sequences_to_use_new_key) |
| 694 | + |
660 | 695 | @with_trio |
661 | 696 | @with_bft_network(start_replica_cmd=start_replica_cmd_with_key_exchange, |
662 | 697 | selected_configs=lambda n, f, c: n == 7, |
|
0 commit comments