From 55b2e82350c2c122333fe4e5e1774b87f27823e2 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Raynaud Date: Thu, 9 Jan 2025 16:02:45 +0100 Subject: [PATCH] fix: TODO 'Should be removed once the signer certification is fully deployed' - 'mithril-common/src/crypto_helper/cardano/key_certification.rs' - 'mithril-common/src/entities/signer.rs' - 'mithril-common/src/messages/message_parts/signer.rs' - 'mithril-common/src/messages/register_signer.rs' - 'mithril-signer/src/configuration.rs' - 'mithril-test-lab/mithril-devnet/mkfiles/mkfiles-docker.sh' - 'mithril-test-lab/mithril-end-to-end/src/mithril/infrastructure.rs' --- .../cardano/key_certification.rs | 9 ++++---- mithril-common/src/entities/signer.rs | 18 ++++++++++----- .../src/messages/message_parts/signer.rs | 22 ++++++++++--------- .../src/messages/register_signer.rs | 11 +++++----- mithril-signer/src/configuration.rs | 3 ++- .../mithril-devnet/mkfiles/mkfiles-docker.sh | 1 - .../src/mithril/infrastructure.rs | 1 - 7 files changed, 37 insertions(+), 28 deletions(-) diff --git a/mithril-common/src/crypto_helper/cardano/key_certification.rs b/mithril-common/src/crypto_helper/cardano/key_certification.rs index 4afddcec245..f8f18bc51ae 100644 --- a/mithril-common/src/crypto_helper/cardano/key_certification.rs +++ b/mithril-common/src/crypto_helper/cardano/key_certification.rs @@ -43,7 +43,8 @@ pub type KESPeriod = u32; #[derive(Error, Debug)] pub enum ProtocolRegistrationErrorWrapper { /// Error raised when a party id is needed but not provided - // TODO: Should be removed once the signer certification is fully deployed + /// + /// Used only for testing when SPO pool id is not certified #[error("missing party id")] PartyIdMissing, @@ -246,9 +247,9 @@ impl KeyRegWrapper { /// Mithril key (with its corresponding Proof of Possession). pub fn register( &mut self, - party_id: Option, // TODO: Parameter should be removed once the signer certification is fully deployed - opcert: Option, // TODO: Option should be removed once the signer certification is fully deployed - kes_sig: Option, // TODO: Option should be removed once the signer certification is fully deployed + party_id: Option, // Used for only for testing when SPO pool id is not certified + opcert: Option, // Used for only for testing when SPO pool id is not certified + kes_sig: Option, // Used for only for testing when SPO pool id is not certified kes_period: Option, pk: ProtocolSignerVerificationKey, ) -> Result { diff --git a/mithril-common/src/entities/signer.rs b/mithril-common/src/entities/signer.rs index 30d2e66329f..3a1bd54145e 100644 --- a/mithril-common/src/entities/signer.rs +++ b/mithril-common/src/entities/signer.rs @@ -14,19 +14,22 @@ use sha2::{Digest, Sha256}; #[derive(Clone, Eq, Serialize, Deserialize)] pub struct Signer { /// The unique identifier of the signer - // TODO: Should be removed once the signer certification is fully deployed + /// + /// Used only for testing when SPO pool id is not certified pub party_id: PartyId, /// The public key used to authenticate signer signature pub verification_key: ProtocolSignerVerificationKey, /// The encoded signer 'Mithril verification key' signature (signed by the Cardano node KES secret key) - // TODO: Option should be removed once the signer certification is fully deployed + /// + /// None is used only for testing when SPO pool id is not certified #[serde(skip_serializing_if = "Option::is_none")] pub verification_key_signature: Option, /// The encoded operational certificate of stake pool operator attached to the signer node - // TODO: Option should be removed once the signer certification is fully deployed + /// + /// None is used only for testing when SPO pool id is not certified #[serde(skip_serializing_if = "Option::is_none")] pub operational_certificate: Option, @@ -136,19 +139,22 @@ impl From for Signer { #[derive(Clone, Eq, Serialize, Deserialize)] pub struct SignerWithStake { /// The unique identifier of the signer - // TODO: Should be removed once the signer certification is fully deployed + /// + /// Used only for testing when SPO pool id is not certified pub party_id: PartyId, /// The public key used to authenticate signer signature pub verification_key: ProtocolSignerVerificationKey, /// The encoded signer 'Mithril verification key' signature (signed by the Cardano node KES secret key) - // TODO: Option should be removed once the signer certification is fully deployed + /// + /// None is used only for testing when SPO pool id is not certified #[serde(skip_serializing_if = "Option::is_none")] pub verification_key_signature: Option, /// The encoded operational certificate of stake pool operator attached to the signer node - // TODO: Option should be removed once the signer certification is fully deployed + /// + /// None is used only for testing when SPO pool id is not certified #[serde(skip_serializing_if = "Option::is_none")] pub operational_certificate: Option, diff --git a/mithril-common/src/messages/message_parts/signer.rs b/mithril-common/src/messages/message_parts/signer.rs index 300cb0b063f..d7b5133b0ab 100644 --- a/mithril-common/src/messages/message_parts/signer.rs +++ b/mithril-common/src/messages/message_parts/signer.rs @@ -16,7 +16,8 @@ use std::fmt::{Debug, Formatter}; #[derive(Clone, PartialEq, Eq, Default, Serialize, Deserialize)] pub struct SignerWithStakeMessagePart { /// The unique identifier of the signer - // TODO: Should be removed once the signer certification is fully deployed + /// + /// Used only for testing when SPO pool id is not certified pub party_id: PartyId, /// The public key used to authenticate signer signature @@ -24,15 +25,15 @@ pub struct SignerWithStakeMessagePart { /// The encoded signer 'Mithril verification key' signature (signed by the /// Cardano node KES secret key). - // TODO: Option should be removed once the signer certification is fully - // deployed. + /// + /// None is used only for testing when SPO pool id is not certified #[serde(skip_serializing_if = "Option::is_none")] pub verification_key_signature: Option, /// The encoded operational certificate of stake pool operator attached to /// the signer node. - // TODO: Option should be removed once the signer certification is fully - // deployed. + /// + /// None is used only for testing when SPO pool id is not certified #[serde(skip_serializing_if = "Option::is_none")] pub operational_certificate: Option, @@ -161,7 +162,8 @@ impl Debug for SignerMessagePart { #[derive(Clone, PartialEq, Eq, Default, Serialize, Deserialize)] pub struct SignerMessagePart { /// The unique identifier of the signer - // TODO: Should be removed once the signer certification is fully deployed + /// + /// Used only for testing when SPO pool id is not certified pub party_id: PartyId, /// The public key used to authenticate signer signature @@ -169,15 +171,15 @@ pub struct SignerMessagePart { /// The encoded signer 'Mithril verification key' signature (signed by the /// Cardano node KES secret key). - // TODO: Option should be removed once the signer certification is fully - // deployed. + /// + /// None is used only for testing when SPO pool id is not certified #[serde(skip_serializing_if = "Option::is_none")] pub verification_key_signature: Option, /// The encoded operational certificate of stake pool operator attached to /// the signer node. - // TODO: Option should be removed once the signer certification is fully - // deployed. + /// + /// None is used only for testing when SPO pool id is not certified #[serde(skip_serializing_if = "Option::is_none")] pub operational_certificate: Option, diff --git a/mithril-common/src/messages/register_signer.rs b/mithril-common/src/messages/register_signer.rs index 0fcabf2b774..9bc706d65f2 100644 --- a/mithril-common/src/messages/register_signer.rs +++ b/mithril-common/src/messages/register_signer.rs @@ -13,7 +13,8 @@ pub struct RegisterSignerMessage { pub epoch: Epoch, /// The unique identifier of the signer - // TODO: Should be removed once the signer certification is fully deployed + /// + /// Used only for testing when SPO pool id is not certified pub party_id: PartyId, /// The public key used to authenticate signer signature @@ -21,15 +22,15 @@ pub struct RegisterSignerMessage { /// The encoded signer 'Mithril verification key' signature (signed by the /// Cardano node KES secret key). - // TODO: Option should be removed once the signer certification is fully - // deployed. + /// + /// None is used only for testing when SPO pool id is not certified #[serde(skip_serializing_if = "Option::is_none")] pub verification_key_signature: Option, /// The encoded operational certificate of stake pool operator attached to /// the signer node. - // TODO: Option should be removed once the signer certification is fully - // deployed. + /// + /// None is used only for testing when SPO pool id is not certified #[serde(skip_serializing_if = "Option::is_none")] pub operational_certificate: Option, diff --git a/mithril-signer/src/configuration.rs b/mithril-signer/src/configuration.rs index e9af4a4b25e..47fe3040e54 100644 --- a/mithril-signer/src/configuration.rs +++ b/mithril-signer/src/configuration.rs @@ -52,7 +52,8 @@ pub struct Configuration { pub relay_endpoint: Option, /// Party Id - // TODO: Field should be removed once the signer certification is fully deployed + /// + /// Used only for testing when SPO pool id is not certified #[example = "`pool1pxaqe80sqpde7902er5kf6v0c7y0sv6d5g676766v2h829fvs3x`"] pub party_id: Option, diff --git a/mithril-test-lab/mithril-devnet/mkfiles/mkfiles-docker.sh b/mithril-test-lab/mithril-devnet/mkfiles/mkfiles-docker.sh index 2bec6725e4c..a61ebf06e08 100644 --- a/mithril-test-lab/mithril-devnet/mkfiles/mkfiles-docker.sh +++ b/mithril-test-lab/mithril-devnet/mkfiles/mkfiles-docker.sh @@ -229,7 +229,6 @@ EOF EOF else # 50% of signers without key certification (legacy) - # TODO: Should be removed once the signer certification is fully deployed cat >> ${NODE}/info.json <