Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions rs/config/src/execution_environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ pub const MAX_COMPILATION_CACHE_SIZE: NumBytes = NumBytes::new(10 * GIB);
/// Maximum number of controllers allowed in a request (specified in the interface spec).
pub const MAX_ALLOWED_CONTROLLERS_COUNT: usize = 10;

/// Default maximum number of canisters per subnet if not set in the registry.
pub const DEFAULT_MAX_NUMBER_OF_CANISTERS: u64 = 120_000;

/// Maximum number of canister snapshots that can be stored for a single canister.
pub const MAX_NUMBER_OF_SNAPSHOTS_PER_CANISTER: usize = 10;

Expand Down
10 changes: 8 additions & 2 deletions rs/messaging/src/message_routing.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use crate::state_machine::{StateMachine, StateMachineImpl};
use crate::{routing, scheduling};
use ic_config::execution_environment::{BitcoinConfig, Config as HypervisorConfig};
use ic_config::execution_environment::{
BitcoinConfig, Config as HypervisorConfig, DEFAULT_MAX_NUMBER_OF_CANISTERS,
};
use ic_config::message_routing::{MAX_STREAM_MESSAGES, TARGET_STREAM_SIZE_BYTES};
use ic_cycles_account_manager::CyclesAccountManager;
use ic_interfaces::execution_environment::{
Expand Down Expand Up @@ -869,7 +871,11 @@ impl<RegistryClient_: RegistryClient> BatchProcessorImpl<RegistryClient_> {
let node_public_keys = self.try_to_populate_node_public_keys(&nodes, registry_version)?;

let subnet_features = subnet_record.features.unwrap_or_default().into();
let max_number_of_canisters = subnet_record.max_number_of_canisters;
let max_number_of_canisters = if subnet_record.max_number_of_canisters == 0 {
DEFAULT_MAX_NUMBER_OF_CANISTERS
} else {
subnet_record.max_number_of_canisters
};

let chain_key_settings = if let Some(chain_key_config) = subnet_record.chain_key_config {
let chain_key_config = ChainKeyConfig::try_from(chain_key_config).map_err(|err| {
Expand Down
3 changes: 1 addition & 2 deletions rs/protobuf/def/registry/subnet/v1/subnet.proto
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ message SubnetRecord {

// The maximum number of canisters that may be present on the subnet at any given time.
//
// A value of 0 is equivalent to setting no limit. This also provides an easy way
// to maintain compatibility of different versions of replica and registry.
// A value of 0 means that the replica's default value will be used.
uint64 max_number_of_canisters = 24;

// The list of public keys whose owners have "readonly" SSH access to all replicas on this subnet,
Expand Down
3 changes: 1 addition & 2 deletions rs/protobuf/src/gen/registry/registry.subnet.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ pub struct SubnetRecord {
pub features: ::core::option::Option<SubnetFeatures>,
/// The maximum number of canisters that may be present on the subnet at any given time.
///
/// A value of 0 is equivalent to setting no limit. This also provides an easy way
/// to maintain compatibility of different versions of replica and registry.
/// A value of 0 means that the replica's default value will be used.
#[prost(uint64, tag = "24")]
pub max_number_of_canisters: u64,
/// The list of public keys whose owners have "readonly" SSH access to all replicas on this subnet,
Expand Down
3 changes: 1 addition & 2 deletions rs/protobuf/src/gen/state/registry.subnet.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ pub struct SubnetRecord {
pub features: ::core::option::Option<SubnetFeatures>,
/// The maximum number of canisters that may be present on the subnet at any given time.
///
/// A value of 0 is equivalent to setting no limit. This also provides an easy way
/// to maintain compatibility of different versions of replica and registry.
/// A value of 0 means that the replica's default value will be used.
#[prost(uint64, tag = "24")]
pub max_number_of_canisters: u64,
/// The list of public keys whose owners have "readonly" SSH access to all replicas on this subnet,
Expand Down
3 changes: 1 addition & 2 deletions rs/protobuf/src/gen/types/registry.subnet.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ pub struct SubnetRecord {
pub features: ::core::option::Option<SubnetFeatures>,
/// The maximum number of canisters that may be present on the subnet at any given time.
///
/// A value of 0 is equivalent to setting no limit. This also provides an easy way
/// to maintain compatibility of different versions of replica and registry.
/// A value of 0 means that the replica's default value will be used.
#[prost(uint64, tag = "24")]
pub max_number_of_canisters: u64,
/// The list of public keys whose owners have "readonly" SSH access to all replicas on this subnet,
Expand Down
Loading