This repository has been archived by the owner on Nov 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Specify the resource reservation mechanism #257
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
mraszyk
reviewed
Nov 28, 2023
mraszyk
reviewed
Nov 28, 2023
mraszyk
reviewed
Nov 28, 2023
mraszyk
reviewed
Nov 28, 2023
mraszyk
reviewed
Nov 28, 2023
mraszyk
reviewed
Nov 28, 2023
mraszyk
reviewed
Nov 28, 2023
mraszyk
reviewed
Nov 28, 2023
mraszyk
reviewed
Nov 28, 2023
mraszyk
reviewed
Nov 28, 2023
mraszyk
reviewed
Nov 28, 2023
mraszyk
reviewed
Nov 28, 2023
mraszyk
reviewed
Nov 28, 2023
mraszyk
reviewed
Nov 28, 2023
mraszyk
reviewed
Nov 28, 2023
mraszyk
reviewed
Nov 28, 2023
mraszyk
reviewed
Nov 28, 2023
mraszyk
reviewed
Nov 28, 2023
mraszyk
reviewed
Nov 28, 2023
Co-authored-by: mraszyk <[email protected]>
Thanks @mraszyk for the thorough review. I applied your suggestions. I agree with your comments and will try to address them this week. |
ulan
commented
Dec 4, 2023
Dfinity-Bjoern
approved these changes
Dec 5, 2023
2 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context:
This adds new fields to the management canister interface:
reserved_cycles
to the result ofcanister_status
.reserved_cycles_limit
tocanister_settings
anddefinite_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 andbalances
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.