Skip to content

Commit 7955657

Browse files
committed
Add singleSignatureScheme feature flag toggle test
1 parent 545c0ee commit 7955657

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

bftengine/src/bftengine/TimeServiceManager.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class TimeServiceManager {
4848
}
4949

5050
// Used on recovery to restore the time prior the request that is about to be re-executed.
51-
// In order to suport a correct behaviour of the compareAndUpdate method.
51+
// In order to support a correct behaviour of the compareAndUpdate method.
5252
void recoverTime(const ConsensusTickRep& recovered_time) {
5353
auto last_timestamp = client_.getLastTimestamp().count();
5454
ConcordAssertLE(recovered_time, last_timestamp);

tests/apollo/test_skvbc_reconfiguration.py

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@
2020
import difflib
2121
import random
2222

23+
from util.consts import CHECKPOINT_SEQUENCES
2324
from util.test_base import ApolloTest, parameterize
2425
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
2627
from util import operator
2728
from util.object_store import ObjectStore, start_replica_cmd_prefix
2829
import sys
@@ -657,6 +658,40 @@ async def test_key_exchange_no_single_signature_scheme(self, bft_network):
657658
"""
658659
await self._test_key_exchange(bft_network)
659660

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+
660695
@with_trio
661696
@with_bft_network(start_replica_cmd=start_replica_cmd_with_key_exchange,
662697
selected_configs=lambda n, f, c: n == 7,

0 commit comments

Comments
 (0)