Dfx 0.14.0 is promoted!

Please see:

Highlights:

  • updates default gateway to icp0.io
  • new optimizer available
  • asset canister supports v2 certification
6 Likes

Pinning this thread for 2 days since there has been multiple reports regarding ic0.app/icp0.io domains.

2 Likes

Here’s a list of forum posts that are likely relevant to a lot of people right now, especially because of the change from ic0.app to icp0.io:

1 Like

Where can we find more info on the following:

The options are "cycles", "size", "O4", "O3", "O2", "O1", "O0", "Oz", and "Os". The options starting with "O" are the optimization levels that wasm-opt provides. The "cycles" and "size" options are recommended defaults for optimizing for cycle usage and binary size respectively.

What should we be using in production?

1 Like

Hey @skilesare

We recommend “cycles” as the default option. You can find specific numbers here:

If you are very constrained by binary size, “size” let’s you shave off another percent or two but you will take a performance hit relative to “cycles”. Note that “cycles” is the same as “O3” and “size” is the same as “Oz”.

If you want to get into the weeds, this is where the optimizations come from: GitHub - WebAssembly/binaryen: Optimizer and compiler/toolchain library for WebAssembly

3 Likes

It would be really nice if dfx also automatically gzipped the binary after optimization. Optimization will not always be enough, and if it isn’t right now there seems to be no way to really gzip the binary before installation but after it’s been optimized with the built-in wasm-opt.

A post_build script would also potentially solve the problem.

Discussion here: Automatically gzip Wasm binaries · dfinity/sdk · Discussion #3110 · GitHub

1 Like

Is the wasm-opt functionality available from the dfx executable somehow? For example, can I do something like dfx wasm-opt [path-to-binary]?

No but you can find the CLI here: GitHub - dfinity/ic-wasm: A collection of libraries and tools for transforming Wasm canisters running on the Internet Computer

The optimizer is under the shrink command

My use case is Azle and Kybra, CDKs. It would be nice to not have to install ic-wasm for our users, it adds to initial install times. dfx is a prerequisite, so it would be great to have that functionality through the dfx executable.

1 Like

I’m on a Mac M1. I cannot run dfx nns install:

Downloading /Users/afat/.cache/dfinity/versions/0.14.0/wasms/ic-icrc1-index.wasm
  from .gz: https://download.dfinity.systems/ic/21aa2ba29bf97115aa3cdedecf0655d0cfa64bf1/canisters/ic-icrc1-index.wasm.gz
ic-nns-init --pass-specified-id --url http://127.0.0.1:57527/ --wasm-dir /Users/afat/.cache/dfinity/versions/0.14.0/wasms --initialize-ledger-with-test-accounts 5b315d2f6702cb3a27d826161797d7b2c2e131cd312aece51d4d5574d1247087 --initialize-ledger-with-test-accounts 2b8fbde99de881f695f279d2a892b1137bfe81a42d7694e064b1be58701e1138 --sns-subnet utvl3-iivpa-pw4l7-hb4ex-2xwrd-hj735-emloh-2drcw-ne3ky-ty42r-7qe
dyld[25016]: Library not loaded: /usr/local/opt/openssl@3/lib/libssl.3.dylib
  Referenced from: <137E40DB-D0B9-3FFA-B736-2AF42D0C0F72> /Users/afat/.cache/dfinity/versions/0.14.0/ic-nns-init
  Reason: tried: '/usr/local/opt/openssl@3/lib/libssl.3.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/openssl@3/lib/libssl.3.dylib' (no such file), '/usr/local/opt/openssl@3/lib/libssl.3.dylib' (no such file), '/usr/local/lib/libssl.3.dylib' (no such file), '/usr/lib/libssl.3.dylib' (no such file, not in dyld cache)
Error: Failed to install NNS components.
Caused by: Failed to install NNS components.
  Failed to install NNS components.
    ic-nns-init call failed

Our team is reporting this and it seems to align with people using Macs.

I get the same issue on Ubuntu. You need to install openssl

I have v3.1.0 The directory it is looking for doesn’t exist. /opt/ isn’t there.

1 Like

This is still a major issue for anyone on mac…we can’t upgrade our projects test environments until we can get dfx nns install working.

I tried following the workaround that levi posted but ended up with:

ic-nns-init --pass-specified-id --url http://127.0.0.1:50489/ --wasm-dir /Users/afat/.cache/dfinity/versions/0.14.0/wasms --initialize-ledger-with-test-accounts 5b315d2f6702cb3a27d826161797d7b2c2e131cd312aece51d4d5574d1247087 --initialize-ledger-with-test-accounts 2b8fbde99de881f695f279d2a892b1137bfe81a42d7694e064b1be58701e1138 --sns-subnet w2hnf-4j6rg-opjqo-r7kgt-h7uhj-wgwsw-qizku-cc4xy-u55qw-xjgzs-cqe
dyld[15816]: Library not loaded: /usr/local/opt/openssl@3/lib/libssl.3.dylib
  Referenced from: <137E40DB-D0B9-3FFA-B736-2AF42D0C0F72> /Users/afat/.cache/dfinity/versions/0.14.0/ic-nns-init
  Reason: tried: '/usr/local/opt/openssl@3/lib/libssl.3.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/openssl@3/lib/libssl.3.dylib' (no such file), '/usr/local/opt/openssl@3/lib/libssl.3.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/local/lib/libssl.3.dylib' (no such file), '/usr/lib/libssl.3.dylib' (no such file, not in dyld cache)
Error: Failed to install NNS components.
Caused by: Failed to install NNS components.
  Failed to install NNS components.
    ic-nns-init call failed

@ericswanson

dfx 0.14.1 should resolve these openssl3 issues, by static linking to openssl. I expect to see dfx 0.14.1-beta.1 created in the next few days.

5 Likes

could you give it a spin?

dfx 0.14.1-beta.1 is now available for manual installation and testing.

DFX_VERSION=0.14.1-beta.1 sh -ci "$(curl -fsSL  https://internetcomputer.org/install.sh)"

Release notes: Release 0.14.1-beta.1 · dfinity/sdk · GitHub

It installed for me! Thanks.

1 Like

This looks sexy:

fix: motoko canisters can import other canisters with service constructor

After specific canister builder output wasm and candid file, dfx will do some post processing on the candid file.

The complete IDL will be copied into .dfx folder with name constructor.did.
It will be used for type checking during canister installation.

Then it is separated into two parts: service.did and init_args.txt, corresponding to canister metadata candid:service and candid:args.

service.did will be imported during dependent canisters building. And it will also be used by the Motoko LSP to provide IDE support.

What does this look like in practice? @claudio