From d4b39a953aa08fad067e50e5c090dc39a539871a Mon Sep 17 00:00:00 2001 From: mraszyk <31483726+mraszyk@users.noreply.github.com> Date: Mon, 5 Aug 2024 11:29:17 +0200 Subject: [PATCH] chore: bump PocketIC to v5.0.0 (server) and v4.0.0 (library) (#59) This MR bumps PocketIC to v5.0.0 (server) and v4.0.0 (library). Setting max request time to `None` avoids PocketIC library timeouts due to long-running update calls. --------- Co-authored-by: Islam El-Ashi --- Cargo.lock | 114 ++++++++++++++++++++++++++++++++++++---- Cargo.toml | 2 +- canbench-bin/src/lib.rs | 7 +-- 3 files changed, 108 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a894c42..8a93520 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -221,7 +221,7 @@ dependencies = [ [[package]] name = "canbench-rs" -version = "0.1.0" +version = "0.1.4" dependencies = [ "canbench-rs-macros", "candid", @@ -232,7 +232,7 @@ dependencies = [ [[package]] name = "canbench-rs-macros" -version = "0.1.0" +version = "0.1.4" dependencies = [ "proc-macro2", "quote", @@ -968,6 +968,16 @@ version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + [[package]] name = "log" version = "0.4.20" @@ -995,6 +1005,16 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + [[package]] name = "miniz_oxide" version = "0.7.2" @@ -1098,6 +1118,29 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.0", +] + [[package]] name = "paste" version = "1.0.14" @@ -1144,11 +1187,10 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pocket-ic" -version = "3.1.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9765eeff77b8750cf6258eaeea237b96607cd770aa3d4003f021924192b7e4e" +checksum = "629f46b7ab8a8d2fee02220ef8e99ae552c7e220117efa1ce0882ff09c8fb038" dependencies = [ - "async-trait", "base64 0.13.1", "candid", "hex", @@ -1158,6 +1200,8 @@ dependencies = [ "serde", "serde_bytes", "serde_json", + "sha2", + "tokio", "tracing", "tracing-appender", "tracing-subscriber", @@ -1217,6 +1261,15 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "redox_syscall" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +dependencies = [ + "bitflags 2.4.2", +] + [[package]] name = "regex" version = "1.10.4" @@ -1324,6 +1377,7 @@ dependencies = [ "js-sys", "log", "mime", + "mime_guess", "once_cell", "percent-encoding", "pin-project-lite", @@ -1513,6 +1567,12 @@ dependencies = [ "syn 2.0.48", ] +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + [[package]] name = "sct" version = "0.7.1" @@ -1554,9 +1614,9 @@ checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" [[package]] name = "serde" -version = "1.0.196" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" dependencies = [ "serde_derive", ] @@ -1572,9 +1632,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.196" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", @@ -1672,6 +1732,15 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", +] + [[package]] name = "slab" version = "0.4.9" @@ -1878,20 +1947,34 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.36.0" +version = "1.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +checksum = "eb2caba9f80616f438e09748d5acda951967e1ea58508ef53d9c6402485a46df" dependencies = [ "backtrace", "bytes", "libc", "mio", "num_cpus", + "parking_lot", "pin-project-lite", + "signal-hook-registry", "socket2", + "tokio-macros", "windows-sys 0.48.0", ] +[[package]] +name = "tokio-macros" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "tokio-rustls" version = "0.24.1" @@ -2072,6 +2155,15 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "unicase" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + [[package]] name = "unicode-bidi" version = "0.3.15" diff --git a/Cargo.toml b/Cargo.toml index ee8c6c1..eff62f6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,4 +29,4 @@ sha256 = "1.5.0" syn = "1.0" tempfile = "3.3.0" wasmparser = "0.119.0" -pocket-ic = "3.1.0" +pocket-ic = "4.0.0" diff --git a/canbench-bin/src/lib.rs b/canbench-bin/src/lib.rs index c1b2353..44e277a 100644 --- a/canbench-bin/src/lib.rs +++ b/canbench-bin/src/lib.rs @@ -100,9 +100,9 @@ fn pocket_ic_path() -> PathBuf { // Downloads PocketIC if it's not already downloaded. fn maybe_download_pocket_ic(verbose: bool) { const POCKET_IC_LINUX_SHA: &str = - "f4ed7d378fbdb12483570501d72eb6696ca789010a3479a7b726b2736901bf8a"; + "bcdfbe1c72fb9761b086ae0f34f54a6b85b6a7dd7f52f8003b41cd233b164711"; const POCKET_IC_MAC_SHA: &str = - "a4d3903f3932888aa1e2c2c06c1e122a8da98ebd7c0839e02991a62b6e47cefe"; + "07cfda0a46b179446509fefab35375e4ec73e4e0cc0facde2fd41d96dadfcf7c"; if pocket_ic_path().exists() { // PocketIC found. Verify that it's the version we expect it to be. @@ -126,7 +126,7 @@ fn maybe_download_pocket_ic(verbose: bool) { fn download_pocket_ic(verbose: bool) { const POCKET_IC_URL_PREFIX: &str = - "https://github.com/dfinity/pocketic/releases/download/4.0.0/pocket-ic-x86_64-"; + "https://github.com/dfinity/pocketic/releases/download/5.0.0/pocket-ic-x86_64-"; if verbose { println!("Downloading runtime (will be cached for future uses)..."); } @@ -167,6 +167,7 @@ fn run_benchmark(canister_wasm_path: &Path, init_args: Vec, bench_fn: &str) std::env::set_var("POCKET_IC_BIN", pocket_ic_path()); std::env::set_var("POCKET_IC_MUTE_SERVER", "1"); let pic = PocketIcBuilder::new() + .with_max_request_time_ms(None) .with_benchmarking_system_subnet() .build(); let can_id = pic.create_canister();