Skip to content

Commit

Permalink
EOP: Integrating Latest IC with Memory 64 (#4610)
Browse files Browse the repository at this point in the history
* Adjust to new system API

* Port to latest IC 64-bit system API

* Update to new IC with Wasm64

* Updating nix hashes

* Update IC dependency (Wasm64 enabled)

* Update expected test results

* Fix migration test

* Use latest `drun`

* Adjust expected test results

* Updating nix hashes

* Update expected test results

* Fix `drun` nix build for Linux

* Disable DTS in `drun`, refactor `drun` patches

* Adjust expected test results

---------

Co-authored-by: Nix hash updater <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
luc-blaeser and github-actions[bot] authored Aug 20, 2024
1 parent 690eff2 commit 0de3aeb
Show file tree
Hide file tree
Showing 78 changed files with 462 additions and 263 deletions.
4 changes: 2 additions & 2 deletions nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ let
};
})

# Rust 1.69
# Rust stable
(self: super: let
rust-channel = self.moz_overlay.rustChannelOf { date = "2023-04-20"; channel = "stable"; };
rust-channel = self.moz_overlay.rustChannelOf { version = "1.78.0"; channel = "stable"; };
in {
rustPlatform_moz_stable = self.makeRustPlatform {
rustc = rust-channel.rust;
Expand Down
67 changes: 60 additions & 7 deletions nix/drun.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pkgs:
{ drun =
pkgs.rustPlatform.buildRustPackage {
pkgs.rustPlatform_moz_stable.buildRustPackage {
name = "drun";

src = pkgs.sources.ic;
Expand All @@ -19,12 +19,10 @@ pkgs:
lockFile = "${pkgs.sources.ic}/Cargo.lock";
outputHashes = {
"build-info-0.0.27" = "sha256-SkwWwDNrTsntkNiCv6rsyTFGazhpRDnKtVzPpYLKF9U=";
"derive_more-0.99.8-alpha.0" = "sha256-tEsfYC9oCAsDjinCsUDgRg3q6ruvayuA1lRmsEP9cys=";
"ic-btc-interface-0.1.0" = "sha256-JoVg1t62C2FIe0la1oQzidybLj1CyAQy80gkRh/MTn0=";
"ic-btc-test-utils-0.1.0" = "sha256-VecEMFjoeiRi0VgJ9CeDoOzdyJbJNiZ5MBmiV1+b7As=";
"icrc1-test-env-0.1.1" = "sha256-yWJF+KM8l65Nr0pwR9QeltkqbHDzOLNPVnLhf1mRukQ=";
"cloudflare-0.11.0" = "sha256-bJYiypmDI4KEy/VWt/7UcOv+g2CZLb9qUA9c1xlLxhM=";
"ic-agent-0.36.0" = "sha256-vDONIVjz0cwVgiszVRIjTKcqRUMHdVwTURflAMqmzHM=";
"icrc1-test-env-0.1.1" = "sha256-2PB7e64Owin/Eji3k8UoeWs+pfDfOOTaAyXjvjOZ/4g=";
"jsonrpc-0.12.1" = "sha256-3FtdZlt2PqVDkE5iKWYIp1eiIELsaYlUPRSP2Xp8ejM=";
"libssh2-sys-0.2.23" = "sha256-9Hb7CnPF+lxrVO1NAhS7EXcPVWZutJXr6UWxpptzk4U=";
"lmdb-rkv-0.14.99" = "sha256-5WcUzapkrc/s3wCBNCuUDhtbp17n67rTbm2rx0qtITg=";
};
};
Expand All @@ -43,9 +41,64 @@ pkgs:
for file in lib_sources {
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 @@
fn main() {
- if std::env::var("TARGET").unwrap() == "x86_64-unknown-linux-gnu" {
- println!("cargo:rustc-link-lib=static=unwind");
- println!("cargo:rustc-link-lib=static=unwind-ptrace");
- println!("cargo:rustc-link-lib=static=unwind-x86_64");
- println!("cargo:rustc-link-lib=dylib=lzma");
- }
}
EOF
mkdir -p .cargo
cat > .cargo/config.toml << EOF
[target.x86_64-apple-darwin]
Expand Down
10 changes: 5 additions & 5 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
"version": "3.2.25"
},
"ic": {
"branch": "pull/143/head",
"branch": "luc/latest-ic-wasm64-test",
"description": "Internet Computer blockchain source: the client/replica software run by nodes",
"homepage": "",
"owner": "dfinity",
"owner": "luc-blaeser",
"repo": "ic",
"rev": "31f02c1b08aef1c6ee4c1b6bb9d25c21c5a4ff41",
"sha256": "04k278900kv082axrgv6vga0n8sw6c3lcc9298ih9gjyx8hanfb1",
"rev": "7921f5f3dc0d9fb774e3222f8ff6b1c00a086f1a",
"sha256": "1ykawbpaqnf1y508vh81m30p813ykmnbffxc3p0hw0p0k1ynq6zz",
"type": "tarball",
"url": "https://github.com/dfinity/ic/archive/31f02c1b08aef1c6ee4c1b6bb9d25c21c5a4ff41.tar.gz",
"url": "https://github.com/luc-blaeser/ic/archive/7921f5f3dc0d9fb774e3222f8ff6b1c00a086f1a.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"ic-hs": {
Expand Down
Loading

0 comments on commit 0de3aeb

Please sign in to comment.