Skip to content

Commit b4f9aef

Browse files
committed
feat(signer): activate DMQ
1 parent 60acbc8 commit b4f9aef

File tree

5 files changed

+2
-49
lines changed

5 files changed

+2
-49
lines changed

mithril-signer/Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ repository = { workspace = true }
1414
ignored = ["reqwest"]
1515

1616
[features]
17-
default = ["jemallocator","future_dmq"]
17+
default = ["jemallocator"]
1818

1919
bundle_tls = ["reqwest/native-tls-vendored"]
2020
jemallocator = ["dep:tikv-jemallocator"]
21-
future_dmq = ["dep:mithril-dmq"]
2221

2322
[dependencies]
2423
anyhow = { workspace = true }
@@ -32,7 +31,7 @@ mithril-cardano-node-chain = { path = "../internal/cardano-node/mithril-cardano-
3231
mithril-cardano-node-internal-database = { path = "../internal/cardano-node/mithril-cardano-node-internal-database" }
3332
mithril-cli-helper = { path = "../internal/mithril-cli-helper" }
3433
mithril-common = { path = "../mithril-common" }
35-
mithril-dmq = { path = "../internal/mithril-dmq", optional = true }
34+
mithril-dmq = { path = "../internal/mithril-dmq" }
3635
mithril-doc = { path = "../internal/mithril-doc" }
3736
mithril-era = { path = "../internal/mithril-era" }
3837
mithril-metric = { path = "../internal/mithril-metric" }

mithril-signer/src/configuration.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use anyhow::Context;
22
use config::{ConfigError, Map, Source, Value};
3-
#[cfg(feature = "future_dmq")]
43
use mithril_dmq::DmqNetwork;
54
use mithril_doc::{Documenter, DocumenterDefault, StructDoc};
65
use serde::{Deserialize, Serialize};
@@ -29,10 +28,6 @@ pub struct SignaturePublisherConfig {
2928
pub delayer_delay_ms: u64,
3029

3130
/// Whether to skip the delayer when publishing the signature
32-
///
33-
/// If set to true, the signatures will be published only once:
34-
/// - if the 'future_dmq` feature is used to compile, the signatures will be published only with the DMQ protocol
35-
/// - if the `future_dmq` feature is not used, the signatures will be published with the regular HTTP protocol
3631
pub skip_delayer: bool,
3732
}
3833

@@ -216,7 +211,6 @@ impl Configuration {
216211
}
217212

218213
/// Return the DMQ network value from the configuration.
219-
#[cfg(feature = "future_dmq")]
220214
pub fn get_dmq_network(&self) -> StdResult<DmqNetwork> {
221215
DmqNetwork::from_code(self.network.clone(), self.dmq_network_magic).with_context(|| {
222216
format!(

mithril-signer/src/dependency_injection/builder.rs

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ use mithril_common::api_version::APIVersionProvider;
2525
use mithril_common::crypto_helper::{
2626
KesSigner, KesSignerStandard, OpCert, ProtocolPartyId, SerDeShelleyFileFormat,
2727
};
28-
#[cfg(feature = "future_dmq")]
2928
use mithril_common::messages::RegisterSignatureMessageDmq;
3029
use mithril_common::signable_builder::{
3130
CardanoStakeDistributionSignableBuilder, CardanoTransactionsSignableBuilder,
@@ -44,11 +43,9 @@ use mithril_persistence::sqlite::{ConnectionBuilder, SqliteConnection, SqliteCon
4443

4544
use mithril_protocol_config::http::HttpMithrilNetworkConfigurationProvider;
4645

47-
#[cfg(feature = "future_dmq")]
4846
use mithril_dmq::{DmqMessageBuilder, DmqPublisherClientPallas};
4947

5048
use crate::dependency_injection::SignerDependencyContainer;
51-
#[cfg(feature = "future_dmq")]
5249
use crate::services::SignaturePublisherDmq;
5350
use crate::services::{
5451
CardanoTransactionsImporter, CardanoTransactionsPreloaderActivationSigner, MithrilEpochService,
@@ -425,7 +422,6 @@ impl<'a> DependenciesBuilder<'a> {
425422
_ => None,
426423
};
427424

428-
#[cfg(feature = "future_dmq")]
429425
let signature_publisher = {
430426
let first_publisher = SignaturePublisherRetrier::new(
431427
match &self.config.dmq_node_socket_path {
@@ -473,35 +469,6 @@ impl<'a> DependenciesBuilder<'a> {
473469
}
474470
};
475471

476-
#[cfg(not(feature = "future_dmq"))]
477-
let signature_publisher = {
478-
let first_publisher = SignaturePublisherRetrier::new(
479-
Arc::new(SignaturePublisherNoop) as Arc<dyn SignaturePublisher>,
480-
SignaturePublishRetryPolicy::never(),
481-
);
482-
483-
let second_publisher = SignaturePublisherRetrier::new(
484-
aggregator_client.clone(),
485-
SignaturePublishRetryPolicy {
486-
attempts: self.config.signature_publisher_config.retry_attempts,
487-
delay_between_attempts: Duration::from_millis(
488-
self.config.signature_publisher_config.retry_delay_ms,
489-
),
490-
},
491-
);
492-
493-
if self.config.signature_publisher_config.skip_delayer {
494-
Arc::new(second_publisher) as Arc<dyn SignaturePublisher>
495-
} else {
496-
Arc::new(SignaturePublisherDelayer::new(
497-
Arc::new(first_publisher),
498-
Arc::new(second_publisher),
499-
Duration::from_millis(self.config.signature_publisher_config.delayer_delay_ms),
500-
self.root_logger(),
501-
)) as Arc<dyn SignaturePublisher>
502-
}
503-
};
504-
505472
let certifier = Arc::new(SignerCertifierService::new(
506473
signed_beacon_repository,
507474
Arc::new(SignerSignedEntityConfigProvider::new(epoch_service.clone())),

mithril-signer/src/main.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,6 @@ pub struct Args {
110110
signature_publisher_delayer_delay_ms: u64,
111111

112112
/// Whether to skip the delayer when publishing the signature
113-
///
114-
/// If set to true, the signatures will be published only once:
115-
/// - if the 'future_dmq` feature is used to compile, the signatures will be published only with the DMQ protocol
116-
/// - if the `future_dmq` feature is not used, the signatures will be published with the regular HTTP protocol
117-
118113
#[clap(
119114
long,
120115
env = "SIGNATURE_PUBLISHER_SKIP_DELAYER",

mithril-signer/src/services/signature_publisher/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
mod delayer;
2-
#[cfg(feature = "future_dmq")]
32
mod dmq;
43
mod http;
54
mod interface;
65
mod noop;
76
mod retrier;
87

98
pub use delayer::*;
10-
#[cfg(feature = "future_dmq")]
119
pub use dmq::*;
1210
pub use interface::*;
1311
pub use noop::*;

0 commit comments

Comments
 (0)