feat: Enable flexible HTTP outcalls on free and system subnets#10829
feat: Enable flexible HTTP outcalls on free and system subnets#10829eichhorl wants to merge 11 commits into
Conversation
There was a problem hiding this comment.
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
FlexibleHttpRequestexecution to legacy pricing on free subnets when theflexible_http_requestsfeature flag is disabled; keep it gated on paying subnets. - Extend
CanisterHttpRequestContext::generate_from_flexible_argsto accept an explicitPricingVersion, 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.
|
✅ No security or compliance issues detected. Reviewed everything up to c8a20a0. Security Overview
Detected Code Changes
|
|
Does this also address system subnets (which are free, but don't have free cost schedule)? |
Now it does: 5429b4a |
This PR enables the
flexible_http_requestmanagement 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:
FlexibleHttpRequestexecution to legacy pricing on free subnets even when theflexible_http_requestsfeature flag is disabled; keep it gated on paying subnets.CanisterHttpRequestContext::generate_from_flexible_argsto accept an explicitPricingVersion, and update tests accordingly.