From 32a7bb18ba86090022549c279fa493c7561173cb Mon Sep 17 00:00:00 2001 From: Luc Blaeser <112870813+luc-blaeser@users.noreply.github.com> Date: Mon, 9 Sep 2024 13:35:25 +0200 Subject: [PATCH] chore: Upgrade `drun` (#4678) Using IC 2024-08-16 with some adjustments: * `drun` adjustments for better testing - https://github.com/dfinity/ic/pull/662 (Lift 8GB memory boundary from drun) - https://github.com/dfinity/ic/pull/988 (Enable Wasm64 with 16GB main memory capacity) - https://github.com/dfinity/ic/pull/991 (Disable DTS for deterministic debug outputs) - https://github.com/dfinity/ic/pull/992 (Increase batch limit for longer running tests) - https://github.com/dfinity/ic/pull/1240 (Enable canister snapshots) * IC build fixes for `nix`: - Remove duplicate entries of same crate with same versions in `Cargo.toml`. - https://github.com/dfinity/ic/pull/993 (Fix MacOS `rocksdb` dependency). * Other IC fixes: - https://github.com/dfinity/ic/pull/1250 (Fix canister snapshots) --- nix/drun.nix | 46 +--------------------------------------------- nix/sources.json | 8 ++++---- 2 files changed, 5 insertions(+), 49 deletions(-) diff --git a/nix/drun.nix b/nix/drun.nix index 7c69c049063..16acb317faa 100644 --- a/nix/drun.nix +++ b/nix/drun.nix @@ -19,8 +19,7 @@ pkgs: lockFile = "${pkgs.sources.ic}/Cargo.lock"; outputHashes = { "build-info-0.0.27" = "sha256-SkwWwDNrTsntkNiCv6rsyTFGazhpRDnKtVzPpYLKF9U="; - "cloudflare-0.11.0" = "sha256-bJYiypmDI4KEy/VWt/7UcOv+g2CZLb9qUA9c1xlLxhM="; - "ic-agent-0.36.0" = "sha256-vDONIVjz0cwVgiszVRIjTKcqRUMHdVwTURflAMqmzHM="; + "cloudflare-0.12.0" = "sha256-FxCAK7gUKp/63fdvzI5Ufsy4aur74fO4R/K3YFiUw0Y="; "icrc1-test-env-0.1.1" = "sha256-2PB7e64Owin/Eji3k8UoeWs+pfDfOOTaAyXjvjOZ/4g="; "jsonrpc-0.12.1" = "sha256-3FtdZlt2PqVDkE5iKWYIp1eiIELsaYlUPRSP2Xp8ejM="; "lmdb-rkv-0.14.99" = "sha256-5WcUzapkrc/s3wCBNCuUDhtbp17n67rTbm2rx0qtITg="; @@ -43,49 +42,6 @@ pkgs: EOF cd - - # Disable DTS for `drun` - patch rs/config/src/subnet_config.rs << EOF -@@ -290,9 +290,9 @@ impl SchedulerConfig { - } - - pub fn system_subnet() -> Self { -- let max_instructions_per_message_without_dts = NumInstructions::from(50 * B); -+ let max_instructions_per_message_without_dts = -+ MAX_INSTRUCTIONS_PER_MESSAGE_WITHOUT_DTS * SYSTEM_SUBNET_FACTOR; - let max_instructions_per_install_code = NumInstructions::from(1_000 * B); -- let max_instructions_per_slice = NumInstructions::from(10 * B); - Self { - scheduler_cores: NUMBER_OF_EXECUTION_THREADS, - max_paused_executions: MAX_PAUSED_EXECUTIONS, -@@ -300,20 +300,19 @@ impl SchedulerConfig { - // TODO(RUN-993): Enable heap delta rate limiting for system subnets. - // Setting initial reserve to capacity effectively disables the rate limiting. - heap_delta_initial_reserve: SUBNET_HEAP_DELTA_CAPACITY, -- // Round limit is set to allow on average 2B instructions. -- // See also comment about \`MAX_INSTRUCTIONS_PER_ROUND\`. -- max_instructions_per_round: max_instructions_per_message_without_dts -- .max(max_instructions_per_slice) -- + NumInstructions::from(2 * B), -+ max_instructions_per_round: MAX_INSTRUCTIONS_PER_ROUND * SYSTEM_SUBNET_FACTOR, -+ // Effectively disable DTS on system subnets. - max_instructions_per_message: max_instructions_per_message_without_dts, - max_instructions_per_message_without_dts, -- max_instructions_per_slice, -+ // Effectively disable DTS on system subnets. -+ max_instructions_per_slice: max_instructions_per_message_without_dts, - instruction_overhead_per_execution: INSTRUCTION_OVERHEAD_PER_EXECUTION, - instruction_overhead_per_canister: INSTRUCTION_OVERHEAD_PER_CANISTER, - instruction_overhead_per_canister_for_finalization: - INSTRUCTION_OVERHEAD_PER_CANISTER_FOR_FINALIZATION, - max_instructions_per_install_code, -- max_instructions_per_install_code_slice: max_instructions_per_slice, -+ // Effectively disable DTS on system subnets. -+ max_instructions_per_install_code_slice: max_instructions_per_install_code, - max_heap_delta_per_iteration: MAX_HEAP_DELTA_PER_ITERATION * SYSTEM_SUBNET_FACTOR, - max_message_duration_before_warn_in_seconds: - MAX_MESSAGE_DURATION_BEFORE_WARN_IN_SECONDS, -EOF - # static linking of libunwind fails under nix Linux patch rs/monitoring/backtrace/build.rs << EOF @@ -1,8 +1,2 @@ diff --git a/nix/sources.json b/nix/sources.json index 19872f58034..88ed2a77e75 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -21,15 +21,15 @@ "version": "3.2.25" }, "ic": { - "branch": "luc/latest-ic-wasm64-test", + "branch": "luc/adjust-drun", "description": "Internet Computer blockchain source: the client/replica software run by nodes", "homepage": "", "owner": "luc-blaeser", "repo": "ic", - "rev": "7921f5f3dc0d9fb774e3222f8ff6b1c00a086f1a", - "sha256": "1ykawbpaqnf1y508vh81m30p813ykmnbffxc3p0hw0p0k1ynq6zz", + "rev": "6c718b80e04ad1930a08e6c53440c15021ca9c3d", + "sha256": "0iglm7m69d836wipzi25xza25l84dmjq9b4s1y6rwa8xnmiipnbh", "type": "tarball", - "url": "https://github.com/luc-blaeser/ic/archive/7921f5f3dc0d9fb774e3222f8ff6b1c00a086f1a.tar.gz", + "url": "https://github.com/luc-blaeser/ic/archive/6c718b80e04ad1930a08e6c53440c15021ca9c3d.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "ic-hs": {