Skip to content

Commit efc05cf

Browse files
committed
Merge branch 'eichhorl/rm-tecdsa-inputs-proto' into 'master'
chore(ecdsa): CON-1208 CON-1216 Remove unused proto definitions These structures are no longer persisted in the block payload and can therefore be removed. Additionally, we remove the redundant `key_transcript_ref` from `ThresholdEcdsaSigInputsRef`, as this reference also exists in the input's `PreSignatureQuadrupleRef`. See merge request dfinity-lab/public/ic!19781
2 parents fc66531 + 389b584 commit efc05cf

File tree

6 files changed

+1
-134
lines changed

6 files changed

+1
-134
lines changed

rs/consensus/src/ecdsa/test_utils.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,6 @@ impl From<&ThresholdEcdsaSigInputs> for TestSigInputs {
290290
.unwrap(),
291291
key_unmasked_ref: UnmaskedTranscript::try_from((height, key)).unwrap(),
292292
},
293-
key_transcript_ref: UnmaskedTranscript::try_from((height, key)).unwrap(),
294293
};
295294
TestSigInputs {
296295
idkg_transcripts,
@@ -1253,7 +1252,6 @@ pub(crate) fn create_ecdsa_sig_inputs_with_args(
12531252
[0u8; 32],
12541253
Randomness::from([0_u8; 32]),
12551254
presig_quadruple_ref,
1256-
key_unmasked_ref,
12571255
);
12581256

12591257
TestSigInputs {

rs/consensus/src/ecdsa/utils.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,13 +246,11 @@ pub(super) fn build_signature_inputs(
246246
let nonce = Id::from(context.nonce?);
247247
let inputs = match (pre_signature, &context.args) {
248248
(PreSignatureRef::Ecdsa(pre_sig), ThresholdArguments::Ecdsa(args)) => {
249-
let key_transcript_ref = pre_sig.key_unmasked_ref;
250249
ThresholdSigInputsRef::Ecdsa(ThresholdEcdsaSigInputsRef::new(
251250
extended_derivation_path,
252251
args.message_hash,
253252
nonce,
254253
pre_sig,
255-
key_transcript_ref,
256254
))
257255
}
258256
(PreSignatureRef::Schnorr(pre_sig), ThresholdArguments::Schnorr(args)) => {

rs/protobuf/def/types/v1/idkg.proto

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,6 @@ message EcdsaKeyTranscript {
3939
registry.crypto.v1.MasterPublicKeyId master_key_id = 4;
4040
}
4141

42-
message OngoingSignature {
43-
RequestId request_id = 1;
44-
ThresholdEcdsaSigInputsRef sig_inputs = 2;
45-
}
46-
47-
message AvailableQuadruple {
48-
reserved 3;
49-
reserved "key_id";
50-
uint64 pre_signature_id = 1;
51-
PreSignatureQuadrupleRef quadruple = 2;
52-
}
53-
54-
message QuadrupleInProgress {
55-
reserved 3;
56-
reserved "key_id";
57-
uint64 pre_signature_id = 1;
58-
QuadrupleInCreation quadruple = 2;
59-
}
60-
6142
message AvailablePreSignature {
6243
uint64 pre_signature_id = 1;
6344
PreSignatureRef pre_signature = 2;
@@ -188,14 +169,6 @@ message PreSignatureQuadrupleRef {
188169
registry.crypto.v1.EcdsaKeyId key_id = 6;
189170
}
190171

191-
message ThresholdEcdsaSigInputsRef {
192-
registry.subnet.v1.ExtendedDerivationPath derivation_path = 1;
193-
bytes hashed_message = 2;
194-
bytes nonce = 3;
195-
PreSignatureQuadrupleRef presig_quadruple_ref = 4;
196-
UnmaskedTranscript key_transcript_ref = 5;
197-
}
198-
199172
message TranscriptInCreation {
200173
registry.crypto.v1.SchnorrKeyId key_id = 1;
201174
RandomUnmaskedTranscriptParams blinder_unmasked_config = 2;

rs/protobuf/src/gen/types/types.v1.rs

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -440,30 +440,6 @@ pub struct EcdsaKeyTranscript {
440440
}
441441
#[allow(clippy::derive_partial_eq_without_eq)]
442442
#[derive(Clone, PartialEq, ::prost::Message)]
443-
pub struct OngoingSignature {
444-
#[prost(message, optional, tag = "1")]
445-
pub request_id: ::core::option::Option<RequestId>,
446-
#[prost(message, optional, tag = "2")]
447-
pub sig_inputs: ::core::option::Option<ThresholdEcdsaSigInputsRef>,
448-
}
449-
#[allow(clippy::derive_partial_eq_without_eq)]
450-
#[derive(Clone, PartialEq, ::prost::Message)]
451-
pub struct AvailableQuadruple {
452-
#[prost(uint64, tag = "1")]
453-
pub pre_signature_id: u64,
454-
#[prost(message, optional, tag = "2")]
455-
pub quadruple: ::core::option::Option<PreSignatureQuadrupleRef>,
456-
}
457-
#[allow(clippy::derive_partial_eq_without_eq)]
458-
#[derive(Clone, PartialEq, ::prost::Message)]
459-
pub struct QuadrupleInProgress {
460-
#[prost(uint64, tag = "1")]
461-
pub pre_signature_id: u64,
462-
#[prost(message, optional, tag = "2")]
463-
pub quadruple: ::core::option::Option<QuadrupleInCreation>,
464-
}
465-
#[allow(clippy::derive_partial_eq_without_eq)]
466-
#[derive(Clone, PartialEq, ::prost::Message)]
467443
pub struct AvailablePreSignature {
468444
#[prost(uint64, tag = "1")]
469445
pub pre_signature_id: u64,
@@ -674,21 +650,6 @@ pub struct PreSignatureQuadrupleRef {
674650
}
675651
#[allow(clippy::derive_partial_eq_without_eq)]
676652
#[derive(Clone, PartialEq, ::prost::Message)]
677-
pub struct ThresholdEcdsaSigInputsRef {
678-
#[prost(message, optional, tag = "1")]
679-
pub derivation_path:
680-
::core::option::Option<super::super::registry::subnet::v1::ExtendedDerivationPath>,
681-
#[prost(bytes = "vec", tag = "2")]
682-
pub hashed_message: ::prost::alloc::vec::Vec<u8>,
683-
#[prost(bytes = "vec", tag = "3")]
684-
pub nonce: ::prost::alloc::vec::Vec<u8>,
685-
#[prost(message, optional, tag = "4")]
686-
pub presig_quadruple_ref: ::core::option::Option<PreSignatureQuadrupleRef>,
687-
#[prost(message, optional, tag = "5")]
688-
pub key_transcript_ref: ::core::option::Option<UnmaskedTranscript>,
689-
}
690-
#[allow(clippy::derive_partial_eq_without_eq)]
691-
#[derive(Clone, PartialEq, ::prost::Message)]
692653
pub struct TranscriptInCreation {
693654
#[prost(message, optional, tag = "1")]
694655
pub key_id: ::core::option::Option<super::super::registry::crypto::v1::SchnorrKeyId>,

rs/types/types/src/consensus/idkg/common.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,6 @@ fn err_schnorr(err: ThresholdSchnorrSigInputsError) -> ThresholdSigInputsResult
11121112
}
11131113

11141114
#[derive(Clone, Debug, PartialEq, Eq)]
1115-
#[allow(clippy::large_enum_variant)]
11161115
pub enum ThresholdSigInputsRef {
11171116
Ecdsa(ThresholdEcdsaSigInputsRef),
11181117
Schnorr(ThresholdSchnorrSigInputsRef),

rs/types/types/src/consensus/idkg/ecdsa.rs

Lines changed: 1 addition & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,6 @@ pub struct ThresholdEcdsaSigInputsRef {
404404
pub hashed_message: [u8; 32],
405405
pub nonce: Randomness,
406406
pub presig_quadruple_ref: PreSignatureQuadrupleRef,
407-
pub key_transcript_ref: UnmaskedTranscript,
408407
}
409408

410409
#[derive(Clone, Debug)]
@@ -420,14 +419,12 @@ impl ThresholdEcdsaSigInputsRef {
420419
hashed_message: [u8; 32],
421420
nonce: Randomness,
422421
presig_quadruple_ref: PreSignatureQuadrupleRef,
423-
key_transcript_ref: UnmaskedTranscript,
424422
) -> Self {
425423
Self {
426424
derivation_path,
427425
hashed_message,
428426
nonce,
429427
presig_quadruple_ref,
430-
key_transcript_ref,
431428
}
432429
}
433430

@@ -441,7 +438,7 @@ impl ThresholdEcdsaSigInputsRef {
441438
.translate(resolver)
442439
.map_err(ThresholdEcdsaSigInputsError::PreSignatureQuadruple)?;
443440
let key_transcript = resolver
444-
.transcript(self.key_transcript_ref.as_ref())
441+
.transcript(self.presig_quadruple_ref.key_unmasked_ref.as_ref())
445442
.map_err(ThresholdEcdsaSigInputsError::KeyTranscript)?;
446443
ThresholdEcdsaSigInputs::new(
447444
&self.derivation_path,
@@ -453,62 +450,3 @@ impl ThresholdEcdsaSigInputsRef {
453450
.map_err(ThresholdEcdsaSigInputsError::Failed)
454451
}
455452
}
456-
457-
impl From<&ThresholdEcdsaSigInputsRef> for pb::ThresholdEcdsaSigInputsRef {
458-
fn from(sig_inputs: &ThresholdEcdsaSigInputsRef) -> Self {
459-
Self {
460-
derivation_path: Some((sig_inputs.derivation_path.clone()).into()),
461-
hashed_message: sig_inputs.hashed_message.to_vec(),
462-
nonce: sig_inputs.nonce.get().to_vec(),
463-
presig_quadruple_ref: Some((&sig_inputs.presig_quadruple_ref).into()),
464-
key_transcript_ref: Some((&sig_inputs.key_transcript_ref).into()),
465-
}
466-
}
467-
}
468-
469-
impl TryFrom<&pb::ThresholdEcdsaSigInputsRef> for ThresholdEcdsaSigInputsRef {
470-
type Error = ProxyDecodeError;
471-
fn try_from(sig_inputs: &pb::ThresholdEcdsaSigInputsRef) -> Result<Self, Self::Error> {
472-
let derivation_path: ExtendedDerivationPath = try_from_option_field(
473-
sig_inputs.derivation_path.clone(),
474-
"ThresholdEcdsaSigInputsRef::derivation_path",
475-
)?;
476-
477-
if sig_inputs.hashed_message.len() != 32 {
478-
return Err(ProxyDecodeError::Other(format!(
479-
"ThresholdEcdsaSigInputsRef:: Invalid hashed_message length: {:?}",
480-
sig_inputs.nonce.len()
481-
)));
482-
}
483-
let mut hashed_message = [0; 32];
484-
hashed_message.copy_from_slice(&sig_inputs.hashed_message[0..32]);
485-
486-
if sig_inputs.nonce.len() != 32 {
487-
return Err(ProxyDecodeError::Other(format!(
488-
"ThresholdEcdsaSigInputsRef:: Invalid nonce length: {:?}",
489-
sig_inputs.nonce.len()
490-
)));
491-
}
492-
let mut nonce = [0; 32];
493-
nonce.copy_from_slice(&sig_inputs.nonce[0..32]);
494-
let nonce = Randomness::from(nonce);
495-
496-
let presig_quadruple_ref: PreSignatureQuadrupleRef = try_from_option_field(
497-
sig_inputs.presig_quadruple_ref.as_ref(),
498-
"ThresholdEcdsaSigInputsRef::presig_quadruple_ref",
499-
)?;
500-
501-
let key_transcript_ref: UnmaskedTranscript = try_from_option_field(
502-
sig_inputs.key_transcript_ref.as_ref(),
503-
"ThresholdEcdsaSigInputsRef::key_transcript_ref",
504-
)?;
505-
506-
Ok(Self::new(
507-
derivation_path,
508-
hashed_message,
509-
nonce,
510-
presig_quadruple_ref,
511-
key_transcript_ref,
512-
))
513-
}
514-
}

0 commit comments

Comments
 (0)