Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update const value for reserved instructions for install code #469

Merged
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
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