Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 5d0f121

Browse files
committed
check freezing limit before canister installation
1 parent 9465a59 commit 5d0f121

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

spec/index.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3822,6 +3822,17 @@ Env = {
38223822
}
38233823
Mod.init(A.canister_id, A.arg, M.caller, Env) = Return {new_state = New_state; new_certified_data = New_certified_data; new_global_timer = New_global_timer; cycles_used = Cycles_used;}
38243824

3825+
freezing_limit(
3826+
S.compute_allocation[A.canister_id],
3827+
S.memory_allocation[A.canister_id],
3828+
S.freezing_threshold[A.canister_id],
3829+
memory_usage(
3830+
S.canisters[A.canister_id].wasm_state,
3831+
S.canisters[A.canister_id].raw_module,
3832+
S.canister_history[A.canister_id],
3833+
),
3834+
S.canister_subnet[A.canister_id].subnet_size,
3835+
) + MAX_CYCLES_PER_MESSAGE ≤ S.balances[A.canister_id]
38253836
freezing_limit(
38263837
S.compute_allocation[A.canister_id],
38273838
S.memory_allocation[A.canister_id],
@@ -3941,6 +3952,28 @@ Env2 = Env with {
39413952
}
39423953
Mod.post_upgrade(A.canister_id, Stable_memory, A.arg, M.caller, Env2) = Return {new_state = New_state; new_certified_data = New_certified_data'; new_global_timer = New_global_timer; cycles_used = Cycles_used';}
39433954

3955+
freezing_limit(
3956+
S.compute_allocation[A.canister_id],
3957+
S.memory_allocation[A.canister_id],
3958+
S.freezing_threshold[A.canister_id],
3959+
memory_usage(
3960+
S.canisters[A.canister_id].wasm_state,
3961+
S.canisters[A.canister_id].raw_module,
3962+
S.canister_history[A.canister_id],
3963+
),
3964+
S.canister_subnet[A.canister_id].subnet_size,
3965+
) + MAX_CYCLES_PER_MESSAGE ≤ S.balances[A.canister_id]
3966+
freezing_limit(
3967+
S.compute_allocation[A.canister_id],
3968+
S.memory_allocation[A.canister_id],
3969+
S.freezing_threshold[A.canister_id],
3970+
memory_usage(
3971+
New_state,
3972+
A.wasm_module,
3973+
New_canister_history
3974+
),
3975+
S.canister_subnet[A.canister_id].subnet_size,
3976+
) + MAX_CYCLES_PER_MESSAGE ≤ S.balances[A.canister_id]
39443977
freezing_limit(
39453978
S.compute_allocation[A.canister_id],
39463979
S.memory_allocation[A.canister_id],

0 commit comments

Comments
 (0)