Skip to content

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

Open
eichhorl wants to merge 11 commits into
masterfrom
eichhorl/enable-flexible-on-free
Open

feat: Enable flexible HTTP outcalls on free and system subnets#10829
eichhorl wants to merge 11 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 c8a20a0.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► rs/execution_environment/src/execution_environment.rs
    Implement adaptive pricing for Ic00Method::FlexibleHttpRequest with pricing_version and http_outcalls_are_free logic
► rs/execution_environment/src/execution_environment.rs
    Update handling of FlexibleHttpRequest to use PayAsYouGo or Legacy pricing depending on feature flag and cost schedule
► rs/execution_environment/src/execution_environment.rs
    Adjust refundable_cycles and refund logic based on http_outcalls_are_free and pricing_version
► rs/execution_environment/src/execution_environment tests.rs
    Add tests for flexible http request on free subnet and system subnet using legacy pricing
► rs/tests/networking/BUILD.bazel
    Mark canister_http_flexible_test as long_test due to extended scenarios
Enhancement ► rs/tests/networking/canister_http/canister_http.rs
    Adjust imports to include FlexibleCanisterHttpRequestArgs, Transformation types, and new headers/types
► rs/tests/networking/canister_http_correctness_test.rs
    Import updated types for flexible http requests; include FlexibleRemoteHttpRequest and related types; adjust test scaffolding to support new pricing/replication paths
► rs/tests/networking/canister_http_correctness_test.rs
    Introduce tests for flexible http request not enabled on normal subnet and system subnet legacy path

@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
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.

3 participants