From 2d3ce72814171e82fa753f22c66a6bb187dfc65e Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 18 Oct 2024 07:59:25 -0700 Subject: [PATCH] feat: wasmtime v25 Importantly, this reverts a previous wasmtime change that enabled trace-logging in regalloc, massively slowing down compilation across all FVM versions. fixes #2058 --- Cargo.lock | 148 ++++++++++++++++++++---------------------- Cargo.toml | 4 +- fvm/src/engine/mod.rs | 10 +++ 3 files changed, 82 insertions(+), 80 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 64ce97836..197b933ca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -887,18 +887,18 @@ dependencies = [ [[package]] name = "cranelift-bforest" -version = "0.111.1" +version = "0.112.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d69b774780246008783a75edfb943eccc2487b6a43808503a07cd563f2ffde" +checksum = "7b765ed4349e66bedd9b88c7691da42e24c7f62067a6be17ddffa949367b6e17" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-bitset" -version = "0.111.1" +version = "0.112.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7d8d71c6b32c1a7cff254c5e5d7359872c1e5e610fbe963472afcddbd9cf303" +checksum = "9eaa2aece6237198afd32bff57699e08d4dccb8d3902c214fc1e6ba907247ca4" dependencies = [ "serde", "serde_derive", @@ -906,9 +906,9 @@ dependencies = [ [[package]] name = "cranelift-codegen" -version = "0.111.1" +version = "0.112.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ad3a906f2a3f3590ad9798d59a46959a8593258eb985af722f634723c063a2c" +checksum = "351824439e59d42f0e4fa5aac1d13deded155120043565769e55cd4ad3ca8ed9" dependencies = [ "bumpalo", "cranelift-bforest", @@ -929,33 +929,33 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.111.1" +version = "0.112.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd5e4ee12262a135efbef3ced4ab2153adafe4adc55f36af94f9d73be0f7505d" +checksum = "5a0ce0273d7a493ef8f31f606849a4e931c19187a4923f5f87fc1f2b13109981" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.111.1" +version = "0.112.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9374a2a5f060f72e3080fe1c87c9ff4bef2cbe798faae60daf276fb1a13968" +checksum = "0f72016ac35579051913f4f07f6b36c509ed69412d852fd44c8e1d7b7fa6d92a" [[package]] name = "cranelift-control" -version = "0.111.1" +version = "0.112.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fba3ca2f344bb22d265a928e7c3f5f46e1a2eb41f1393bd53538d07b6ffb5293" +checksum = "db28951d21512c4fd0554ef179bfb11e4eb6815062957a9173824eee5de0c46c" dependencies = [ "arbitrary", ] [[package]] name = "cranelift-entity" -version = "0.111.1" +version = "0.112.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6aef77dfb018eed09d92d4244abe3c1c060cbbd900c24f75ddde7d75d0e781e" +checksum = "14ebe592a2f81af9237cf9be29dd3854ecb72108cfffa59e85ef12389bf939e3" dependencies = [ "cranelift-bitset", "serde", @@ -964,9 +964,9 @@ dependencies = [ [[package]] name = "cranelift-frontend" -version = "0.111.1" +version = "0.112.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1d6954f03d63df1cb95d66153c97df0201862220861349bbd5f583754b1917" +checksum = "4437db9d60c7053ac91ded0802740c2ccf123ee6d6898dd906c34f8c530cd119" dependencies = [ "cranelift-codegen", "log", @@ -976,15 +976,15 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.111.1" +version = "0.112.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8b9b7e088b784796ea8aa5947c1cc12034c1b076a077ec2a5a287da717fa746" +checksum = "230cb33572b9926e210f2ca28145f2bc87f389e1456560932168e2591feb65c1" [[package]] name = "cranelift-native" -version = "0.111.1" +version = "0.112.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cab7424083d070669ff3fdeea7c5b4b5013a055aa1ee0532703f17a5f62af64" +checksum = "364524ac7aef7070b1141478724abebeec297d4ea1e87ad8b8986465e91146d9" dependencies = [ "cranelift-codegen", "libc", @@ -993,9 +993,9 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.111.1" +version = "0.112.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81a9f6d0495984eef1d753ec8748de0b216b37ade16d219f1c0f27d8188d7f77" +checksum = "0572cbd9d136a62c0f39837b6bce3b0978b96b8586794042bec0c214668fd6f5" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -1003,7 +1003,7 @@ dependencies = [ "itertools 0.12.1", "log", "smallvec", - "wasmparser 0.215.0", + "wasmparser 0.217.0", "wasmtime-types", ] @@ -3029,15 +3029,6 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - [[package]] name = "hashbrown" version = "0.14.5" @@ -4310,11 +4301,11 @@ dependencies = [ [[package]] name = "regalloc2" -version = "0.9.3" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6" +checksum = "12908dbeb234370af84d0579b9f68258a0f67e201412dd9a2814e6f45b2fc0f0" dependencies = [ - "hashbrown 0.13.2", + "hashbrown 0.14.5", "log", "rustc-hash", "slice-group-by", @@ -4417,9 +4408,9 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" -version = "1.1.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustc-hex" @@ -5268,9 +5259,9 @@ dependencies = [ [[package]] name = "wasm-encoder" -version = "0.215.0" +version = "0.217.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb56df3e06b8e6b77e37d2969a50ba51281029a9aeb3855e76b7f49b6418847" +checksum = "7b88b0814c9a2b323a9b46c687e726996c255ac8b64aa237dd11c81ed4854760" dependencies = [ "leb128", ] @@ -5308,9 +5299,9 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.215.0" +version = "0.217.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fbde0881f24199b81cf49b6ff8f9c145ac8eb1b7fc439adb5c099734f7d90e" +checksum = "ca917a21307d3adf2b9857b94dd05ebf8496bdcff4437a9b9fb3899d3e6c74e7" dependencies = [ "ahash", "bitflags 2.6.0", @@ -5342,20 +5333,20 @@ dependencies = [ [[package]] name = "wasmprinter" -version = "0.215.0" +version = "0.217.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8e9a325d85053408209b3d2ce5eaddd0dd6864d1cff7a007147ba073157defc" +checksum = "50dc568b3e0d47e8f96ea547c90790cfa783f0205160c40de894a427114185ce" dependencies = [ "anyhow", "termcolor", - "wasmparser 0.215.0", + "wasmparser 0.217.0", ] [[package]] name = "wasmtime" -version = "24.0.1" +version = "25.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e4a5b05e9f1797e557e79f0cf04348eaa7a232596939ef4762838ddf7a6127a" +checksum = "ef01f9cb9636ed42a7ec5a09d785c0643590199dc7372dc22c7e2ba7a31a97d4" dependencies = [ "anyhow", "bitflags 2.6.0", @@ -5384,7 +5375,7 @@ dependencies = [ "smallvec", "sptr", "target-lexicon", - "wasmparser 0.215.0", + "wasmparser 0.217.0", "wasmtime-asm-macros", "wasmtime-component-macro", "wasmtime-cranelift", @@ -5398,18 +5389,18 @@ dependencies = [ [[package]] name = "wasmtime-asm-macros" -version = "24.0.1" +version = "25.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64414227e19556d4372f9688458c5673606de83473eb66cd0514d36ea8808cab" +checksum = "ba5b20797419d6baf2296db2354f864e8bb3447cacca9d151ce7700ae08b4460" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-component-macro" -version = "24.0.1" +version = "25.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3ead31b73689602225742920adbcd881f5656702c1a3b4830862c0c66731727" +checksum = "26593c4b18c76ca3c3fbdd813d6692256537b639b851d8a6fe827e3d6966fc01" dependencies = [ "anyhow", "proc-macro2", @@ -5422,15 +5413,15 @@ dependencies = [ [[package]] name = "wasmtime-component-util" -version = "24.0.1" +version = "25.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab2c778661800e1dcd8ba3e15ff042299709e0a4c512525d9cbb604a04c0421b" +checksum = "a2ed562fbb0cbed20a56c369c8de146c1de06a48c19e26ed9aa45f073514ee60" [[package]] name = "wasmtime-cranelift" -version = "24.0.1" +version = "25.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7ee1f436bcf7d213ef7c2e9d44caffcd57e540ccf997d013384c2ae9b82db7" +checksum = "f389b789cbcb53a8499131182135dea21d7d97ad77e7fb66830f69479ef0e68c" dependencies = [ "anyhow", "cfg-if", @@ -5443,18 +5434,19 @@ dependencies = [ "gimli 0.29.0", "log", "object", + "smallvec", "target-lexicon", "thiserror", - "wasmparser 0.215.0", + "wasmparser 0.217.0", "wasmtime-environ", "wasmtime-versioned-export-macros", ] [[package]] name = "wasmtime-environ" -version = "24.0.1" +version = "25.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa8c33adfb3b9f8d6ef716bc55aea5e6b2275cd5a6721ec8c837d1cb0c471516" +checksum = "84b72debe8899f19bedf66f7071310f06ef62de943a1369ba9b373613e77dd3d" dependencies = [ "anyhow", "cranelift-bitset", @@ -5467,17 +5459,17 @@ dependencies = [ "serde", "serde_derive", "target-lexicon", - "wasm-encoder 0.215.0", - "wasmparser 0.215.0", - "wasmprinter 0.215.0", + "wasm-encoder 0.217.0", + "wasmparser 0.217.0", + "wasmprinter 0.217.0", "wasmtime-types", ] [[package]] name = "wasmtime-jit-debug" -version = "24.0.1" +version = "25.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73a04d46279307c3c06279441232ed7247eeb821c39eae2778ece734abdf9073" +checksum = "48ed7f0bbb9da3252c252b05fcd5fd42672db161e6276aa96e92059500247d8c" dependencies = [ "object", "once_cell", @@ -5487,9 +5479,9 @@ dependencies = [ [[package]] name = "wasmtime-jit-icache-coherence" -version = "24.0.1" +version = "25.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa89fc440f0edca882ba6d1890608898e6f0193afdc504c0a64478ec53622bd6" +checksum = "1d930bc1325bc0448be6a11754156d770f56f6c3a61f440e9567f36cd2ea3065" dependencies = [ "anyhow", "cfg-if", @@ -5499,29 +5491,29 @@ dependencies = [ [[package]] name = "wasmtime-slab" -version = "24.0.1" +version = "25.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "682b7a5b6772c4e4de8c696fc619ec97930b5e89098db9bee22c1136e002438b" +checksum = "055a181b8d03998511294faea14798df436503f14d7fd20edcf7370ec583e80a" [[package]] name = "wasmtime-types" -version = "24.0.1" +version = "25.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a95ea5572f8c3ffe777af21aa00a92097ded291a342fecad9f2c6a972ecea99" +checksum = "c8340d976673ac3fdacac781f2afdc4933920c1adc738c3409e825dab3955399" dependencies = [ "anyhow", "cranelift-entity", "serde", "serde_derive", "smallvec", - "wasmparser 0.215.0", + "wasmparser 0.217.0", ] [[package]] name = "wasmtime-versioned-export-macros" -version = "24.0.1" +version = "25.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3621bfccd4e4336ae141d62b96e96316c0f23c47d64e9700594ebe3c4d9a10" +checksum = "a4b0c1f76891f778db9602ee3fbb4eb7e9a3f511847d1fb1b69eddbcea28303c" dependencies = [ "proc-macro2", "quote", @@ -5530,9 +5522,9 @@ dependencies = [ [[package]] name = "wasmtime-wit-bindgen" -version = "24.0.1" +version = "25.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee0f4524da226d2cb503d794c8928de6bc24878758cebd4e383c946e9fdb8b3a" +checksum = "b2fca2cbb5bb390f65d4434c19bf8d9873dfc60f10802918ebcd6f819a38d703" dependencies = [ "anyhow", "heck 0.4.1", @@ -5616,7 +5608,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -5775,9 +5767,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "wit-parser" -version = "0.215.0" +version = "0.217.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "935a97eaffd57c3b413aa510f8f0b550a4a9fe7d59e79cd8b89a83dcb860321f" +checksum = "fb893dcd6d370cfdf19a0d9adfcd403efb8e544e1a0ea3a8b81a21fe392eaa78" dependencies = [ "anyhow", "id-arena", @@ -5788,7 +5780,7 @@ dependencies = [ "serde_derive", "serde_json", "unicode-xid", - "wasmparser 0.215.0", + "wasmparser 0.217.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index ebb22c372..8e789b6d5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,8 +54,8 @@ libsecp256k1 = { version = "0.7.1" } bls-signatures = { version = "0.15", default-features = false } # wasmtime -wasmtime = {version = "24.0.1", default-features = false, features = ["cranelift", "pooling-allocator", "parallel-compilation", "runtime"] } -wasmtime-environ = "24.0.1" +wasmtime = {version = "25.0.2", default-features = false, features = ["cranelift", "pooling-allocator", "parallel-compilation", "runtime"] } +wasmtime-environ = "25.0.2" # misc libfuzzer-sys = "0.4" diff --git a/fvm/src/engine/mod.rs b/fvm/src/engine/mod.rs index fd6d76a4a..192e2c0ec 100644 --- a/fvm/src/engine/mod.rs +++ b/fvm/src/engine/mod.rs @@ -259,6 +259,16 @@ fn wasmtime_config(ec: &EngineConfig) -> anyhow::Result { // debugging tools. But we'll just have to live with that. c.macos_use_mach_ports(false); + // wasmtime default: true + // Disable extended const support. We'll probably enable this in the future but that requires a + // FIP. + c.wasm_extended_const(false); + + // wasmtime default: false + // Disable the component module. + #[cfg(feature = "wasmtime/component-model")] + c.wasm_component_model(false); + Ok(c) }