Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

### 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

## Dependencies

### Updated to [agent-rs 0.35.0](https://github.com/dfinity/agent-rs/blob/main/CHANGELOG.md#0350---2024-05-10)
Expand Down Expand Up @@ -51,7 +53,7 @@ Stderr:

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

### feat: WASM memory soft-limit
### 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`.

Expand Down Expand Up @@ -555,7 +557,7 @@ Fix the HTTP header for deploying in remote environments

### feat: large canister modules now supported

When using `dfx deploy` or `dfx canister install`, previously WASM modules larger than 2MiB would be rejected.
When using `dfx deploy` or `dfx canister install`, previously Wasm modules larger than 2MiB would be rejected.
They are now automatically submitted via the chunking API if they are large enough.
From a user perspective the limitation will simply have been lifted.

Expand Down Expand Up @@ -1413,7 +1415,7 @@ The identity may be specified using the environment variable `DFX_IDENTITY`.

### feat: Add DFX_ASSETS_WASM

Added the ability to configure the WASM module used for assets canisters through the environment variable `DFX_ASSETS_WASM`.
Added the ability to configure the Wasm module used for assets canisters through the environment variable `DFX_ASSETS_WASM`.

### fix: dfx deploy and icx-asset no longer retry on permission failure

Expand Down Expand Up @@ -1529,7 +1531,7 @@ Added validate_grant_permission() and validate_revoke_permission() methods per S

### feat: Add dfx sns download

This allows users to download SNS canister WASMs.
This allows users to download SNS canister Wasm binaries.

### fix: fixed error text
- `dfx nns install` had the wrong instructions for setting up the local replica type
Expand Down Expand Up @@ -2126,7 +2128,7 @@ It is now possible to inhibit automatic wallet creation by setting the `DFX_DISA

### feat: canister installation now waits for the replica

When installing a new WASM module to a canister, DFX will now wait for the updated state (i.e. the new module hash) to be visible in the replica's certified state tree before proceeding with post-installation tasks or producing a success status.
When installing a new Wasm module to a canister, DFX will now wait for the updated state (i.e. the new module hash) to be visible in the replica's certified state tree before proceeding with post-installation tasks or producing a success status.

### feat!: remove `dfx config`

Expand Down Expand Up @@ -2410,7 +2412,7 @@ can instead use `dfx canister metadata`.

### refactor: optimize from ic-wasm

Optimize Rust canister WASM module via ic-wasm library instead of ic-cdk-optimizer. A separate installation of ic-cdk-optimizer is no longer needed.
Optimize Rust canister Wasm module via ic-wasm library instead of ic-cdk-optimizer. A separate installation of ic-cdk-optimizer is no longer needed.

The actual optimization was kept the same.

Expand Down Expand Up @@ -3707,7 +3709,7 @@ dfx deploy or dfx install will delete them.

### feat: get certified canister info from read state #1514

Added `dfx canister info` command to get certified canister information. Currently this information is limited to the controller of the canister and the SHA256 hash of its WASM module. If there is no WASM module installed, the hash will be None.
Added `dfx canister info` command to get certified canister information. Currently this information is limited to the controller of the canister and the SHA256 hash of its Wasm module. If there is no Wasm module installed, the hash will be None.

## Asset Canister

Expand Down Expand Up @@ -3850,18 +3852,18 @@ Please submit your Principal ("dfx identity get-principal") in the intake form t
- feat: add deploy wallet subcommand to identity (#1414)

This feature adds the deploy-wallet subcommand to the dfx identity.
The User provides the ID of the canister onto which the wallet WASM is deployed.
The User provides the ID of the canister onto which the wallet Wasm is deployed.

``` bash
dfx identity deploy-wallet --help
dfx-identity-deploy-wallet
Installs the wallet WASM to the provided canister id
Installs the wallet Wasm to the provided canister id

USAGE:
dfx identity deploy-wallet <canister-id>

ARGS:
<canister-id> The ID of the canister where the wallet WASM will be deployed
<canister-id> The ID of the canister where the wallet Wasm will be deployed

FLAGS:
-h, --help Prints help information
Expand Down
10 changes: 5 additions & 5 deletions docs/cli-reference/dfx-canister.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ For reference information and examples that illustrate using `dfx canister` comm
| [`deposit-cycles`](#dfx-canister-deposit-cycles) | Deposit cycles into the specified canister. |
| `help` | Displays usage information message for a specified subcommand. |
| [`id`](#dfx-canister-id) | Displays the identifier of a canister. |
| [`info`](#dfx-canister-info) | Get the hash of a canister’s WASM module and its current controller. |
| [`info`](#dfx-canister-info) | Get the hash of a canister’s Wasm module and its current controller. |
| [`install`](#dfx-canister-install) | Installs compiled code in a canister. |
| [`logs`](#dfx-canister-logs) | Returns the logs from a canister. |
| [`metadata`](#dfx-canister-metadata) | Displays metadata in a canister. |
Expand Down Expand Up @@ -459,7 +459,7 @@ The command displays output similar to the following:

## dfx canister info

Use the `dfx canister info` command to output a canister's controller and installed WASM module hash.
Use the `dfx canister info` command to output a canister's controller and installed Wasm module hash.

### Basic usage

Expand All @@ -477,7 +477,7 @@ You can use the following argument with the `dfx canister info` command.

### Examples

You can use the `dfx canister info` command to display the canister controller and installed WASM module.
You can use the `dfx canister info` command to display the canister controller and installed Wasm module.

To the data about the `hello_world` canister, you can run the following command:

Expand Down Expand Up @@ -517,7 +517,7 @@ You can use the following options with the `dfx canister install` command.
| `--no-wallet` | Performs the call with the user Identity as the Sender of messages. Bypasses the Wallet canister. Enabled by default. |
| `--no-asset-upgrade` | Skips upgrading the asset canister, to only install the assets themselves. |
| `--upgrade-unchanged` | Upgrade the canister even if the .wasm did not change. |
| `--wasm <file.wasm>` | Specifies a particular WASM file to install, bypassing the dfx.json project settings. |
| `--wasm <file.wasm>` | Specifies a particular Wasm file to install, bypassing the dfx.json project settings. |

#### Specifies the argument to pass to the init entrypoint

Expand Down Expand Up @@ -609,7 +609,7 @@ The command displays output similar to the following:

## dfx canister metadata

Use the `dfx canister metadata` command to display metadata stored in a canister's WASM module.
Use the `dfx canister metadata` command to display metadata stored in a canister's Wasm module.

### Basic usage

Expand Down
6 changes: 3 additions & 3 deletions docs/cli-reference/dfx-identity.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ For reference information and examples that illustrate using `dfx identity` comm

| Command | Description |
|-------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------|
| [`deploy-wallet`](#dfx-identity-deploy-wallet) | Installs the wallet WASM to the provided canister id. |
| [`deploy-wallet`](#dfx-identity-deploy-wallet) | Installs the wallet Wasm to the provided canister id. |
| [`get-principal`](#dfx-identity-get-principal) | Shows the textual representation of the principal associated with the current identity. |
| [`get-wallet`](#dfx-identity-get-wallet) | Shows the canister identifier for the wallet associated with your current identity principal. |
| `help` | Displays this usage message or the help of the given subcommand(s). |
Expand All @@ -48,7 +48,7 @@ This command adds a private key for the `ic_admin` user identity in the `~/.conf

## dfx identity deploy-wallet

Use the `dfx identity deploy-wallet` command to turn a canister into a wallet canister by installing the wallet WASM to it.
Use the `dfx identity deploy-wallet` command to turn a canister into a wallet canister by installing the wallet Wasm to it.

Note that you must be connected to the IC or the local canister execution environment to run this command. In addition, you must be a controller of the canister you want to deploy the wallet to.

Expand All @@ -64,7 +64,7 @@ You must specify the following argument for the `dfx identity deploy-wallet` com

| Argument | Description |
|-----------------|----------------------------------------------------------------|
| `<canister id>` | The ID of the canister where the wallet WASM will be deployed. |
| `<canister id>` | The ID of the canister where the wallet Wasm will be deployed. |

## dfx identity get-principal

Expand Down
20 changes: 10 additions & 10 deletions docs/dfx-json-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
},
"package": {
"title": "Package Name",
"description": "Name of the rust package that compiles to this canister's WASM.",
"description": "Name of the rust package that compiles to this canister's Wasm binary.",
"type": "string"
},
"type": {
Expand Down Expand Up @@ -273,7 +273,7 @@
"properties": {
"build": {
"title": "Build Commands",
"description": "Commands that are executed in order to produce this canister's WASM module. Expected to produce the WASM in the path specified by the 'wasm' field. No build commands are allowed if the `wasm` field is a URL.",
"description": "Commands that are executed in order to produce this canister's Wasm module. Expected to produce the Wasm in the path specified by the 'wasm' field. No build commands are allowed if the `wasm` field is a URL.",
"default": [],
"allOf": [
{
Expand All @@ -293,8 +293,8 @@
]
},
"wasm": {
"title": "WASM Path",
"description": "Path to WASM to be installed. URLs to a WASM module are also acceptable. A canister that has a URL to a WASM module can not also have `build` steps.",
"title": "Wasm Path",
"description": "Path to Wasm to be installed. URLs to a Wasm module are also acceptable. A canister that has a URL to a Wasm module can not also have `build` steps.",
"type": "string"
}
}
Expand Down Expand Up @@ -381,7 +381,7 @@
}
},
"gzip": {
"title": "Gzip Canister WASM",
"title": "Gzip Canister Wasm",
"description": "Disabled by default.",
"type": [
"boolean",
Expand Down Expand Up @@ -438,7 +438,7 @@
}
},
"optimize": {
"title": "Optimize Canister WASM",
"title": "Optimize Canister Wasm",
"description": "Invoke wasm level optimizations after building the canister. Optimization level can be set to \"cycles\" to optimize for cycle usage, \"size\" to optimize for binary size, or any of \"O4, O3, O2, O1, O0, Oz, Os\". Disabled by default. If this option is specified, the `shrink` option will be ignored.",
"default": null,
"anyOf": [
Expand Down Expand Up @@ -487,7 +487,7 @@
]
},
"shrink": {
"title": "Shrink Canister WASM",
"title": "Shrink Canister Wasm",
"description": "Whether run `ic-wasm shrink` after building the Canister. Enabled by default for Rust/Motoko canisters. Disabled by default for custom canisters.",
"type": [
"boolean",
Expand Down Expand Up @@ -961,8 +961,8 @@
"minimum": 0.0
},
"wasm_memory_limit": {
"title": "WASM Memory Limit",
"description": "Specifies a soft limit (in bytes) on the Wasm memory usage of the canister.\n\nUpdate calls, timers, heartbeats, installs, and post-upgrades fail if the WASM memory usage exceeds this limit. The main purpose of this setting is to protect against the case when the canister reaches the hard 4GiB limit.\n\nMust be a number of bytes between 0 and 2^48 (i.e. 256 TiB), inclusive. Can be specified as an integer, or as an SI unit string (e.g. \"4KB\", \"2 MiB\")",
"title": "Wasm Memory Limit",
"description": "Specifies a soft limit (in bytes) on the Wasm memory usage of the canister.\n\nUpdate calls, timers, heartbeats, installs, and post-upgrades fail if the Wasm memory usage exceeds this limit. The main purpose of this setting is to protect against the case when the canister reaches the hard 4GiB limit.\n\nMust be a number of bytes between 0 and 2^48 (i.e. 256 TiB), inclusive. Can be specified as an integer, or as an SI unit string (e.g. \"4KB\", \"2 MiB\")",
"default": null,
"anyOf": [
{
Expand Down Expand Up @@ -1207,4 +1207,4 @@
]
}
}
}
}
4 changes: 2 additions & 2 deletions e2e/assets/wasm/identity/README.adoc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
= How to build the main.wasm

The code for this WASM is in `/e2e/assets/identity/identity.mo`.
The code for this Wasm is in `/e2e/assets/identity/identity.mo`.

Follow the instructions there; create a new dfx project, overwrite the project's
main.mo with the file above, and then rebuild it.
Take the resulting WASM and DID and put them here.
Take the resulting Wasm and DID and put them here.

- [ ] TODO(#682)
6 changes: 3 additions & 3 deletions e2e/tests-dfx/build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@ teardown() {
dfx_start
dfx canister create --all
assert_command dfx build custom -vvv
assert_not_match "Shrinking WASM"
assert_not_match "Shrinking Wasm"

jq '.canisters.custom.shrink=true' dfx.json | sponge dfx.json
assert_command dfx build custom -vvv
assert_match "Shrinking WASM"
assert_match "Shrinking Wasm"
}

@test "build custom canister default no optimize" {
Expand All @@ -170,7 +170,7 @@ teardown() {

jq '.canisters.custom.optimize="size"' dfx.json | sponge dfx.json
assert_command dfx build custom -vvv
assert_match "Optimizing WASM at level"
assert_match "Optimizing Wasm at level"
}

@test "build succeeds if enable gzip" {
Expand Down
8 changes: 4 additions & 4 deletions e2e/tests-dfx/create.bash
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ teardown() {

assert_command dfx canister create e2e_project_frontend --no-wallet
assert_command dfx canister status e2e_project_frontend
assert_contains "Reserved Cycles Limit: 5_000_000_000_000 Cycles"
assert_contains "Reserved cycles limit: 5_000_000_000_000 Cycles"

assert_command dfx canister create e2e_project_backend --reserved-cycles-limit 470000 --no-wallet
assert_command dfx canister status e2e_project_backend
assert_contains "Reserved Cycles Limit: 470_000 Cycles"
assert_contains "Reserved cycles limit: 470_000 Cycles"
}

@test "create succeeds on default project" {
Expand Down Expand Up @@ -329,7 +329,7 @@ teardown() {
assert_command dfx canister status e2e_project_backend
assert_contains 'Memory allocation: 2_147_483_648'
assert_contains 'Compute allocation: 5'
assert_contains 'Reserved Cycles Limit: 1_000_000_000_000'
assert_contains 'WASM Memory Limit: 1_073_741_824'
assert_contains 'Reserved cycles limit: 1_000_000_000_000'
assert_contains 'Wasm memory limit: 1_073_741_824'
assert_contains 'Freezing threshold: 604_800'
}
2 changes: 1 addition & 1 deletion e2e/tests-dfx/deploy.bash
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ teardown() {
assert_command dfx deploy --no-wallet

assert_command dfx canister status hello_backend
assert_contains "Reserved Cycles Limit: 860_000 Cycles"
assert_contains "Reserved cycles limit: 860_000 Cycles"
}

@test "deploy --upgrade-unchanged upgrades even if the .wasm did not change" {
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests-dfx/rust.bash
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ teardown() {
dfx_start
dfx canister create --all
assert_command dfx build hello_backend -vvv
assert_match "Shrinking WASM"
assert_match "Shrinking Wasm"
assert_command dfx canister install hello_backend
assert_command dfx canister call hello_backend greet dfinity
assert_match '("Hello, dfinity!")'
Expand Down
8 changes: 4 additions & 4 deletions e2e/tests-dfx/update_settings.bash
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ teardown() {
dfx_start
assert_command dfx deploy hello_backend
assert_command dfx canister status hello_backend
assert_contains "Reserved Cycles Limit: 5_000_000_000_000 Cycles"
assert_contains "Reserved cycles Limit: 5_000_000_000_000 Cycles"

assert_command dfx canister update-settings hello_backend --reserved-cycles-limit 650000
assert_command dfx canister status hello_backend
assert_contains "Reserved Cycles Limit: 650_000 Cycles"
assert_contains "Reserved cycles Limit: 650_000 Cycles"
}

@test "set freezing threshold" {
Expand All @@ -49,12 +49,12 @@ teardown() {
assert_command dfx canister create e2e_project_backend --no-wallet --wasm-memory-limit 2MiB
assert_command dfx deploy e2e_project_backend
assert_command dfx canister status e2e_project_backend
assert_contains "WASM Memory Limit: 2_097_152 Bytes"
assert_contains "Wasm memory limit: 2_097_152 Bytes"
# currently the limit is only checked when the memory grows. uncomment this line when that changes
# assert_command dfx canister call e2e_project_backend greet_update '("alice")'
assert_command dfx canister update-settings e2e_project_backend --wasm-memory-limit 8b
assert_command dfx canister status e2e_project_backend
assert_contains "WASM Memory Limit: 8 Bytes"
assert_contains "Wasm memory limit: 8 Bytes"
assert_command dfx canister call e2e_project_backend greet '("alice")' --query
assert_command dfx canister call e2e_project_backend greet '("alice")' --update
assert_command_fail dfx canister call e2e_project_backend greet_update '("alice")'
Expand Down
Loading