pub fn new(
        subnet_id: SubnetId,
        catch_up_package: CUPWithOriginalProtobuf,
        config: ArtifactPoolConfig,
        registry: ic_metrics::MetricsRegistry,
        log: ReplicaLogger,
    ) -> ConsensusPoolImpl {
        let mut pool = UncachedConsensusPoolImpl::new(config.clone(), log.clone());
        Self::init_genesis(catch_up_package, pool.validated.as_mut());
        let mut pool = Self::from_uncached(pool, registry.clone());
        // If the back up directory is set, instantiate the backup component
        // and create a subdirectory with the subnet id as directory name.
        pool.backup = config.backup_config.map(|config| {
            Backup::new(
                &pool,
                config.spool_path.clone(),
                config
                    .spool_path
                    .join(subnet_id.to_string())
                    .join(ic_types::ReplicaVersion::default().to_string()),
                Duration::from_secs(config.retention_time_secs),
                Duration::from_secs(config.purging_interval_secs),
                registry,
                log,
            )
        });

        // Initial update to the metrics, such that they always report the state, even
        // when a subnet is halted.
        pool.validated_metrics.update(pool.validated.pool_section());
        pool.unvalidated_metrics
            .update(pool.unvalidated.pool_section());
        pool
    }
/// Create a consensus pool from a given `config`, and initialize it with
/// the given `catch_up_package`. If a catch-up package already exists in
/// the validated pool, the one that is greater (with respect to
/// height and registry version) will be used.
Create a consensus pool from a given `config`, and initialize it with
the given `catch_up_package`. If a catch-up package already exists in
the validated pool, the one that is greater (with respect to
height and registry version) will be used.
Create a consensus pool from a given ` config ` and initialize it with the given ` catch_up_package ` . If a catch - up package already exists in the validated pool the one that is greater ( with respect to height and registry version ) will be used .
pub fn new(
        subnet_id: SubnetId,
        catch_up_package: CUPWithOriginalProtobuf,
        config: ArtifactPoolConfig,
        registry: ic_metrics::MetricsRegistry,
        log: ReplicaLogger,
    ) -> ConsensusPoolImpl {
        let mut pool = UncachedConsensusPoolImpl::new(config.clone(), log.clone());
        Self::init_genesis(catch_up_package, pool.validated.as_mut());
        let mut pool = Self::from_uncached(pool, registry.clone());
        // If the back up directory is set, instantiate the backup component
        // and create a subdirectory with the subnet id as directory name.
        pool.backup = config.backup_config.map(|config| {
            Backup::new(
                &pool,
                config.spool_path.clone(),
                config
                    .spool_path
                    .join(subnet_id.to_string())
                    .join(ic_types::ReplicaVersion::default().to_string()),
                Duration::from_secs(config.retention_time_secs),
                Duration::from_secs(config.purging_interval_secs),
                registry,
                log,
            )
        });
        // Initial update to the metrics, such that they always report the state, even
        // when a subnet is halted.
        pool.validated_metrics.update(pool.validated.pool_section());
        pool.unvalidated_metrics
            .update(pool.unvalidated.pool_section());
        pool
    }
pub fn new ( subnet_id : SubnetId , catch_up_package : CUPWithOriginalProtobuf , config : ArtifactPoolConfig , registry : ic_metrics :: MetricsRegistry , log : ReplicaLogger , ) -> ConsensusPoolImpl { let mut pool = UncachedConsensusPoolImpl :: new ( config . clone ( ) , log . clone ( ) ) ; Self :: init_genesis ( catch_up_package , pool . validated . as_mut ( ) ) ; let mut pool = Self :: from_uncached ( pool , registry . clone ( ) ) ; // If the back up directory is set, instantiate the backup component // and create a subdirectory with the subnet id as directory name. pool . backup = config . backup_config . map ( | config | { Backup :: new ( & pool , config . spool_path . clone ( ) , config . spool_path . join ( subnet_id . to_string ( ) ) . join ( ic_types :: ReplicaVersion :: default ( ) . to_string ( ) ) , Duration :: from_secs ( config . retention_time_secs ) , Duration :: from_secs ( config . purging_interval_secs ) , registry , log , ) } ) ; // Initial update to the metrics, such that they always report the state, even // when a subnet is halted. pool . validated_metrics . update ( pool . validated . pool_section ( ) ) ; pool . unvalidated_metrics . update ( pool . unvalidated . pool_section ( ) ) ; pool }
Create a consensus pool from a given `config`, and initialize it with
the given `catch_up_package`.
Create a consensus pool from a given ` config ` and initialize it with the given ` catch_up_package ` .
subnet_id
SubnetId
catch_up_package
CUPWithOriginalProtobuf
config
ArtifactPoolConfig
registry
ic_metrics::MetricsRegistry
log
ReplicaLogger
subnet_id
SubnetId
catch_up_package
CUPWithOriginalProtobuf
config
ArtifactPoolConfig
registry
ic_metrics::MetricsRegistry
log
ReplicaLogger