Skip to content

Commit

Permalink
test: Enable VetKD in integration tests (#4021)
Browse files Browse the repository at this point in the history
This should be possible now that #3860
is merged
  • Loading branch information
eichhorl authored Feb 21, 2025
1 parent 7fac242 commit 6878684
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
13 changes: 9 additions & 4 deletions rs/consensus/tests/framework/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ use ic_crypto_temp_crypto::{NodeKeysToGenerate, TempCryptoComponent, TempCryptoC
use ic_crypto_test_utils_ni_dkg::{initial_dkg_transcript, InitialNiDkgConfig};
use ic_interfaces_registry::RegistryClient;
use ic_management_canister_types_private::{
EcdsaCurve, EcdsaKeyId, MasterPublicKeyId, SchnorrAlgorithm, SchnorrKeyId,
EcdsaCurve, EcdsaKeyId, MasterPublicKeyId, SchnorrAlgorithm, SchnorrKeyId, VetKdCurve,
VetKdKeyId,
};
use ic_protobuf::registry::subnet::v1::{CatchUpPackageContents, InitialNiDkgTranscriptRecord};
use ic_registry_client_fake::FakeRegistryClient;
Expand Down Expand Up @@ -64,7 +65,7 @@ pub fn setup_subnet<R: Rng + CryptoRng>(
let subnet_record = SubnetRecordBuilder::from(node_ids)
.with_dkg_interval_length(19)
.with_chain_key_config(ChainKeyConfig {
key_configs: test_threshold_key_ids()
key_configs: test_master_public_key_ids()
.iter()
.map(|key_id| KeyConfig {
key_id: key_id.clone(),
Expand Down Expand Up @@ -181,7 +182,7 @@ pub fn setup_subnet<R: Rng + CryptoRng>(
.expect("Could not add node record.");

// Add threshold signing subnet to registry
for key_id in test_threshold_key_ids() {
for key_id in test_master_public_key_ids() {
data_provider
.add(
&ic_registry_keys::make_chain_key_signing_subnet_list_key(&key_id),
Expand Down Expand Up @@ -213,7 +214,7 @@ pub fn setup_subnet<R: Rng + CryptoRng>(
(registry_client, cup, cryptos)
}

pub(crate) fn test_threshold_key_ids() -> Vec<MasterPublicKeyId> {
pub(crate) fn test_master_public_key_ids() -> Vec<MasterPublicKeyId> {
vec![
MasterPublicKeyId::Ecdsa(EcdsaKeyId {
curve: EcdsaCurve::Secp256k1,
Expand All @@ -227,5 +228,9 @@ pub(crate) fn test_threshold_key_ids() -> Vec<MasterPublicKeyId> {
algorithm: SchnorrAlgorithm::Bip340Secp256k1,
name: "bip340_test_key".to_string(),
}),
MasterPublicKeyId::VetKd(VetKdKeyId {
curve: VetKdCurve::Bls12_381_G2,
name: "vetkd_test_key".to_string(),
}),
]
}
6 changes: 3 additions & 3 deletions rs/consensus/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::framework::{
malicious, setup_subnet, ComponentModifier, ConsensusDependencies, ConsensusInstance,
ConsensusRunner, ConsensusRunnerConfig, StopPredicate,
};
use framework::test_threshold_key_ids;
use framework::test_master_public_key_ids;
use ic_consensus_utils::pool_reader::PoolReader;
use ic_interfaces::consensus_pool::ConsensusPool;
use ic_interfaces::messaging::MessageRouting;
Expand Down Expand Up @@ -330,12 +330,12 @@ fn run_n_rounds_and_check_pubkeys(
};

let mut found_keys = 0;
for key_id in test_threshold_key_ids() {
for key_id in test_master_public_key_ids() {
if batch.chain_key_subnet_public_keys.contains_key(&key_id) {
found_keys += 1
}
}
if found_keys == test_threshold_key_ids().len() {
if found_keys == test_master_public_key_ids().len() {
*pubkey_exists_clone.borrow_mut() = true;
}
*pubkey_exists_clone.borrow()
Expand Down

0 comments on commit 6878684

Please sign in to comment.