diff --git a/Cargo.lock b/Cargo.lock index 9876264bb..a3615d90f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,7 +8,16 @@ version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b" dependencies = [ - "gimli", + "gimli 0.32.3", +] + +[[package]] +name = "addr2line" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59317f77929f0e679d39364702289274de2f0f0b22cbf50b2b8cff2169a0b27a" +dependencies = [ + "gimli 0.33.0", ] [[package]] @@ -37,6 +46,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "alloca" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5a7d05ea6aea7e9e64d25b9156ba2fee3fdd659e34e41063cd2fc7cd020d7f4" +dependencies = [ + "cc", +] + [[package]] name = "allocator-api2" version = "0.2.21" @@ -129,14 +147,14 @@ dependencies = [ [[package]] name = "ambassador" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e68de4cdc6006162265d0957edb4a860fe4e711b1dc17a5746fd95f952f08285" +checksum = "8184c5d23ba3829fb1e93388d776c3469cd9f4162af65250490b4f22d3ecf614" dependencies = [ "itertools 0.10.5", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.117", ] [[package]] @@ -228,6 +246,17 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +[[package]] +name = "async-trait" +version = "0.1.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82f6aeea286b8eb4dd3431a1be1b59d290ace00f5bfd8e2a159bc2a05e2c1667" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.3", +] + [[package]] name = "autocfg" version = "1.5.0" @@ -240,11 +269,11 @@ version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6" dependencies = [ - "addr2line", + "addr2line 0.25.1", "cfg-if", "libc", "miniz_oxide", - "object", + "object 0.37.3", "rustc-demangle", "windows-link", ] @@ -780,6 +809,15 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "435aea653a110cde24da15ca2dac9e06d17d92ce2bd6c2b9179b508abbe6f06f" +[[package]] +name = "cpp_demangle" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0667304c32ea56cb4cd6d2d7c0cfe9a2f8041229db8c033af7f8d69492429def" +dependencies = [ + "cfg-if", +] + [[package]] name = "cpufeatures" version = "0.2.17" @@ -800,46 +838,48 @@ dependencies = [ [[package]] name = "cranelift-assembler-x64" -version = "0.123.13" +version = "0.134.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f8e1303ae2128891cb59691a74de4547dd208bc8511a2f287cca2b93bb3c728" +checksum = "16c273ba1bfc3a1cb27cb4f83df27134f3cb638a61f5ed79ab22cf86eb13da0d" dependencies = [ "cranelift-assembler-x64-meta", ] [[package]] name = "cranelift-assembler-x64-meta" -version = "0.123.13" +version = "0.134.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58b2740a5936332028d9a1e8f29a199de2fd386e426d44da5fea70cf8e3f8e75" +checksum = "cbf8909326a466739e83ffe11e74c0c8c6b4bfa911b612aece915daa746cff58" dependencies = [ "cranelift-srcgen", ] [[package]] name = "cranelift-bforest" -version = "0.123.13" +version = "0.134.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37fd128d3629fb105e433bda09744c5a2959cd1da04617a455c4cc17dff1ebef" +checksum = "3cb26b06b54d8b2f8cdf4d440a32fc3b3b91c71c162333a69a70a66fa265fc45" dependencies = [ "cranelift-entity", + "wasmtime-internal-core", ] [[package]] name = "cranelift-bitset" -version = "0.123.13" +version = "0.134.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24a88f6d5a6cf6fcbc6386415d48948094721dfa4585d6615938b11ca938f20a" +checksum = "7ce4e57dbb7f73d08011808a19787c3a03c3e7854b2a479ed0b788915fb671be" dependencies = [ "serde", "serde_derive", + "wasmtime-internal-core", ] [[package]] name = "cranelift-codegen" -version = "0.123.13" +version = "0.134.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daa4a357d030bdd586d8fe3da56b394f7f6b6ded506e59f945e7b32b1e126b71" +checksum = "74b0a8968f33d0bc13bc86fe70dd3947e93acc9f358ed9848e9988448972a9be" dependencies = [ "bumpalo", "cranelift-assembler-x64", @@ -850,23 +890,27 @@ dependencies = [ "cranelift-control", "cranelift-entity", "cranelift-isle", - "gimli", - "hashbrown 0.15.5", + "gimli 0.33.0", + "hashbrown 0.17.0", + "libm", "log", + "postcard", "pulley-interpreter", "regalloc2", "rustc-hash", "serde", + "serde_derive", + "sha2 0.10.9", "smallvec", "target-lexicon", - "wasmtime-internal-math", + "wasmtime-internal-core", ] [[package]] name = "cranelift-codegen-meta" -version = "0.123.13" +version = "0.134.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4121e36a8757dea6fb237435ee5095eba25bc13ecc2eaee57eb9bffd4b27784f" +checksum = "f69e8e2fe9deb48ef7b8d0c61612f8c1e2277d0421c201e30a4c844a4ebac698" dependencies = [ "cranelift-assembler-x64-meta", "cranelift-codegen-shared", @@ -877,37 +921,39 @@ dependencies = [ [[package]] name = "cranelift-codegen-shared" -version = "0.123.13" +version = "0.134.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5173265fc30b9e42205cf06dfca9a272ee949667ce4115d975ed2c08d466e2f8" +checksum = "ad4db1e87a65e9c5a832e3ede160830d4e34df938ac38b5604819f8825687e73" [[package]] name = "cranelift-control" -version = "0.123.13" +version = "0.134.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6ca8a393e66dc13f915c6f456bdcf496d78fac4995792f7022b7806352d7a4" +checksum = "9248cd37bb6ec460981f57ead368e32b1eca7a207ad50e3e9c7adc3b161f20e9" dependencies = [ "arbitrary", ] [[package]] name = "cranelift-entity" -version = "0.123.13" +version = "0.134.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e609d9ba416bc26d774f343295a1d411515248a6a6d83d5f7492a0dd919569fa" +checksum = "26b8bc91c0a3530d132acbf118965dabe9a084029eb0fa74b64760360dec3316" dependencies = [ "cranelift-bitset", "serde", "serde_derive", + "wasmtime-internal-core", ] [[package]] name = "cranelift-frontend" -version = "0.123.13" +version = "0.134.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90a3a277b1a0aff1123f6bae61c080a4bcb6df964829ed427f98e18dff14257f" +checksum = "5086f2ebc084a98b387e522680f62ef65a512444d8382151e03088716d3a1714" dependencies = [ "cranelift-codegen", + "hashbrown 0.17.0", "log", "smallvec", "target-lexicon", @@ -915,15 +961,15 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.123.13" +version = "0.134.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be53dd9b3a4cbeb9ced45c4a543ea8417ccfb334c3ba1cbb2233f4b25fb2531f" +checksum = "b6a658670f779afc2df083be201ebe54805f69b7b9ffa8dab04142b72ed751c9" [[package]] name = "cranelift-native" -version = "0.123.13" +version = "0.134.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca62ab1d9f48cad97da5843b913ccf96c3dfde935af5d750cb5a6d367ccfb262" +checksum = "16a41083b1fd953debd6f32d21fcda765b258f323ce907fdd6b4715f2769c478" dependencies = [ "cranelift-codegen", "libc", @@ -932,9 +978,9 @@ dependencies = [ [[package]] name = "cranelift-srcgen" -version = "0.123.13" +version = "0.134.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a13b72860f54a2a19d3756bd47575fd8bddeafd6e5bbbf16372cdfebc482628a" +checksum = "244d9cd0759b0a3ccdd587cafb13434f9ea43b5c9d07701d277daf5cd0f7b7c1" [[package]] name = "crc32fast" @@ -947,10 +993,11 @@ dependencies = [ [[package]] name = "criterion" -version = "0.7.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c047a62b0cc3e145fa84415a3191f628e980b194c2755aa12300a4e6cbd928" +checksum = "950046b2aa2492f9a536f5f4f9a3de7b9e2476e575e05bd6c333371add4d98f3" dependencies = [ + "alloca", "anes", "cast", "ciborium", @@ -959,6 +1006,7 @@ dependencies = [ "itertools 0.13.0", "num-traits", "oorandom", + "page_size", "plotters", "rayon", "regex", @@ -970,9 +1018,9 @@ dependencies = [ [[package]] name = "criterion-plot" -version = "0.6.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b1bcc0dc7dfae599d84ad0b1a55f80cde8af3725da8313b528da95ef783e338" +checksum = "d8d80a2f4f5b554395e47b5d8305bc3d27813bacb73493eb1001e8f76dae29ea" dependencies = [ "cast", "itertools 0.13.0", @@ -1426,12 +1474,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" -[[package]] -name = "fallible-iterator" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" - [[package]] name = "fastrand" version = "2.4.1" @@ -2176,6 +2218,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + [[package]] name = "forest_hash_utils" version = "0.1.0" @@ -2406,6 +2454,7 @@ dependencies = [ "thiserror 2.0.18", "wasmtime", "wasmtime-environ", + "wat", "yastl", ] @@ -2851,25 +2900,17 @@ dependencies = [ name = "fvm_test_actors" version = "0.1.0" -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - [[package]] name = "fxprof-processed-profile" -version = "0.6.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27d12c0aed7f1e24276a241aadc4cb8ea9f83000f34bc062b7cc2d51e3b0fabd" +checksum = "25234f20a3ec0a962a61770cfe39ecf03cb529a6e474ad8cff025ed497eda557" dependencies = [ "bitflags 2.11.1", "debugid", - "fxhash", + "rustc-hash", "serde", + "serde_derive", "serde_json", ] @@ -2936,8 +2977,15 @@ name = "gimli" version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" + +[[package]] +name = "gimli" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf7f043f89559805f8c7cacc432749b2fa0d0a0a9ee46ce47164ed5ba7f126c" dependencies = [ - "fallible-iterator", + "fnv", + "hashbrown 0.16.1", "indexmap 2.14.0", "stable_deref_trait", ] @@ -2995,15 +3043,25 @@ version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ - "foldhash", - "serde", + "foldhash 0.1.5", ] +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" + [[package]] name = "hashbrown" version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51" +dependencies = [ + "foldhash 0.2.0", + "serde", + "serde_core", +] [[package]] name = "heck" @@ -3490,12 +3548,9 @@ checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" [[package]] name = "mach2" -version = "0.4.3" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d640282b302c0bb0a2a8e0233ead9035e3bed871f0b7e81fe4a1ec829765db44" -dependencies = [ - "libc", -] +checksum = "dae608c151f68243f2b000364e1f7b186d9c29845f7d2d85bd31b9ad77ad552b" [[package]] name = "macro-string" @@ -3784,9 +3839,18 @@ name = "object" version = "0.37.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" +dependencies = [ + "memchr", +] + +[[package]] +name = "object" +version = "0.39.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e5a6c098c7a3b6547378093f5cc30bc54fd361ce711e05293a5cc589562739b" dependencies = [ "crc32fast", - "hashbrown 0.15.5", + "hashbrown 0.17.0", "indexmap 2.14.0", "memchr", ] @@ -3846,6 +3910,16 @@ dependencies = [ "sha2 0.10.9", ] +[[package]] +name = "page_size" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30d5b2194ed13191c1999ae0704b7839fb18384fa22e49b57eeaa97d79ce40da" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "pairing" version = "0.23.0" @@ -4101,21 +4175,21 @@ dependencies = [ [[package]] name = "pulley-interpreter" -version = "36.0.13" +version = "47.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2662666315cb90dfb4d99a652ee053d4d8598f71c474209e84da031ca56ae5a4" +checksum = "ed2bd641cb6a3ec5bffe60405568933163e0ea619da0943e9d2a417ceaa7fe82" dependencies = [ "cranelift-bitset", "log", "pulley-macros", - "wasmtime-internal-math", + "wasmtime-internal-core", ] [[package]] name = "pulley-macros" -version = "36.0.13" +version = "47.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb9a7d9ed2618f94b6d054aba3eb2768c9b489fe16b4ef8847fbc6ed41b707bb" +checksum = "d3fd4024d1e559eaf5579bc8ad84a2b5915f34b47acc13a06ffba7dac401b166" dependencies = [ "proc-macro2", "quote", @@ -4309,15 +4383,16 @@ dependencies = [ [[package]] name = "regalloc2" -version = "0.12.2" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5216b1837de2149f8bc8e6d5f88a9326b63b8c836ed58ce4a0a29ec736a59734" +checksum = "757712e8e61590d6d4f5d563483755538b5aa13467837a3b41cd9832509a7f85" dependencies = [ "allocator-api2", "bumpalo", - "hashbrown 0.15.5", + "hashbrown 0.17.0", "log", "rustc-hash", + "serde", "smallvec", ] @@ -4543,6 +4618,10 @@ name = "semver" version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" +dependencies = [ + "serde", + "serde_core", +] [[package]] name = "serde" @@ -5427,32 +5506,32 @@ dependencies = [ [[package]] name = "wasm-encoder" -version = "0.236.1" +version = "0.244.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "724fccfd4f3c24b7e589d333fc0429c68042897a7e8a5f8694f31792471841e7" +checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" dependencies = [ "leb128fmt", - "wasmparser 0.236.1", + "wasmparser 0.244.0", ] [[package]] name = "wasm-encoder" -version = "0.244.0" +version = "0.248.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" +checksum = "ac92cf547bc18d27ecc521015c08c353b4f18b84ab388bb6d1b6b682c620d9b6" dependencies = [ "leb128fmt", - "wasmparser 0.244.0", + "wasmparser 0.248.0", ] [[package]] name = "wasm-encoder" -version = "0.248.0" +version = "0.252.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac92cf547bc18d27ecc521015c08c353b4f18b84ab388bb6d1b6b682c620d9b6" +checksum = "8185ae345fa5687c054626ff9a50e7089797a343d9904d1dc9820eb4c4d3196f" dependencies = [ "leb128fmt", - "wasmparser 0.248.0", + "wasmparser 0.252.0", ] [[package]] @@ -5490,38 +5569,38 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.236.1" +version = "0.244.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9b1e81f3eb254cf7404a82cee6926a4a3ccc5aad80cc3d43608a070c67aa1d7" +checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" dependencies = [ "bitflags 2.11.1", "hashbrown 0.15.5", "indexmap 2.14.0", "semver", - "serde", ] [[package]] name = "wasmparser" -version = "0.244.0" +version = "0.248.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" +checksum = "aa4439c5eee9df71ee0c6efb37f63b1fcb1fec38f85f5142c54e7ed05d33091a" dependencies = [ "bitflags 2.11.1", - "hashbrown 0.15.5", "indexmap 2.14.0", "semver", ] [[package]] name = "wasmparser" -version = "0.248.0" +version = "0.252.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa4439c5eee9df71ee0c6efb37f63b1fcb1fec38f85f5142c54e7ed05d33091a" +checksum = "d3eb099dcadcde5be9eef55e3a337128efd4e44b4c93122487e4d2e4e1c6627c" dependencies = [ "bitflags 2.11.1", + "hashbrown 0.17.0", "indexmap 2.14.0", "semver", + "serde", ] [[package]] @@ -5536,36 +5615,35 @@ dependencies = [ [[package]] name = "wasmprinter" -version = "0.236.1" +version = "0.252.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2df225df06a6df15b46e3f73ca066ff92c2e023670969f7d50ce7d5e695abbb1" +checksum = "7142797de29b35ab8dbf15c00f55fda75d409da4c423a8ab8bd6b667a785824b" dependencies = [ "anyhow", "termcolor", - "wasmparser 0.236.1", + "wasmparser 0.252.0", ] [[package]] name = "wasmtime" -version = "36.0.13" +version = "47.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d881c5dcff5f230368d84fcf110ca25fe47badc694e7d559c3891492159916" +checksum = "4cdaf5b8af5713146e3a62d940c71e3eb2ad1ebacfa6b55f0c8509a5b4b87718" dependencies = [ - "addr2line", - "anyhow", + "addr2line 0.26.1", + "async-trait", "bitflags 2.11.1", "bumpalo", "cc", "cfg-if", + "futures", "fxprof-processed-profile", - "hashbrown 0.15.5", - "indexmap 2.14.0", "ittapi", "libc", "log", "mach2", "memfd", - "object", + "object 0.39.1", "once_cell", "postcard", "pulley-interpreter", @@ -5576,152 +5654,151 @@ dependencies = [ "serde_json", "smallvec", "target-lexicon", - "wasmparser 0.236.1", + "wasmparser 0.252.0", "wasmtime-environ", - "wasmtime-internal-asm-macros", + "wasmtime-internal-core", "wasmtime-internal-cranelift", "wasmtime-internal-fiber", "wasmtime-internal-jit-debug", "wasmtime-internal-jit-icache-coherence", - "wasmtime-internal-math", - "wasmtime-internal-slab", "wasmtime-internal-unwinder", "wasmtime-internal-versioned-export-macros", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] name = "wasmtime-environ" -version = "36.0.13" +version = "47.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4b25534a3ff9dd844701c2bc997f76cb1f97bf2af0546a7066ae96f49c2e068" +checksum = "58793271eab7ec26bab99ca497131f8b37702e7dc39e2f2d18293e3e915b4964" dependencies = [ "anyhow", + "cpp_demangle", + "cranelift-bforest", "cranelift-bitset", "cranelift-entity", - "gimli", + "gimli 0.33.0", + "hashbrown 0.17.0", "indexmap 2.14.0", "log", - "object", + "object 0.39.1", "postcard", + "rustc-demangle", + "semver", "serde", "serde_derive", + "sha2 0.10.9", "smallvec", "target-lexicon", - "wasm-encoder 0.236.1", - "wasmparser 0.236.1", - "wasmprinter 0.236.1", + "wasm-encoder 0.252.0", + "wasmparser 0.252.0", + "wasmprinter 0.252.0", + "wasmtime-internal-component-util", + "wasmtime-internal-core", ] [[package]] -name = "wasmtime-internal-asm-macros" -version = "36.0.13" +name = "wasmtime-internal-component-util" +version = "47.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7032ff6b4d7a45e05be1cb32ec1756df5f2669f08296dbe2c61c3789dead2c" + +[[package]] +name = "wasmtime-internal-core" +version = "47.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d02832d760351fb3a1aa99eb8f7b95596c0f4e4e52df1547fcdb295ea5c780c" +checksum = "f41d3b2cb9c3de7b696690af070d408b5e357011832f8b8bb7fbb315dbb620ed" dependencies = [ - "cfg-if", + "anyhow", + "hashbrown 0.17.0", + "libm", + "serde", ] [[package]] name = "wasmtime-internal-cranelift" -version = "36.0.13" +version = "47.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65821bab751956cddfc6ee957beb13a0e2a6cf682050d75dfb7a0228db2ed499" +checksum = "1d5cda5b90247978dd2ba6ca4e309508da19e9244445671d2d0e6a34e5c3b847" dependencies = [ - "anyhow", "cfg-if", "cranelift-codegen", "cranelift-control", "cranelift-entity", "cranelift-frontend", "cranelift-native", - "gimli", + "gimli 0.33.0", "itertools 0.14.0", "log", - "object", + "object 0.39.1", "pulley-interpreter", "smallvec", "target-lexicon", "thiserror 2.0.18", - "wasmparser 0.236.1", + "wasmparser 0.252.0", "wasmtime-environ", - "wasmtime-internal-math", + "wasmtime-internal-core", + "wasmtime-internal-unwinder", "wasmtime-internal-versioned-export-macros", ] [[package]] name = "wasmtime-internal-fiber" -version = "36.0.13" +version = "47.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18cf73e5e8d28a2b30d86454430c7dea3b593598dcbbc0ebb927ca2716222d41" +checksum = "4d126366176553e8f304e8ac2078a4cc37134fe8f19d4d4695a09c5a2f577f10" dependencies = [ - "anyhow", "cc", "cfg-if", "libc", "rustix 1.1.4", - "wasmtime-internal-asm-macros", + "wasmtime-environ", "wasmtime-internal-versioned-export-macros", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] name = "wasmtime-internal-jit-debug" -version = "36.0.13" +version = "47.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4279dc3147ddaa21e5b3d2c0eaff117881c4f937747bdd2379eb361665843bd3" +checksum = "c1d28ff131bc40e11d84bc3a9fa0d264506439ffbbc89f3562fbb529d1caa617" dependencies = [ "cc", - "object", + "object 0.39.1", "rustix 1.1.4", "wasmtime-internal-versioned-export-macros", ] [[package]] name = "wasmtime-internal-jit-icache-coherence" -version = "36.0.13" +version = "47.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8eb677944201839c0be19b39b0f19dcd663efbcbc05a09c73f26fec7bdf0331" +checksum = "4a52de8b6afbfcd618073f592c1450cb661574e7061f3f4a44f1f7ec0c7f7909" dependencies = [ - "anyhow", "cfg-if", "libc", - "windows-sys 0.60.2", -] - -[[package]] -name = "wasmtime-internal-math" -version = "36.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db9a153e184878df396a11f8912444531c2e4d0c7a1d9e9a52b30d9853d89cb9" -dependencies = [ - "libm", + "wasmtime-internal-core", + "windows-sys 0.61.2", ] -[[package]] -name = "wasmtime-internal-slab" -version = "36.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b771494bead25e1f0c4c89a9476dd0b65eacca314ed82125f1e197fbc3f0396b" - [[package]] name = "wasmtime-internal-unwinder" -version = "36.0.13" +version = "47.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90199caed6925420434a923861d8ad813689ca8533d2c679f805d12e35b40a4b" +checksum = "5524fbaaf3d2134dd6229164d7fc81e443cce06d1e0576524d5f4e86e747cb13" dependencies = [ - "anyhow", "cfg-if", "cranelift-codegen", "log", - "object", + "object 0.39.1", + "wasmtime-environ", ] [[package]] name = "wasmtime-internal-versioned-export-macros" -version = "36.0.13" +version = "47.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae71687aa834f9cc9eb5b0f97c85184d7dc70b84d32fd8927af0887998a1ba35" +checksum = "e93bb9ae112a80618510f938275a5d88637b656e7d0a021fc906f52206c708ad" dependencies = [ "proc-macro2", "quote", @@ -5825,16 +5902,7 @@ version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.60.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" -dependencies = [ - "windows-targets 0.53.5", + "windows-targets", ] [[package]] @@ -5852,31 +5920,14 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm 0.52.6", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.53.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" -dependencies = [ - "windows-link", - "windows_aarch64_gnullvm 0.53.1", - "windows_aarch64_msvc 0.53.1", - "windows_i686_gnu 0.53.1", - "windows_i686_gnullvm 0.53.1", - "windows_i686_msvc 0.53.1", - "windows_x86_64_gnu 0.53.1", - "windows_x86_64_gnullvm 0.53.1", - "windows_x86_64_msvc 0.53.1", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] [[package]] @@ -5885,96 +5936,48 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" - [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_aarch64_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" - [[package]] name = "windows_i686_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" -[[package]] -name = "windows_i686_gnu" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" - [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -[[package]] -name = "windows_i686_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" - [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_i686_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" - [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" -[[package]] -name = "windows_x86_64_gnu" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" - [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "windows_x86_64_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" - [[package]] name = "winnow" version = "0.7.15" diff --git a/Cargo.toml b/Cargo.toml index fcb2752f9..3f7e33332 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,8 +53,8 @@ k256 = { version = "0.13.4", features = ["ecdsa"], default-features = false } bls-signatures = { version = "0.15", default-features = false } # wasmtime -wasmtime = {version = "36", default-features = false, features = ["cranelift", "pooling-allocator", "parallel-compilation", "runtime"] } -wasmtime-environ = "36" +wasmtime = {version = "47", default-features = false, features = ["anyhow", "cranelift", "pooling-allocator", "parallel-compilation", "runtime"] } +wasmtime-environ = "47" # misc libfuzzer-sys = "0.4" @@ -62,10 +62,10 @@ arbitrary = "1.4.1" itertools = "0.14.0" once_cell = "1.21.3" unsigned-varint = "0.8.0" -ambassador = "0.4.1" +ambassador = "0.5" # dev/tools/tests -criterion = "0.7" +criterion = "0.8" quickcheck = "1.0.3" quickcheck_macros = "1.0.0" minstant = "0.1.7" diff --git a/deny.toml b/deny.toml index 29a667d71..e235f82c9 100644 --- a/deny.toml +++ b/deny.toml @@ -1,6 +1,5 @@ [advisories] ignore = [ - "RUSTSEC-2025-0057", # fxhash is no longer maintained, tracked in https://github.com/filecoin-project/ref-fvm/issues/2221 "RUSTSEC-2025-0141", # bincode unmaintained, transitive dep via bellperson/filecoin-proofs "RUSTSEC-2024-0436", # paste unmaintained (indirect dep via alloy) - the upstream ignores the advisory, nothing to be done ] diff --git a/fvm/Cargo.toml b/fvm/Cargo.toml index 9c7dc12f5..664ea83f7 100644 --- a/fvm/Cargo.toml +++ b/fvm/Cargo.toml @@ -45,6 +45,7 @@ static_assertions = "1.1.0" pretty_assertions = "1.4.1" fvm = { path = ".", features = ["testing"], default-features = false } coverage-helper = { workspace = true } +wat = "1" [features] default = ["opencl", "verify-signature"] diff --git a/fvm/src/engine/mod.rs b/fvm/src/engine/mod.rs index 28ddf2f59..ae0901f1e 100644 --- a/fvm/src/engine/mod.rs +++ b/fvm/src/engine/mod.rs @@ -18,7 +18,7 @@ use num_traits::Zero; use wasmtime::OptLevel::Speed; use wasmtime::{ Global, GlobalType, InstanceAllocationStrategy, Memory, MemoryType, Module, Mutability, Val, - ValType, WasmBacktraceDetails, + ValType, WasmBacktraceDetails, WasmFeatures, }; use crate::Kernel; @@ -212,9 +212,16 @@ fn wasmtime_config(ec: &EngineConfig) -> anyhow::Result { // handled correctly in wasm-instrument c.wasm_multi_value(false); - // Note: GC is disabled by default. - // If we add the "wasmtime/gc" feature in the future, - // we would explicitly set c.wasm_gc(false) and c.wasm_function_references(false) here. + // Wasm 3.0 turns the below on by default in wasmtime; they were all off in + // the versions FVM shipped before. The set of accepted Wasm is consensus-critical, + // so we reject all of them explicitly. + c.wasm_features( + WasmFeatures::GC + | WasmFeatures::FUNCTION_REFERENCES + | WasmFeatures::EXCEPTIONS + | WasmFeatures::LEGACY_EXCEPTIONS, + false, + ); // wasmtime default: false // @@ -231,6 +238,10 @@ fn wasmtime_config(ec: &EngineConfig) -> anyhow::Result { // Note: This is in bytes, while the instrumented limit is in stack elements c.max_wasm_stack(4 << 20); + // We don't use async, but wasmtime unconditionally rejects a `max_wasm_stack` larger than the + // `async_stack_size` (default 2MiB), so raise the latter to keep the stack limit above. + c.async_stack_size(8 << 20); + // Execution cost accouting is done through wasm instrumentation, c.consume_fuel(false); c.epoch_interruption(false); @@ -241,7 +252,7 @@ fn wasmtime_config(ec: &EngineConfig) -> anyhow::Result { c.generate_address_map(false); c.cranelift_debug_verifier(false); c.native_unwind_info(false); - c.wasm_backtrace(false); + c.wasm_backtrace_max_frames(None); c.wasm_backtrace_details(WasmBacktraceDetails::Disable); // Reiterate some defaults @@ -274,6 +285,10 @@ fn wasmtime_config(ec: &EngineConfig) -> anyhow::Result { // FIP. c.wasm_extended_const(false); + // wasmtime default: whether the crate `gc` feature is enabled or not + // Disable GC support. + c.gc_support(false); + // Note: Component model is disabled by default. // If we add the "wasmtime/component-model" feature in the future, // we would explicitly set c.wasm_component_model(false) here. @@ -539,8 +554,9 @@ impl Engine { cache .linker .define(&store, "gas", GAS_COUNTER_NAME, gas_global) - .context("failed to define gas counter") - .map_err(Abort::Fatal)?; + .map_err(|e| { + Abort::Fatal(anyhow::Error::from(e).context("failed to define gas counter")) + })?; let mut module_cache = self .inner @@ -557,10 +573,9 @@ impl Engine { // Pre-instantiate to catch any linker errors. These are considered fatal as it means // the wasm module wasn't properly validated. - let pre_instance = cache - .linker - .instantiate_pre(module) - .context("failed to link actor module")?; + let pre_instance = cache.linker.instantiate_pre(module).map_err(|e| { + Abort::Fatal(anyhow::Error::from(e).context("failed to link actor module")) + })?; // Update the gas _just_ in case. update_gas_available(store)?; @@ -677,7 +692,7 @@ impl wasmtime::ResourceLimiter for WasmtimeLimiter { current: usize, desired: usize, maximum: Option, - ) -> anyhow::Result { + ) -> wasmtime::Result { if maximum.is_some_and(|m| desired > m) { return Ok(false); } @@ -690,7 +705,7 @@ impl wasmtime::ResourceLimiter for WasmtimeLimiter { current: usize, desired: usize, maximum: Option, - ) -> anyhow::Result { + ) -> wasmtime::Result { if maximum.is_some_and(|m| desired > m) { return Ok(false); } @@ -767,4 +782,71 @@ mod tests { assert!(limits.table_growing(2, 4, None).unwrap()); assert_eq!(limits.0.memory, 5 * 8); } + + // The set of accepted Wasm proposals is consensus-critical: it must not drift when wasmtime is + // upgraded. This pins both sides of the boundary (every feature we accept and every proposal we + // reject) so that a wasmtime release flipping any proposal's default (as Wasm 3.0 did for GC and + // typed function references) fails here instead of silently changing which actor code loads. + #[test] + fn accepted_wasm_features_are_fixed() { + use fvm_shared::version::NetworkVersion; + + use crate::engine::{EngineConfig, wasmtime_config}; + use crate::machine::NetworkConfig; + + let ec = EngineConfig::from(&NetworkConfig::new(NetworkVersion::V28)); + let engine = wasmtime::Engine::new(&wasmtime_config(&ec).unwrap()).unwrap(); + let validates = + |wat: &str| wasmtime::Module::validate(&engine, &wat::parse_str(wat).unwrap()).is_ok(); + + const CALL_REF: &str = + r#"(module (type $t (func)) (func (param $p (ref $t)) (call_ref $t (local.get $p))))"#; + + // Accepted: plain MVP plus the Wasm 2.0 features FVM depends on (funcref reference-types, + // bulk-memory, sign-extension, non-trapping float-to-int). Pinning the accepted side guards + // against a future default turning one of these off. + for m in [ + r#"(module (func (export "f")))"#, + r#"(module (type $t (func)) (table 1 funcref) (func (export "f") (call_indirect (type $t) (i32.const 0))))"#, + r#"(module (func (result funcref) (ref.null func)))"#, + r#"(module (memory 1) (func (memory.fill (i32.const 0) (i32.const 0) (i32.const 0))))"#, + r#"(module (func (param i32) (result i32) (i32.extend8_s (local.get 0))))"#, + r#"(module (func (param f32) (result i32) (i32.trunc_sat_f32_s (local.get 0))))"#, + ] { + assert!(validates(m), "should be accepted: {m}"); + } + + // Rejected: every proposal FVM disables. `(global.get 0)` in a constant expression is the + // relaxation Wasm 3.0 added (the spec files it under extended-const, wasmtime gates it under + // GC); we disable both. `externref` needs the GC runtime, which we build without. + for m in [ + CALL_REF, // typed function references + r#"(module (type $s (struct (field i32))))"#, // GC + r#"(module (tag $e))"#, // exception handling + r#"(module (func try catch_all end))"#, // legacy exception handling + r#"(module (global i32 (i32.const 1)) (global i32 (global.get 0)))"#, // relaxed constant expression + r#"(module (global externref (ref.null extern)))"#, // externref + r#"(module (func (result v128) (v128.const i32x4 0 0 0 0)))"#, // SIMD + r#"(module (func $f) (func (return_call $f)))"#, // tail calls + r#"(module (func (result i32 i32) (i32.const 0) (i32.const 1)))"#, // multi-value + r#"(module (memory 1) (memory 1))"#, // multi-memory + r#"(module (memory i64 1))"#, // memory64 + r#"(module (memory 1 1 (pagesize 1)))"#, // custom page sizes + r#"(module (global i32 (i32.add (i32.const 1) (i32.const 2))))"#, // extended const + r#"(module (func (param i64 i64 i64 i64) (result i64 i64) (i64.add128 (local.get 0) (local.get 1) (local.get 2) (local.get 3))))"#, // wide arithmetic + r#"(module (memory 1 1 shared))"#, // threads / shared memory + ] { + assert!(!validates(m), "should be rejected: {m}"); + } + + // Positive control: re-enabling the function-references proposal is what makes `call_ref` + // validate, proving the rejection above comes from our explicit disable, not some other + // cause. + let mut permissive = wasmtime_config(&ec).unwrap(); + permissive.wasm_features(wasmtime::WasmFeatures::FUNCTION_REFERENCES, true); + let permissive = wasmtime::Engine::new(&permissive).unwrap(); + assert!( + wasmtime::Module::validate(&permissive, &wat::parse_str(CALL_REF).unwrap()).is_ok() + ); + } } diff --git a/fvm/src/machine/limiter.rs b/fvm/src/machine/limiter.rs index ed6f15008..c6db9b472 100644 --- a/fvm/src/machine/limiter.rs +++ b/fvm/src/machine/limiter.rs @@ -4,7 +4,7 @@ use crate::machine::NetworkConfig; /// Execution level memory tracking and adjustment. -pub trait MemoryLimiter: Sized { +pub trait MemoryLimiter: Sized + Send { /// Get a snapshot of the total memory required by the callstack (in bytes). This currently /// includes: /// diff --git a/fvm/src/syscalls/error.rs b/fvm/src/syscalls/error.rs index 8d6059d87..a63be4c39 100644 --- a/fvm/src/syscalls/error.rs +++ b/fvm/src/syscalls/error.rs @@ -56,8 +56,8 @@ impl Abort { } /// Unwraps a trap error from an actor into an "abort". -impl From for Abort { - fn from(e: anyhow::Error) -> Self { +impl From for Abort { + fn from(e: wasmtime::Error) -> Self { if let Some(trap) = e.downcast_ref::() { return match trap { | Trap::MemoryOutOfBounds @@ -80,13 +80,13 @@ impl From for Abort { trap.to_string(), NO_DATA_BLOCK_ID, ), - _ => Abort::Fatal(anyhow!("unexpected wasmtime trap: {}", trap)), + _ => Abort::Fatal(anyhow!("unexpected wasmtime trap: {trap}")), }; }; match e.downcast::() { Ok(abort) => abort, - Err(e) => Abort::Fatal(e), + Err(e) => Abort::Fatal(e.into()), } } }