Skip to content

Commit

Permalink
Merge pull request #1348 from txpipe/feat/pallas-observer
Browse files Browse the repository at this point in the history
enhance mithril/cardano node communication
  • Loading branch information
jpraynaud authored Nov 29, 2023
2 parents 951bc02 + 323ecdc commit 64140b1
Show file tree
Hide file tree
Showing 17 changed files with 599 additions and 216 deletions.
79 changes: 75 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mithril-aggregator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-aggregator"
version = "0.4.12"
version = "0.4.13"
description = "A Mithril Aggregator server"
authors = { workspace = true }
edition = { workspace = true }
Expand Down
18 changes: 14 additions & 4 deletions mithril-aggregator/src/dependency_injection/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ use anyhow::Context;
use mithril_common::{
api_version::APIVersionProvider,
certificate_chain::{CertificateVerifier, MithrilCertificateVerifier},
chain_observer::{CardanoCliChainObserver, CardanoCliRunner, ChainObserver, FakeObserver},
chain_observer::{
CardanoCliChainObserver, CardanoCliRunner, ChainObserver, FakeObserver, PallasChainObserver,
},
crypto_helper::{
ProtocolGenesisSigner, ProtocolGenesisVerificationKey, ProtocolGenesisVerifier,
},
Expand Down Expand Up @@ -463,9 +465,17 @@ impl DependenciesBuilder {

async fn build_chain_observer(&mut self) -> Result<Arc<dyn ChainObserver>> {
let chain_observer: Arc<dyn ChainObserver> = match self.configuration.environment {
ExecutionEnvironment::Production => Arc::new(CardanoCliChainObserver::new(
self.get_cardano_cli_runner().await?,
)),
ExecutionEnvironment::Production => {
let fallback = CardanoCliChainObserver::new(self.get_cardano_cli_runner().await?);
let observer = PallasChainObserver::new(
&self.configuration.cardano_node_socket_path,
self.configuration.get_network().with_context(|| {
"Dependencies Builder can not get Cardano network while building cardano cli runner"
})?,
fallback,
);
Arc::new(observer)
}
_ => Arc::new(FakeObserver::default()),
};

Expand Down
4 changes: 3 additions & 1 deletion mithril-common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-common"
version = "0.2.138"
version = "0.2.139"
description = "Common types, interfaces, and utilities for Mithril nodes."
authors = { workspace = true }
edition = { workspace = true }
Expand Down Expand Up @@ -34,6 +34,7 @@ kes-summed-ed25519 = { version = "0.2.1", features = [
"sk_clone_enabled",
] }
nom = "7.1.3"
pallas-network = "0.20.0"
rand_chacha = "0.3.1"
rand_core = { version = "0.6.4", features = ["getrandom"] }
rayon = "1.8.0"
Expand Down Expand Up @@ -73,6 +74,7 @@ mithril-stm = { path = "../mithril-stm", version = "0.3", default-features = fal
[dev-dependencies]
criterion = { version = "0.5.1", features = ["html_reports", "async_tokio"] }
mockall = "0.11.4"
pallas-codec = "0.20.0"
reqwest = { version = "0.11.22", features = ["json"] }
slog-async = "2.8.0"
slog-scope = "4.4.0"
Expand Down
Loading

0 comments on commit 64140b1

Please sign in to comment.