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

Commit

Permalink
Merge branch 'master' into mraszyk/anonymous-read-state-expiry
Browse files Browse the repository at this point in the history
  • Loading branch information
mraszyk committed Oct 25, 2024
2 parents 3693184 + bed36d9 commit a18686c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions docusaurus/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions spec/_attachments/interface-spec-changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## Changelog {#changelog}

### ∞ (unreleased)

### 0.28.0 (2024-10-11) {#0_28_0}
* Add new management canister methods for canister snapshot support.

### 0.27.0 (2024-09-20) {#0_27_0}
Expand Down
12 changes: 5 additions & 7 deletions spec/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1718,7 +1718,7 @@ There must be at most one call to `ic0.call_on_cleanup` between `ic0.call_new` a

This deducts `MAX_CYCLES_PER_RESPONSE` cycles from the canister balance and sets them aside for response processing.

If the function returns `0` as the `err_code`, the IC was able to enqueue the call. In this case, the call will either be delivered, returned because the destination canister does not exist or returned because of an out of cycles condition. This also means that exactly one of the reply or reject callbacks will be executed.
If the function returns `0` as the `err_code`, the IC was able to enqueue the call. In this case, the call will either be delivered, returned because the destination canister does not exist, returned due to a lack of resources within the IC, or returned because of an out of cycles condition. This also means that exactly one of the reply or reject callbacks will be executed.

If the function returns a non-zero value, the call cannot (and will not be) performed. This can happen due to a lack of resources within the IC, but also if it would reduce the current cycle balance to a level below where the canister would be frozen.

Expand Down Expand Up @@ -7197,23 +7197,21 @@ ic0.call_peform<es>() : ( err_code : i32 ) =
if es.context ∉ {U, CQ, Ry, Rt, CRy, CRt, T} then Trap {cycles_used = es.cycles_used;}
if es.pending_call = NoPendingCall then Trap {cycles_used = es.cycles_used;}

es.balance := es.balance - MAX_CYCLES_PER_RESPONSE

// are we below the freezing threshold?
// Or maybe the system has other reasons to not perform this
if liquid_balance(es) < 0 or system_cannot_do_this_call_now()
// `system_cannot_do_this_call_now` abstracts over resource issues preventing the call from being made
if liquid_balance(es) < MAX_CYCLES_PER_RESPONSE or system_cannot_do_this_call_now()
then
discard_pending_call<es>()
return <implementation-specific>
or
es.balance := es.balance - MAX_CYCLES_PER_RESPONSE
es.calls := es.calls · es.pending_call
es.pending_call := NoPendingCall
return 0

// helper function
discard_pending_call<es>() =
if es.pending_call ≠ NoPendingCall then
es.balance := es.balance + MAX_CYCLES_PER_RESPONSE + es.pending_call.transferred_cycles
es.balance := es.balance + es.pending_call.transferred_cycles
es.pending_call := NoPendingCall

ic0.stable_size<es>() : (page_count : i32) =
Expand Down

0 comments on commit a18686c

Please sign in to comment.