Skip to content

Commit d6c6fce

Browse files
committed
Merge branch 'kpop/CON-979/proto2' into 'master'
feat(Consensus): [CON-979] Add "halt_at_cup_height" to the registry proto. This is needed for the Subnet Splitting MVP. The actual subnet halting will be implemented in a [subsequent MR](https://gitlab.com/dfinity-lab/public/ic/-/merge_requests/12475). [1-pager](https://docs.google.com/document/d/14DmM-lPrVlJymK8VJFeDec-yNU_bhNFbBe6wSx-5W0k/edit#heading=h.g6x0685fi43z) See merge request dfinity-lab/public/ic!12298
2 parents 84283f2 + 61dc9ef commit d6c6fce

File tree

18 files changed

+177
-54
lines changed

18 files changed

+177
-54
lines changed

rs/crypto/temp_crypto/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ impl EcdsaSubnetConfig {
414414
start_as_nns: false,
415415
subnet_type: SubnetType::Application.into(),
416416
is_halted: false,
417+
halt_at_cup_height: false,
417418
max_instructions_per_message: 5_000_000_000,
418419
max_instructions_per_round: 7_000_000_000,
419420
max_instructions_per_install_code: 200_000_000_000,

rs/nns/integration_tests/src/subnet_handler.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ fn test_submit_and_accept_update_subnet_proposal() {
5959
start_as_nns: false,
6060
subnet_type: SubnetType::Application.into(),
6161
is_halted: false,
62+
halt_at_cup_height: false,
6263
max_instructions_per_message: 5_000_000_000,
6364
max_instructions_per_round: 7_000_000_000,
6465
max_instructions_per_install_code: 200_000_000_000,
@@ -109,6 +110,7 @@ fn test_submit_and_accept_update_subnet_proposal() {
109110
start_as_nns: None,
110111
subnet_type: None,
111112
is_halted: Some(true),
113+
halt_at_cup_height: Some(true),
112114
max_instructions_per_message: None,
113115
max_instructions_per_round: Some(8_000_000_000),
114116
max_instructions_per_install_code: None,
@@ -180,6 +182,7 @@ fn test_submit_and_accept_update_subnet_proposal() {
180182
start_as_nns: false,
181183
subnet_type: SubnetType::Application.into(),
182184
is_halted: true,
185+
halt_at_cup_height: true,
183186
max_instructions_per_message: 5_000_000_000,
184187
max_instructions_per_round: 8_000_000_000,
185188
max_instructions_per_install_code: 200_000_000_000,

rs/prep/src/subnet_configuration.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ impl SubnetConfig {
297297
start_as_nns: false,
298298
subnet_type: self.subnet_type.into(),
299299
is_halted: false,
300+
halt_at_cup_height: false,
300301
max_instructions_per_message: self.max_instructions_per_message,
301302
max_instructions_per_round: self.max_instructions_per_round,
302303
max_instructions_per_install_code: self.max_instructions_per_install_code,

rs/protobuf/def/registry/subnet/v1/subnet.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ message SubnetRecord {
9090
// to `Some`. To remove a key, the list of `key_ids` can be set to not include a particular key.
9191
// If a removed key is not held by another subnet, it will be lost.
9292
EcdsaConfig ecdsa_config = 27;
93+
94+
// If `true`, the subnet will be halted after reaching the next cup height: it will no longer
95+
// create or execute blocks.
96+
bool halt_at_cup_height = 28;
9397
}
9498

9599
message EcdsaInitialization {

rs/protobuf/src/gen/registry/registry.subnet.v1.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ pub struct SubnetRecord {
7777
/// If a removed key is not held by another subnet, it will be lost.
7878
#[prost(message, optional, tag = "27")]
7979
pub ecdsa_config: ::core::option::Option<EcdsaConfig>,
80+
/// If `true`, the subnet will be halted after reaching the next cup height: it will no longer
81+
/// create or execute blocks.
82+
#[prost(bool, tag = "28")]
83+
pub halt_at_cup_height: bool,
8084
}
8185
#[derive(serde::Serialize, serde::Deserialize)]
8286
#[allow(clippy::derive_partial_eq_without_eq)]

rs/protobuf/src/gen/state/registry.subnet.v1.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ pub struct SubnetRecord {
7676
/// If a removed key is not held by another subnet, it will be lost.
7777
#[prost(message, optional, tag = "27")]
7878
pub ecdsa_config: ::core::option::Option<EcdsaConfig>,
79+
/// If `true`, the subnet will be halted after reaching the next cup height: it will no longer
80+
/// create or execute blocks.
81+
#[prost(bool, tag = "28")]
82+
pub halt_at_cup_height: bool,
7983
}
8084
#[allow(clippy::derive_partial_eq_without_eq)]
8185
#[derive(Clone, PartialEq, ::prost::Message)]

rs/protobuf/src/gen/types/registry.subnet.v1.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ pub struct SubnetRecord {
7777
/// If a removed key is not held by another subnet, it will be lost.
7878
#[prost(message, optional, tag = "27")]
7979
pub ecdsa_config: ::core::option::Option<EcdsaConfig>,
80+
/// If `true`, the subnet will be halted after reaching the next cup height: it will no longer
81+
/// create or execute blocks.
82+
#[prost(bool, tag = "28")]
83+
pub halt_at_cup_height: bool,
8084
}
8185
#[derive(serde::Serialize, serde::Deserialize)]
8286
#[allow(clippy::derive_partial_eq_without_eq)]

rs/registry/admin/src/main.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,21 +78,19 @@ use ic_protobuf::registry::node_rewards::v2::{
7878
};
7979
use ic_protobuf::registry::{
8080
crypto::v1::{PublicKey, X509PublicKeyCert},
81+
dc::v1::{AddOrRemoveDataCentersProposalPayload, DataCenterRecord},
8182
node::v1::NodeRecord,
82-
node_operator::v1::NodeOperatorRecord,
83+
node_operator::v1::{NodeOperatorRecord, RemoveNodeOperatorsPayload},
8384
provisional_whitelist::v1::ProvisionalWhitelist as ProvisionalWhitelistProto,
8485
replica_version::v1::{BlessedReplicaVersions, ReplicaVersionRecord},
8586
routing_table::v1::{CanisterMigrations, RoutingTable},
8687
subnet::v1::{SubnetListRecord, SubnetRecord as SubnetRecordProto},
8788
unassigned_nodes_config::v1::UnassignedNodesConfigRecord,
8889
};
89-
use ic_protobuf::registry::{
90-
dc::v1::{AddOrRemoveDataCentersProposalPayload, DataCenterRecord},
91-
node_operator::v1::RemoveNodeOperatorsPayload,
92-
};
9390
use ic_registry_client::client::RegistryClientImpl;
94-
use ic_registry_client_helpers::ecdsa_keys::EcdsaKeysRegistry;
95-
use ic_registry_client_helpers::{crypto::CryptoRegistry, subnet::SubnetRegistry};
91+
use ic_registry_client_helpers::{
92+
crypto::CryptoRegistry, ecdsa_keys::EcdsaKeysRegistry, subnet::SubnetRegistry,
93+
};
9694
use ic_registry_keys::{
9795
get_node_record_node_id, is_node_record_key, make_blessed_replica_versions_key,
9896
make_canister_migrations_record_key, make_crypto_node_key,
@@ -1833,11 +1831,17 @@ struct ProposeToUpdateSubnetCmd {
18331831
/// field to the value set. See `ProposeToCreateSubnetCmd` for the semantic
18341832
/// of this field.
18351833
pub start_as_nns: Option<bool>,
1834+
18361835
/// If set, the subnet will be halted: it will no longer create or execute
18371836
/// blocks
18381837
#[clap(long)]
18391838
pub is_halted: Option<bool>,
18401839

1840+
/// If set, the subnet will be halted at the next CUP height: it will no longer create or execute
1841+
/// blocks
1842+
#[clap(long)]
1843+
pub halt_at_cup_height: Option<bool>,
1844+
18411845
#[clap(long)]
18421846
/// If set, this updates the instruction limit per message.
18431847
/// See the comments in `subnet_config.rs` for more details
@@ -2069,6 +2073,7 @@ impl ProposalPayload<UpdateSubnetPayload> for ProposeToUpdateSubnetCmd {
20692073
subnet_type: None,
20702074

20712075
is_halted: self.is_halted,
2076+
halt_at_cup_height: self.halt_at_cup_height,
20722077
max_instructions_per_message: self.max_instructions_per_message,
20732078
max_instructions_per_round: self.max_instructions_per_round,
20742079
max_instructions_per_install_code: self.max_instructions_per_install_code,

rs/registry/canister/canister/registry.did

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ type UpdateSubnetPayload = record {
241241
features : opt SubnetFeatures;
242242
set_gossip_config_to_default : bool;
243243
max_instructions_per_message : opt nat64;
244+
halt_at_cup_height : opt bool;
244245
pfn_evaluation_period_ms : opt nat32;
245246
subnet_id : principal;
246247
max_ingress_bytes_per_message : opt nat64;

rs/registry/canister/src/mutations/do_create_subnet.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,13 @@ use serde::Serialize;
1414

1515
use ic_base_types::{NodeId, PrincipalId, RegistryVersion, SubnetId};
1616
use ic_ic00_types::{EcdsaKeyId, SetupInitialDKGArgs, SetupInitialDKGResponse};
17-
use ic_protobuf::registry::subnet::v1::EcdsaConfig;
1817
use ic_protobuf::registry::{
1918
node::v1::NodeRecord,
20-
subnet::v1::{CatchUpPackageContents, GossipConfig, SubnetRecord},
19+
subnet::v1::{CatchUpPackageContents, EcdsaConfig, GossipConfig, SubnetRecord},
2120
};
22-
use ic_registry_keys::make_node_record_key;
2321
use ic_registry_keys::{
2422
make_catch_up_package_contents_key, make_crypto_threshold_signing_pubkey_key,
25-
make_subnet_list_record_key, make_subnet_record_key,
23+
make_node_record_key, make_subnet_list_record_key, make_subnet_record_key,
2624
};
2725
use ic_registry_subnet_features::{SubnetFeatures, DEFAULT_ECDSA_MAX_QUEUE_SIZE};
2826
use ic_registry_subnet_type::SubnetType;
@@ -331,6 +329,7 @@ impl From<CreateSubnetPayload> for SubnetRecord {
331329
subnet_type: val.subnet_type.into(),
332330

333331
is_halted: val.is_halted,
332+
halt_at_cup_height: false,
334333

335334
max_instructions_per_message: val.max_instructions_per_message,
336335
max_instructions_per_round: val.max_instructions_per_round,

0 commit comments

Comments
 (0)