Skip to content

Commit 329b385

Browse files
Merge branch 'master' into delete-ENABLE_CREATE_CANISTER_AND_INSTALL_CODE_PROPOSALS-daniel-wong
2 parents e6d9bd5 + 5da0d5f commit 329b385

94 files changed

Lines changed: 2771 additions & 1681 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.lock

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ic-os/guestos/context/Dockerfile.base

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,8 @@ COPY packages.* /tmp/
6262
RUN apt-get -y update && \
6363
apt-get -y upgrade && \
6464
apt-get -y --no-install-recommends install $(for P in ${PACKAGE_FILES}; do cat /tmp/$P | sed -e "s/#.*//" ; done) \
65-
# TODO(NODE-1852): Temporarily pin the kernel here.
66-
# ${_KERNEL_PACKAGE} \
67-
# linux-modules-extra-$(apt-cache depends ${_KERNEL_PACKAGE} | sed -n -e 's/ Depends: linux-image-\(.*\)-generic/\1/p')-generic && \
68-
linux-image-6.14.0-37-generic linux-modules-extra-6.14.0-37-generic && \
65+
${_KERNEL_PACKAGE} \
66+
linux-modules-extra-$(apt-cache depends ${_KERNEL_PACKAGE} | sed -n -e 's/ Depends: linux-image-\(.*\)-generic/\1/p')-generic && \
6967
rm /tmp/packages.*
7068

7169
# Install node_exporter

mainnet-canister-revisions.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@
6868
"sha256": "bce508df3db43b47b158c0aab9a7c9a3709a78e055a7ced76d5ff89832f9e778"
6969
},
7070
"governance": {
71-
"rev": "b904c9dd1bdef8841bd12f03efbc71180a015e25",
72-
"sha256": "bae2c5741b1ff9a5ad67b6d91b6c0945cfdbffd57349614346cd29f32aa3e637"
71+
"rev": "021bf342f66296d5605b355a61b2430406a83783",
72+
"sha256": "c66ff7d948ff79a826e61eab9e11714082d93a45e42f3b7deec1c2377341285f"
7373
},
7474
"governance-canister_test": {
75-
"rev": "b904c9dd1bdef8841bd12f03efbc71180a015e25",
76-
"sha256": "4b339f28e589d6ed42cf56b46b253485167d7be687e6cac46012f68d8b48812b"
75+
"rev": "021bf342f66296d5605b355a61b2430406a83783",
76+
"sha256": "dfce35eed2811d7e2b303785868cf9d87e40e37a40fc7c4a76c50eefec57fd32"
7777
},
7878
"index": {
7979
"rev": "3ae3649a2366aaca83404b692fc58e4c6e604a25",
@@ -104,8 +104,8 @@
104104
"tag": "proposal-141231"
105105
},
106106
"node-rewards": {
107-
"rev": "d17cf0bcd330e94f868cc7d19d0ac860cbe64198",
108-
"sha256": "da1f1f9ec646bfe4a50f2ec06111b57845b549a2d86d27c31eab138965f29a58"
107+
"rev": "ea86e66305668654c6699f182dc69f547af7106a",
108+
"sha256": "a8213923e423e32f1b62cf5588fa6504e9d8689b4fe86ca520b5e8a77d8f1359"
109109
},
110110
"registry": {
111111
"rev": "2450f6dd9beb5e2049a7b201e7b54f28e9d63815",

packages/pocket-ic/tests/tests.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3497,6 +3497,26 @@ fn default_cost_schedule_on_cloud_engine() {
34973497
let _pic = PocketIcBuilder::new_with_config(config).build();
34983498
}
34993499

3500+
#[test]
3501+
fn cloud_engine_with_registry() {
3502+
// Regression test: creating a cloud engine subnet with the registry ICP feature enabled
3503+
// must not trigger the registry invariant check failure
3504+
// "is a cloud engine subnet but some nodes do not have reward type 4".
3505+
let icp_features = IcpFeatures {
3506+
registry: Some(IcpFeaturesConfig::DefaultConfig),
3507+
..Default::default()
3508+
};
3509+
let subnet_spec = SubnetSpec::default().with_cost_schedule(CanisterCyclesCostSchedule::Free);
3510+
let config = ExtendedSubnetConfigSet {
3511+
nns: Some(SubnetSpec::default()),
3512+
cloud_engine: vec![subnet_spec],
3513+
..Default::default()
3514+
};
3515+
let _pic = PocketIcBuilder::new_with_config(config)
3516+
.with_icp_features(icp_features)
3517+
.build();
3518+
}
3519+
35003520
#[test]
35013521
fn cloud_engine_default_effective_canister_id() {
35023522
// Create a PocketIC instance with a single (cloud) engine and NNS subnet.

rs/artifact_pool/src/canister_http_pool.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ mod tests {
263263
id: CallbackId::from(id),
264264
content_hash: CryptoHashOf::from(CryptoHash(vec![1, 2, 3])),
265265
content_size: 42,
266+
is_reject: false,
266267
registry_version: RegistryVersion::from(id),
267268
replica_version: ReplicaVersion::default(),
268269
},

rs/config/src/subnet_config.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ pub const MAX_MESSAGE_DURATION_BEFORE_WARN_IN_SECONDS: f64 = 5.0;
108108
///
109109
const MAX_PAUSED_EXECUTIONS: usize = 4;
110110

111+
/// Cost for creating a new canister.
112+
pub const CANISTER_CREATION_FEE: Cycles = Cycles::new(500_000_000_000);
113+
111114
/// 10B cycles corresponds to 1 SDR cent. Assuming we can create 1 signature per
112115
/// second, that would come to 26k SDR per month if we spent the whole time
113116
/// creating signatures. At 13 nodes and 2k SDR per node per month this would
@@ -458,7 +461,7 @@ impl CyclesAccountManagerConfig {
458461
let ten_update_instructions_execution_fee_in_cycles = 10;
459462
Self {
460463
reference_subnet_size: DEFAULT_REFERENCE_SUBNET_SIZE,
461-
canister_creation_fee: Cycles::new(500_000_000_000),
464+
canister_creation_fee: CANISTER_CREATION_FEE,
462465
compute_percent_allocated_per_second_fee: Cycles::new(10_000_000),
463466

464467
// The following fields are set based on a thought experiment where

rs/execution_environment/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ rust_library(
2929
"//rs/query_stats",
3030
"//rs/registry/provisional_whitelist",
3131
"//rs/registry/resource_limits",
32+
"//rs/registry/routing_table",
3233
"//rs/registry/subnet_type",
3334
"//rs/replicated_state",
3435
"//rs/state_layout",

rs/execution_environment/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ ic-metrics = { path = "../monitoring/metrics" }
2727
ic-query-stats = { path = "../query_stats" }
2828
ic-registry-provisional-whitelist = { path = "../registry/provisional_whitelist" }
2929
ic-registry-resource-limits = { path = "../registry/resource_limits" }
30+
ic-registry-routing-table = { path = "../registry/routing_table" }
3031
ic-registry-subnet-type = { path = "../registry/subnet_type" }
3132
ic-replicated-state = { path = "../replicated_state" }
3233
ic-state-layout = { path = "../state_layout" }
@@ -67,7 +68,6 @@ ic-crypto-sha2 = { path = "../crypto/sha2" }
6768
ic-crypto-test-utils-vetkd = { path = "../crypto/test_utils/vetkd" }
6869
ic-interfaces-state-manager-mocks = { path = "../interfaces/state_manager/mocks" }
6970
ic-nns-constants = { path = "../nns/constants" }
70-
ic-registry-routing-table = { path = "../registry/routing_table" }
7171
ic-registry-subnet-features = { path = "../registry/subnet_features" }
7272
ic-state-machine-tests = { path = "../state_machine_tests" }
7373
ic-test-utilities = { path = "../test_utilities" }

rs/execution_environment/src/canister_manager.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2337,6 +2337,12 @@ impl CanisterManager {
23372337
round_limits,
23382338
compilation_cost_handling,
23392339
);
2340+
debug_assert!(
2341+
instructions_for_execution <= prepaid_execution_instructions,
2342+
"instructions_for_execution {:?} exceeds prepaid_execution_instructions {:?}",
2343+
instructions_for_execution,
2344+
prepaid_execution_instructions,
2345+
);
23402346
let instructions_to_refund =
23412347
prepaid_execution_instructions.saturating_sub(&instructions_for_execution);
23422348
self.cycles_account_manager.refund_unused_execution_cycles(

rs/execution_environment/src/canister_manager/tests.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use ic_config::{
2525
SUBNET_MEMORY_RESERVATION, TEST_DEFAULT_LOG_MEMORY_USAGE,
2626
},
2727
flag_status::FlagStatus,
28-
subnet_config::SchedulerConfig,
28+
subnet_config::{CANISTER_CREATION_FEE, SchedulerConfig},
2929
};
3030
use ic_cycles_account_manager::{CyclesAccountManager, ResourceSaturation};
3131
use ic_embedders::{
@@ -7263,7 +7263,7 @@ fn create_canister_free() {
72637263
.canister_metrics()
72647264
.consumed_cycles()
72657265
.get(),
7266-
0
7266+
CANISTER_CREATION_FEE.get()
72677267
);
72687268
assert_eq!(canister.system_state.balance(), *INITIAL_CYCLES);
72697269
}
@@ -7296,7 +7296,7 @@ fn create_canister_as_subnet_admin_succeeds_on_free_cost_schedule() {
72967296
.canister_metrics()
72977297
.consumed_cycles()
72987298
.get(),
7299-
0
7299+
CANISTER_CREATION_FEE.get()
73007300
);
73017301
assert_eq!(canister.system_state.balance(), Cycles::new(0));
73027302
}

0 commit comments

Comments
 (0)