diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bf2815362..4f03fa92fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,8 @@ This applies to the following: - tech stack value computation - packtool (vessel, mops etc) +### chore: update Candid UI canister with commit 8c20762b734316613792226fb247a2aabd8fb823 + ### feat: `dfx extension list` supports listing available extensions `dfx extension list` now support `--available` flag to list available extensions from the @@ -48,11 +50,30 @@ The extension catalog can be overridden with the `--catalog-url` parameter. ## Dependencies +### Replica + +Updated replica to elected commit 179973553248415fc85679d853b48b0e0ec231c6. +This incorporates the following executed proposals: + +- [132482](https://dashboard.internetcomputer.org/proposal/132482) +- [132481](https://dashboard.internetcomputer.org/proposal/132481) +- [132375](https://dashboard.internetcomputer.org/proposal/132375) +- [132222](https://dashboard.internetcomputer.org/proposal/132222) +- [132149](https://dashboard.internetcomputer.org/proposal/132149) +- [132148](https://dashboard.internetcomputer.org/proposal/132148) +- [131787](https://dashboard.internetcomputer.org/proposal/131787) +- [131757](https://dashboard.internetcomputer.org/proposal/131757) +- [131697](https://dashboard.internetcomputer.org/proposal/131697) + ### Frontend canister Added `create_chunks`. It has the same behavior as `create_chunk`, except that it takes a `vec blob` and returns a `vec BatchId` instead of non-`vec` variants. -Module hash: 3a533f511b3960b4186e76cf9abfbd8222a2c507456a66ec55671204ee70cae3 +Updated dependencies. + +- Module hash: 3a533f511b3960b4186e76cf9abfbd8222a2c507456a66ec55671204ee70cae3 +- https://github.com/dfinity/sdk/pull/3898 +- https://github.com/dfinity/sdk/pull/3889 ### Motoko diff --git a/Cargo.lock b/Cargo.lock index 2591726658..b130a8a798 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4563,7 +4563,7 @@ dependencies = [ [[package]] name = "pocket-ic" version = "4.0.0" -source = "git+https://github.com/dfinity/ic?rev=3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d#3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d" +source = "git+https://github.com/dfinity/ic?rev=179973553248415fc85679d853b48b0e0ec231c6#179973553248415fc85679d853b48b0e0ec231c6" dependencies = [ "base64 0.13.1", "candid", @@ -4575,6 +4575,7 @@ dependencies = [ "serde_bytes", "serde_json", "sha2 0.10.8", + "slog", "tokio", "tracing", "tracing-appender", @@ -6220,9 +6221,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.39.3" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", "bytes", diff --git a/Cargo.toml b/Cargo.toml index 29d933625c..c5857a2a3f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ candid = "0.10.4" candid_parser = "0.1.4" ic-agent = { git = "https://github.com/dfinity/agent-rs.git", rev = "6e11a350112f9b907c4d590d8217f340e153d898" } ic-asset = { path = "src/canisters/frontend/ic-asset" } -ic-cdk = "0.13.1" +ic-cdk = "0.13.5" ic-identity-hsm = { git = "https://github.com/dfinity/agent-rs.git", rev = "6e11a350112f9b907c4d590d8217f340e153d898" } ic-utils = { git = "https://github.com/dfinity/agent-rs.git", rev = "6e11a350112f9b907c4d590d8217f340e153d898" } @@ -71,7 +71,7 @@ semver = "1.0.6" tempfile = "3.3.0" thiserror = "1.0.24" time = "0.3.9" -tokio = "1.35" +tokio = "1.40" url = { version = "2.1.0", features = ["serde"] } walkdir = "2.3.2" diff --git a/e2e/tests-dfx/assetscanister.bash b/e2e/tests-dfx/assetscanister.bash index 27f4d3c25a..75c9e70509 100644 --- a/e2e/tests-dfx/assetscanister.bash +++ b/e2e/tests-dfx/assetscanister.bash @@ -718,7 +718,7 @@ check_permission_failure() { # fails with because %e6 is not valid utf-8 percent encoding assert_command_fail curl --fail -vv http://localhost:"$PORT"/%e6?canisterId="$ID" - assert_contains "400 Bad Request" + assert_contains "500 Internal Server Error" } @test "http_request percent-decodes urls" { @@ -788,7 +788,7 @@ check_permission_failure() { assert_command_fail curl --fail -vv http://localhost:"$PORT"/%e6?canisterId="$ID" # fails because %e6 is not valid utf-8 percent encoding - assert_contains "400 Bad Request" + assert_contains "500 Internal Server Error" assert_command curl --fail -vv http://localhost:"$PORT"/%25?canisterId="$ID" assert_match "200 OK" "$stderr" @@ -803,7 +803,7 @@ check_permission_failure() { # curl now reports "curl: (3) URL using bad/illegal format or missing URL" so we cannot verify behavior # assert_command_fail curl --fail -vv --path-as-is http://localhost:"$PORT"/'filename with space'.txt?canisterId="$ID" - # assert_match "400 Bad Request" "$stderr" + # assert_match "500 Internal Server Error" "$stderr" } @test "generates gzipped content encoding for .js files" { diff --git a/e2e/tests-dfx/create.bash b/e2e/tests-dfx/create.bash index f7babaf6b3..9c15e48f77 100644 --- a/e2e/tests-dfx/create.bash +++ b/e2e/tests-dfx/create.bash @@ -348,7 +348,7 @@ teardown() { assert_contains 'Memory allocation: 0' assert_contains 'Compute allocation: 0' assert_contains 'Reserved cycles limit: 5_000_000_000_000' - assert_contains 'Wasm memory limit: 0' + assert_contains 'Wasm memory limit: 3_221_225_472' assert_contains 'Freezing threshold: 2_592_000' assert_contains 'Log visibility: controllers' } diff --git a/e2e/tests-dfx/cycles-ledger.bash b/e2e/tests-dfx/cycles-ledger.bash index 7feb9e05e5..1b36725427 100644 --- a/e2e/tests-dfx/cycles-ledger.bash +++ b/e2e/tests-dfx/cycles-ledger.bash @@ -25,7 +25,7 @@ teardown() { start_and_install_nns() { dfx_start_for_nns_install - dfx extension install nns --version 0.3.1 + dfx extension install nns --version 0.4.3 dfx nns install --ledger-accounts "$(dfx ledger account-id --identity cycle-giver)" } diff --git a/nix/sources.json b/nix/sources.json index 2028dabc2a..80ce442402 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -2,71 +2,71 @@ "canister_sandbox-x86_64-darwin": { "builtin": false, "description": "The canister_sandbox binary. It must be updated together with the replica binary.", - "rev": "3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d", - "sha256": "0gwf449hw1j4c0v9na3968k6fs9l0ag9hm10vnqkds6vlc7wq8pa", + "rev": "179973553248415fc85679d853b48b0e0ec231c6", + "sha256": "06l0c6ad38jz79mc4jl8l5v989r861j9a5c607r6d1zcm2flyc64", "type": "file", - "url": "https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-darwin/canister_sandbox.gz", + "url": "https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-darwin/canister_sandbox.gz", "url_template": "https://download.dfinity.systems/ic//binaries/x86_64-darwin/canister_sandbox.gz" }, "canister_sandbox-x86_64-linux": { "builtin": false, "description": "The canister_sandbox binary. It must be updated together with the replica binary.", - "rev": "3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d", - "sha256": "08pjwgxzmk91bifb6xqbmm0vs0nswypwazj4zb4dmy4rxzdi90p3", + "rev": "179973553248415fc85679d853b48b0e0ec231c6", + "sha256": "0aza359s5hvx1f16pyrrn819jbs61rsfdf0wrljw920xc60x0r6f", "type": "file", - "url": "https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-linux/canister_sandbox.gz", + "url": "https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-linux/canister_sandbox.gz", "url_template": "https://download.dfinity.systems/ic//binaries/x86_64-linux/canister_sandbox.gz" }, "compiler_sandbox-x86_64-darwin": { "builtin": false, "description": "The compiler_sandbox binary. It must be updated together with the replica binary.", - "rev": "3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d", - "sha256": "1s9pcwq2288xdbchzgrzvbk3awzc3dj3zij5nfksnqlx6ak5s959", + "rev": "179973553248415fc85679d853b48b0e0ec231c6", + "sha256": "1q2hwdfxxdf64k3w7b3spvxn6wqwxri34n2aiaix5w19ad9czarl", "type": "file", - "url": "https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-darwin/compiler_sandbox.gz", + "url": "https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-darwin/compiler_sandbox.gz", "url_template": "https://download.dfinity.systems/ic//binaries/x86_64-darwin/compiler_sandbox.gz" }, "compiler_sandbox-x86_64-linux": { "builtin": false, "description": "The compiler_sandbox binary. It must be updated together with the replica binary.", - "rev": "3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d", - "sha256": "1r1dai197xy8kjb68h4j0pdic5zn5h0pcpqsjz7ipxcnfizdf4mk", + "rev": "179973553248415fc85679d853b48b0e0ec231c6", + "sha256": "173d8g1j6j2qhnpvw4xqkh6xl7x7dsr7dzp992icka6mj2221djb", "type": "file", - "url": "https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-linux/compiler_sandbox.gz", + "url": "https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-linux/compiler_sandbox.gz", "url_template": "https://download.dfinity.systems/ic//binaries/x86_64-linux/compiler_sandbox.gz" }, "ic-admin-x86_64-darwin": { "builtin": false, "description": "The ic-admin binary.", - "rev": "3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d", - "sha256": "0gqi3kz5i50yz44kn9adpbahlamp9zqz05mwrvr3abw8z4bd9jwb", + "rev": "179973553248415fc85679d853b48b0e0ec231c6", + "sha256": "1dw40zn1rgr7wpf6nb5wyhfs6y1gh2dkx4v6pgqnl8246xd7y3fj", "type": "file", - "url": "https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-darwin/ic-admin.gz", + "url": "https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-darwin/ic-admin.gz", "url_template": "https://download.dfinity.systems/ic//binaries/x86_64-darwin/ic-admin.gz" }, "ic-admin-x86_64-linux": { "builtin": false, "description": "The ic-admin binary.", - "rev": "3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d", - "sha256": "0zfc2vchrgqp4rrvb8d5jymrjp15x67jpra3nnlh2cwnsmxvqqvf", + "rev": "179973553248415fc85679d853b48b0e0ec231c6", + "sha256": "1ry5jiwdi4pwagd1lv3j3sp87plp3ayk4riirzn77inw3adjzdlz", "type": "file", - "url": "https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-linux/ic-admin.gz", + "url": "https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-linux/ic-admin.gz", "url_template": "https://download.dfinity.systems/ic//binaries/x86_64-linux/ic-admin.gz" }, "ic-btc-adapter-x86_64-darwin": { "builtin": false, - "rev": "3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d", - "sha256": "1xjnm2mxrydadpq0vyqv503g5ba10lajh0rf441is561z3p8ms9p", + "rev": "179973553248415fc85679d853b48b0e0ec231c6", + "sha256": "01cna8svy9fml5pnjpp669f47bcp2rpcwi15f2xwq9p8vnpaz2la", "type": "file", - "url": "https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-darwin/ic-btc-adapter.gz", + "url": "https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-darwin/ic-btc-adapter.gz", "url_template": "https://download.dfinity.systems/ic//binaries/x86_64-darwin/ic-btc-adapter.gz" }, "ic-btc-adapter-x86_64-linux": { "builtin": false, - "rev": "3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d", - "sha256": "0hvjihh8inm19lf246s84wrpq58lpcqs0y75g54s9nz2cns2dx70", + "rev": "179973553248415fc85679d853b48b0e0ec231c6", + "sha256": "1ixh0n507dpp1wcmbqsmf4ys8hxz5m764mybjx2hf41zkbqxydcx", "type": "file", - "url": "https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-linux/ic-btc-adapter.gz", + "url": "https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-linux/ic-btc-adapter.gz", "url_template": "https://download.dfinity.systems/ic//binaries/x86_64-linux/ic-btc-adapter.gz" }, "ic-btc-canister": { @@ -78,52 +78,52 @@ }, "ic-https-outcalls-adapter-x86_64-darwin": { "builtin": false, - "rev": "3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d", - "sha256": "0zsvmxg81nwv3rznhcc1yzf92a3kp6xzwnnsngg95v6w5x8g3pmd", + "rev": "179973553248415fc85679d853b48b0e0ec231c6", + "sha256": "0sklvbzvvqpv74mq1s3bvjwdsgxnz7hlv2vl7z1f54slk4952h3m", "type": "file", - "url": "https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-darwin/ic-https-outcalls-adapter.gz", + "url": "https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-darwin/ic-https-outcalls-adapter.gz", "url_template": "https://download.dfinity.systems/ic//binaries/x86_64-darwin/ic-https-outcalls-adapter.gz" }, "ic-https-outcalls-adapter-x86_64-linux": { "builtin": false, - "rev": "3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d", - "sha256": "0b1lapab1jav2flgklp6mhy5k7rpzdd02mc8psszz2p44lxnl1l3", + "rev": "179973553248415fc85679d853b48b0e0ec231c6", + "sha256": "0gnx6gi0wzknzd75fhfrcajaypr2n0mjnm1afrpam80rd7is73k4", "type": "file", - "url": "https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-linux/ic-https-outcalls-adapter.gz", + "url": "https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-linux/ic-https-outcalls-adapter.gz", "url_template": "https://download.dfinity.systems/ic//binaries/x86_64-linux/ic-https-outcalls-adapter.gz" }, "ic-nns-init-x86_64-darwin": { "builtin": false, "description": "The ic-nns-init binary.", - "rev": "3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d", - "sha256": "0nrhmhcl0fhf35r64rap60cgjdwqr1lavvsak6amwzcznmkzci0x", + "rev": "179973553248415fc85679d853b48b0e0ec231c6", + "sha256": "1625qn6gr3ikdzcibgymrfdnr8w4228yk6inqcp71gm97ndrkx1q", "type": "file", - "url": "https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-darwin/ic-nns-init.gz", + "url": "https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-darwin/ic-nns-init.gz", "url_template": "https://download.dfinity.systems/ic//binaries/x86_64-darwin/ic-nns-init.gz" }, "ic-nns-init-x86_64-linux": { "builtin": false, "description": "The ic-nns-init binary.", - "rev": "3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d", - "sha256": "1i2gww8cy414p1gapxp5kyq371fv193p5wbj1nrjb1jq9rcrgk4j", + "rev": "179973553248415fc85679d853b48b0e0ec231c6", + "sha256": "103m70b2zp93baqbr5fayz4p0ykmn1sg5f73r2jdvgydyz8d0irg", "type": "file", - "url": "https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-linux/ic-nns-init.gz", + "url": "https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-linux/ic-nns-init.gz", "url_template": "https://download.dfinity.systems/ic//binaries/x86_64-linux/ic-nns-init.gz" }, "ic-starter-x86_64-darwin": { "builtin": false, - "rev": "3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d", - "sha256": "1k93j3h39ypbddmbirdszilmk30hnmn1jrvg1rcaqyj7g5z960j5", + "rev": "179973553248415fc85679d853b48b0e0ec231c6", + "sha256": "0p5d07nkn4d4nq6fsppcc27sm8kykimqa83n7m002jwv1rcm2rn4", "type": "file", - "url": "https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-darwin/ic-starter.gz", + "url": "https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-darwin/ic-starter.gz", "url_template": "https://download.dfinity.systems/ic//binaries/x86_64-darwin/ic-starter.gz" }, "ic-starter-x86_64-linux": { "builtin": false, - "rev": "3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d", - "sha256": "1lyp9g0lh8b7dwcn1kkcj5nxvxhy3x1x39s61yk6ym3sq3bkjq9v", + "rev": "179973553248415fc85679d853b48b0e0ec231c6", + "sha256": "0kbpfsysl76pypbfqh5rmnmwk3diin25q3760rx9342s9wjvcfnh", "type": "file", - "url": "https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-linux/ic-starter.gz", + "url": "https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-linux/ic-starter.gz", "url_template": "https://download.dfinity.systems/ic//binaries/x86_64-linux/ic-starter.gz" }, "motoko-base": { @@ -153,71 +153,71 @@ "version": "0.12.1" }, "pocket-ic-x86_64-darwin": { - "rev": "3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d", - "sha256": "0i0idk3k93lb6g2bnxvcrdxj1psnfdw2aqdj9kl85safsk3wbads", + "rev": "179973553248415fc85679d853b48b0e0ec231c6", + "sha256": "02h2834ki81zjmrn821fj3zh89m86lrc1x16nmdfarbbc5b3x9v5", "type": "file", - "url": "https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-darwin/pocket-ic.gz", + "url": "https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-darwin/pocket-ic.gz", "url_template": "https://download.dfinity.systems/ic//binaries/x86_64-darwin/pocket-ic.gz" }, "pocket-ic-x86_64-linux": { - "rev": "3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d", - "sha256": "0cwgx77s6pdq4bsp116dba359hha4r7ahl2wnzzh28b9mdqkkdff", + "rev": "179973553248415fc85679d853b48b0e0ec231c6", + "sha256": "1n1a0hlg0g9frk18p0bg4ay4v250i7h8f6gjn7rlv893g99q7y50", "type": "file", - "url": "https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-linux/pocket-ic.gz", + "url": "https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-linux/pocket-ic.gz", "url_template": "https://download.dfinity.systems/ic//binaries/x86_64-linux/pocket-ic.gz" }, "replica-x86_64-darwin": { "builtin": false, "description": "The replica binary. It must be updated together with the canister_sandbox binary.", - "rev": "3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d", - "sha256": "1hd7i76zfxj6f7vrfswfwknz4nwjyzwgc2w1dn5jg6c4dv6a8gd7", + "rev": "179973553248415fc85679d853b48b0e0ec231c6", + "sha256": "1ds9fizizgpwrrbrprjg48dpqwwnnqfhjqfqanbwfbl24wcnjhmd", "type": "file", - "url": "https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-darwin/replica.gz", + "url": "https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-darwin/replica.gz", "url_template": "https://download.dfinity.systems/ic//binaries/x86_64-darwin/replica.gz" }, "replica-x86_64-linux": { "builtin": false, "description": "The replica binary. It must be updated together with the canister_sandbox binary.", - "rev": "3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d", - "sha256": "15ji5r2lhg4i6ww579c130ragzpk5zwa8f2bgi0hn1kkgdbdlqbb", + "rev": "179973553248415fc85679d853b48b0e0ec231c6", + "sha256": "1s9j4glz61vsnl0pgddfjvqqz1qszy6cnkggdzh08f1nqv7sylnb", "type": "file", - "url": "https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-linux/replica.gz", + "url": "https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-linux/replica.gz", "url_template": "https://download.dfinity.systems/ic//binaries/x86_64-linux/replica.gz" }, "sandbox_launcher-x86_64-darwin": { "builtin": false, "description": "The sandbox_launcher binary. It must be updated together with the replica binary.", - "rev": "3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d", - "sha256": "11hfff3nj4krafvdphqf0wjv9h51yiclbzcinvfklggk03762lnc", + "rev": "179973553248415fc85679d853b48b0e0ec231c6", + "sha256": "17kkj6v3il1csd2ryl1valfrhm44ax7r7534nkyx64aycxdzy5sa", "type": "file", - "url": "https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-darwin/sandbox_launcher.gz", + "url": "https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-darwin/sandbox_launcher.gz", "url_template": "https://download.dfinity.systems/ic//binaries/x86_64-darwin/sandbox_launcher.gz" }, "sandbox_launcher-x86_64-linux": { "builtin": false, "description": "The sandbox_launcher binary. It must be updated together with the replica binary.", - "rev": "3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d", - "sha256": "118hyg4jdbdm5paclbbv5qmlm7w995pxkx98s6ci2nc7yx6s3i7n", + "rev": "179973553248415fc85679d853b48b0e0ec231c6", + "sha256": "149h5lxd87xqsghpg4kz7x3zbrcp441r4lj72mkdsavspwjr7cih", "type": "file", - "url": "https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-linux/sandbox_launcher.gz", + "url": "https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-linux/sandbox_launcher.gz", "url_template": "https://download.dfinity.systems/ic//binaries/x86_64-linux/sandbox_launcher.gz" }, "sns-x86_64-darwin": { "builtin": false, "description": "The sns binary.", - "rev": "3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d", - "sha256": "194i20d59gfl13jh0dchl5brixvv7dy999r290sb49m8n7sgv19r", + "rev": "179973553248415fc85679d853b48b0e0ec231c6", + "sha256": "0blyd3bf2l716ycd71lbw81kz4x87vdk8q81kl2sba7h8izxakhl", "type": "file", - "url": "https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-darwin/sns.gz", + "url": "https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-darwin/sns.gz", "url_template": "https://download.dfinity.systems/ic//binaries/x86_64-darwin/sns.gz" }, "sns-x86_64-linux": { "builtin": false, "description": "The sns binary.", - "rev": "3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d", - "sha256": "0zhkaxhgs9m5n5f0c4h0fviqsj0v4ddx2i7b78aklg85vg1v91vz", + "rev": "179973553248415fc85679d853b48b0e0ec231c6", + "sha256": "1fpiqf4a5y07g1fxn90x7n82p1lz2wf33x3q92yv34vywmavms73", "type": "file", - "url": "https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-linux/sns.gz", + "url": "https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-linux/sns.gz", "url_template": "https://download.dfinity.systems/ic//binaries/x86_64-linux/sns.gz" } } diff --git a/scripts/test-uis.py b/scripts/test-uis.py index 5752936c29..a51a313768 100644 --- a/scripts/test-uis.py +++ b/scripts/test-uis.py @@ -56,6 +56,7 @@ ] _CANDID_UI_ERRORS_TO_IGNORE = [ ("Failed to load resource: the server responded with a status of 404 (Not Found)", "/read_state"), + ("Error: Please provide a URL to your local Internet Identity service using the `ii` query parameter", "/index.js"), ] # `page.route` does not support additional function parameters _FRONTEND_URL = None diff --git a/src/dfx-core/src/config/model/dfinity.rs b/src/dfx-core/src/config/model/dfinity.rs index 50d2883ea2..3d29c73862 100644 --- a/src/dfx-core/src/config/model/dfinity.rs +++ b/src/dfx-core/src/config/model/dfinity.rs @@ -644,7 +644,7 @@ impl Default for ReplicaLogLevel { } impl ReplicaLogLevel { - pub fn as_ic_starter_string(&self) -> String { + pub fn as_slog_string(&self) -> String { match self { Self::Critical => "critical".to_string(), Self::Error => "error".to_string(), diff --git a/src/dfx/Cargo.toml b/src/dfx/Cargo.toml index ad79c93dc9..cd6104be66 100644 --- a/src/dfx/Cargo.toml +++ b/src/dfx/Cargo.toml @@ -23,7 +23,7 @@ reqwest.workspace = true serde = { version = "1.0", features = ["derive"] } sha2 = "0.10.6" tar = "0.4.26" -tokio = { version = "1.24.2", features = ["full"] } +tokio = { workspace = true, features = ["full"] } toml = "0.7.3" walkdir = "2.3.2" @@ -127,7 +127,7 @@ ci_info = "0.14" junction = "1.0.0" [target.'cfg(unix)'.dependencies] -pocket-ic = { git = "https://github.com/dfinity/ic", rev = "3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d" } +pocket-ic = { git = "https://github.com/dfinity/ic", rev = "179973553248415fc85679d853b48b0e0ec231c6" } [dev-dependencies] env_logger = "0.10" diff --git a/src/dfx/assets/dfx-asset-sources.toml b/src/dfx/assets/dfx-asset-sources.toml index 3d0b8a6900..b38e3d2383 100644 --- a/src/dfx/assets/dfx-asset-sources.toml +++ b/src/dfx/assets/dfx-asset-sources.toml @@ -1,25 +1,25 @@ # generated by write-dfx-asset-sources.sh -replica-rev = '3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d' +replica-rev = '179973553248415fc85679d853b48b0e0ec231c6' [x86_64-darwin.ic-admin] -url = 'https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-darwin/ic-admin.gz' -sha256 = '8bcbd416f9882f35f2cebc16f0f14fb72a0ad5ba4d253b09f91e9458fe1c113f' +url = 'https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-darwin/ic-admin.gz' +sha256 = 'd20d7f5a3744206af1bb66933e9b802f78a31df4bc2c6bdce527bf1cec0784b7' [x86_64-darwin.ic-btc-adapter] -url = 'https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-darwin/ic-btc-adapter.gz' -sha256 = '37e98aeef8c1141d03212e0328150541adf206281bfb0df06daaf9dcaba856f6' +url = 'https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-darwin/ic-btc-adapter.gz' +sha256 = '8a8aafaedde826ccbb702544ce6e1697ad435c32e65e696fa1d525bf35529605' [x86_64-darwin.ic-https-outcalls-adapter] -url = 'https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-darwin/ic-https-outcalls-adapter.gz' -sha256 = 'addef1502fdcec92deb3da5afebbb9732891dcf78131687f1e9bdb805eaf5b7f' +url = 'https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-darwin/ic-https-outcalls-adapter.gz' +sha256 = '75405112995493e2c23f748b4de1f9b63fddb8dc6be8802b39fbe2bdffda746a' [x86_64-darwin.ic-nns-init] -url = 'https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-darwin/ic-nns-init.gz' -sha256 = '1d44f667b59f7d5e95994aefad68c89837f9183057656272190e3a4019ac305b' +url = 'https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-darwin/ic-nns-init.gz' +sha256 = '38f4999b3da9be702ec3369ae9911084a36c9bcbd5bf15d96f338efc8cc54598' [x86_64-darwin.ic-starter] -url = 'https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-darwin/ic-starter.gz' -sha256 = '4502937e79477aac580e6f67196cb5108c5969fcbae5b86a6bebfa34e09023cd' +url = 'https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-darwin/ic-starter.gz' +sha256 = 'c46651590e9b4b01403d7620856b9c7ea2aa8f60ec5eed0cb6a4113bed01ad5c' [x86_64-darwin.motoko] url = 'https://github.com/dfinity/motoko/releases/download/0.12.1/motoko-Darwin-x86_64-0.12.1.tar.gz' @@ -27,30 +27,30 @@ sha256 = '41cfa1a6f93c122458f11229dd1b0873263ab80ab5ae6c5b789552d7b7725f7a' # The replica, canister_sandbox and compiler_sandbox binaries must have the same revision. [x86_64-darwin.replica] -url = 'https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-darwin/replica.gz' -sha256 = 'a73da4cc6e8499278b6d810bf6f8f7925bf2ede48e6b97f7714676f7cd89a7c1' +url = 'https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-darwin/replica.gz' +sha256 = 'ad42691927822ec79755d861091db696737c1b224fe69b57cefcbe1f7f7449b7' # The replica, canister_sandbox and compiler_sandbox binaries must have the same revision. [x86_64-darwin.canister_sandbox] -url = 'https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-darwin/canister_sandbox.gz' -sha256 = 'ea22cc0fa3dbe836b1dd2054989e02346967263269289b366044060e13218e3f' +url = 'https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-darwin/canister_sandbox.gz' +sha256 = 'c4304f9da8ec8766f201861595643028279476a1884ac26a3a5fa2d19461801a' # The replica, canister_sandbox and compiler_sandbox binaries must have the same revision. [x86_64-darwin.compiler_sandbox] -url = 'https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-darwin/compiler_sandbox.gz' -sha256 = 'a9245da6329d62aba7b345c63f641bec7335e6da3fbf0fd96a1d2121306737e9' +url = 'https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-darwin/compiler_sandbox.gz' +sha256 = '34abcf525329f0d2a38a4a583262ee1c7363fbbe7aacc3c724c6b5de5de350e0' [x86_64-darwin.sandbox_launcher] -url = 'https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-darwin/sandbox_launcher.gz' -sha256 = 'cc5261ce00f33d3addb691fd4559f4a1c0b425070ec3dbb65379126987730e86' +url = 'https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-darwin/sandbox_launcher.gz' +sha256 = '4a17ff5b675e11d3fdb46494934f578454981d553b509f45d32cd038b691739e' [x86_64-darwin.sns] -url = 'https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-darwin/sns.gz' -sha256 = '3985fdf4b1a826b2344822a7947c3b7bf79857a1903500e508d4bd541a1091a4' +url = 'https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-darwin/sns.gz' +sha256 = '144ed57f44f0a8a5059d016134db3ea8933f03e28b86d39837e150e1d6689e2e' [x86_64-darwin.pocket-ic] -url = 'https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-darwin/pocket-ic.gz' -sha256 = 'baa9c5c7d44ee982e84cb26125787356df207bcb6c77bbc4338b8e34c76c1144' +url = 'https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-darwin/pocket-ic.gz' +sha256 = '65a73e56616b65e55ab526f4c03235a82604ff902e086473953fa038c940020a' [x86_64-darwin.motoko-base] url = 'https://github.com/dfinity/motoko/releases/download/0.12.1/motoko-base-library.tar.gz' @@ -61,24 +61,24 @@ url = 'https://github.com/dfinity/bitcoin-canister/releases/download/release%2F2 sha256 = '09f5647a45ff6d5d05b2b0ed48613fb2365b5fe6573ba0e901509c39fb9564ac' [x86_64-linux.ic-admin] -url = 'https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-linux/ic-admin.gz' -sha256 = '6e63bc7bd5963301a9b543e52b8fe9255c99ab97a5a1b5732617bf0cd916cc7d' +url = 'https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-linux/ic-admin.gz' +sha256 = '9fb62f9b1adcc673eccf316632bd1a97de83ae1e726c1ada53fc92d87894c5e7' [x86_64-linux.ic-btc-adapter] -url = 'https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-linux/ic-btc-adapter.gz' -sha256 = 'e0f426b465e2dba44979e578a031bb14157c3327481b221c4da1da88208c7243' +url = 'https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-linux/ic-btc-adapter.gz' +sha256 = '9d35dff19a3f10074597cb57624e2dbf43a43d7155e355190ff7b6038a05b0c7' [x86_64-linux.ic-https-outcalls-adapter] -url = 'https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-linux/ic-https-outcalls-adapter.gz' -sha256 = '83066a3b25e48affb5be8855015afb379f593cace6d2f9a8135bc9b0d455342c' +url = 'https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-linux/ic-https-outcalls-adapter.gz' +sha256 = '648ea3e36919a0aa6e762a542b2bb0225fafa462d941574efb767e0ee233dd3e' [x86_64-linux.ic-nns-init] -url = 'https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-linux/ic-nns-init.gz' -sha256 = '92cc97594e588625b30d72f172470adb8533b09fe5f6ab5eb82410cf10e74fc4' +url = 'https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-linux/ic-nns-init.gz' +sha256 = '2f47d0d0f7cdbfdda4c8e3b8f274b0757a70c9f7ca95bcb05a23dd2f16387580' [x86_64-linux.ic-starter] -url = 'https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-linux/ic-starter.gz' -sha256 = '3b6139d7c07a546fa60f46a7d1431f1ef6dd6d916cce60196f672148c14bd7d3' +url = 'https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-linux/ic-starter.gz' +sha256 = 'd03ab6254f5a90917a06e60c5c848db18dc9abadb940ecd6f5d71caabd76774d' [x86_64-linux.motoko] url = 'https://github.com/dfinity/motoko/releases/download/0.12.1/motoko-Linux-x86_64-0.12.1.tar.gz' @@ -86,30 +86,30 @@ sha256 = '1e5da959a90fd64a2d3ed3d5a3f0b6f1bf0150e18b6cdef0732a3f9ea3cdbee2' # The replica, canister_sandbox and compiler_sandbox binaries must have the same revision. [x86_64-linux.replica] -url = 'https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-linux/replica.gz' -sha256 = '6b61da567b73060b417c4b38a4f82ff3fea7321881a5533837913c48452e5196' +url = 'https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-linux/replica.gz' +sha256 = 'cb52afcfc6363804e06fef4dcb8cff1a878ff196aeb57701b57a07f3e92332e9' # The replica, canister_sandbox and compiler_sandbox binaries must have the same revision. [x86_64-linux.canister_sandbox] -url = 'https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-linux/canister_sandbox.gz' -sha256 = 'e38214dbef99f8dac8fa447ec5afe7da02bd41ad0b77b35c5c21cdfafbe3f222' +url = 'https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-linux/canister_sandbox.gz' +sha256 = 'ce64d081611d88c425cd1cb8e6740e462f9902b239fb6b820b7dc3a25319ea2b' # The replica, canister_sandbox and compiler_sandbox binaries must have the same revision. [x86_64-linux.compiler_sandbox] -url = 'https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-linux/compiler_sandbox.gz' -sha256 = 'b312d77e7496f51bcf971a5f76012cf61716db05924064969cc8f79342542de4' +url = 'https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-linux/compiler_sandbox.gz' +sha256 = '4bb6208490d5a8c9a248e9fe76b26ea71fda0d9cb813beaf85584823c3436d9c' [x86_64-linux.sandbox_launcher] -url = 'https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-linux/sandbox_launcher.gz' -sha256 = 'f6c4a14df787591199d128f5d96f49899f4a2b2e7b2dcad42db5ad26c9f31085' +url = 'https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-linux/sandbox_launcher.gz' +sha256 = '30b29325bf7a2bdd6615475292032197e5f5473f7f9277e1d3b81fd43a2d3091' [x86_64-linux.sns] -url = 'https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-linux/sns.gz' -sha256 = '7f87b4c3db053d3a153aeb44d15b231b488de3760012065cb1a526fd6057137e' +url = 'https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-linux/sns.gz' +sha256 = 'e3e8ba55e57e93b1bd4878f4311c179f862b903d1d24db5d7807f8a288c3f1ba' [x86_64-linux.pocket-ic] -url = 'https://download.dfinity.systems/ic/3d0b3f10417fc6708e8b5d844a0bac5e86f3e17d/binaries/x86_64-linux/pocket-ic.gz' -sha256 = 'ceb53971ab692101ffb75c50a84e260ac254865acd8470f522b85da3cfe98f33' +url = 'https://download.dfinity.systems/ic/179973553248415fc85679d853b48b0e0ec231c6/binaries/x86_64-linux/pocket-ic.gz' +sha256 = 'a0f883537a23a14df3b1f21987e089a0884dbc226f818bc2cc2e3df028042ad8' [x86_64-linux.motoko-base] url = 'https://github.com/dfinity/motoko/releases/download/0.12.1/motoko-base-library.tar.gz' diff --git a/src/dfx/src/actors/pocketic.rs b/src/dfx/src/actors/pocketic.rs index 9370b3efc2..2b7e4d5206 100644 --- a/src/dfx/src/actors/pocketic.rs +++ b/src/dfx/src/actors/pocketic.rs @@ -11,13 +11,13 @@ use actix::{ use anyhow::{anyhow, bail}; use candid::Principal; use crossbeam::channel::{unbounded, Receiver, Sender}; +use dfx_core::config::model::dfinity::ReplicaLogLevel; use dfx_core::config::model::replica_config::ReplicaConfig; use slog::{debug, error, info, warn, Logger}; use std::ops::ControlFlow::{self, *}; use std::path::{Path, PathBuf}; use std::thread::JoinHandle; use std::time::{Duration, Instant}; -use tempfile::tempdir; pub mod signals { use actix::prelude::*; @@ -88,18 +88,13 @@ impl PocketIc { fn wait_for_ready( port_file_path: &Path, - ready_file_path: &Path, shutdown_signal: Receiver<()>, ) -> Result> { let mut retries = 0; - let mut ready = false; loop { - if !ready && ready_file_path.exists() { - ready = true; - } - if ready { - if let Ok(content) = std::fs::read_to_string(port_file_path) { - if let Ok(port) = content.parse::() { + if let Ok(content) = std::fs::read_to_string(port_file_path) { + if content.contains('\n') { + if let Ok(port) = content.trim_end().parse::() { return Ok(port); } } @@ -232,9 +227,6 @@ fn pocketic_start_thread( "--ttl", "2592000", ]); - let tmp = tempdir().expect("Could not create temporary directory."); - let ready_file = tmp.path().join("ready"); - cmd.args(["--ready-file".as_ref(), ready_file.as_os_str()]); if !config.verbose { cmd.env("RUST_LOG", "error"); } @@ -252,24 +244,25 @@ fn pocketic_start_thread( ); } - let port = - match PocketIc::wait_for_ready(&config.port_file, &ready_file, receiver.clone()) { - Ok(p) => p, - Err(e) => { - let _ = child.kill(); - let _ = child.wait(); - if let Continue(e) = e { - error!(logger, "Failed to start pocket-ic: {e:#}"); - continue; - } else { - debug!(logger, "Got signal to stop"); - break; - } + let port = match PocketIc::wait_for_ready(&config.port_file, receiver.clone()) { + Ok(p) => p, + Err(e) => { + let _ = child.kill(); + let _ = child.wait(); + if let Continue(e) = e { + error!(logger, "Failed to start pocket-ic: {e:#}"); + continue; + } else { + debug!(logger, "Got signal to stop"); + break; } - }; + } + }; let instance = match initialize_pocketic( port, config.replica_config.state_manager.state_root.clone(), + config.replica_config.log_level, + config.replica_config.artificial_delay as u64, logger.clone(), ) { Err(e) => { @@ -323,9 +316,16 @@ fn pocketic_start_thread( #[cfg(unix)] #[tokio::main(flavor = "current_thread")] -async fn initialize_pocketic(port: u16, state_dir: PathBuf, logger: Logger) -> DfxResult { +async fn initialize_pocketic( + port: u16, + state_dir: PathBuf, + log_level: ReplicaLogLevel, + artificial_delay: u64, + logger: Logger, +) -> DfxResult { use pocket_ic::common::rest::{ - CreateInstanceResponse, ExtendedSubnetConfigSet, InstanceConfig, RawTime, SubnetSpec, + AutoProgressConfig, CreateInstanceResponse, ExtendedSubnetConfigSet, InstanceConfig, + RawTime, SubnetSpec, }; use reqwest::Client; use time::OffsetDateTime; @@ -342,9 +342,11 @@ async fn initialize_pocketic(port: u16, state_dir: PathBuf, logger: Logger) -> D bitcoin: None, system: vec![], application: vec![SubnetSpec::default()], + verified_application: vec![], }, state_dir: Some(state_dir), nonmainnet_features: true, + log_level: Some(log_level.as_slog_string()), }) .send() .await? @@ -374,6 +376,9 @@ async fn initialize_pocketic(port: u16, state_dir: PathBuf, logger: Logger) -> D .post(format!( "http://localhost:{port}/instances/{instance}/auto_progress" )) + .json(&AutoProgressConfig { + artificial_delay_ms: Some(artificial_delay), + }) .send() .await? .error_for_status()?; @@ -382,7 +387,13 @@ async fn initialize_pocketic(port: u16, state_dir: PathBuf, logger: Logger) -> D } #[cfg(not(unix))] -fn initialize_pocketic(_: u16, _: PathBuf, _: Logger) -> DfxResult { +fn initialize_pocketic( + _: u16, + _: PathBuf, + _: ReplicaLogLevel, + _: u64, + _: Logger, +) -> DfxResult { bail!("PocketIC not supported on this platform") } diff --git a/src/dfx/src/actors/pocketic_proxy.rs b/src/dfx/src/actors/pocketic_proxy.rs index 5a21824f4a..8eff868dd6 100644 --- a/src/dfx/src/actors/pocketic_proxy.rs +++ b/src/dfx/src/actors/pocketic_proxy.rs @@ -16,7 +16,6 @@ use std::ops::ControlFlow::{self, *}; use std::path::{Path, PathBuf}; use std::thread::JoinHandle; use std::time::Duration; -use tempfile::tempdir; use url::Url; pub mod signals { @@ -129,18 +128,13 @@ impl PocketIcProxy { fn wait_for_ready( port_file_path: &Path, - ready_file_path: &Path, shutdown_signal: Receiver<()>, ) -> Result> { let mut retries = 0; - let mut ready = false; loop { - if !ready && ready_file_path.exists() { - ready = true; - } - if ready { - if let Ok(content) = std::fs::read_to_string(port_file_path) { - if let Ok(port) = content.parse::() { + if let Ok(content) = std::fs::read_to_string(port_file_path) { + if content.contains('\n') { + if let Ok(port) = content.trim_end().parse::() { return Ok(port); } } @@ -239,9 +233,6 @@ fn pocketic_proxy_start_thread( cmd.args(["--ttl", "2592000"]); cmd.args(["--port-file".as_ref(), pocketic_proxy_port_path.as_os_str()]); - let tmp = tempdir().expect("Could not create temporary directory."); - let ready_file = tmp.path().join("ready"); - cmd.args(["--ready-file".as_ref(), ready_file.as_os_str()]); cmd.stdout(std::process::Stdio::inherit()); cmd.stderr(std::process::Stdio::inherit()); let last_start = std::time::Instant::now(); @@ -252,24 +243,21 @@ fn pocketic_proxy_start_thread( .expect("Could not write to pocketic-proxy-pid file."); std::fs::write(&pocketic_proxy_pid_path, child.id().to_string()) .expect("Could not write to pocketic-proxy-pid file."); - let port = match PocketIcProxy::wait_for_ready( - &pocketic_proxy_port_path, - &ready_file, - receiver.clone(), - ) { - Ok(p) => p, - Err(e) => { - let _ = child.kill(); - let _ = child.wait(); - if let Continue(e) = e { - error!(logger, "Failed to start HTTP gateway: {e:#}"); - continue; - } else { - debug!(logger, "Got signal to stop"); - break; + let port = + match PocketIcProxy::wait_for_ready(&pocketic_proxy_port_path, receiver.clone()) { + Ok(p) => p, + Err(e) => { + let _ = child.kill(); + let _ = child.wait(); + if let Continue(e) = e { + error!(logger, "Failed to start HTTP gateway: {e:#}"); + continue; + } else { + debug!(logger, "Got signal to stop"); + break; + } } - } - }; + }; if let Err(e) = initialize_gateway( format!("http://localhost:{port}").parse().unwrap(), replica_url.clone(), diff --git a/src/dfx/src/actors/replica.rs b/src/dfx/src/actors/replica.rs index d9c51ee791..e23059b872 100644 --- a/src/dfx/src/actors/replica.rs +++ b/src/dfx/src/actors/replica.rs @@ -325,7 +325,7 @@ fn replica_start_thread( "--chain-key-ids", "schnorr:Ed25519:dfx_test_key", "--log-level", - &config.log_level.as_ic_starter_string(), + &config.log_level.as_slog_string(), "--use-specified-ids-allocation-range", ]); #[cfg(target_os = "macos")] diff --git a/src/dfx/src/commands/deploy.rs b/src/dfx/src/commands/deploy.rs index 78751a62de..d93dcf83fb 100644 --- a/src/dfx/src/commands/deploy.rs +++ b/src/dfx/src/commands/deploy.rs @@ -24,7 +24,6 @@ use slog::info; use std::collections::BTreeMap; use std::path::PathBuf; use tokio::runtime::Runtime; -use url::Url; /// Deploys all or a specific canister from the code in your project. By default, all canisters are deployed. #[derive(Parser)] @@ -198,7 +197,7 @@ fn display_urls(env: &dyn Environment) -> DfxResult { let canister_id_store = env.get_canister_id_store()?; let mut frontend_urls = BTreeMap::new(); - let mut candid_urls: BTreeMap<&String, Url> = BTreeMap::new(); + let mut candid_urls = BTreeMap::new(); if let Some(canisters) = &config.get_config().canisters { for (canister_name, canister_config) in canisters { diff --git a/src/dfx/src/commands/deps/pull.rs b/src/dfx/src/commands/deps/pull.rs index 3da9b7d9d8..f4afcdef17 100644 --- a/src/dfx/src/commands/deps/pull.rs +++ b/src/dfx/src/commands/deps/pull.rs @@ -22,7 +22,7 @@ use fn_error_context::context; use ic_agent::{Agent, AgentError}; use ic_wasm::metadata::get_metadata; use sha2::{Digest, Sha256}; -use slog::{error, info, trace, warn, Logger}; +use slog::{debug, error, info, warn, Logger}; use std::collections::{BTreeMap, BTreeSet, VecDeque}; use std::io::Write; use std::path::Path; @@ -166,7 +166,7 @@ async fn download_and_generate_pulled_canister( cache_hit = true; pulled_canister.gzip = gzip; pulled_canister.wasm_hash_download = hex::encode(hash_cache); - trace!(logger, "The canister wasm was found in the cache."); + debug!(logger, "The canister wasm was found in the cache."); } break; } @@ -280,14 +280,14 @@ async fn get_hash_on_chain( warn!(logger, "Canister {canister_id} specified both `wasm_hash` and `wasm_hash_url`. `wasm_hash` will be used."); }; if let Some(wasm_hash_str) = &pullable.wasm_hash { - trace!( + debug!( logger, "Canister {canister_id} specified a custom hash: {wasm_hash_str}" ); Ok(hex::decode(wasm_hash_str) .with_context(|| format!("Failed to decode {wasm_hash_str} as sha256 hash."))?) } else if let Some(wasm_hash_url) = &pullable.wasm_hash_url { - trace!( + debug!( logger, "Canister {canister_id} specified a custom hash via url: {wasm_hash_url}" ); diff --git a/src/dfx/src/lib/models/canister.rs b/src/dfx/src/lib/models/canister.rs index 2fac1a62b6..69623de7cf 100644 --- a/src/dfx/src/lib/models/canister.rs +++ b/src/dfx/src/lib/models/canister.rs @@ -22,7 +22,7 @@ use ic_wasm::optimize::OptLevel; use itertools::Itertools; use petgraph::graph::{DiGraph, NodeIndex}; use rand::{thread_rng, RngCore}; -use slog::{error, info, trace, warn, Logger}; +use slog::{debug, error, info, trace, warn, Logger}; use std::cell::RefCell; use std::collections::{BTreeMap, HashSet}; use std::convert::TryFrom; @@ -133,7 +133,7 @@ impl Canister { // optimize or shrink if let Some(level) = info.get_optimize() { - trace!(logger, "Optimizing Wasm at level {}", level); + debug!(logger, "Optimizing Wasm at level {}", level); ic_wasm::optimize::optimize( &mut m, &wasm_opt_level_convert(level), @@ -146,7 +146,7 @@ impl Canister { } else if info.get_shrink() == Some(true) || (info.get_shrink().is_none() && (info.is_rust() || info.is_motoko())) { - trace!(logger, "Shrinking Wasm"); + debug!(logger, "Shrinking Wasm"); ic_wasm::shrink::shrink(&mut m); modified = true; } @@ -761,9 +761,9 @@ impl CanisterPool { .map(|c| c.get_name()) .contains(&canister.get_name()) { - trace!(log, "Building canister '{}'.", canister.get_name()); + debug!(log, "Building canister '{}'.", canister.get_name()); } else { - trace!(log, "Not building canister '{}'.", canister.get_name()); + debug!(log, "Not building canister '{}'.", canister.get_name()); continue; } result.push( diff --git a/src/distributed/ui.wasm b/src/distributed/ui.wasm index 0c223601fc..bdb653d8fb 100644 Binary files a/src/distributed/ui.wasm and b/src/distributed/ui.wasm differ