Skip to content

feat(pic): add costSchedule option and bump PocketIC to v13 - #264

Merged
nikosxenakis merged 4 commits into
dfinity:mainfrom
q-uint:feat/cost-schedule-pocketic-v13
Apr 14, 2026
Merged

feat(pic): add costSchedule option and bump PocketIC to v13#264
nikosxenakis merged 4 commits into
dfinity:mainfrom
q-uint:feat/cost-schedule-pocketic-v13

Conversation

@q-uint

@q-uint q-uint commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

Add costSchedule on ApplicationSubnetConfig so application subnets can opt into the Free canister cycles cost schedule. The option is typed only on application subnets; the server rejects non-default values on other kinds, which is covered by a new test.

Bump the bundled PocketIC server to v13.0.0 and send the new required cloud_engine field (empty, not user-configurable) in the create-instance request.

Add `costSchedule` on `ApplicationSubnetConfig` so application
subnets can opt into the `Free` canister cycles cost schedule. The
option is typed only on application subnets; the server rejects
non-default values on other kinds, which is covered by a new test.

Bump the bundled PocketIC server to v13.0.0 and send the new
required `cloud_engine` field (empty, not user-configurable) in the
create-instance request.
@q-uint
q-uint requested a review from a team as a code owner April 14, 2026 09:15
Copilot AI review requested due to automatic review settings April 14, 2026 09:15

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

Adds support for selecting a canister cycles cost schedule for application subnets (notably Free), and updates the bundled PocketIC server integration to match the v13.0.0 server contract.

Changes:

  • Add costSchedule?: CanisterCyclesCostSchedule to ApplicationSubnetConfig and introduce the CanisterCyclesCostSchedule enum.
  • Update create-instance request encoding to include cost_schedule on subnet specs and send the new required cloud_engine field (empty array).
  • Bump the downloaded PocketIC server binary from v12.0.0 to v13.0.0 and add a test covering acceptance/rejection behavior.

Reviewed changes

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

Show a summary per file
File Description
packages/pic/tests/src/cost-schedule.spec.ts New tests validating default/Free cost schedule behavior and server-side rejection on non-application subnets
packages/pic/src/pocket-ic-types.ts Public API typing: introduces CanisterCyclesCostSchedule and exposes costSchedule only on application subnets
packages/pic/src/pocket-ic-client-types.ts Client-side request encoding: adds cost_schedule encoding and includes required cloud_engine field for v13
packages/pic/postinstall.mjs Bumps PocketIC binary download to v13.0.0
CHANGELOG.md Documents the new option and the PocketIC server bump

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

Comment thread packages/pic/src/pocket-ic-client-types.ts Outdated
Comment thread packages/pic/tests/src/cost-schedule.spec.ts Outdated
Addresses PR dfinity#264 review feedback. Move costSchedule off the base
SubnetConfig onto ApplicationSubnetConfig only, route encoding through
a dedicated application helper, rename the test suite to match, and
drop the obsolete server-reject test now that enforcement is type-level.
Comment thread packages/pic/src/pocket-ic-client-types.ts
Comment thread packages/pic/tests/src/cost-schedule.spec.ts
nikosxenakis
nikosxenakis previously approved these changes Apr 14, 2026

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

Looks good, some minor comments to address, accepting.

Comment thread packages/pic/tests/src/cost-schedule.spec.ts
Add a comment in the default-schedule cost test clarifying that
advancing time by 30 days accrues idle resource costs (memory and
compute allocation), which is what drains the cycles balance under
the Normal schedule.
nikosxenakis
nikosxenakis previously approved these changes Apr 14, 2026
Comment thread packages/pic/tests/src/cost-schedule.spec.ts
@github-actions
github-actions Bot dismissed nikosxenakis’s stale review April 14, 2026 10:12

Review dismissed by automation script.

@nikosxenakis
nikosxenakis added this pull request to the merge queue Apr 14, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 14, 2026
@nikosxenakis
nikosxenakis added this pull request to the merge queue Apr 14, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 14, 2026
@nikosxenakis
nikosxenakis added this pull request to the merge queue Apr 14, 2026
Merged via the queue into dfinity:main with commit 140ccbd Apr 14, 2026
15 checks passed
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