You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ic0.cost_sign_with_ecdsa : (src : I, size : I, ecdsa_curve: i32, dst : I) -> i32; // * s
1573
1576
ic0.cost_sign_with_schnorr : (src : I, size : I, algorithm: i32, dst : I) -> i32; // * s
1574
1577
ic0.cost_vetkd_derive_key : (src : I, size : I, vetkd_curve: i32, dst : I) -> i32; // * s
@@ -1749,9 +1752,10 @@ A canister can learn about its own identity:
1749
1752
1750
1753
A canister can learn about the subnet it is running on:
1751
1754
1752
-
-`ic0.subnet_self_size : () → I` and `ic0.subnet_self_copy: (dst : I, offset : I, size : I) → ()`; `I ∈ {i32, i64}`
1755
+
-`ic0.subnet_self_size : () → I`, `ic0.subnet_self_copy: (dst : I, offset : I, size : I) → ()`; `I ∈ {i32, i64}`, and `ic0.subnet_self_replica_count : () -> i32`
1756
+
1757
+
These functions allow the canister to query the subnet id (as a blob) of the subnet on which the canister is running, and to retrieve the number of replicas that are currently on the subnet.
1753
1758
1754
-
These functions allow the canister to query the subnet id (as a blob) of the subnet on which the canister is running.
1755
1759
1756
1760
### Canister status {#system-api-canister-status}
1757
1761
@@ -2164,6 +2168,10 @@ These system calls return costs in Cycles, represented by 128 bits, which will b
2164
2168
2165
2169
`max_res_bytes` is the maximum response length the caller wishes to accept (the caller should provide the default value of `2,000,000` if no maximum response length is provided in the actual request to the management canister).
The cost of a canister http outcall via [`flexible_http_request`](#ic-flexible_http_request). The `request_size` is same as for `cost_http_request` and covers the url, headers, body and transform. The `replica_count` is the number to be used in the call to `flexible_http_request`.
2174
+
2167
2175
-`ic0.cost_sign_with_ecdsa(src : I, size : I, ecdsa_curve: i32, dst : I) -> i32`; `I ∈ {i32, i64}`
2168
2176
2169
2177
-`ic0.cost_sign_with_schnorr(src : I, size : I, algorithm: i32, dst : I) -> i32`; `I ∈ {i32, i64}`
@@ -2820,6 +2828,34 @@ If you do not specify the `max_response_bytes` parameter, the maximum of a `2MB`
2820
2828
2821
2829
:::
2822
2830
2831
+
### IC method `flexible_http_request` {#ic-flexible_http_request}
2832
+
2833
+
This is a variant of the [`http_request`](#ic-http_request) method that allows the caller to select how many IC replicas issue the request, and returns potentially multiple responses instead of a single one, one from each replica issuing the request. Use cases include calling HTTP endpoints that provide rapidly changing information, calling non-idempotent endpoints (by issuing the request from a single replica only), calling endpoints that provide signed data whose authenticity can be checked without trusting the endpoint, and letting the user pick a trade-off between cheaper calls (fewer replicas responding) and stronger integrity guarantees (more replicas responding).
2834
+
2835
+
The arguments of the call are as for `http_request`, except that:
2836
+
2837
+
- there is an additional argument `responses_from`, which can be set to either `all_replicas` or to a particular `replica_count` with a given (positive) number of replicas. The number of replicas must not exceed the subnet size.
2838
+
2839
+
-`max_response_bytes` argument is not needed.
2840
+
2841
+
The other arguments, `url`, `method`, `headers`, `body`, and `transform` are the same as for `http_request`. The result is a vector of responses, with each individual response having the same structure as a `http_request` response, providing `status`, `headers`, and `body` fields.
2842
+
2843
+
As for `http_request`, the endpoint specified by the provided `url` should be idempotent. The one exception is when a `replica_count` of 1 is used in `responses_from`. The request restrictions are also the same as for the `http_request` method:
2844
+
2845
+
- The total number of bytes in the request must not exceed `2MB` (`2,000,000`) bytes.
2846
+
2847
+
- Only the `GET`, `HEAD`, and `POST` methods are supported.
2848
+
2849
+
- The number of headers must not exceed `64`.
2850
+
2851
+
- The number of bytes representing a header name or value must not exceed `8KiB`.
2852
+
2853
+
- The total number of bytes representing the header names and values must not exceed `48KiB`.
2854
+
2855
+
The response from the remote server must not exceed `2MB`. Moreover, the total size of the result, that is, the sum of the responses returned by the different replicas (possibly after the transform function), must also not exceed 2MB.
2856
+
2857
+
Cycles to pay for the call must be explicitly transferred with the call, i.e., they are not automatically deducted from the caller's balance implicitly (e.g., as for inter-canister calls). The upfront cycles cost covers a call that maxes out the resource usage during processing, for example, hitting the `2MB` limit on the size of the response. The unused cycles are then refunded to the caller.
2858
+
2823
2859
### IC method `node_metrics_history` {#ic-node_metrics_history}
2824
2860
2825
2861
This method can only be called by canisters, i.e., it cannot be called by external users via ingress messages.
0 commit comments