Skip to content

Commit 900fb4e

Browse files
committed
wip(dmq): temporary fix KES signature
1 parent 4ce1016 commit 900fb4e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

internal/mithril-dmq/src/model/builder.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::sync::Arc;
1+
use std::{sync::Arc, vec};
22

33
use anyhow::{Context, anyhow};
44
use blake2::{Blake2b, Digest, digest::consts::U64};
@@ -65,16 +65,21 @@ impl DmqMessageBuilder {
6565
let block_number = (*block_number)
6666
.try_into()
6767
.with_context(|| "Failed to convert block number to u32")?;
68-
let (kes_signature, operational_certificate) = self
68+
// TODO: fix, this is here only to circumvent a problem with the computation of the KES period which relies on the Operational Certificate
69+
let (_kes_signature, operational_certificate) = self
6970
.kes_signer
70-
.sign(message_bytes, block_number)
71+
.sign(message_bytes, 0)
7172
.with_context(|| "Failed to KES sign message while building DMQ message")?;
7273
let kes_period = self
7374
.chain_observer
7475
.get_current_kes_period(&operational_certificate)
7576
.await
7677
.with_context(|| "Failed to get KES period while building DMQ message")?
7778
.unwrap_or_default();
79+
let (kes_signature, operational_certificate) = self
80+
.kes_signer
81+
.sign(message_bytes, kes_period)
82+
.with_context(|| "Failed to KES sign message while building DMQ message")?;
7883
let mut dmq_message = DmqMsg {
7984
msg_id: vec![],
8085
msg_body: message_bytes.to_vec(),

0 commit comments

Comments
 (0)