Skip to content

Commit

Permalink
feat: textual description of ic0.msg_method_name_size and ic0.msg_met…
Browse files Browse the repository at this point in the history
…hod_name_copy (#3908)
  • Loading branch information
mraszyk authored Dec 20, 2024
1 parent b718fd1 commit 53b36d6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/references/ic-interface-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -1631,6 +1631,8 @@ This can be invoked multiple times within the same message execution to build up

A canister can inspect ingress messages before executing them. When the IC receives an update call from a user, the IC will use the canister method `canister_inspect_message` to determine whether the message shall be accepted. If the canister is empty (i.e. does not have a Wasm module), then the ingress message will be rejected. If the canister is not empty and does not implement `canister_inspect_message`, then the ingress message will be accepted.

In `canister_inspect_message`, the canister can determine the name of the method called by the message using `ic0.msg_method_name_size : () → I` and `ic0.msg_method_name_copy : (dst : I, offset : I, size : I) → ()`; `I ∈ {i32, i64}`.

In `canister_inspect_message`, the canister can accept the message by invoking `ic0.accept_message : () → ()`. This function traps if invoked twice. If the canister traps in `canister_inspect_message` or does not call `ic0.accept_message`, then the access is denied.

:::note
Expand Down

0 comments on commit 53b36d6

Please sign in to comment.