feat: CON-1700 Support flexible outcalls and pay-as-you-go pricing in pocket-ic - #11245
Open
eichhorl wants to merge 7 commits into
Open
feat: CON-1700 Support flexible outcalls and pay-as-you-go pricing in pocket-ic#11245eichhorl wants to merge 7 commits into
pocket-ic#11245eichhorl wants to merge 7 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds flexible HTTP outcall mocking and pay-as-you-go pricing support across the replica, PocketIC server, client API, and tests.
Changes:
- Gates pay-as-you-go pricing with the flexible-outcalls feature flag.
- Adds flexible response mocking plus replication and pricing metadata.
- Accounts for mocked response costs and validates reject-message limits.
Reviewed changes
Copilot reviewed 25 out of 26 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
rs/types/types/src/canister_http.rs |
Gates selectable pricing versions. |
rs/types/management_canister_types/src/lib.rs |
Re-exports pricing constants. |
rs/types/management_canister_types/src/http.rs |
Defines gated pricing versions. |
rs/tests/networking/canister_http_correctness_test.rs |
Updates context construction. |
rs/state_machine_tests/src/lib.rs |
Supports per-node response receipts. |
rs/pocket_ic_server/src/state_api/state.rs |
Adds mock-validation errors. |
rs/pocket_ic_server/src/state_api/routes.rs |
Adds the flexible-mocking route. |
rs/pocket_ic_server/src/pocket_ic.rs |
Implements metadata, pricing, and flexible mocking. |
rs/pocket_ic_server/src/beta_features.rs |
Enables flexible HTTP requests. |
rs/pocket_ic_server/CHANGELOG.md |
Documents server changes. |
rs/pocket_ic_server/Cargo.toml |
Adds the pricing dependency. |
rs/pocket_ic_server/BUILD.bazel |
Adds the Bazel pricing dependency. |
rs/https_outcalls/client/src/client.rs |
Enables pay-as-you-go request processing. |
rs/execution_environment/src/execution_environment/tests.rs |
Tests pricing feature gating. |
rs/execution_environment/src/execution_environment.rs |
Passes pricing-gate state into requests. |
packages/pocket-ic/tests/tests.rs |
Adds comprehensive integration coverage. |
packages/pocket-ic/test_canister/src/canister.rs |
Adds raw and flexible outcall methods. |
packages/pocket-ic/test_canister/canister.did |
Exposes the new test methods. |
packages/pocket-ic/src/nonblocking.rs |
Adds the asynchronous flexible-mocking API. |
packages/pocket-ic/src/lib.rs |
Adds the synchronous flexible-mocking API. |
packages/pocket-ic/src/common/rest.rs |
Defines new REST request and metadata types. |
packages/pocket-ic/HOWTO.md |
Documents flexible outcalls and pricing. |
packages/pocket-ic/CHANGELOG.md |
Records client-facing changes. |
packages/pocket-ic/Cargo.toml |
Adds the test serialization dependency. |
packages/pocket-ic/BUILD.bazel |
Adds corresponding test dependencies. |
Cargo.lock |
Locks the added dependencies. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
eichhorl
marked this pull request as ready for review
August 21, 2026 09:31
pocket-icpocket-ic
|
✅ No security or compliance issues detected. Reviewed everything up to 20cfcdf. Security Overview
Detected Code Changes
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replica Changes
The option to choose pay-as-you-go pricing for non- and fully-replicated outcalls is now gated behind the same feature flag that is already gating flexible outcalls (which use pay-as-you-go pricing by default).
Pocket-ic Changes
Added
replicationfield onCanisterHttpRequestdescribing how a pending canister HTTP outcall is replicated across the nodes of its subnet:FullyReplicated,NonReplicated, orFlexiblewith the outcall'stotal_requests,min_responses, andmax_responses.pricing_versionfield onCanisterHttpRequest, reporting whether a pending canister HTTP outcall is priced with theLegacyor thePayAsYouGopricing model.IcpConfig::beta_featurespassed toPocketIcBuilder::with_icp_config) now also enables the pay-as-you-go pricing model, which covers both theflexible_http_requestmanagement canister endpoint (whose outcalls are always priced that way) and thepricing_versionfield ofhttp_request(through which a fully replicated or non-replicated outcall can select it).Changed