// Each artifact will be stored separately used the following path:
//
// <subnet_id>/<(height / N) * N>/height/<artifact_specific_name>.bin
//
// Note that the artifact specific name must contain all parameters to be
// differentiated not only across other artifacts of the same replica, but also
// across artifacts from all replicas. E.g., since we use multi-signatures for
// notarizations and finalizations, these artifacts can be created in different
// ways on different replicas, so we need to put their hashes into the artifact
// name.
Each artifact will be stored separately used the following path:
/<(height / N) * N>/height/.bin

Note that the artifact specific name must contain all parameters to be
differentiated not only across other artifacts of the same replica, but also
across artifacts from all replicas. E.g., since we use multi-signatures for
notarizations and finalizations, these artifacts can be created in different
ways on different replicas, so we need to put their hashes into the artifact
name.
Each artifact will be stored separately used the following path : / < ( height / N ) * N > / height / . bin Note that the artifact specific name must contain all parameters to be differentiated not only across other artifacts of the same replica but also across artifacts from all replicas . E . g . since we use multi - signatures for notarizations and finalizations these artifacts can be created in different ways on different replicas so we need to put their hashes into the artifact name .
fn file_location(&self, path: &Path) -> (PathBuf, String) {
        // Create a subdir for the height
        use BackupArtifact::*;
        let (height, file_name) = match self {
            Finalization(artifact) => (
                artifact.height(),
                format!(
                    "finalization_{}_{}.bin",
                    bytes_to_hex_str(&artifact.content.block),
                    bytes_to_hex_str(&ic_crypto::crypto_hash(artifact.as_ref())),
                ),
            ),
            Notarization(artifact) => (
                artifact.height(),
                format!(
                    "notarization_{}_{}.bin",
                    bytes_to_hex_str(&artifact.content.block),
                    bytes_to_hex_str(&ic_crypto::crypto_hash(artifact.as_ref())),
                ),
            ),
            BlockProposal(artifact) => (
                artifact.height(),
                format!(
                    "block_proposal_{}_{}.bin",
                    bytes_to_hex_str(artifact.content.get_hash()),
                    bytes_to_hex_str(&ic_crypto::crypto_hash(artifact.as_ref())),
                ),
            ),
            RandomTape(artifact) => (artifact.height(), "random_tape.bin".to_string()),
            RandomBeacon(artifact) => (artifact.height(), "random_beacon.bin".to_string()),
            CatchUpPackage(artifact) => (artifact.height(), "catch_up_package.bin".to_string()),
        };
        // We group heights by directories to avoid running into any kind of unexpected
        // FS inode limitations. Each group directory will contain at most
        // `BACKUP_GROUP_SIZE` heights.
        let group_key = (height.get() / BACKUP_GROUP_SIZE) * BACKUP_GROUP_SIZE;
        let path_with_height = path.join(group_key.to_string()).join(height.to_string());
        (path_with_height, file_name)
    }
fn file_location ( & self , path : & Path ) -> ( PathBuf , String ) { // Create a subdir for the height use BackupArtifact :: * ; let ( height , file_name ) = match self { Finalization ( artifact ) => ( artifact . height ( ) , format ! ( " " bytes_to_hex_str ( artifact content block ) bytes_to_hex_str ( ic_crypto crypto_hash ( artifact as_ref ( ) ) ) ) , ) , Notarization ( artifact ) => ( artifact . height ( ) , format ! ( " " bytes_to_hex_str ( artifact content block ) bytes_to_hex_str ( ic_crypto crypto_hash ( artifact as_ref ( ) ) ) ) , ) , BlockProposal ( artifact ) => ( artifact . height ( ) , format ! ( " " bytes_to_hex_str ( artifact content get_hash ( ) ) bytes_to_hex_str ( ic_crypto crypto_hash ( artifact as_ref ( ) ) ) ) , ) , RandomTape ( artifact ) => ( artifact . height ( ) , " " . to_string ( ) ) , RandomBeacon ( artifact ) => ( artifact . height ( ) , " " . to_string ( ) ) , CatchUpPackage ( artifact ) => ( artifact . height ( ) , " " . to_string ( ) ) , } ; // We group heights by directories to avoid running into any kind of unexpected // FS inode limitations. Each group directory will contain at most // `BACKUP_GROUP_SIZE` heights. let group_key = ( height . get ( ) / BACKUP_GROUP_SIZE ) * BACKUP_GROUP_SIZE ; let path_with_height = path . join ( group_key . to_string ( ) ) . join ( height . to_string ( ) ) ; ( path_with_height , file_name ) }
Each artifact will be stored separately used the following path:
<subnet_id>/<(height / N) * N>/height/<artifact_specific_name>.bin
Each artifact will be stored separately used the following path : <subnet_id > / < ( height / N ) * N > / height / <artifact_specific_name > . bin
&self
path
&Path