The best source that I know of is the changelog.
A while back I heard some chatter about maybe adding the version to the state tree, but IDK if that resulted in something. Itās not in the spec AFAICT
The best source that I know of is the changelog.
A while back I heard some chatter about maybe adding the version to the state tree, but IDK if that resulted in something. Itās not in the spec AFAICT
is there a way to check what version of the replica is being used by PocketIC?
You can query the status endpoint /instances/0/api/v2/status at runtime and read out the impl_version field of the returned cbor payload. Alternatively, for the PocketIC server included in dfx, the replica version of PocketIC can be read out from the nix/sources.json file (e.g., here for v0.20.2).
I am getting an error when trying to test the method that performs https_outcall
PocketIC server is too busy to process the request
@NathanosDev
Can you try with the latest beta version and see if that helps?
npm i -D @hadronous/pic@beta
PocketIC server encountered an error BadIngressMessage(āFailed to answer to ingress 0x54e41af253fc7c0304cf06b06e532757d39e436551ec8c7d0209be7d40c7de2d after 100 rounds.ā)
@mraszyk do you know why this might happen? This is using PocketIC server v4.
Canister https outcalls are not yet supported in PocketIC (theyāll be supported in the upcoming release in a few weeks) which is why you see the error.
Not sure what my issue is now, but I canāt seem to get pocket-ic to ācreateā properly:
The subnet that was spit out after running the SNS scenario was: 6hddd-nszlm-yb7u4-wqfxt-btk2p-w2jgp-emsaz-ree4f-cmeth-y3gko-gae
I figured out that the config structure changed a bit, and now I have:
pic = await PocketIc.create(process.env.PIC_URL,{
nns: {
state: {
type: SubnetStateType.FromPath,
path: NNS_STATE_PATH,
subnetId: Principal.fromText(NNS_SUBNET_ID),
},
},
});
But now I get a bunch of message in my log
thread ātokio-runtime-workerā panicked at rs/pocket_ic_server/src/state_api/routes.rs:959:10:
Failed to launch PocketIC: JoinError::Panic(Id(21), ā¦)
thread ātokio-runtime-workerā panicked at rs/pocket_ic_server/src/pocket_ic.rs:125:60:
I notice that a bunch of other options are now available on the object, so maybe Iāll play with those a bit? Since I constructed this with dfx Iām guessing everything is on the same subnetā¦maybe that is going to be a problem?
Ps. Iām running pic.js beta with a state produced with dfx 20.1
I did change to
pic = await PocketIc.create(process.env.PIC_URL,{
nns: {
state: {
type: SubnetStateType.FromPath,
path: NNS_STATE_PATH,
subnetId: Principal.fromText(NNS_SUBNET_ID),
},
},
sns: {
state: {
type: SubnetStateType.New,
},
},
});
ā¦and the errors went away, but now I get a
TypeError: fetch failed
at async makeRequest (node_modules/@hadronous/pic/src/http2-client.ts:59:19)
at async intervalMs (node_modules/@hadronous/pic/src/http2-client.ts:130:21)
at async Timeout.runPoll [as _onTimeout] (node_modules/@hadronous/pic/src/util/poll.ts:17:24)
Cause:
connect ECONNREFUSED 127.0.0.1:53189
Now Iām getting something. I think my debugs breaks were causing the server to stop:
Jul 10 19:35:48.586 WARN s:/n:/ic_state_manager/ic_state_manager No state available with certification.
Jul 10 19:35:48.590 WARN s:/n:/ic_messaging/message_routing mr_non_increasing_batch_time: Non-increasing batch time at height 6801: state_time = 2024-07-10 17:55:32.046328 UTC, batch_time = 2021-05-06 19:17:10.000000001 UTC.
thread ātokio-runtime-workerā panicked at rs/state_machine_tests/src/lib.rs:1573:17:
Critical error mr_non_increasing_batch_time occurred.
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
But after this it kind of dies.
looks like it is getting to pic.tick() call but that is failing with:
Error: A request to the PocketIC server timed out.
at eval (eval-b3e01baf.repl:1:1)
at
at EventTarget. (/Users/afat/Dropbox/development/origyn/gitlab/snsgovapp/node_modules/@hadronous/pic/src/http2-client.ts:51:11)
at EventTarget.[nodejs.internal.kHybridDispatch] (node:internal/event_target:826:20)
at EventTarget.dispatchEvent (node:internal/event_target:761:26)
at abortSignal (node:internal/abort_controller:371:10)
at AbortController.abort (node:internal/abort_controller:393:5)
at makeRequest (/Users/afat/Dropbox/development/origyn/gitlab/snsgovapp/node_modules/@hadronous/pic/src/http2-client.ts:65:30)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async intervalMs (/Users/afat/Dropbox/development/origyn/gitlab/snsgovapp/node_modules/@hadronous/pic/src/http2-client.ts:130:21)
at async runPoll (/Users/afat/Dropbox/development/origyn/gitlab/snsgovapp/node_modules/@hadronous/pic/src/util/poll.ts:17:24) {stack: āError: A request to the PocketIC server timedā¦odules/@hadronous/pic/src/util/poll.ts:17:24)ā, message: āA request to the PocketIC server timed out.ā}
calling
{method: āPOSTā, path: ā/instances/0/update/tickā, headers: {ā¦}, body: undefined}
body:
undefined
headers:
{Content-Type: āapplication/jsonā}
Content-Type:
āapplication/jsonā
[[Prototype]]:
Object
method:
āPOSTā
path:
ā/instances/0/update/tickā
Sometimes I get:
tokio-runtime-workerā panicked at rs/state_machine_tests/src/lib.rs:1573:17:
Critical error mr_non_increasing_batch_time occurred.
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
2024-07-10T19:47:40.803557Z INFO pocket_ic_server: The PocketIC server will terminate
in my output.
What version exactly? If you want I can quickly try to update the version in Juno and see if my tests are still running.
Iām using v0.8.1 and quickly tested v0.9.0-b0 but in both case, my test suite was ok. I fear I cannot really help.
Iām stupid. I had commented out my set time function. I added it back in and set the time to just after I had created the state(that was showing up in my error) and now it works.

This actually didnāt work. ![]()
The first time I call list_neuons on my sns_governance canister I get this message repeated over and over in my console until things timeout:
console.error
PocketIC server encountered an error BadIngressMessage(āCanister not foundā)
at intervalMs (node_modules/@hadronous/pic/src/http2-client.ts:144:19)
at async Timeout.runPoll [as _onTimeout] (node_modules/@hadronous/pic/src/util/poll.ts:17:24)
Iāve confirmed it is trying to make the ingress call for list neurons by putting break points in the pic client.
Iāve called list neurons on the same canister on my dfx state successfully, so I donāt know what is going on unless there is something internal that maps that br5f7-7uaaa-aaaaa-qaaca-cai canister id to a theoretical SNS subnet. My SNS canisters are all on the NNS subnet because I have to give the whole state to the nns when I fire it up:
pic = await PocketIc.create(process.env.PIC_URL,{
processingTimeoutMs: 30000,
nns: {
state: {
type: SubnetStateType.FromPath,
path: NNS_STATE_PATH,
subnetId: Principal.fromText(NNS_SUBNET_ID),
},
},
});
const snsGovActor = await pic.createActor<SNSGovenranceService>(
snsgovIdlFactory,
Principal.fromText(snsgovCanisterId),
);
const neurons = await snsGovActor.list_neurons({
limit: 5,
start_page_at:[],
of_principal: []
});
When I call getCanisterSubnet for the target canister I also get null.
The getSNSSubnet is also null, which I expect, but makes me suspicious if the range is hardcoded.
Can you outline what steps you followed to produce the replica state that youāre importing into PocketIC?
Youāre sailing in unchartered territory now ![]()
Ran the setup_locally and run_basic_scenario from the apple silicone instructions from GitHub - dfinity/sns-testing: Testing SNS in local testing environment(I think I did something to force dfx 0.20.1.
It produced this state with a SNS aggregator that put out the listed json:
I exported it and used the import command listed there for your beta if pic.js
@NathanosDev Did you ever have a chance to look into this?
Sorry not yet, Iāll let you know once I get a chance to look.
targetCanisterId?ā
optionaltargetCanisterId:Principal
The Id of the canister to create. Can only be used on Bitcoin, Fiduciary, II, SNS and NNS subnets.
Why can this only be used on these subnets? I have a canister that Iāve deployed to an application subnet on mainnet and I want to simulate it on pocket ic. Iām currently getting told that I canāt do it because of canister rangesā¦is there some way to adapt the topography of the network so I can install it to a particular place?
Is anyone using Vitest and noticing timeouts when running a test suite with Vitest v2, while everything was fine with v1 (e.g., v1.6.0)? How did you solve the issue?
RUN v2.0.3 /Users/daviddalbusco/projects/juno/juno
⯠src/tests/satellite.auth.spec.ts (14 tests | 1 failed) 12300ms
Ć Satellite authentication > admin > should have empty config per default
ā Test timed out in 5000ms.
If this is a long-running test, pass a timeout value as the last argument or configure it globally with "testTimeout".
ā src/tests/satellite.spec.ts (21 tests) 13977ms
stderr | src/tests/orbiter.upgrade.spec.ts > Orbiter upgrade > v0.0.6 -> v0.0.7 > Page views > should be able to collect new entry and list both bounded and unbounded serialized data
PocketIC server encountered an error UpdateError { message: "Instance was deleted" }
etc.
vs
RUN v1.6.0 /Users/daviddalbusco/projects/juno/juno
ā src/tests/satellite.storage.spec.ts (34 tests) 2201ms
ā src/tests/console.storage.spec.ts (51 tests) 2371ms
ā src/tests/satellite.upgrade.spec.ts (14 tests) 58027ms
ā src/tests/orbiter.upgrade.spec.ts (6 tests) 21407ms
ā src/tests/satellite.spec.ts (21 tests) 1702ms
ā src/tests/satellite.auth.spec.ts (14 tests) 1617ms
etc.