-
Notifications
You must be signed in to change notification settings - Fork 447
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
Tidy up inter-canister calls #3881
base: master
Are you sure you want to change the base?
Conversation
Strengthen the specification of `ic0.call_perform` as discussed in the interface spec meeting. Also unify the naming of reject codes (previously was also "rejection code").
FIY @lwshang |
🤖 Here's your preview: https://c3z4p-2iaaa-aaaam-abaya-cai.icp0.io |
Co-authored-by: mraszyk <31483726+mraszyk@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consistent with discussion in the interface spec meeting, thanks Oggy!
@@ -1757,9 +1757,9 @@ 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, 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. | |||
The returned `err_code` is always one of `0`, `1`, `2`, and `3`. An `err_code` of `0` means that no error occurred and that the IC could 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The returned
err_code
is always one of0
,1
,2
, and3
.
Are we sure that the implementation does not start producing the new code 6
for "unknown" in some cases in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well we obviously can never be sure that the implementation won't start ignoring the spec but I can't think of a reason why a synchronous error would be raised for unknown reasons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussion in the interface spec meeting:
- Currently there is inconsistent behavior in messages sent to the IC management canister, where in case of an invalid candid payload, the canister would trap. (Which is inconsistent with what happens if invalid candid is sent to another canister.)
- For the same case for ingress messages, we would fail with a
4
. - If we ever wanted to clean up this behavior, this would mean we would want to return a
4
synchronously.
Strengthen the specification of
ic0.call_perform
as discussed in the interface spec meeting. Also unify the naming of reject codes (previously was also "rejection code").Thank you for your contribution to the IC Developer Portal. This repo contains the content for https://internetcomputer.org and the ICP Developer Documentation, https://internetcomputer.org/docs/.
If you are submitting a Pull Request for adding or changing content on the ICP Developer Documentation, please make sure that your contribution meets the following requirements:
.mdx
file format to support the previous two components./sidebars.js
, otherwise, it will not appear in theside navigation bar.
.github/CODEOWNERS
file isfilled with new documents that you added. This way we can ensure that future Pull Requests are reviewed by the right people.