This repository has been archived by the owner on Nov 19, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Specify the resource reservation mechanism (#257)
* Specify the resource reservation mechanism Context: - https://forum.dfinity.org/t/23447 - https://dashboard.internetcomputer.org/proposal/126094 This adds new fields to the management canister interface: - `reserved_cycles` to the result of `canister_status`. - `reserved_cycles_limit` to `canister_settings` and `definite_canister_settings`. The corresponding fields are also added to the abstract state: - `reserved_balances`, - `reserved_balance_limits`. Note that the naming matches the exiting naming of the main cycle balance, which is `cycles` in the management canister and `balances` in the abstract state. A new unspecified function `cycles_to_reserve` models cycle reservation for allocated resources depending on the old abstract state and the new state of the canister (and its new allocation settings). Since the reserved cycles also affect canister freezing, a new helper function called `liquid_balance` is used to compute how many cycles are available after taking the freezing limit and reserved cycles into account. * Apply suggestions from code review Co-authored-by: mraszyk <[email protected]> * Fix issues found by Martin * Add a canister id parameter to cycles_to_reserve * update changelog --------- Co-authored-by: mraszyk <[email protected]> Co-authored-by: Martin Raszyk <[email protected]>
- Loading branch information