All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- The endpoint
/instances/<instance_id>/update/delete_subnetto delete a subnet (non-named subnets only: application, cloud engine, system, or verified application subnets). If a state directory is configured for the instance, the deleted subnet's state directory is removed from disk.
- Canister IDs allocated to newly created canisters without a specified canister ID.
- The endpoint
/instances/takes an additional optional fielddisable_ingress_validationspecifying that ingress validation is disabled for mainnet-like endpoints/instances/<instance_id>/api/...of the instance. - Support for canister signatures produced by the ICP mainnet in mainnet-like endpoints
/instances/<instance_id>/api/.... - A new test threshold keys subnet kind (
TestThresholdKeys): a new variant inSubnetKindand new fields inSubnetConfigSetandExtendedSubnetConfigSet. It is an application subnet with 13 nodes holding threshold keys with namestest_key_1anddfx_test_keyfor all supported algorithms (ECDSA, Schnorr, VetKd). Its canister range (z474k-xiaaa-aaaao-qaaaa-caitofxzgb-eaaaa-aaaao-7777q-cai) matches the mainnet subnetfuqsr-in2lc-zbcjj-ydmcw-pzq7h-4xm2z-pto4i-dcyee-5z4rz-x63ji-nae.
- The endpoints
/instances/<instance_id>/update/submit_ingress_messageand/instances/<instance_id>/read/queryaccept an additional optional fieldsender_infoin the request body specifying additional information provided by the canister with which the sender principal is associated. - The II and fiduciary subnets no longer hold threshold keys with names
test_key_1anddfx_test_key; these keys are now exclusively held by theTestThresholdKeyssubnet.
- The endpoint
/instances/takes an additional optional fieldmainnet_nns_subnet_idspecifying that the NNS subnet should be created with the mainnet NNS subnet ID. - The CLI option
--hard-ttlto specify that the PocketIC server should perform a hard exit after the provided number of seconds since its launch. - The HTTP gateway configuration (used in the
/http_gatewayendpoint and thehttp_gateway_configfield of the/instances/endpoint) takes a new optional fielddomain_custom_provider_local_filespecifying a path to a local file that maps custom domain names to canister IDs. The file format is one mapping per line:<domain>:<canister-id>(e.g.,my-app.example.com:rdmx6-jaaaa-aaaaa-aaadq-cai). - A new cloud engine subnet kind: a new variant in
SubnetKindand a new field inSubnetConfigSetandExtendedSubnetConfigSet. - A new optional field to specify subnet admins in
SubnetSpecandSubnetConfig. The field can only be set for application subnets and cloud engines on a "free" cost schedule (see below)! - A new field to specify subnet cost schedule in
SubnetSpecandSubnetConfig. The field can only be set to a non-default value for application subnets and cloud engines! Moreover, the field has to be set to the "free" cost schedule on cloud engines!
- All subnets with mainnet canister ranges but the NNS subnet are always created with mainnet subnet IDs.
- The HTTP gateway skips authority validation (
--domain-skip-authority-validation) when thedomainsfield of the HTTP gateway configuration is not set (i.e.,null/None), allowing requests from any domain to be served as long as the canister ID can be resolved from the request (e.g., via a subdomain or thecanisterIdquery parameter). Whendomainsis explicitly provided, authority validation is enforced and only requests matching the configured domains are accepted.
- New CLI option
--mainnet-registry-versionto specify the mainnet registry version to use for fetching the mainnet routing table using the existing CLI option--fetch-mainnet-routing-table. Defaults to the latest registry version.
- The CLI option
--fetch-mainnet-routing-tableto specify that the mainnet routing table should be fetched from the mainnet registry does not require a file path specified as--mainnet-routing-table. - The field
blockmakersin the argument of the endpoint/instances/<instance_id>/update/tickhas been flattened into an optional vector of blockmakers per subnet.
- New DELETE endpoint
/prune_graph/<state_label>/<op_id>for pruning the result of a long-running operation. This endpoint should be called after successfully reading the result using the GET endpoint/read_graph/<state_label>/<op_id>. Thestate_labelandop_idare returned byApiResponse::Started {state_label, op_id}. - New ICP features
bitcoin,dogecoin, andcanister_migrationcan be specified in the optional fieldicp_featuresin the argument of the endpoint/instances/. - Support for Dogecoin: PocketIC server interacts with a
dogecoindprocess listening at an address and port specified in a new optional fielddogecoind_addrof the endpoint/instances/. - The endpoint
/instances/<instance_id>/update/canister_snapshot_downloadto download a canister snapshot to a given snapshot directory. - The endpoint
/instances/<instance_id>/update/canister_snapshot_uploadto upload a canister snapshot from a given snapshot directory. - New CLI option
--mainnet-routing-tableto specify a path to a JSON file containing the mainnet routing table (used to create canisters with mainnet canister IDs). The PocketIC server contains a hard-coded mainnet routing table used if this option is not provided. - New CLI option
--fetch-mainnet-routing-tableto specify that the mainnet routing table should be fetched from the mainnet registry and written to the file path specified as--mainnet-routing-table.
- The endpoint
/instances/<instance_id>/update/await_ingress_message(execute rounds on the PocketIc instance until the message is executed): to fix a performance regression when using the two endpoints/instances/<instance_id>/update/tickand/instances/<instance_id>/read/ingress_statusin a loop. - The argument of the endpoint
/instances/takes an additional optional fieldicp_featuresspecifying ICP features (implemented by system canisters) to be enabled in the newly created PocketIC instance. - The argument of the endpoint
/instances/takes an additional optional fieldincomplete_statespecifying if incomplete state (e.g., resulting from not deleting a PocketIC instance gracefully) is allowed. - The argument of the endpoint
/instances/takes an additional optional fieldinitial_timespecifying the initial timestamp of the newly created instance or if the new instance should make progress automatically, i.e., if PocketIC should periodically update the time of the instance to the real time and execute rounds on the subnets. - The argument of the endpoint
/instances/takes an optional fieldicp_configspecifying which features not available on the ICP mainnet should be available in the newly created PocketIC instance (the field used to be callednonmainnet_featuresand be of a simple Boolean type before). - The argument of the endpoint
/instances/takes an additional optional fieldhttp_gateway_configspecifying that an HTTP gateway with the given configuration should be created for the newly created instance.
- The endpoint
/instances/<instance_id>/auto_progresssets the (certified) time of the PocketIC instance to the current system time before starting to execute rounds automatically.
- The endpoint
/instances/<instance_id>/update/await_ingress_message: use the two endpoints/instances/<instance_id>/update/tickand/instances/<instance_id>/read/ingress_statusto execute a round and fetch the status of the update call instead.
- Crash when creating a canister with a specified id on a PocketIC instance created from an existing PocketIC state.
- Crash when creating multiple instances with the same subnet state directory simultaneously.
- The
GETendpoint/instances/<instance_id>/auto_progressthat returns whether the automatic progress was enabled for the PocketIC instance. - Support for VetKd if nonmainnet features are enabled on a PocketIC instance.
- The II canister always belongs to the dedicated II subnet (the II canister used to belong to the NNS subnet if no II subnet was specified).
- The II subnet size to be 34 nodes as on the ICP mainnet.
- New endpoint
/instances/<instance_id>/read/ingress_statusto fetch the status of an update call submitted through an ingress message. If an optional caller is provided, the status of the update call is known, but the update call was submitted by a different caller, then an error is returned. - New endpoint
/instances/<instance_id>/update/set_certified_timeto set the current certified time on all subnets of the PocketIC instance. - The endpoint
/instances/<instance_id>/update/ticktakes an argument optionally containing the blockmaker and failed blockmakers for every subnet used by the endpointnode_metrics_historyof the management canister.
- Canisters created via
provisional_create_canister_with_cycleswith the management canister ID as the effective canister ID are created on an arbitrary subnet.
- The response type
RawSubmitIngressResultis replaced byResult<RawMessageId, RejectResponse>. - The response types
RawWasmResultandUserErrorinRawCanisterResultare replaced byVec<u8>andRejectResponse.
- The endpoint
/instances/<instance_id>/update/execute_ingress_message: use the two endpoints/instances/<instance_id>/update/submit_ingress_messageand/instances/<instance_id>/update/await_ingress_messageto submit and then await an ingress message instead.
- Support for IC Bitcoin API via the management canister if the bitcoin canister is installed as the bitcoin testnet canister
(canister ID
g4xu7-jiaaa-aaaan-aaaaq-cai) on the bitcoin subnet and configured withNetwork::Regtestand abitcoindprocess is listening at an address and port specified in an additional argument of the endpoint/instances/to create a new PocketIC instance. - New endpoint
/instances/<instance_id>/_/topologyreturning the topology of the PocketIC instance. - New CLI option
--log-levelsto specify the log levels for PocketIC server logs (defaults topocket_ic_server=info,tower_http=info,axum::rejection=trace). - New endpoint
/instances/<instance_id/read/get_controllersto get the controllers of a canister.
- Renamed
dfx_test_key1tECDSA and tSchnorr keys todfx_test_key.
- The PocketIC HTTP gateway routes requests whose paths start with
/_/and for which no canister ID can be found directly to the PocketIC instance/replica (this only used to apply to requests for/_/dashboardindependently of whether a canister ID could be found). - Subnet ids can be specified in
SubnetSpecs for all subnet kinds. - The certified time of a round is only bumped by
1nsif the time of the corresponding PocketIC instance did not increase since the last round. - The endpoint
/instances/<instance_id>/update/set_timereturns an error if the time of a PocketIC instance is set into the past. - Subnet sizes to match the subnet sizes on the ICP mainnet: II from 28 to 31 nodes, Fiduciary from 28 to 34 nodes.
- The CLI option
--pid: use the CLI option--port-fileinstead.
- New CLI option
--ip-addrto specify the IP address at which the PocketIC server should listen (defaults to127.0.0.1). - New argument
ip_addrof the endpoint/http_gatewayto specify the IP address at which the HTTP gateway should listen (defaults to127.0.0.1). - New GET endpoint
/http_gatewaylisting all HTTP gateways and their details. - Support for query statistics in the management canister.
- The argument of the endpoint
/instances/<instance_id>/auto_progressbecomes a struct with an optional fieldartificial_delay_msspecifying the minimum delay between consecutive rounds in auto progress mode. - Support for verified application subnets: the record types
SubnetConfigSetandExtendedSubnetConfigSetcontain a new fieldverified_applicationspecifying verified application subnets; the enumeration typeSubnetKindhas a new variantVerifiedApplication. - New endpoint
/instances/<instance_id>/api/v2/subnet/...supporting the IC HTTP subnet read state requests. - New endpoint
/api/v2/subnetof the PocketIC HTTP gateway supporting the IC HTTP subnet read state requests. - The argument of the endpoint
/instances/takes an additional optional fieldlog_levelspecifying the replica log level of the PocketIC instance. - ECDSA support (IC mainnet-like): there are three ECDSA keys with names
dfx_test_key1,test_key_1, andkey_1on the II and fiduciary subnet. - tSchnorr support (IC mainnet-like): there are three Schnorr keys with names
dfx_test_key1,test_key_1, andkey_1and algorithm BIP340 as well as three Schnorr keys with namesdfx_test_key1,test_key_1, andkey_1and algorithm Ed25519 on the II and fiduciary subnet. The messages to sign with tSchnorr must be of length 32 bytes. - New endpoint
/_/dashboardof the PocketIC HTTP gateway returning the dashboard of the underlying PocketIC instance or replica. - The argument of the endpoint
/instances/<instance_id>/mock_canister_http_responsetakes an additional fieldadditional_responsesto mock additional responses for a pending canister HTTP outcall; if non-empty, the total number of responses (one plus the number of additional responses) must be equal to the size of the subnet on which the canister making the HTTP outcall is deployed.
- The argument
listen_atof the endpoint/http_gatewayhas been renamed toport. - The endpoint
/instances/<instance_id>/auto_progressreturns an error if the corresponding PocketIC instance is already in auto progress mode.
- The option
--ready-file: the PocketIC server is ready to accept HTTP connections once the port file (specified via--pidor--port-file) contains a line terminated by a newline character.
- A new subnet is created on an existing PocketIC instance if a new canister is created with a specified mainnet canister ID that does not belong to any existing subnet's canister range.
- The argument of the endpoint
/http_gatewaytakes an additional optional fielddomainsspecifying the domains at which the HTTP gateway is listening (default tolocalhost). - The argument of the endpoint
/http_gatewaytakes an additional optional fieldhttps_configspecifying the TLS certificate and key. If provided, then an HTTPS gateway is started using that TLS certificate. - A new endpoint
/instances/<instance_id>/read/topologyto retrieve the topology of the PocketIC instance. The topology contains a list of node IDs instead of subnet size which can be derived from the number of node IDs. - New CLI option
--ready-fileto specify a file which is created by the PocketIC server once it is ready to accept HTTP connections. - A new endpoint
/instances/<instance_id>/_/dashboardserving a PocketIC dashboard. - ECDSA support (IC mainnet-like): there are three ECDSA keys with names
dfx_test_key1,test_key_1, andkey_1on the II subnet. - The argument of the endpoint
/instances/to create a new PocketIC instance becomes a struct with three fields: the original argument of that endpoint is the fieldsubnet_config_set, the new optional fieldstate_dirspecifies a directory in which the state of the PocketIC instance can be preserved across the PocketIC instance lifetime (that directory should be empty when specified asstate_dirfor the very first time), and the new optional fieldnonmainnet_featuresspecifies if non-mainnet features (e.g., best-effort responses) should be enabled for the PocketIC instance. The topology contains a new fieldsubnet_seedwhich is equal to the directory name of the directory in thestate_dirstoring the state of the corresponding subnet. The state directory (if specified) also contains a fileregistry.protocontaining the current snapshot of the registry. - Support for canister HTTP outcalls: endpoint
/instances/<instance_id>/get_canister_httpto retrieve pending canister HTTP outcalls and endpoint/instances/<instance_id>/mock_canister_http_responseto mock a response for a pending canister HTTP outcall, the server produces responses for pending canister HTTP outcalls automatically in the auto-progress mode (started by calling the endpoint/instances/<instance_id>/auto_progress). - New endpoint
/instance/<instance_id>/api/v3/canister/<effective_canister_id>/callsupporting a synchronous HTTP interface of the IC for update calls. Note that this endpoint might non-deterministically return a response with status code 202 and empty body (in this case, the status of the call must be polled at the endpoint/instance/<instance_id>/api/v3/canister/<effective_canister_id>/read_state).
- Executing a query call on a new PocketIC instance crashed the PocketIC server.
- New endpoints
/instances/<instance_id>/auto_progressand/instances/<instance_id>/stop_progressto make IC instances progress (updating time and executing rounds) automatically. - New endpoints
/instances/<instance_id>/api/v2/...supporting the HTTP interface of the IC as described by the Interface Specification. - Breaking: New subnet specification allowing to set very high instruction limits for (asymptotic) benchmarking canister code.
- New endpoint
/read_graph/:state_label/:op_idfor polling on a long-running operation. Thestate_labelandop_idare returned byApiResponse::Started{state_label, op_id}. - New CLI option
--port-fileto specify a file to which the PocketIC server port should be written. - New endpoints
/http_gatewayand/http_gateway/:id/stopto start and stop an HTTP gateway. - Breaking: DTS is enabled on a subnet based on a new field
dts_flaginSubnetSpec. - New endpoints
submit_ingress_message(submit an ingress message without executing it) andawait_ingress_message(execute rounds on the PocketIc instance until the message is executed).
- Potentially breaking: Subnet IDs are derived from the subnets' public keys by default.
- Potentially breaking: The time of every subnet advances by 1ns before every round execution to make sure the subnet time is strictly increasing in every round.
- Traps in tECDSA calls due to malformed tECDSA public key.
- Server rejects jsons containing unimplemented variants of
SubnetStateConfig. - The
inspect_messagemethod no longer panics when call is rejected.
- New endpoint
/api.jsonthat serves an OpenAPI documentation of the PocketIC server. - Instances can be created from existing NNS state.
- Breaking: The create_instance endpoint accepts an ExtendedSubnetConfigSet, which allows more options.
- Canister inspect message errors when executing ingress messages are returned as canister execution results rather than request errors.
- Subnets agree on which subnet id is the NNS subnet id. Fixes the problem where a canister installation via CMC directly would fail.
- Fixed a bug where
get_subnet()would return results for non-existent canisters, causingcanister_exists()to returntruefor non-existent canisters in client libraries - Fixed a bug related to
PocketIcs internal time being set to the current time, which lead to non-deterministic behavior
- Cycles consumption is now more appropriately scaled according to the size of the subnet
- Support for multiple subnets
- Support for cross-subnet canister calls
- Improved support to start the PocketIC server from the command line:
- Ability to start the server without any flags
- Use
-p or --portto specify a port where the server should listen - Use
--ttlto specify for how long the server should be running before it shuts down --pidflag is no longer required and discouraged to use from the command line
- Improved logging support:
- Use the
POCKET_IC_LOG_DIRenvironment varible to specify where to store logs - Use the environment variable
POCKET_IC_LOG_DIR_LEVELS=traceto specify the log level of the logs that are written to the log file
- Use the
read/pub_keyendpoint to retrieve the public key of a subnetread/get_subnetendpoint to retrieve the subnet id of a canister
- POST
instances/endpoint requires a subnet config - POST
instances/endpoint returns a toplogy of the instance /read/queryand/update/execute_ingress_messagerequire aneffective_principalfield
- Checkpointing
read/canister_existsendpoint (superseded byread/get_subnet)read/root_keyendpoint (superseded byread/pub_key)
- Blocking REST-API: Encode IC-call in endpoint, not in body
- Blocking API to make IC-calls to a PocketIC server