Hello everyone!
My name is Jason, I am the Engineering Manager of the SDK team at DFINITY. I’d like to announce an exciting change we’re bringing to dfx!
Previously, when running Internet Computer locally, dfx would use a configuration called the System Subnet to deploy canisters and execute their code. This has worked well for the most part, but we have heard from developers that many were faced with challenges when they were ready to migrate to mainnet.
This is because the System Subnet configuration is much more lenient:
- No cycles accounting is done
- Function calls have more generous limits
- There is a higher maximum limit on canister .wasm size
The result is that once code developed locally gets deployed to mainnet, many users hit errors such as “cycles limit exceeded” with no clear indication as to why.
We’re happy to introduce two new subnet types to dfx - Application
and VerifiedApplication
. Here, we’ll focus on the Application
subnet type. This subnet configuration is much more strict - apart from a few bells and whistles, it is essentially the same configuration that is used in mainnet. You should now see errors much earlier in your development lifecycle, and that should lead to fewer errors in production!
Moving forward, this is the default behavior when using dfx. You can always revert to the old behavior if you encounter any issues with the new configuration. The subnet type can be configured using the defaults.replica.subnet_type
key in dfx.json
. The possible values are system
, application
, and verifiedapplication
.
You may also now encounter a point where you must top up your canisters when running Internet Computer locally. This makes for a fine opportunity to learn how to deal with these types of errors before promoting your code to mainnet.
To top up your canisters locally, you can leverage the “fabricate-cycles” command, providing an amount in ICP or cycles:
dfx canister fabricate-cycles
So to recap, the application subnet introduces the following changes to your local development experience:
- The same instruction limits for messages
- Proper cycles accounting
This is available as of version 0.10.0-beta.1
. Try it out for yourself and let us know what you think! As always, if you encounter any issues, please let us know by dropping a line here in the forum or flagging an issue in our GitHub and we will get right on it.
We’re excited about what this change brings, and we hope you will be too. Let’s build!