Skip to content

Commit

Permalink
update const value for reserved instructions for install code
Browse files Browse the repository at this point in the history
  • Loading branch information
ravi-sawlani-yral committed Nov 22, 2024
1 parent 2a96388 commit 665eb54
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib/shared_utils/src/constant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub const COST_PER_BILLION_INSTRUCTION_EXECUTED: u128 = 1_000_000_000; //1B cycl
pub const ASSUMED_NUMBER_OF_INGRESS_CALL_PER_DAY: u128 = 10;
pub const ASSUMED_BYTES_PER_INGRESS_CALL: u128 = 100; // 100 bytes
pub const ASSUMED_NUMBER_OF_INSTRUCTIONS_PER_INGRESS_CALL: u128 = 5_000_000_000; //5B instructions (no matter the number of instructions executed 5B is reserved)
pub const RESERVED_NUMBER_OF_INSTRUCTIONS_FOR_INSTALL_CODE: u128 = 200_000_000_000; //200B instructions
pub const RESERVED_NUMBER_OF_INSTRUCTIONS_FOR_INSTALL_CODE: u128 = 300_000_000_000; //200B instructions
pub const THRESHOLD_NUMBER_OF_DAYS_TO_KEEP_CANISTER_RUNNING: u128 = 1;
pub const MAX_NUMBER_OF_DAYS_TO_KEEP_CANISTER_RUNNING: u128 = 7;

Expand Down
3 changes: 1 addition & 2 deletions src/lib/shared_utils/src/cycles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ pub fn calculate_required_cycles_for_upgrading(
* COST_PER_BILLION_INSTRUCTION_EXECUTED)
/ 1_000_000_000);

//100B cycles to safeguard the upgrade process
freezing_threshold_cycles + cycles_required_for_upgrade_execution + 100_000_000_000
freezing_threshold_cycles + cycles_required_for_upgrade_execution
}

#[cfg(test)]
Expand Down

0 comments on commit 665eb54

Please sign in to comment.