Skip to content

feat: First draft of flexible http outcalls#5890

Draft
oggy-dfin wants to merge 30 commits intomasterfrom
oggy/flexible-http-outcalls
Draft

feat: First draft of flexible http outcalls#5890
oggy-dfin wants to merge 30 commits intomasterfrom
oggy/flexible-http-outcalls

Conversation

@oggy-dfin
Copy link
Copy Markdown
Contributor

@oggy-dfin oggy-dfin commented Jun 27, 2025

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:

@github-actions github-actions bot added the interface-spec Changes to the IC Interface Specification label Jun 27, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 27, 2025

🤖 Here's your preview: https://hada6-4yaaa-aaaam-abaha-cai.icp0.io

Comment thread docs/references/ic-interface-spec.md Outdated
@oggy-dfin oggy-dfin force-pushed the oggy/flexible-http-outcalls branch from 748a6ef to b40ad06 Compare September 22, 2025 12:13
Comment thread docs/references/_attachments/ic.did Outdated
Comment thread docs/references/ic-interface-spec.md
@oggy-dfin oggy-dfin force-pushed the oggy/flexible-http-outcalls branch from e14bba0 to 14a0954 Compare November 12, 2025 15:04
@oggy-dfin oggy-dfin changed the title First draft of flexible http outcalls feat: First draft of flexible http outcalls Nov 12, 2025
Comment thread docs/references/_attachments/ic.did Outdated
Comment thread docs/references/ic-interface-spec.md Outdated
Comment thread docs/references/_attachments/ic.did Outdated
Comment thread docs/references/_attachments/ic.did Outdated
Comment thread docs/references/_attachments/ic.did Outdated
Comment thread docs/references/ic-interface-spec.md Outdated
Comment thread docs/references/_attachments/ic.did
Comment thread docs/references/ic-interface-spec.md Outdated
oggy-dfin and others added 3 commits November 21, 2025 14:59
Co-authored-by: mraszyk <31483726+mraszyk@users.noreply.github.com>
Co-authored-by: mraszyk <31483726+mraszyk@users.noreply.github.com>
Co-authored-by: mraszyk <31483726+mraszyk@users.noreply.github.com>
@mihailjianu1 mihailjianu1 marked this pull request as ready for review January 28, 2026 09:50
@mihailjianu1 mihailjianu1 requested review from a team as code owners January 28, 2026 09:50
Copy link
Copy Markdown
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.

Left some more feedback.

Comment thread docs/references/_attachments/ic.did Outdated
Comment thread docs/references/_attachments/ic.did Outdated
Comment thread docs/references/ic-interface-spec.md Outdated
Comment thread docs/references/ic-interface-spec.md
Comment thread docs/references/_attachments/ic.did Outdated
Comment thread docs/references/_attachments/ic.did Outdated
Comment thread docs/references/_attachments/ic.did Outdated
Comment thread docs/references/ic-interface-spec.md
Comment thread docs/references/ic-interface-spec.md Outdated
Comment thread docs/references/ic-interface-spec.md
@mihailjianu1 mihailjianu1 marked this pull request as draft January 29, 2026 09:03
github-merge-queue bot pushed a commit to dfinity/ic that referenced this pull request Feb 24, 2026
…or flexible calls (#9001)

Extends the CanisterHttpRequestContext for flexible outcalls.

This is the very first step to enable [flexible HTTPS
outcalls](dfinity/portal#5890).
github-merge-queue bot pushed a commit to dfinity/ic that referenced this pull request Feb 24, 2026
…or flexible calls (#9001)

Extends the CanisterHttpRequestContext for flexible outcalls.

This is the very first step to enable [flexible HTTPS
outcalls](dfinity/portal#5890).
github-merge-queue bot pushed a commit to dfinity/ic that referenced this pull request Mar 3, 2026
#9090)

Adds the error types for flexible outcalls according to the draft spec
(dfinity/portal#5890).
Comment thread docs/references/_attachments/ic.did Outdated
github-merge-queue bot pushed a commit to dfinity/ic that referenced this pull request Mar 27, 2026
…g payload for flexible outcall (#9572)

Adapts the HTTP outcalls payload builder for flexible calls to filter
out reject responses when trying to find a viable ok-response group.

Currently, `find_flexible_responses` picks up responses from the pool
via `get_response_content_by_hash`, which returns the full
`CanisterHttpResponse` including `Reject` content. It doesn't filter by
content type -- any response from a valid committee member gets
included, whether `Success` or `Reject`.

According to the [spec](dfinity/portal#5890) an
`ok` result is `vec http_request_result` (status, headers, body). A
`Reject` can't be meaningfully represented as an `http_request_result`.
The canister called `flexible_http_request` to get HTTP responses: a
node that couldn't reach the server didn't produce a useful HTTP
response.

The `min_responses` threshold still applies after filtering -- if too
many nodes produced `Reject` and we can't reach `min_responses`
successes, the group isn't included and the request will eventually time
out.

In a follow-up PR, to aid with debugging, we will adapt the payload
builder to include `Reject` responses in the `node_details` of the
[flexible_http_request_err](https://github.com/dfinity/portal/pull/5890/changes#diff-0e66a818a5739ab2c506ec15a9b9e83c5851f14d1f8416b79a130899e547d463R105)
whenever a call to `flexible_http_request` times out.

---------

Co-authored-by: IDX GitHub Automation <infra+github-automation@dfinity.org>
github-merge-queue bot pushed a commit to dfinity/ic that referenced this pull request Mar 27, 2026
…g payload for flexible outcall (#9572)

Adapts the HTTP outcalls payload builder for flexible calls to filter
out reject responses when trying to find a viable ok-response group.

Currently, `find_flexible_responses` picks up responses from the pool
via `get_response_content_by_hash`, which returns the full
`CanisterHttpResponse` including `Reject` content. It doesn't filter by
content type -- any response from a valid committee member gets
included, whether `Success` or `Reject`.

According to the [spec](dfinity/portal#5890) an
`ok` result is `vec http_request_result` (status, headers, body). A
`Reject` can't be meaningfully represented as an `http_request_result`.
The canister called `flexible_http_request` to get HTTP responses: a
node that couldn't reach the server didn't produce a useful HTTP
response.

The `min_responses` threshold still applies after filtering -- if too
many nodes produced `Reject` and we can't reach `min_responses`
successes, the group isn't included and the request will eventually time
out.

In a follow-up PR, to aid with debugging, we will adapt the payload
builder to include `Reject` responses in the `node_details` of the
[flexible_http_request_err](https://github.com/dfinity/portal/pull/5890/changes#diff-0e66a818a5739ab2c506ec15a9b9e83c5851f14d1f8416b79a130899e547d463R105)
whenever a call to `flexible_http_request` times out.

---------

Co-authored-by: IDX GitHub Automation <infra+github-automation@dfinity.org>
github-merge-queue bot pushed a commit to dfinity/ic that referenced this pull request Mar 27, 2026
…g payload for flexible outcall (#9572)

Adapts the HTTP outcalls payload builder for flexible calls to filter
out reject responses when trying to find a viable ok-response group.

Currently, `find_flexible_responses` picks up responses from the pool
via `get_response_content_by_hash`, which returns the full
`CanisterHttpResponse` including `Reject` content. It doesn't filter by
content type -- any response from a valid committee member gets
included, whether `Success` or `Reject`.

According to the [spec](dfinity/portal#5890) an
`ok` result is `vec http_request_result` (status, headers, body). A
`Reject` can't be meaningfully represented as an `http_request_result`.
The canister called `flexible_http_request` to get HTTP responses: a
node that couldn't reach the server didn't produce a useful HTTP
response.

The `min_responses` threshold still applies after filtering -- if too
many nodes produced `Reject` and we can't reach `min_responses`
successes, the group isn't included and the request will eventually time
out.

In a follow-up PR, to aid with debugging, we will adapt the payload
builder to include `Reject` responses in the `node_details` of the
[flexible_http_request_err](https://github.com/dfinity/portal/pull/5890/changes#diff-0e66a818a5739ab2c506ec15a9b9e83c5851f14d1f8416b79a130899e547d463R105)
whenever a call to `flexible_http_request` times out.

---------

Co-authored-by: IDX GitHub Automation <infra+github-automation@dfinity.org>
};

type flexible_http_request_err = record {
global_error: opt variant {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I discussed with @gregorydemay that we add yet another global error tag too_many_rejects, which would occur if more than total_requests - min_responses responses from the HTTP adapters are reject responses (e.g., DNS/connection issues).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

interface-spec Changes to the IC Interface Specification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants