Skip to content

Comments

feat(flexible-outcalls): IC-1947 generate CanisterHttpRequestContext from flexible args#9019

Open
fspreiss wants to merge 3 commits intomasterfrom
fspreiss/flex-outcalls-generate-context-from-flexible-args
Open

feat(flexible-outcalls): IC-1947 generate CanisterHttpRequestContext from flexible args#9019
fspreiss wants to merge 3 commits intomasterfrom
fspreiss/flex-outcalls-generate-context-from-flexible-args

Conversation

@fspreiss
Copy link
Contributor

Adds generate_from_flexible_args constructor to CanisterHttpRequestContext that builds a context from the new FlexibleCanisterHttpRequestArgs with a randomly-selected node committee and configurable min_responses / max_responses counts.

Validates ReplicationCounts invariants (1 <= total_requests <= N, 0 <= min_responses <= max_responses <= total_requests) and default to total_requests = N, min_responses = floor(2N/3) + 1, max_responses = N when no replication config is provided.

Refactors shared validation logic (validate_transform_principal, validate_url_length) out of the existing new constructor so both generate_from_args and generate_from_flexible_args reuse the same checks, and simplifies the non-replicated node selection using rand::seq::IteratorRandom::choose.

@github-actions github-actions bot added the feat label Feb 24, 2026
@fspreiss fspreiss marked this pull request as ready for review February 24, 2026 06:55
@fspreiss fspreiss requested review from a team as code owners February 24, 2026 06:55
@fspreiss fspreiss requested a review from eichhorl February 24, 2026 06:55
@fspreiss fspreiss changed the title feat(flexible-outcalls): CON-1947 generate CanisterHttpRequestContext from flexible args feat(flexible-outcalls): IC-1947 generate CanisterHttpRequestContext from flexible args Feb 24, 2026
Base automatically changed from fspreiss/CON-1640-flex-outcalls-extend-context to master February 24, 2026 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant