Skip to content

Commit b803bf0

Browse files
authored
feat(registry): Obsolete legacy ECDSA configs (dfinity#3709)
This PR is a follow-up to the chain-key config generalization worked that took place last year. Now that chain key has worked on the mainnet for a few months, the clients are ready, we simplify the API. Notes on changed tests: * Most tests were generalized from legacy ECDSA to chain key in scope of the original work, so the remaining legacy ones are deleted in this PR, not ported (those were marked `TODO[NNS1-3102]: Remove this test.`). * Since we no longer need legacy ECDSA <--> chain key conversions, the corresponding tests were removed. * Tests that covered legacy ECDSA and chain key configs being specified together were removed, as not legacy ECDSA is always forbidden. * In one instance, I de-duplicate tests to avoid obvious redundancy (`test_disallow_chain_key_signing_disable_and_enable_for_same_key` and `enable_and_disable_signing_lists_should_not_have_same_keys_in_single_request`)
1 parent d343919 commit b803bf0

File tree

10 files changed

+327
-1900
lines changed

10 files changed

+327
-1900
lines changed

rs/protobuf/src/registry/subnet.rs

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,3 @@
11
#[allow(clippy::all)]
22
#[path = "../gen/registry/registry.subnet.v1.rs"]
33
pub mod v1;
4-
5-
use crate::registry::subnet::v1::{
6-
ChainKeyConfig as ChainKeyConfigPb, EcdsaConfig as EcdsaConfigPb, KeyConfig as KeyConfigPb,
7-
};
8-
use crate::types::v1::{master_public_key_id, MasterPublicKeyId as MasterPublicKeyIdPb};
9-
10-
/// This code is part of the data migration from `EcdsaConfig` to `ChainKeyConfig`.
11-
///
12-
/// Use this implementation to retrofit the values from an existing `EcdsaConfig` instance in places
13-
/// where we now need a `ChainKeyConfig` instance.
14-
///
15-
/// TODO[NNS1-2986]: Remove this code.
16-
impl From<EcdsaConfigPb> for ChainKeyConfigPb {
17-
fn from(src: EcdsaConfigPb) -> Self {
18-
let EcdsaConfigPb {
19-
key_ids,
20-
quadruples_to_create_in_advance,
21-
max_queue_size,
22-
signature_request_timeout_ns,
23-
idkg_key_rotation_period_ms,
24-
} = src;
25-
26-
let pre_signatures_to_create_in_advance = Some(quadruples_to_create_in_advance);
27-
let max_queue_size = Some(max_queue_size);
28-
29-
let key_configs = key_ids
30-
.into_iter()
31-
.map(|key_id| {
32-
let key_id = Some(master_public_key_id::KeyId::Ecdsa(key_id));
33-
let key_id = Some(MasterPublicKeyIdPb { key_id });
34-
KeyConfigPb {
35-
key_id,
36-
pre_signatures_to_create_in_advance,
37-
max_queue_size,
38-
}
39-
})
40-
.collect();
41-
42-
Self {
43-
key_configs,
44-
signature_request_timeout_ns,
45-
idkg_key_rotation_period_ms,
46-
}
47-
}
48-
}

0 commit comments

Comments
 (0)