Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
05fb00b
refactor: use a `DummyCardanoDbBuilder` to make the creation of the C…
dlachaume Dec 18, 2024
3ba6e22
feat: create archive for ancillary files
dlachaume Dec 17, 2024
b294513
feat: integrate ancillary archive creation into the upload process
dlachaume Dec 23, 2024
6f95567
feat: reference the ancillary artifact location in the artifact
dlachaume Dec 23, 2024
86ef2ab
feat: make the ancillary archive name more precise
dlachaume Dec 24, 2024
6294a1e
refactor: remove `http_server` dependency from `LocalUploader`
dlachaume Jan 2, 2025
9298db2
refactor: rename `LocalUploader` to `LocalSnapshotUploader`
dlachaume Jan 2, 2025
135c6ef
refactor: type `server_url_prefix` from `LocalSnapshotUploader` to `U…
dlachaume Jan 2, 2025
b6cf1b2
feat: implement standard `LocalUploader`
dlachaume Jan 3, 2025
b8668e8
refactor: create function to build the server url prefix in the aggre…
dlachaume Jan 3, 2025
536dd40
refactor: rewording and adjusting values in tests
dlachaume Jan 3, 2025
f7c5bad
feat: return error when `AncillaryArtifactBuilder` is created without…
dlachaume Jan 6, 2025
a041e51
feat: log uploader errors and return an error if no location is retur…
dlachaume Jan 6, 2025
bda4968
feat: enable Snapshotter to create archives in subdirectories
dlachaume Jan 6, 2025
e723715
fix: remove useless async attribute in test
dlachaume Jan 6, 2025
1eee194
test: verify upload behavior when uploaders are failing and at least …
dlachaume Jan 6, 2025
1e77688
chore: reference the feature in the CHANGELOG
dlachaume Jan 6, 2025
8d374ca
chore: upgrade crate versions
dlachaume Jan 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ As a minor extension, we have adopted a slightly different versioning convention
- **UNSTABLE** Cardano database incremental certification:

- Implement the artifact routes of the aggregator for the signed entity type `CardanoDatabase`.
- Implement the artifact ancillary builder in the aggregator.

- Crates versions:

Expand Down
8 changes: 4 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.6.8"
version = "0.6.9"
description = "A Mithril Aggregator server"
authors = { workspace = true }
edition = { workspace = true }
Expand Down
40 changes: 32 additions & 8 deletions mithril-aggregator/src/artifact_builder/cardano_database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ pub struct CardanoDatabaseArtifactBuilder {
db_directory: PathBuf,
cardano_node_version: Version,
compression_algorithm: CompressionAlgorithm,
#[allow(dead_code)]
ancillary_builder: Arc<AncillaryArtifactBuilder>,
}

Expand Down Expand Up @@ -62,8 +61,10 @@ impl ArtifactBuilder<CardanoDbBeacon, CardanoDatabaseSnapshot> for CardanoDataba
})?;
let total_db_size_uncompressed = compute_uncompressed_database_size(&self.db_directory)?;

let ancillary_locations = self.ancillary_builder.upload(&beacon).await?;

let locations = ArtifactsLocations {
ancillary: vec![],
ancillary: ancillary_locations,
digests: vec![],
immutables: vec![],
};
Expand Down Expand Up @@ -111,9 +112,14 @@ mod tests {
use std::path::PathBuf;

use mithril_common::{
digesters::DummyImmutablesDbBuilder,
entities::{ProtocolMessage, ProtocolMessagePartKey},
digesters::DummyCardanoDbBuilder,
entities::{AncillaryLocation, ProtocolMessage, ProtocolMessagePartKey},
test_utils::{fake_data, TempDir},
CardanoNetwork,
};

use crate::{
artifact_builder::MockAncillaryFileUploader, test_tools::TestLogger, DumbSnapshotter,
};

use super::*;
Expand All @@ -129,7 +135,7 @@ mod tests {
let immutable_trio_file_size = 777;
let ledger_file_size = 6666;
let volatile_file_size = 99;
DummyImmutablesDbBuilder::new(test_dir.as_os_str().to_str().unwrap())
DummyCardanoDbBuilder::new(test_dir.as_os_str().to_str().unwrap())
.with_immutables(&[1, 2])
.set_immutable_trio_file_size(immutable_trio_file_size)
.with_ledger_files(&["blocks-0.dat", "blocks-1.dat", "blocks-2.dat"])
Expand All @@ -152,7 +158,7 @@ mod tests {
let immutable_trio_file_size = 777;
let ledger_file_size = 6666;
let volatile_file_size = 99;
DummyImmutablesDbBuilder::new(test_dir.as_os_str().to_str().unwrap())
DummyCardanoDbBuilder::new(test_dir.as_os_str().to_str().unwrap())
.with_immutables(&[1])
.set_immutable_trio_file_size(immutable_trio_file_size)
.with_ledger_files(&["blocks-0.dat"])
Expand All @@ -162,11 +168,26 @@ mod tests {
.build();
let expected_total_size = immutable_trio_file_size + ledger_file_size + volatile_file_size;

let mut ancillary_uploader = MockAncillaryFileUploader::new();
ancillary_uploader.expect_upload().return_once(|_| {
Ok(AncillaryLocation::CloudStorage {
uri: "ancillary_uri".to_string(),
})
});
let cardano_database_artifact_builder = CardanoDatabaseArtifactBuilder::new(
test_dir,
&Version::parse("1.0.0").unwrap(),
CompressionAlgorithm::Zstandard,
Arc::new(AncillaryArtifactBuilder::new(vec![])),
Arc::new(
AncillaryArtifactBuilder::new(
vec![Arc::new(ancillary_uploader)],
Arc::new(DumbSnapshotter::new()),
CardanoNetwork::DevNet(123),
CompressionAlgorithm::Gzip,
TestLogger::stdout(),
)
.unwrap(),
),
);

let beacon = fake_data::beacon();
Expand All @@ -187,12 +208,15 @@ mod tests {
.await
.unwrap();

let expected_ancillary_locations = vec![AncillaryLocation::CloudStorage {
uri: "ancillary_uri".to_string(),
}];
let artifact_expected = CardanoDatabaseSnapshot::new(
"merkleroot".to_string(),
beacon,
expected_total_size,
ArtifactsLocations {
ancillary: vec![],
ancillary: expected_ancillary_locations,
digests: vec![],
immutables: vec![],
},
Expand Down
Loading