diff --git a/mithril-aggregator/src/runtime/runner.rs b/mithril-aggregator/src/runtime/runner.rs index 2fb248a8eb6..5ce28dd4de5 100644 --- a/mithril-aggregator/src/runtime/runner.rs +++ b/mithril-aggregator/src/runtime/runner.rs @@ -4,6 +4,7 @@ use crate::snapshot_uploaders::SnapshotLocation; use crate::{DependencyManager, SnapshotError, Snapshotter}; use async_trait::async_trait; use chrono::Utc; +use hex::FromHex; use mithril_common::digesters::{Digester, DigesterResult, ImmutableDigester, ImmutableFile}; use mithril_common::entities::{Beacon, Certificate, CertificatePending, Snapshot}; @@ -378,8 +379,9 @@ impl AggregatorRunnerTrait for AggregatorRunner { file_path: &Path, remote_locations: Vec, ) -> Result { + let digest_hex = Vec::from_hex(certificate.digest).unwrap(); let snapshot = Snapshot::new( - certificate.digest, + String::from_utf8(digest_hex).map_err(|e| RuntimeError::General(e.to_string()))?, certificate.hash, std::fs::metadata(file_path) .map_err(|e| RuntimeError::General(e.to_string()))? diff --git a/mithril-aggregator/src/runtime/state_machine.rs b/mithril-aggregator/src/runtime/state_machine.rs index 77f02d110c0..782703daedb 100644 --- a/mithril-aggregator/src/runtime/state_machine.rs +++ b/mithril-aggregator/src/runtime/state_machine.rs @@ -154,14 +154,14 @@ impl AggregatorRuntime { ) -> Result { let certificate_pending = self.runner.drop_pending_certificate().await?; let path = self.runner.create_snapshot_archive().await?; - let _ = self.runner.upload_snapshot_archive(&path).await?; + let locations = self.runner.upload_snapshot_archive(&path).await?; let certificate = self .runner .create_and_save_certificate(&state.current_beacon, &certificate_pending) .await?; let _ = self .runner - .create_and_save_snapshot(certificate, &path, Vec::new()) + .create_and_save_snapshot(certificate, &path, locations) .await?; Ok(IdleState { diff --git a/mithril-test-lab/mithril-end-to-end/src/end_to_end_spec.rs b/mithril-test-lab/mithril-end-to-end/src/end_to_end_spec.rs index 3e15e500d8d..79956d87d99 100644 --- a/mithril-test-lab/mithril-end-to-end/src/end_to_end_spec.rs +++ b/mithril-test-lab/mithril-end-to-end/src/end_to_end_spec.rs @@ -56,7 +56,7 @@ impl Spec { async fn wait_for_pending_certificate(aggregator_endpoint: &str) -> Result<(), String> { let url = format!("{}/certificate-pending", aggregator_endpoint); - match attempt!(10, Duration::from_millis(100), { + match attempt!(10, Duration::from_millis(1000), { match reqwest::get(url.clone()).await { Ok(response) => match response.status() { StatusCode::OK => { diff --git a/mithril-test-lab/mithril-end-to-end/src/mithril/aggregator.rs b/mithril-test-lab/mithril-end-to-end/src/mithril/aggregator.rs index d010c0d1c0d..8f14ff283fd 100644 --- a/mithril-test-lab/mithril-end-to-end/src/mithril/aggregator.rs +++ b/mithril-test-lab/mithril-end-to-end/src/mithril/aggregator.rs @@ -25,11 +25,14 @@ impl Aggregator { ("SNAPSHOT_UPLOADER_TYPE", "local"), ( "PENDING_CERTIFICATE_STORE_DIRECTORY", - "./store/pending-certs", + "./store/aggregator/pending-certs", ), - ("CERTIFICATE_STORE_DIRECTORY", "./store/certs"), - ("VERIFICATION_KEY_STORE_DIRECTORY", "./store/certs"), - ("STAKE_STORE_DIRECTORY", "./store/stakes"), + ("CERTIFICATE_STORE_DIRECTORY", "./store/aggregator/certs"), + ( + "VERIFICATION_KEY_STORE_DIRECTORY", + "./store/aggregator/certs", + ), + ("STAKE_STORE_DIRECTORY", "./store/aggregator/stakes"), ]); let args = vec![ "--db-directory", diff --git a/mithril-test-lab/mithril-end-to-end/src/mithril/signer.rs b/mithril-test-lab/mithril-end-to-end/src/mithril/signer.rs index 0234e1805a4..7f687010c02 100644 --- a/mithril-test-lab/mithril-end-to-end/src/mithril/signer.rs +++ b/mithril-test-lab/mithril-end-to-end/src/mithril/signer.rs @@ -22,7 +22,7 @@ impl Signer { ("RUN_INTERVAL", "2000"), ("AGGREGATOR_ENDPOINT", &aggregator_endpoint), ("DB_DIRECTORY", db_directory.to_str().unwrap()), - ("STAKE_STORE_DIRECTORY", "./store/stakes") + ("STAKE_STORE_DIRECTORY", "./store/signer/stakes"), ]); let args = vec!["-vvv"];