From e6dcad3ac97158579d12eab3ccebc6aad5676e00 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Raynaud Date: Thu, 15 Sep 2022 12:02:15 +0200 Subject: [PATCH] Add 'skip_signer_certification' feature So we can smoothly migrate the Signers first and then the Aggregator on the preview network, also the Signer certification is not needed in the protocol demo. --- demo/protocol-demo/Cargo.toml | 2 ++ mithril-aggregator/Cargo.toml | 2 ++ mithril-common/Cargo.toml | 1 + mithril-common/src/crypto_helper/cardano/key_certification.rs | 4 ++++ mithril-signer/Cargo.toml | 2 ++ 5 files changed, 11 insertions(+) diff --git a/demo/protocol-demo/Cargo.toml b/demo/protocol-demo/Cargo.toml index d4bc5a80021..8b78fa0fee8 100644 --- a/demo/protocol-demo/Cargo.toml +++ b/demo/protocol-demo/Cargo.toml @@ -16,4 +16,6 @@ serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" [features] +default = ["skip_signer_certification"] portable = ["mithril-common/portable"] +skip_signer_certification = ["mithril-common/skip_signer_certification"] diff --git a/mithril-aggregator/Cargo.toml b/mithril-aggregator/Cargo.toml index 8c8303a00b7..e311436ca24 100644 --- a/mithril-aggregator/Cargo.toml +++ b/mithril-aggregator/Cargo.toml @@ -39,5 +39,7 @@ slog-term = "2.9.0" tempfile = "3.3.0" [features] +default = ["skip_signer_certification"] # TODO: remove 'skip_signer_certification' from default features to activate full signer certification portable = ["mithril-common/portable"] +skip_signer_certification = ["mithril-common/skip_signer_certification"] diff --git a/mithril-common/Cargo.toml b/mithril-common/Cargo.toml index 3f2b08f9d24..a21e9dd3585 100644 --- a/mithril-common/Cargo.toml +++ b/mithril-common/Cargo.toml @@ -43,3 +43,4 @@ slog-scope = "4.4.0" [features] portable = ["mithril/portable"] +skip_signer_certification = [] diff --git a/mithril-common/src/crypto_helper/cardano/key_certification.rs b/mithril-common/src/crypto_helper/cardano/key_certification.rs index da27f2eb754..bbdcd3bb9fb 100644 --- a/mithril-common/src/crypto_helper/cardano/key_certification.rs +++ b/mithril-common/src/crypto_helper/cardano/key_certification.rs @@ -183,6 +183,10 @@ impl KeyRegWrapper { let cert = OpCert::from_file(opcert_path)?; cert.validate().map_err(|_| RegisterError::InvalidOpCert)?; + + #[cfg(feature = "skip_signer_certification")] + println!("WARNING: Signer certification is skipped!!!"); + #[cfg(feature = "skip_signer_certification")] kes_sig .verify(kes_period, &cert.kes_vk, &pk.to_bytes()) .map_err(|_| RegisterError::KesSignatureInvalid)?; diff --git a/mithril-signer/Cargo.toml b/mithril-signer/Cargo.toml index caca94c7904..726688c2672 100644 --- a/mithril-signer/Cargo.toml +++ b/mithril-signer/Cargo.toml @@ -33,4 +33,6 @@ mockall = "0.11.0" slog-term = "2.9.0" [features] +default = ["skip_signer_certification"] # TODO: remove 'skip_signer_certification' from default features to activate full signer certification portable = ["mithril-common/portable"] +skip_signer_certification = ["mithril-common/skip_signer_certification"]