Skip to content

Commit

Permalink
fix: TODO 'Should be removed once the signer certification is fully
Browse files Browse the repository at this point in the history
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'
  • Loading branch information
jpraynaud committed Jan 9, 2025
1 parent 423e225 commit 55b2e82
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 28 deletions.
9 changes: 5 additions & 4 deletions mithril-common/src/crypto_helper/cardano/key_certification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down Expand Up @@ -246,9 +247,9 @@ impl KeyRegWrapper {
/// Mithril key (with its corresponding Proof of Possession).
pub fn register(
&mut self,
party_id: Option<ProtocolPartyId>, // TODO: Parameter should be removed once the signer certification is fully deployed
opcert: Option<ProtocolOpCert>, // TODO: Option should be removed once the signer certification is fully deployed
kes_sig: Option<ProtocolSignerVerificationKeySignature>, // TODO: Option should be removed once the signer certification is fully deployed
party_id: Option<ProtocolPartyId>, // Used for only for testing when SPO pool id is not certified
opcert: Option<ProtocolOpCert>, // Used for only for testing when SPO pool id is not certified
kes_sig: Option<ProtocolSignerVerificationKeySignature>, // Used for only for testing when SPO pool id is not certified
kes_period: Option<KESPeriod>,
pk: ProtocolSignerVerificationKey,
) -> Result<ProtocolPartyId, ProtocolRegistrationErrorWrapper> {
Expand Down
18 changes: 12 additions & 6 deletions mithril-common/src/entities/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<ProtocolSignerVerificationKeySignature>,

/// 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<ProtocolOpCert>,

Expand Down Expand Up @@ -136,19 +139,22 @@ impl From<SignerWithStake> 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<ProtocolSignerVerificationKeySignature>,

/// 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<ProtocolOpCert>,

Expand Down
22 changes: 12 additions & 10 deletions mithril-common/src/messages/message_parts/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,24 @@ 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
pub verification_key: HexEncodedVerificationKey,

/// 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<HexEncodedVerificationKeySignature>,

/// 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<HexEncodedOpCert>,

Expand Down Expand Up @@ -161,23 +162,24 @@ 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
pub verification_key: HexEncodedVerificationKey,

/// 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<HexEncodedVerificationKeySignature>,

/// 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<HexEncodedOpCert>,

Expand Down
11 changes: 6 additions & 5 deletions mithril-common/src/messages/register_signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,24 @@ 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
pub verification_key: HexEncodedVerificationKey,

/// 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<HexEncodedVerificationKeySignature>,

/// 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<HexEncodedOpCert>,

Expand Down
3 changes: 2 additions & 1 deletion mithril-signer/src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ pub struct Configuration {
pub relay_endpoint: Option<String>,

/// 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<PartyId>,

Expand Down
1 change: 0 additions & 1 deletion mithril-test-lab/mithril-devnet/mkfiles/mkfiles-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOF
{
"name": "Signer ${NODE_ID}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ impl MithrilInfrastructure {
for (index, pool_node) in pool_nodes.iter().enumerate() {
// 50% of signers with key certification if allow unverified signer registration
// Or 100% of signers otherwise
// TODO: Should be removed once the signer certification is fully deployed
let enable_certification =
index % 2 == 0 || cfg!(not(feature = "allow_skip_signer_certification"));
let aggregator_endpoint = if config.use_p2p_network_mode {
Expand Down

0 comments on commit 55b2e82

Please sign in to comment.