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

Specify the resource reservation mechanism #257

Merged
merged 6 commits into from
Dec 5, 2023
Merged

Specify the resource reservation mechanism #257

merged 6 commits into from
Dec 5, 2023

Conversation

ulan
Copy link
Contributor

@ulan ulan commented Nov 28, 2023

Context:

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.

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.
@ulan ulan requested a review from a team as a code owner November 28, 2023 13:52
spec/index.md Show resolved Hide resolved
spec/index.md Outdated Show resolved Hide resolved
spec/index.md Outdated Show resolved Hide resolved
spec/index.md Outdated Show resolved Hide resolved
spec/index.md Outdated Show resolved Hide resolved
spec/index.md Outdated Show resolved Hide resolved
spec/index.md Outdated Show resolved Hide resolved
spec/index.md Outdated Show resolved Hide resolved
spec/index.md Outdated Show resolved Hide resolved
spec/index.md Outdated Show resolved Hide resolved
spec/index.md Outdated Show resolved Hide resolved
spec/index.md Show resolved Hide resolved
spec/index.md Outdated Show resolved Hide resolved
spec/index.md Outdated Show resolved Hide resolved
spec/index.md Outdated Show resolved Hide resolved
spec/index.md Show resolved Hide resolved
spec/index.md Show resolved Hide resolved
spec/index.md Outdated Show resolved Hide resolved
spec/index.md Outdated Show resolved Hide resolved
@ulan
Copy link
Contributor Author

ulan commented Nov 29, 2023

Thanks @mraszyk for the thorough review. I applied your suggestions. I agree with your comments and will try to address them this week.

spec/index.md Show resolved Hide resolved
@mraszyk mraszyk merged commit b5d4d61 into master Dec 5, 2023
4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants