Skip to content

Releases: dfinity/sdk

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 <zhangwei983@hotmail.com>
Co-authored-by: Linwei Shang <linwei.shang@dfinity.org>

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 <zhangwei983@hotmail.com>
Co-authored-by: Linwei Shang <linwei.shang@dfinity.org>

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] <support@github.com>
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:

0.19.0

01 Apr 19:12
1f2ad3c
Compare
Choose a tag to compare

fix: call management canister Bitcoin query API without replica-signed query

dfx canister call --query defaults to use "Replica-signed query" feature.

It doesn't work with bitcoin query calls to the management canister because the Boundary Nodes cannot route the read_state call.

Only for these particular queries, dfx will make the query calls without checking the replica signatures.

If the response reliability is a concern, you can make update calls to the secure alternatives.

feat(beta): enable cycles ledger support

If the environment variable DFX_CYCLES_LEDGER_SUPPORT_ENABLE is set and no cycles wallet is configured, then dfx will try to use the cycles ledger to perform any operation that the cycles wallet usually is used for.

The following commands/options have been unhidden:

  • dfx cycles
  • --from-subaccount for dfx deploy, dfx canister create, dfx canister deposit-cycles to determine which cycles ledger subaccount the used cycles should be used from
  • --created-at-time for dfx deploy, dfx create canister, dfx canister deposit-cycles to control transaction deduplication on the cycles ledger
  • --to-subaccount for dfx canister delete to control into which subaccount cycles are withdrawn before the canister is deleted

The cycles ledger will not be supported by default until the cycles ledger canister is under NNS control.

feat: dfx canister call ... --output json

This is the same as dfx canister call ... | idl2json, for convenience.

See also: https://github.com/dfinity/idl2json

fix: Output of dfx ping is now valid JSON

Added commas in between fields, and newlines to improve formatting.

fix: canister status output to be grep compatible

dfx canister status now outputs to stdout, rather than stderr, so that its output is grep compatible.

fix: fetching canister logs to be grep & tail compatible

dfx canister logs now outputs to stdout, rather than stderr, so that its output is grep and tail compatible.

fix: fetching canister logs

The management canister method fetch_canister_logs can be called only as a query, not as an update call. Therefore, dfx canister logs <canister_id> now uses a query call for this purpose.

dfx wallet set-name now actually sets the name of the wallet

feat: hyphenated project names

DFX no longer forbids hyphens in project names. Anywhere they appear as the name of a variable, e.g. environment variables or generated JS variables, they will be replaced with underscores.

fix: .ic-assets.json configuration entries no longer overwrite the default for allow_raw_access

Previously, any configuration element in .ic-assets.json functioned as if a setting of
"allow_raw_access": true were present in the json object.

For example, given the following configuration, all files would be configured
with allow_raw_access set to true, as if the second entry specified
"allow_raw_access": true (which is the default), even though it does not.

[
  {
    "match": "**/*",
    "allow_raw_access": false
  },
  {
    "match": "**/*",
    "headers": {
      "X-Anything": "Something"
    }
  }
]

Now, given the same configuration, all files would be configured with allow_raw_access set to false, as expected.

Note that the default value of allow_raw_access is still true.

fix: removed version switching logic

Removed the logic for calling a different version of dfx based on DFX_VERSION or the dfx field in
dfx.json. This is now performed by dfxvm.

feat: --always-assist flag for dfx canister call/install/sign and dfx deploy

When all the arguments are optional, dfx automatically provides a null value when no arguments are provided.
--always-assist flag enables the candid assist feature for optional arguments, instead of providing a default null value.

fix(deps): the second pull forget to set wasm_hash_download in pulled.json

When the dependency has been in the cache, dfx deps pull forgot to set correct wasm_hash_download in pulled.json.

It caused the following init/deploy commands to fail.

Dependencies

Replica

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

Bitcoin canister

Downgraded Bitcoin canister to release/2023-10-13

Motoko

Updated Motoko to 0.11.1

0.19.0-beta.1

28 Mar 22:41
e3399d6
Compare
Choose a tag to compare
0.19.0-beta.1 Pre-release
Pre-release

0.19.0-beta.1

Motoko

Updated Motoko to 0.11.1

0.19.0-beta.0

26 Mar 17:48
72512be
Compare
Choose a tag to compare
0.19.0-beta.0 Pre-release
Pre-release

0.19.0-beta.0

fix: call management canister Bitcoin query API without replica-signed query

dfx canister call --query defaults to use "Replica-signed query" feature.

It doesn't work with bitcoin query calls to the management canister because the Boundary Nodes cannot route the read_state call.

Only for these particular queries, dfx will make the query calls without checking the replica signatures.

If the response reliability is a concern, you can make update calls to the secure alternatives.

feat(beta): enable cycles ledger support

If the environment variable DFX_CYCLES_LEDGER_SUPPORT_ENABLE is set and no cycles wallet is configured, then dfx will try to use the cycles ledger to perform any operation that the cycles wallet usually is used for.

The following commands/options have been unhidden:

  • dfx cycles
  • --from-subaccount for dfx deploy, dfx canister create, dfx canister deposit-cycles to determine which cycles ledger subaccount the used cycles should be used from
  • --created-at-time for dfx deploy, dfx create canister, dfx canister deposit-cycles to control transaction deduplication on the cycles ledger
  • --to-subaccount for dfx canister delete to control into which subaccount cycles are withdrawn before the canister is deleted

The cycles ledger will not be supported by default until the cycles ledger canister is under NNS control.

feat: dfx canister call ... --output json

This is the same as dfx canister call ... | idl2json, for convenience.

See also: https://github.com/dfinity/idl2json

fix: Output of dfx ping is now valid JSON

Added commas in between fields, and newlines to improve formatting.

fix: canister status output to be grep compatible

dfx canister status now outputs to stdout, rather than stderr, so that its output is grep compatible.

fix: fetching canister logs to be grep & tail compatible

dfx canister logs now outputs to stdout, rather than stderr, so that its output is grep and tail compatible.

fix: fetching canister logs

The management canister method fetch_canister_logs can be called only as a query, not as an update call. Therefore, dfx canister logs <canister_id> now uses a query call for this purpose.

dfx wallet set-name now actually sets the name of the wallet

feat: hyphenated project names

DFX no longer forbids hyphens in project names. Anywhere they appear as the name of a variable, e.g. environment variables or generated JS variables, they will be replaced with underscores.

fix: .ic-assets.json configuration entries no longer overwrite the default for allow_raw_access

Previously, any configuration element in .ic-assets.json functioned as if a setting of
"allow_raw_access": true were present in the json object.

For example, given the following configuration, all files would be configured
with allow_raw_access set to true, as if the second entry specified
"allow_raw_access": true (which is the default), even though it does not.

[
  {
    "match": "**/*",
    "allow_raw_access": false
  },
  {
    "match": "**/*",
    "headers": {
      "X-Anything": "Something"
    }
  }
]

Now, given the same configuration, all files would be configured with allow_raw_access set to false, as expected.

Note that the default value of allow_raw_access is still true.

fix: removed version switching logic

Removed the logic for calling a different version of dfx based on DFX_VERSION or the dfx field in
dfx.json. This is now performed by dfxvm.

feat: --always-assist flag for dfx canister call/install/sign and dfx deploy

When all the arguments are optional, dfx automatically provides a null value when no arguments are provided.
--always-assist flag enables the candid assist feature for optional arguments, instead of providing a default null value.

fix(deps): the second pull forget to set wasm_hash_download in pulled.json

When the dependency has been in the cache, dfx deps pull forgot to set correct wasm_hash_download in pulled.json.

It caused the following init/deploy commands to fail.

Dependencies

Replica

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

Bitcoin canister

Downgraded Bitcoin canister to release/2023-10-13