Skip to content

feat(http-outcalls): CON-1686 disregard reject responses when building payload for flexible outcall#9572

Merged
fspreiss merged 8 commits into
masterfrom
fspreiss/CON-1686-disregard-rejects-in-flex-payload-building
Mar 27, 2026
Merged

feat(http-outcalls): CON-1686 disregard reject responses when building payload for flexible outcall#9572
fspreiss merged 8 commits into
masterfrom
fspreiss/CON-1686-disregard-rejects-in-flex-payload-building

Conversation

@fspreiss
Copy link
Copy Markdown
Contributor

@fspreiss fspreiss commented Mar 24, 2026

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 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 whenever a call to flexible_http_request times out.

@github-actions github-actions Bot added the feat label Mar 24, 2026
@fspreiss fspreiss marked this pull request as ready for review March 26, 2026 13:19
@fspreiss fspreiss requested a review from a team as a code owner March 26, 2026 13:19
@fspreiss fspreiss requested a review from eichhorl March 26, 2026 13:19
Copy link
Copy Markdown
Contributor

@eichhorl eichhorl left a comment

Choose a reason for hiding this comment

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

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 whenever a call to flexible_http_request times out.

I guess alternatively we could already produce a response as soon as we have more than n-min reject responses? Because we would never receive enough success responses.

Comment thread rs/https_outcalls/consensus/src/payload_builder/utils.rs
@fspreiss fspreiss added this pull request to the merge queue Mar 27, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Mar 27, 2026
@fspreiss fspreiss added this pull request to the merge queue Mar 27, 2026
Merged via the queue into master with commit b5fd267 Mar 27, 2026
38 checks passed
@fspreiss fspreiss deleted the fspreiss/CON-1686-disregard-rejects-in-flex-payload-building branch March 27, 2026 15:28
github-merge-queue Bot pushed a commit that referenced this pull request Mar 28, 2026
…cution (#9564)

Implements the `IntoMessages` path for flexible HTTP outcall
ok-responses, converting each `FlexibleCanisterHttpResponses` group from
the consensus payload into a single Candid-encoded `ConsensusResponse`
for delivery to the execution environment.

For each flexible response group, the individual
`CanisterHttpResponsePayloads` (already Candid-encoded by the HTTP
adapter) are decoded, collected into a `Vec`, wrapped in
`FlexibleHttpRequestResult::Ok(vec![...])`, and re-encoded as a single
`Payload::Data` for the canister callback.

Reject entries (infrastructure-level failures like DNS/network errors)
are filtered out as this path is unrechable due to payload
building/validation ensuring that no reject responses are included in
the ok-payload (see #9572).

If Candid decoding or encoding fails, the delivery of the response is
skipped and a timeout will eventually gracefully end the outstanding
callback.

---------

Co-authored-by: IDX GitHub Automation <infra+github-automation@dfinity.org>
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.

2 participants