Skip to content

feat: Enable flexible HTTP outcalls on free and system subnets#10829

Merged
eichhorl merged 12 commits into
masterfrom
eichhorl/enable-flexible-on-free
Jul 21, 2026
Merged

feat: Enable flexible HTTP outcalls on free and system subnets#10829
eichhorl merged 12 commits into
masterfrom
eichhorl/enable-flexible-on-free

Conversation

@eichhorl

@eichhorl eichhorl commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

This PR enables the flexible_http_request management canister endpoint on free cost schedule subnets by falling back to legacy pricing. Legacy pricing charges the full cost of the outcall up front (which is zero on free subnets).

On normal subnets, flexible outcalls are still disabled (gated by a feature flag), as they depend on the new pay-as-you-go pricing implementation.

Changes:

  • Route FlexibleHttpRequest execution to legacy pricing on free subnets even when the flexible_http_requests feature flag is disabled; keep it gated on paying subnets.
  • Extend CanisterHttpRequestContext::generate_from_flexible_args to accept an explicit PricingVersion, and update tests accordingly.
  • Add/expand networking system tests to exhaustively cover flexible outcall scenarios on a free-cost-schedule subnet, plus a correctness test asserting the API remains disabled on normal subnets.

@eichhorl eichhorl added the CI_ALL_BAZEL_TARGETS Runs all bazel targets label Jul 20, 2026
@github-actions github-actions Bot added the feat label Jul 20, 2026

Copilot AI left a comment

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.

Pull request overview

This PR enables the flexible_http_request management canister endpoint on free cost schedule subnets by falling back to legacy pricing when the pay-as-you-go pricing model (and its feature flag) is not enabled, and adds extensive system and unit test coverage for the new behavior.

Changes:

  • Route FlexibleHttpRequest execution to legacy pricing on free subnets when the flexible_http_requests feature flag is disabled; keep it gated on paying subnets.
  • Extend CanisterHttpRequestContext::generate_from_flexible_args to accept an explicit PricingVersion, and update tests accordingly.
  • Add/expand networking system tests to exhaustively cover flexible outcall scenarios on a free-cost-schedule subnet, plus a correctness test asserting the API remains disabled on normal subnets.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
rs/types/types/src/canister_http.rs Thread pricing_version into flexible HTTP request context generation and update serialization/unit tests.
rs/execution_environment/src/execution_environment.rs Enable flexible outcalls on free subnets via legacy pricing fallback when the feature flag is disabled.
rs/execution_environment/src/execution_environment/tests.rs Add unit coverage ensuring free-subnet flexible outcalls use legacy pricing when the flag is disabled.
rs/tests/networking/canister_http/canister_http.rs Add setup helper to configure the application subnet with a free cost schedule for flexible outcall tests.
rs/tests/networking/canister_http_flexible_test.rs Replace the prior basic test with an extensive flexible outcall system test suite targeting free subnets.
rs/tests/networking/canister_http_correctness_test.rs Add a test asserting flexible outcalls are rejected on normal (paying) subnets when gated.
rs/tests/networking/BUILD.bazel Mark canister_http_flexible_test as a long test.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rs/tests/networking/canister_http_flexible_test.rs
Comment thread rs/tests/networking/canister_http_flexible_test.rs Outdated
@eichhorl eichhorl removed the CI_ALL_BAZEL_TARGETS Runs all bazel targets label Jul 20, 2026
@eichhorl
eichhorl marked this pull request as ready for review July 20, 2026 13:25
@eichhorl
eichhorl requested a review from a team as a code owner July 20, 2026 13:25
@zeropath-ai

zeropath-ai Bot commented Jul 20, 2026

Copy link
Copy Markdown

No security or compliance issues detected. Reviewed everything up to 530220f.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► rs/execution_environment/src/execution_environment.rs
    Modify Ic00 FlexibleHttpRequest handling with pricing/version logic and free/legacy paths
► rs/execution_environment/src/execution_environment.rs
    Add helper http_outcalls_are_free
► rs/execution_environment/src/execution_environment.rs
    Adjust try_add_http_context_to_replicated_state to account for http_outcalls_are_free and pricing_version
► rs/execution_environment/src/execution_environment.tests.rs
    Add tests for flexible HTTP request behavior on free and system subnets
► rs/tests/networking/BUILD.bazel
    Add tags and long_test label for canister_http_flexible_test
► rs/tests/networking/canister_http/canister_http.rs
    Include FlexibleCanisterHttpRequestArgs, FlexibleRemoteHttpRequest types and related imports
► rs/tests/networking/canister_http_correctness_test.rs
    Update imports to include FlexibleCanisterHttpRequestArgs, FlexibleHttpRequestResult, and related types
► rs/tests/networking/canister_http_flexible_test.rs
    Improve test scaffolding for flexible HTTP and add new helpers for runtime, proxy canister, and assertions
► rs/tests/networking/canister_http_correctness_test.rs
    Add new helper functions and test scaffolding for flexible outcalls integration tests
► rs/tests/networking/canister_http_correctness_test.rs
    Add tests for default replication, status checks, and header/transform handling
► rs/tests/networking/canister_http_correctness_test.rs
    Add tests for rejection and error handling in flexible HTTP outcalls
► rs/tests/networking/canister_http_correctness_test.rs
    Add tests for per-node error details and system-subnet interactions
► rs/tests/networking/canister_http_correctness_test.rs
    Add integration tests for transformative behavior and replication edge cases

@schneiderstefan

Copy link
Copy Markdown
Contributor

Does this also address system subnets (which are free, but don't have free cost schedule)?

@eichhorl eichhorl changed the title feat: Enable flexible HTTP outcalls on free subnets feat: Enable flexible HTTP outcalls on free and system subnets Jul 20, 2026
@eichhorl

Copy link
Copy Markdown
Contributor Author

Does this also address system subnets (which are free, but don't have free cost schedule)?

Now it does: 5429b4a

Comment thread rs/tests/networking/canister_http_correctness_test.rs
@eichhorl
eichhorl enabled auto-merge July 21, 2026 14:26
@eichhorl
eichhorl added this pull request to the merge queue Jul 21, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 21, 2026
@eichhorl
eichhorl added this pull request to the merge queue Jul 21, 2026
Merged via the queue into master with commit 4f20763 Jul 21, 2026
37 checks passed
@eichhorl
eichhorl deleted the eichhorl/enable-flexible-on-free branch July 21, 2026 18:11
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.

4 participants