Skip to content

feat(outcalls): add flexible outcalls endpoint#7615

Merged
mihailjianu1 merged 21 commits intomasterfrom
mihailjianu1/outcalls-flexible-endpoint
Feb 3, 2026
Merged

feat(outcalls): add flexible outcalls endpoint#7615
mihailjianu1 merged 21 commits intomasterfrom
mihailjianu1/outcalls-flexible-endpoint

Conversation

@mihailjianu1
Copy link
Contributor

@mihailjianu1 mihailjianu1 commented Nov 10, 2025

This PR adds a new FlexibleHttpRequest as an Ic00 method. Making a well formatted request to it will result in a "Not implemented" error. In the future, this API will return a list of responses. The candid of the request has the following structure:

record {
   url : text;
   headers : vec http_header;
   method : variant { get; head; post };
   body : opt blob;
   transform : opt record {
      function : func (record {response : http_response; context : blob}) -> (http_response) query;
      context : blob;
   };
   replication: opt record {
      min_responses: nat64;
      max_responses: nat64;
      total_requests: nat64;
   };
}

compared to the current one used for fully replicated requests:

record {
   url : text;
   max_response_bytes : opt nat64;
   headers : vec http_header;
   method : variant { get; head; post };
   body : opt blob;
   transform : opt record {
     function : func (record {response : http_response; context : blob}) -> (http_response) query;
     context : blob;
   };
   is_replicated : opt bool;
   pricing_version : opt nat32;
}

Explanation of the differences:

  • addition of total_requests: opt nat32: this field specifies how many replicas should attempt the outcall (making the API "flexible"). If missing, it defaults to the replication factor. It's also the replication factor for fully replicated requests (ie all replicas attempt the outcall)
  • addition of min_responses : opt nat32: this field specifies the minimum number of responses that should be contained in the response. This field is non-sensical for fully replicated requests, as they have unique responses
  • addition of max_responses: opt nat32: same as min_responses, but specifies the (inclusive) upper limit.
  • removal of is_replicated. This information is already contained in the above three parameters. if is_replicated = Some(false), this corresponds to (total_requests = N, min_responses = 1, max_responses = 1).
  • removal of pricing_version. we will implement flexible outcalls with the "pay-as-you-go" pricing model from the beginning, so there is (currently) no need for maintaining multiple pricing versions.
  • removal of max_response_bytes: that parameter is no longer used with the pay-as-you-go pricing model

The candid of the response has not been introduced in the PR, as it's not being created anywhere yet. We'll introduce it once it's created

@github-actions github-actions bot added the feat label Nov 10, 2025
@mihailjianu1 mihailjianu1 marked this pull request as draft November 19, 2025 14:03
@mihailjianu1 mihailjianu1 marked this pull request as ready for review January 19, 2026 15:59
Copy link
Contributor

@mraszyk mraszyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also (eventually) include the new method and its candid types in rs/types/management_canister_types/tests/{candid_equality.rs,ic.did}.

@mihailjianu1 mihailjianu1 added this pull request to the merge queue Feb 3, 2026
Merged via the queue into master with commit 3084026 Feb 3, 2026
39 checks passed
@mihailjianu1 mihailjianu1 deleted the mihailjianu1/outcalls-flexible-endpoint branch February 3, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants