Skip to content

Releases: dfinity/sdk

0.21.0-beta.0

20 Jun 09:59
c0be086
Compare
Choose a tag to compare
0.21.0-beta.0 Pre-release
Pre-release

feat: dfx killall

Introduced dfx killall, a command for killing DFX-started processes.

feat!: remove support for bitcoin query API

dfx call --query aaaaa-aa bitcoin_get_balance_query/bitcoin_get_utxos_query will result in an error.

fix: simplified log message when using the default shared network configuration

Now displays Using the default configuration for the local shared network.
instead of Using the default definition for the 'local' shared network because ~/.config/dfx/networks.json does not define it.

chore!: Improved error message about canister ranges when directly connecting to a node on a non-root subnet

feat: dfx start for the shared local network stores replica state files in unique directories by options

The state files for different replica versions are often incompatible,
so dfx start requires the --clean argument in order to reset data when
using different replica versions or different replica options.

For the local shared network, dfx now stores replica state files in different
directories, split up by replica version and options.

As an example, you'll be able to do things like this going forward:

dfx +0.21.0 start
(cd project1 && dfx deploy && dfx canister call ...)
dfx stop

dfx +0.22.0 start
# notice --clean is not required.
# even if --clean were passed, the canisters for project1 would be unaffected.
(cd project2 && dfx deploy)
# project1 won't be affected unless you call dfx in its directory
dfx stop

dfx +0.21.0 start
# the canisters are still deployed
(cd project1 && dfx canister call ...)

Prior to this change, the second dfx start would have had to include --clean,
which would have reset the state of the shared local network, affecting all projects.

This also means dfx start for the shared local network won't ever require you to pass --clean.

dfx start will delete old replica state directories. At present, it retains the 10 most recently used.

This doesn't apply to project-specific networks, and it doesn't apply with --pocketic.

It doesn't apply to project-specific networks because the project's canister ids would
reset anyway on first access. If you run dfx start in a project directory where dfx.json
defines the local network, you'll still be prompted to run with --clean if using a
different replica version or different replica options.

It doesn't apply to --pocketic because PocketIC does not yet persist any data.

feat: allow specifying encodings in .ic-assets.json

When uploading assets to an asset canister, dfx by default uploads .txt, .html and .js files in identity encoding but also in gzip encoding to the frontend canister if encoding saves bytes.
It is now possible to specify in .ic-assets.json which encodings are used besides identity.
Note that encodings are only used if the encoding saves bytes compared to identity or if identity is not a specified encoding.

Example: To turn off gzip for .js files and to turn on gzip for .jpg files, use this in .ic-assets.json:

{
  "match": "**/*.js",
  "encodings": ["identity"]
},
{
  "match": "**/*.jpg",
  "encodings": ["identity", "gzip"]
}

feat: dfx canister url

Add dfx canister url subcommand to display the url of a given canister. Basic usage as below:

dfx canister url <canister>

The <canister> argument specifies the name or id of the canister for which you want to display the url.

feat: log_visibility canister setting

Adds support for the log_visibility canister setting, which configures which users are allowed to read a canister's logs.
Valid options are controllers and public. The setting can be used with the --log-visibility flag in dfx canister create
and dfx canister update-settings, or in dfx.json under canisters[].initialization_values.log_visibility.

Asset canister synchronization

feat: support brotli encoding

Asset synchronization now not only supports identity and gzip, but also brotli encoding.
The default encodings are still

  • identity and gzip for MIME types .txt, .html and .js
  • identity for anything else

Dependencies

Frontend canister

fix!: URL decoding follows the whatwg standard

Previously, the frontend canister used custom logic to decode URLs.
The logic was replaced with a dependency that follows https://url.spec.whatwg.org/#percent-decode, which is what JavaScript's new Request("https://example.com/% $").url also uses.
This also drops support for decoding %% to %. % does no longer need to be encoded.

URLs that contain invalid encodings now return 400 Bad Request instead of 500 Internal Server Error

  • Module hash: 2cc4ec4381dee231379270a08403c984986c9fc0c2eaadb64488b704a3104cc0
  • #3767

Replica

Updated replica to elected commit 246d0ce0784d9990c06904809722ce5c2c816269.
This incorporates the following executed proposals:

0.20.2

17 Jun 19:00
619b224
Compare
Choose a tag to compare
0.20.2 Pre-release
Pre-release

fix: dfx canister delete fails

dfx canister delete occasionally fails because it attempts to withdraw too many cycles from the canister before it is deleted.
Usually, dfx tries again with a larger margin of cycles, but sometimes this gets stuck.
It is now possible to use --initial-margin to manually supply a margin in case the automatic margin does not work.

perf: improve sync command performance

Improves sync (eg. dfx deploy, icx-asset sync) performance by parallelization:

  • Make asset properties query faster by parallelization, significant improvement for canisters that have many assets
  • Make chunk creation process faster, by increasing parallelization 4=>25, significant improvement when deploying lots of small assets

icx-asset: add support for log levels, defaulting to info

PocketIC support

Passing --pocketic to dfx start now starts a PocketIC server instead of the replica. PocketIC is lighter-weight than the replica and execution environment internals can be manipulated by REST commands. For more information, see the PocketIC readme.

feat: subaccount can be derived from principal in dfx ledger account-id

feat: dfx info candid-ui-url

dfx info candid-ui-url displays the URL to the Candid UI canister for an explicitly specified --network <network name> (or local by default).

chore: Improve help text of dfx identity new to include which characters are valid in identity names

fix: Capitalization of "Wasm" in docs and messages

The output of dfx canister status has been also changed to use consistent capitalization of words.

fix!(frontend-canister): include .well-known directory by default for asset upload

When uploading assets to an asset canister, dfx by default excludes directories and files with names that start with ..
dfx will start including folders with the name .well-known by default.
It is possible to override this in .ic-assets.json like this:

{
  "match": ".well-known",
  "ignore": true
}

fix: Transferring funds too early in dfx ledger create-canister with --next-to

When creating a canister with dfx ledger create-canister --next-to on a canister that does not exist (e.g., 2vxsx-fae), then the funds are first transferred away from the users account, but the call then fails to create the new canister, and the funds are not returned to the user's account.

Dependencies

Updated to agent-rs 0.35.0

Replica

Updated replica to elected commit ec35ebd252d4ffb151d2cfceba3a86c4fb87c6d6.
This incorporates the following executed proposals:

0.20.2-beta.0

28 May 17:39
06eaa58
Compare
Choose a tag to compare
0.20.2-beta.0 Pre-release
Pre-release

fix: dfx canister delete fails

dfx canister delete occasionally fails because it attempts to withdraw too many cycles from the canister before it is deleted.
Usually, dfx tries again with a larger margin of cycles, but sometimes this gets stuck.
It is now possible to use --initial-margin to manually supply a margin in case the automatic margin does not work.

perf: improve sync command performance

Improves sync (eg. dfx deploy, icx-asset sync) performance by parallelization:

  • Make asset properties query faster by parallelization, significant improvement for canisters that have many assets
  • Make chunk creation process faster, by increasing parallelization 4=>25, significant improvement when deploying lots of small assets

icx-asset: add support for log levels, defaulting to info

PocketIC support

Passing --pocketic to dfx start now starts a PocketIC server instead of the replica. PocketIC is lighter-weight than the replica and execution environment internals can be manipulated by REST commands. For more information, see the PocketIC readme.

feat: subaccount can be derived from principal in dfx ledger account-id

feat: dfx info candid-ui-url

dfx info candid-ui-url displays the URL to the Candid UI canister for an explicitly specified --network <network name> (or local by default).

chore: Improve help text of dfx identity new to include which characters are valid in identity names

fix: Capitalization of "Wasm" in docs and messages

The output of dfx canister status has been also changed to use consistent capitalization of words.

fix!(frontend-canister): include .well-known directory by default for asset upload

When uploading assets to an asset canister, dfx by default excludes directories and files with names that start with ..
dfx will start including folders with the name .well-known by default.
It is possible to override this in .ic-assets.json like this:

{
  "match": ".well-known",
  "ignore": true
}

fix: Transferring funds too early in dfx ledger create-canister with --next-to

When creating a canister with dfx ledger create-canister --next-to on a canister that does not exist (e.g., 2vxsx-fae), then the funds are first transferred away from the users account, but the call then fails to create the new canister, and the funds are not returned to the user's account.

Dependencies

Updated to agent-rs 0.35.0

Replica

Updated replica to elected commit ec35ebd252d4ffb151d2cfceba3a86c4fb87c6d6.
This incorporates the following executed proposals:

0.20.1

28 May 17:51
aae1196
Compare
Choose a tag to compare

feat: reformatted error output

Rather than increasing indentation, dfx now aligns the error causes with a "Caused by: " prefix.

Also changed error types to report error causes as causes, rather than embedding their error cause in the error text.

Before:

Error: Failed while trying to deploy canisters.
Caused by: Failed while trying to deploy canisters.
  Failed to build all canisters.
    Failed while trying to build all canisters.
      The build step failed for canister 'bw4dl-smaaa-aaaaa-qaacq-cai' (wasminst_backend) with an embedded error: Failed to build Motoko canister 'wasminst_backend'.: Failed to compile Motoko.: Failed to run 'moc'.: The command '"/Users/ericswanson/.cache/dfinity/versions/0.19.0/moc" ... params ...  failed with exit status 'exit status: 1'.
Stdout:

Stderr:
/Users/ericswanson/w/wasminst/src/wasminst_backend/main2.mo: No such file or directory

After:

Error: Failed while trying to deploy canisters.
Caused by: Failed to build all canisters.
Caused by: Failed while trying to build all canisters.
Caused by: The build step failed for canister 'bw4dl-smaaa-aaaaa-qaacq-cai' (wasminst_backend)
Caused by: Failed to build Motoko canister 'wasminst_backend'.
Caused by: Failed to compile Motoko.
Caused by: Failed to run 'moc'.
Caused by: The command '"/Users/ericswanson/.cache/dfinity/versions/0.20.0/moc" ... params ... failed with exit status 'exit status: 1'.
Stdout:

Stderr:
/Users/ericswanson/w/wasminst/src/wasminst_backend/main2.mo: No such file or directory

fix: "Failed to decrypt PEM file" errors messages will now include the cause

feat: Wasm memory soft-limit

Adds support for the wasm_memory_limit canister setting, which limits the canister's heap during most calls but does not affect queries. As with other canister settings, it can be set in dfx canister create or dfx canister update-settings via the --wasm-memory-limit flag, as well as in dfx.json under canisters[].initialization_values.wasm_memory_limit.

feat: extensions can define a canister type

Please see extension-defined-canister-types for details.

feat: init_arg_file in dfx.json

Introduces support for the init_arg_file field in dfx.json, providing an alternative method to specify initialization arguments.

This field accepts a relative path, from the directory containing the dfx.json file.

Note

  • Only one of init_arg and init_arg_file can be defined at a time.
  • If --argument or --argument-file are set, the argument from the command line takes precedence over the one in dfx.json.

fix: dfx new failure when node is available but npm is not

dfx new could fail with "Failed to scaffold frontend code" if node was installed but npm was not installed.

Dependencies

Cycles wallet

Updated cycles wallet to a gzipped version of 20240410 release:

  • Module hash: 7745d3114e3e5fbafe8a7150a0a8c15a5b8dc9257f294d5ced67d41be76065bc, in gzipped form: 664df1045e093084f4ebafedd3a793cc3b3be0a7ef1b245d8d3defe20b33057c
  • dfinity/cycles-wallet@b013764

Replica

Updated replica to elected commit 5e285dcaf77db014ac85d6f96ff392fe461945f5.
This incorporates the following executed proposals:

Full Changelog: 0.9.1...0.20.1

0.20.0

07 May 01:30
07b17fb
Compare
Choose a tag to compare

0.20.0

fix: set CANISTER_CANDID_PATH_<canister name> properly for remote canisters

In the remote canister declaration it is possible to set a candid file to use when the canister is remote on a specific network.
dfx now correctly sets the CANISTER_CANDID_PATH_<canister name> environment variable during the build process on remote networks if the file exists.

feat: display schema for dfx metadata json

dfx schema --for dfx-metadata to display JSON schema of the "dfx" metadata.

feat: add tech_stack to the Canister Metadata Standard

The standardized dfx metadata is extended with another object: tech_stack.

Please check tech-stack for more details.

chore: updated management canister .did file

feat: added dfx completion command

This command generates shell completion scripts for bash, elvish, fish, zsh, or PowerShell.

Describing how to install shell completion scripts is beyond the scope of this document.
Here are two commands that would enable command completion in the current shell:

In zsh:

source <(dfx completion zsh)

In bash:

source <(dfx completion)

fix: dfx no longer always creates .dfx directory if dfx.json is present

Previously, dfx would always create a .dfx directory in the project root if dfx.json was present.
Now, it only does so if the command accesses the .dfx directory in some way.

fix: dfx only loads dfx.json for commands that need it

For example, this will work now:

echo garbage >dfx.json && dfx identity get-principal

Dependencies

Replica

Updated replica to elected commit 02dcaf3ccdfe46bd959d683d43c5513d37a1420d.
This incorporates the following executed proposals:

0.20.1-beta.0

06 May 22:07
b5969ac
Compare
Choose a tag to compare
0.20.1-beta.0 Pre-release
Pre-release

0.20.1

feat: reformatted error output

Rather than increasing indentation, dfx now aligns the error causes with a "Caused by: " prefix.

Also changed error types to report error causes as causes, rather than embedding their error cause in the error text.

Before:

Error: Failed while trying to deploy canisters.
Caused by: Failed while trying to deploy canisters.
  Failed to build all canisters.
    Failed while trying to build all canisters.
      The build step failed for canister 'bw4dl-smaaa-aaaaa-qaacq-cai' (wasminst_backend) with an embedded error: Failed to build Motoko canister 'wasminst_backend'.: Failed to compile Motoko.: Failed to run 'moc'.: The command '"/Users/ericswanson/.cache/dfinity/versions/0.19.0/moc" ... params ...  failed with exit status 'exit status: 1'.
Stdout:

Stderr:
/Users/ericswanson/w/wasminst/src/wasminst_backend/main2.mo: No such file or directory

After:

Error: Failed while trying to deploy canisters.
Caused by: Failed to build all canisters.
Caused by: Failed while trying to build all canisters.
Caused by: The build step failed for canister 'bw4dl-smaaa-aaaaa-qaacq-cai' (wasminst_backend)
Caused by: Failed to build Motoko canister 'wasminst_backend'.
Caused by: Failed to compile Motoko.
Caused by: Failed to run 'moc'.
Caused by: The command '"/Users/ericswanson/.cache/dfinity/versions/0.20.0/moc" ... params ... failed with exit status 'exit status: 1'.
Stdout:

Stderr:
/Users/ericswanson/w/wasminst/src/wasminst_backend/main2.mo: No such file or directory

fix: "Failed to decrypt PEM file" errors messages will now include the cause

feat: WASM memory soft-limit

Adds support for the wasm_memory_limit canister setting, which limits the canister's heap during most calls but does not affect queries. As with other canister settings, it can be set in dfx canister create or dfx canister update-settings via the --wasm-memory-limit flag, as well as in dfx.json under canisters[].initialization_values.wasm_memory_limit.

feat: extensions can define a canister type

Please see extension-defined-canister-types for details.

feat: init_arg_file in dfx.json

Introduces support for the init_arg_file field in dfx.json, providing an alternative method to specify initialization arguments.

This field accepts a relative path, from the directory containing the dfx.json file.

Note

  • Only one of init_arg and init_arg_file can be defined at a time.
  • If --argument or --argument-file are set, the argument from the command line takes precedence over the one in dfx.json.

fix: dfx new failure when node is available but npm is not

dfx new could fail with "Failed to scaffold frontend code" if node was installed but npm was not installed.

Dependencies

Cycles wallet

Updated cycles wallet to a gzipped version of 20240410 release:

  • Module hash: 7745d3114e3e5fbafe8a7150a0a8c15a5b8dc9257f294d5ced67d41be76065bc, in gzipped form: 664df1045e093084f4ebafedd3a793cc3b3be0a7ef1b245d8d3defe20b33057c
  • dfinity/cycles-wallet@b013764

Replica

Updated replica to elected commit 5e285dcaf77db014ac85d6f96ff392fe461945f5.
This incorporates the following executed proposals:

0.20.0-icsystemtest.1: feat: init_arg_file in dfx.json (#3721)

24 Apr 16:50
e38935e
Compare
Choose a tag to compare
* Add  support in dfx.json. (WIP)

* Trim the string read from the arg file.

* Update dfx-json-schema.json file.

* Get the absolute path of 'init_arg_file', and update changelog.

* Fix cargo format.

* simplify a bit

* comments

* improve the warning message

* changelog

* fmt

---------

Co-authored-by: Vincent Zhang <[email protected]>
Co-authored-by: Linwei Shang <[email protected]>

0.20.0-icsystemtest.0: feat: init_arg_file in dfx.json (#3721)

24 Apr 15:28
e38935e
Compare
Choose a tag to compare
* Add  support in dfx.json. (WIP)

* Trim the string read from the arg file.

* Update dfx-json-schema.json file.

* Get the absolute path of 'init_arg_file', and update changelog.

* Fix cargo format.

* simplify a bit

* comments

* improve the warning message

* changelog

* fmt

---------

Co-authored-by: Vincent Zhang <[email protected]>
Co-authored-by: Linwei Shang <[email protected]>

0.20.0-extensioncanistertype.0: chore(deps): bump rustls from 0.21.10 to 0.21.11 (#3720)

22 Apr 18:25
e685122
Compare
Choose a tag to compare
Bumps [rustls](https://github.com/rustls/rustls) from 0.21.10 to 0.21.11.
- [Release notes](https://github.com/rustls/rustls/releases)
- [Changelog](https://github.com/rustls/rustls/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustls/rustls/compare/v/0.21.10...v/0.21.11)

---
updated-dependencies:
- dependency-name: rustls
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

0.20.0-beta.0

16 Apr 16:12
a4ecb31
Compare
Choose a tag to compare
0.20.0-beta.0 Pre-release
Pre-release

fix: set CANISTER_CANDID_PATH_<canister name> properly for remote canisters

In the remote canister declaration it is possible to set a candid file to use when the canister is remote on a specific network.
dfx now correctly sets the CANISTER_CANDID_PATH_<canister name> environment variable during the build process on remote networks if the file exists.

feat: display schema for dfx metadata json

dfx schema --for dfx-metadata to display JSON schema of the "dfx" metadata.

feat: add tech_stack to the Canister Metadata Standard

The standardized dfx metadata is extended with another object: tech_stack.

Please check tech-stack for more details.

chore: updated management canister .did file

feat: added dfx completion command

This command generates shell completion scripts for bash, elvish, fish, zsh, or PowerShell.

Describing how to install shell completion scripts is beyond the scope of this document.
Here are two commands that would enable command completion in the current shell:

In zsh:

source <(dfx completion zsh)

In bash:

source <(dfx completion)

fix: dfx no longer always creates .dfx directory if dfx.json is present

Previously, dfx would always create a .dfx directory in the project root if dfx.json was present.
Now, it only does so if the command accesses the .dfx directory in some way.

fix: dfx only loads dfx.json for commands that need it

For example, this will work now:

echo garbage >dfx.json && dfx identity get-principal

Dependencies

Replica

Updated replica to elected commit 02dcaf3ccdfe46bd959d683d43c5513d37a1420d.
This incorporates the following executed proposals: