diff --git a/Cargo.lock b/Cargo.lock index dbdb3a92a5..2f847a38f0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -61,15 +61,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "aho-corasick" -version = "0.7.20" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" -dependencies = [ - "memchr", -] - [[package]] name = "aho-corasick" version = "1.0.2" @@ -96,9 +87,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.15" +version = "0.2.16" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "56fc6cf8dc8c4158eed8649f9b8b0ea1518eb62b544fe9490d66fa0b349eafe9" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] name = "android-tzdata" @@ -166,9 +157,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.72" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" [[package]] name = "arc-swap" @@ -185,11 +176,11 @@ dependencies = [ "ark-ff", "ark-poly", "ark-serialize", - "ark-std 0.4.0", + "ark-std", "derivative", "hashbrown 0.13.2", "itertools 0.10.5", - "num-traits 0.2.15", + "num-traits 0.2.16", "zeroize", ] @@ -202,12 +193,12 @@ dependencies = [ "ark-ff-asm", "ark-ff-macros", "ark-serialize", - "ark-std 0.4.0", + "ark-std", "derivative", "digest 0.10.7", "itertools 0.10.5", "num-bigint", - "num-traits 0.2.15", + "num-traits 0.2.16", "paste", "rustc_version", "zeroize", @@ -230,7 +221,7 @@ source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" dependencies = [ "num-bigint", - "num-traits 0.2.15", + "num-traits 0.2.16", "proc-macro2", "quote", "syn 1.0.109", @@ -244,7 +235,7 @@ checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" dependencies = [ "ark-ff", "ark-serialize", - "ark-std 0.4.0", + "ark-std", "derivative", "hashbrown 0.13.2", ] @@ -257,7 +248,7 @@ checksum = "4c02e954eaeb4ddb29613fee20840c2bbc85ca4396d53e33837e11905363c5f2" dependencies = [ "ark-ec", "ark-ff", - "ark-std 0.4.0", + "ark-std", ] [[package]] @@ -268,7 +259,7 @@ checksum = "3975a01b0a6e3eae0f72ec7ca8598a6620fc72fa5981f6f5cca33b7cd788f633" dependencies = [ "ark-ec", "ark-ff", - "ark-std 0.4.0", + "ark-std", ] [[package]] @@ -278,7 +269,7 @@ source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" dependencies = [ "ark-serialize-derive", - "ark-std 0.4.0", + "ark-std", "digest 0.10.7", "num-bigint", ] @@ -294,23 +285,13 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "ark-std" -version = "0.3.0" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" -dependencies = [ - "num-traits 0.2.15", - "rand", -] - [[package]] name = "ark-std" version = "0.4.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" dependencies = [ - "num-traits 0.2.15", + "num-traits 0.2.16", "rand", ] @@ -358,9 +339,9 @@ checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" [[package]] name = "async-compression" -version = "0.3.15" +version = "0.4.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "942c7cd7ae39e91bde4820d74132e9862e62c2f386c3aa90ccf55949f5bad63a" +checksum = "62b74f44609f0f91493e3082d3734d98497e094777144380ea4db9f9905dd5b6" dependencies = [ "brotli", "flate2", @@ -394,7 +375,7 @@ dependencies = [ "indexmap 1.9.3", "mime", "multer", - "num-traits 0.2.15", + "num-traits 0.2.16", "once_cell", "pin-project-lite", "regex", @@ -478,18 +459,18 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] name = "async-trait" -version = "0.1.69" +version = "0.1.72" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "7b2d0f03b3640e3a630367e40c468cb7f309529c708ed1d88597047b0e7c6ef7" +checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] @@ -498,18 +479,7 @@ version = "1.0.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "d7c57d12312ff59c811c0643f4d80830505833c9ffaebd193d819392b265be8e" dependencies = [ - "num-traits 0.2.15", -] - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", + "num-traits 0.2.16", ] [[package]] @@ -563,12 +533,6 @@ version = "0.13.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" -[[package]] -name = "base64" -version = "0.20.0" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "0ea22880d78093b0cbe17c89f64a7d457941e65759157ec6cb31a31d652b05e5" - [[package]] name = "base64" version = "0.21.2" @@ -592,7 +556,7 @@ checksum = "a6773ddc0eafc0e509fb60e48dff7f450f8e674a0686ae8605e8d9901bd5eefa" dependencies = [ "num-bigint", "num-integer", - "num-traits 0.2.15", + "num-traits 0.2.16", "serde", ] @@ -607,8 +571,17 @@ dependencies = [ [[package]] name = "bincode" -version = "2.0.0-rc.2" -source = "git+/~https://github.com/bincode-org/bincode.git?tag=v2.0.0-rc.2#6c219e9214bda2bdce1327db6ed7f66d2fa4bf02" +version = "2.0.0-rc.3" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "f11ea1a0346b94ef188834a65c068a03aec181c94896d481d7a0a40d85b0ce95" +dependencies = [ + "serde", +] + +[[package]] +name = "bincode" +version = "2.0.0-rc.3" +source = "git+/~https://github.com/bincode-org/bincode.git?tag=v2.0.0-rc.3#aada4bb4cb457677a4b8e47572ae7ca8dd44927c" dependencies = [ "serde", ] @@ -672,17 +645,17 @@ dependencies = [ [[package]] name = "blockifier" -version = "0.1.0" -source = "git+/~https://github.com/dojoengine/blockifier?rev=f5b684d#f5b684df4f3ead90aecf3fe3e98f20e7919d615e" +version = "0.1.0-rc0" +source = "git+/~https://github.com/dojoengine/blockifier?rev=007a4aafad49acd751e408b4e37d963d72a26792#007a4aafad49acd751e408b4e37d963d72a26792" dependencies = [ "ark-ff", "ark-secp256k1", - "cairo-felt", + "cairo-felt 0.8.2", "cairo-lang-casm", "cairo-lang-runner", "cairo-lang-starknet", - "cairo-vm", - "ctor 0.2.3", + "cairo-vm 0.8.2", + "ctor", "derive_more", "indexmap 1.9.3", "itertools 0.10.5", @@ -690,7 +663,7 @@ dependencies = [ "log", "num-bigint", "num-integer", - "num-traits 0.2.15", + "num-traits 0.2.16", "phf", "serde", "serde_json", @@ -725,13 +698,12 @@ dependencies = [ [[package]] name = "bstr" -version = "1.5.0" +version = "1.6.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "a246e68bb43f6cd9db24bea052a53e40405417c5fb372e3d1a8a7f770a564ef5" +checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" dependencies = [ "memchr", - "once_cell", - "regex-automata", + "regex-automata 0.3.3", "serde", ] @@ -741,7 +713,7 @@ version = "0.4.3" source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "9dd6407f73a9b8b6162d8a2ef999fe6afd7cc15902ebf42c5cd296addf17e0ad" dependencies = [ - "num-traits 0.2.15", + "num-traits 0.2.16", ] [[package]] @@ -779,26 +751,39 @@ checksum = "38fcc2979eff34a4b84e1cf9a1e3da42a7d44b3b690a40cdcb23e3d556cfb2e5" [[package]] name = "cairo-felt" -version = "0.6.1" -source = "git+/~https://github.com/dojoengine/cairo-rs.git?rev=b1a3683fe20bb668e4ab72cd9f99b8a0a33515a8#b1a3683fe20bb668e4ab72cd9f99b8a0a33515a8" +version = "0.6.2" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "eec837cac4e5e5a7f7abd6fb26c1d91cf0a588cf394367a7111a9549cabaa0b9" dependencies = [ "lazy_static", "num-bigint", "num-integer", - "num-traits 0.2.15", + "num-traits 0.2.16", + "serde", +] + +[[package]] +name = "cairo-felt" +version = "0.8.2" +source = "git+/~https://github.com/dojoengine/cairo-rs.git?rev=69f30bcd1acf99631645bcc4efc434553e2f146e#69f30bcd1acf99631645bcc4efc434553e2f146e" +dependencies = [ + "lazy_static", + "num-bigint", + "num-integer", + "num-traits 0.2.16", "serde", ] [[package]] name = "cairo-lang-casm" -version = "2.0.1" +version = "2.1.0-rc2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "ffe86abd9f988018b39e1e41b467608ad9596ff466f141d41ffecc29a483c2f4" +checksum = "cab9793f38a7090c54b6508b0367064dad6609de4192fdd9a065758f2152a19f" dependencies = [ "cairo-lang-utils", - "indoc", + "indoc 2.0.3", "num-bigint", - "num-traits 0.2.15", + "num-traits 0.2.16", "parity-scale-codec", "parity-scale-codec-derive", "schemars", @@ -808,9 +793,9 @@ dependencies = [ [[package]] name = "cairo-lang-compiler" -version = "2.0.1" +version = "2.1.0-rc2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "220a48cb861ea7dac60f50e7aea044d7c0936ea602f64479e9577d4c4bed5c9e" +checksum = "49f4a267b8f3006ec7fe20ddc2178020e8a81b3e685120a4f8735d0343ba405d" dependencies = [ "anyhow", "cairo-lang-defs", @@ -833,18 +818,18 @@ dependencies = [ [[package]] name = "cairo-lang-debug" -version = "2.0.1" +version = "2.1.0-rc2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "4bd06a99f5ac52f466a64fbdd0615baddb078b9e0cb97fdc7575faea916a66b5" +checksum = "8a19fed5e9b0d38eba6249e4835eee9351790b79f4fd15e092b1847b47a3fd00" dependencies = [ "cairo-lang-utils", ] [[package]] name = "cairo-lang-defs" -version = "2.0.1" +version = "2.1.0-rc2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "6b8512ee5f8b3a2a18c7ffbaa23a815e56d9f8737ba0d3a0d5dcbf9b2fcbe96b" +checksum = "ebaaa8b1627fd879ed0dceea2333a2b5652541be5272d9546eb337fc80b7a696" dependencies = [ "cairo-lang-debug", "cairo-lang-diagnostics", @@ -852,41 +837,42 @@ dependencies = [ "cairo-lang-parser", "cairo-lang-syntax", "cairo-lang-utils", - "indexmap 1.9.3", - "itertools 0.10.5", + "indexmap 2.0.0", + "itertools 0.11.0", "salsa", "smol_str", ] [[package]] name = "cairo-lang-diagnostics" -version = "2.0.1" +version = "2.1.0-rc2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "e0a351f6441a55ce70b7ba62814670d0c154b2fdc4a7453387b71027a8440da2" +checksum = "2fa9e6394ac948fc3664f005ac2e7d3ff6f232d74b1874e76acba78f5bcda261" dependencies = [ + "cairo-lang-debug", "cairo-lang-filesystem", "cairo-lang-utils", - "itertools 0.10.5", + "itertools 0.11.0", "salsa", ] [[package]] name = "cairo-lang-eq-solver" -version = "2.0.1" +version = "2.1.0-rc2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "824ee8e225355e09ac57f537a9612049e4367b2bd3934d0591559bf87337cdbe" +checksum = "93bdea1c5b949e905c15d52e8060bd37e9f7f6384a1937c0b76d3e420098ed0a" dependencies = [ "cairo-lang-utils", "good_lp", - "indexmap 1.9.3", - "itertools 0.10.5", + "indexmap 2.0.0", + "itertools 0.11.0", ] [[package]] name = "cairo-lang-filesystem" -version = "2.0.1" +version = "2.1.0-rc2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "1da7ceb69b84fb8b0d6e4d4648c4f2218feddcf0b9929094358b2bd3b2603ef0" +checksum = "e0d47d58533b468218e6599a6a34487481c29eef73422f2a730cf1e85943a195" dependencies = [ "cairo-lang-debug", "cairo-lang-utils", @@ -898,9 +884,9 @@ dependencies = [ [[package]] name = "cairo-lang-formatter" -version = "2.0.1" +version = "2.1.0-rc2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "a22ae069ae484dd262171c3da695467e82e9e31bc063df6a13534278df9e0bda" +checksum = "9bea9cafdddae66fc573a1909bd53b97454679cc63ec9af9df3fa77fd46e2104" dependencies = [ "anyhow", "cairo-lang-diagnostics", @@ -911,7 +897,7 @@ dependencies = [ "colored", "diffy", "ignore", - "itertools 0.10.5", + "itertools 0.11.0", "log", "salsa", "smol_str", @@ -919,9 +905,9 @@ dependencies = [ [[package]] name = "cairo-lang-language-server" -version = "2.0.1" +version = "2.1.0-rc2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "2386905632f77cc6d9e507fe4712c596838206f944ce3e187be8da50b8483f8a" +checksum = "cfdf719635a59f76d6a1fa79dcff7acc15cb0c8848122c4f50a6401ec7b2bd2c" dependencies = [ "anyhow", "cairo-lang-compiler", @@ -938,23 +924,23 @@ dependencies = [ "cairo-lang-starknet", "cairo-lang-syntax", "cairo-lang-utils", - "indoc", + "indoc 2.0.3", "log", - "lsp-types", + "lsp-types 0.94.0", "salsa", "scarb-metadata 1.4.2 (registry+/~https://github.com/rust-lang/crates.io-index)", "serde", "serde_json", "smol_str", "tokio", - "tower-lsp", + "tower-lsp 0.19.0", ] [[package]] name = "cairo-lang-lowering" -version = "2.0.1" +version = "2.1.0-rc2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "a70fb2960cc39ceee250090109f9df05b26f781dab8c0ba48b6fd6f663858587" +checksum = "ff9d12f5f01509c5a5197c8e632246934686e4871ea7641afc75b64ee6af41c7" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -966,20 +952,20 @@ dependencies = [ "cairo-lang-syntax", "cairo-lang-utils", "id-arena", - "indexmap 1.9.3", - "itertools 0.10.5", + "indexmap 2.0.0", + "itertools 0.11.0", "log", "num-bigint", - "num-traits 0.2.15", + "num-traits 0.2.16", "salsa", "smol_str", ] [[package]] name = "cairo-lang-parser" -version = "2.0.1" +version = "2.1.0-rc2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "48c44c66f5aeb3d80189f4f2fd0bc6872b4c6f5cc25002402dc6e85561d2cc53" +checksum = "01ab8f4d4c85615662439a95c5bc92d2a66fb1901a865ffddaf3823ce8715730" dependencies = [ "cairo-lang-diagnostics", "cairo-lang-filesystem", @@ -987,10 +973,10 @@ dependencies = [ "cairo-lang-syntax-codegen", "cairo-lang-utils", "colored", - "itertools 0.10.5", + "itertools 0.11.0", "log", "num-bigint", - "num-traits 0.2.15", + "num-traits 0.2.16", "salsa", "smol_str", "unescaper", @@ -998,9 +984,9 @@ dependencies = [ [[package]] name = "cairo-lang-plugins" -version = "2.0.1" +version = "2.1.0-rc2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "d0acfa9aca2811c5df6d72a160c4168fd6cc53eb3c3f966c933e791b0f91ce01" +checksum = "5d608f88a82a581d1c3ed57b27fc396abcf70fdbe28d6904a046dfc139a6f504" dependencies = [ "cairo-lang-defs", "cairo-lang-diagnostics", @@ -1009,49 +995,50 @@ dependencies = [ "cairo-lang-semantic", "cairo-lang-syntax", "cairo-lang-utils", - "indoc", - "itertools 0.10.5", + "indoc 2.0.3", + "itertools 0.11.0", + "num-bigint", "salsa", "smol_str", ] [[package]] name = "cairo-lang-proc-macros" -version = "2.0.1" +version = "2.1.0-rc2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "0e5ce4ad906f6491bc82eaae14eea6a96755d651a8809fc1adb53feb99bcc55a" +checksum = "ecfd29efb3d12c31d5ea0e6668ecf8a1be37e68ff729f4342530d14630156f1c" dependencies = [ "cairo-lang-debug", "quote", - "syn 1.0.109", + "syn 2.0.27", ] [[package]] name = "cairo-lang-project" -version = "2.0.1" +version = "2.1.0-rc2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "46f7c638a2a30010071a176396c29bc065701f353f2c3205b96f03463b54721c" +checksum = "8889fc471fe82bd43e7a23dd067b93aa4097ac15a7b9158145da582c0f657338" dependencies = [ "cairo-lang-filesystem", "cairo-lang-utils", "serde", "smol_str", "thiserror", - "toml 0.4.10", + "toml", ] [[package]] name = "cairo-lang-runner" -version = "2.0.1" +version = "2.1.0-rc2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "2e6dd17668d38b3374ae5198a009765b5fd5b645ab240e1cae7df720594b1999" +checksum = "aec3797ba90fcf40f21287d240e973489e1abf987141a5515dd605f0f48247c1" dependencies = [ "anyhow", "ark-ff", "ark-secp256k1", "ark-secp256r1", - "ark-std 0.3.0", - "cairo-felt", + "ark-std", + "cairo-felt 0.8.2", "cairo-lang-casm", "cairo-lang-compiler", "cairo-lang-defs", @@ -1064,23 +1051,24 @@ dependencies = [ "cairo-lang-sierra-gas", "cairo-lang-sierra-generator", "cairo-lang-sierra-to-casm", + "cairo-lang-sierra-type-size", "cairo-lang-starknet", "cairo-lang-utils", - "cairo-vm", - "itertools 0.10.5", + "cairo-vm 0.8.2", + "itertools 0.11.0", "keccak", "num-bigint", "num-integer", - "num-traits 0.2.15", + "num-traits 0.2.16", "salsa", "thiserror", ] [[package]] name = "cairo-lang-semantic" -version = "2.0.1" +version = "2.1.0-rc2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "bb3e68af88e60a1e30776877b0a3a346a21a3d15c54c9f8ace844e0652b1036f" +checksum = "0f125c9c693ec20d067b0362e0c4efb9ac3af398a52db45d8c2c1ff14a9db92e" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -1091,29 +1079,29 @@ dependencies = [ "cairo-lang-syntax", "cairo-lang-utils", "id-arena", - "itertools 0.10.5", + "itertools 0.11.0", "log", "num-bigint", - "num-traits 0.2.15", + "num-traits 0.2.16", "salsa", "smol_str", ] [[package]] name = "cairo-lang-sierra" -version = "2.0.1" +version = "2.1.0-rc2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "3e4ccc934f2d4a063f7f72554d422e724134925c981cd0e592b4defb73ca103a" +checksum = "0bcc305af1cd4174bed72b6856cc0ca24fab608bced0c698ef9e54b0622cc9cd" dependencies = [ "cairo-lang-utils", "const-fnv1a-hash", "convert_case 0.6.0", "derivative", - "itertools 0.10.5", + "itertools 0.11.0", "lalrpop", "lalrpop-util", "num-bigint", - "num-traits 0.2.15", + "num-traits 0.2.16", "regex", "salsa", "serde", @@ -1124,35 +1112,37 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-ap-change" -version = "2.0.1" +version = "2.1.0-rc2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "ad6e742ec576f773c9d6c4f1e4be6fbe9f1e5b470cd374f27f5c82e15c151b85" +checksum = "fe36cb757958cfb1381ee9f6bd17234d1fa933331aadf9d1b0f9c4c7f0babb4d" dependencies = [ "cairo-lang-eq-solver", "cairo-lang-sierra", + "cairo-lang-sierra-type-size", "cairo-lang-utils", - "itertools 0.10.5", + "itertools 0.11.0", "thiserror", ] [[package]] name = "cairo-lang-sierra-gas" -version = "2.0.1" +version = "2.1.0-rc2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "2dc4e1b3793f639724f59f34eb4007253a91d5179de8b2ab2c511c6c5d56155c" +checksum = "2f6ad8d10d5fcaf780b115d4fc337c912b9490fecd61e5c2b94655a26ac25246" dependencies = [ "cairo-lang-eq-solver", "cairo-lang-sierra", + "cairo-lang-sierra-type-size", "cairo-lang-utils", - "itertools 0.10.5", + "itertools 0.11.0", "thiserror", ] [[package]] name = "cairo-lang-sierra-generator" -version = "2.0.1" +version = "2.1.0-rc2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "20c323c6f656398254f9404126c4a60e0a5234214255590288783eb323f6f187" +checksum = "4712ca7af12fa771a127a2e0a1e3757160a299b4f9c2db03a5e1e879986a324d" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -1167,8 +1157,8 @@ dependencies = [ "cairo-lang-syntax", "cairo-lang-utils", "id-arena", - "indexmap 1.9.3", - "itertools 0.10.5", + "indexmap 2.0.0", + "itertools 0.11.0", "num-bigint", "salsa", "smol_str", @@ -1176,33 +1166,44 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-to-casm" -version = "2.0.1" +version = "2.1.0-rc2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "b26fffdbf578f9aaf00d74001ac93cad4a713b510642161a0594f1403a59c543" +checksum = "32af568d896f497bc7154b6b38cf3a63634cd1a49625e788132b897b206aa117" dependencies = [ "assert_matches", - "cairo-felt", + "cairo-felt 0.8.2", "cairo-lang-casm", "cairo-lang-sierra", "cairo-lang-sierra-ap-change", "cairo-lang-sierra-gas", + "cairo-lang-sierra-type-size", "cairo-lang-utils", - "indoc", - "itertools 0.10.5", + "indoc 2.0.3", + "itertools 0.11.0", "log", "num-bigint", - "num-traits 0.2.15", + "num-traits 0.2.16", "thiserror", ] +[[package]] +name = "cairo-lang-sierra-type-size" +version = "2.1.0-rc2" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "12eeec139a81250cb07734913539725de1ae527304d036bd0247424ae053ca74" +dependencies = [ + "cairo-lang-sierra", + "cairo-lang-utils", +] + [[package]] name = "cairo-lang-starknet" -version = "2.0.1" +version = "2.1.0-rc2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "c63e026127221a7bb5b5081b631eeef552a99cbdae76414dced7a224694afeaa" +checksum = "3fc16911988deeaa242f3b9111d27a07033c09c720af10970ea30c3091a7cfe7" dependencies = [ "anyhow", - "cairo-felt", + "cairo-felt 0.8.2", "cairo-lang-casm", "cairo-lang-compiler", "cairo-lang-defs", @@ -1221,12 +1222,13 @@ dependencies = [ "cairo-lang-utils", "convert_case 0.6.0", "genco", - "indoc", - "itertools 0.10.5", + "indent", + "indoc 2.0.3", + "itertools 0.11.0", "log", "num-bigint", "num-integer", - "num-traits 0.2.15", + "num-traits 0.2.16", "once_cell", "serde", "serde_json", @@ -1237,15 +1239,15 @@ dependencies = [ [[package]] name = "cairo-lang-syntax" -version = "2.0.1" +version = "2.1.0-rc2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "d6b48a1c67679bc19165c2ce45b38e7bc7ce5a4fbb004a07f60361f99b618e73" +checksum = "c8b2dcb8a45ad35acb806b9dae478ecd9090b23d535099aa4b382509d00acf89" dependencies = [ "cairo-lang-debug", "cairo-lang-filesystem", "cairo-lang-utils", "num-bigint", - "num-traits 0.2.15", + "num-traits 0.2.16", "salsa", "smol_str", "thiserror", @@ -1254,9 +1256,9 @@ dependencies = [ [[package]] name = "cairo-lang-syntax-codegen" -version = "2.0.1" +version = "2.1.0-rc2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "8b2102b91819a7638f1efb39379351578a296d042de53f7492684eeb47c3a844" +checksum = "7a68448f3ac131fac80e7160502b47a5f76b7b401c1f72aaced7dccdb4dd892f" dependencies = [ "genco", "xshell", @@ -1264,12 +1266,12 @@ dependencies = [ [[package]] name = "cairo-lang-test-runner" -version = "2.0.1" +version = "2.1.0-rc2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "73db1b93b06e4d04757e77201af0806a8a09f5577d13a5020e50a4ecdecfb9fe" +checksum = "3aa955b81083d714b6430e4ac7e1e7ebe7b2039bec8fe7d581ffa4852cbfb5b6" dependencies = [ "anyhow", - "cairo-felt", + "cairo-felt 0.8.2", "cairo-lang-casm", "cairo-lang-compiler", "cairo-lang-debug", @@ -1287,11 +1289,11 @@ dependencies = [ "cairo-lang-starknet", "cairo-lang-syntax", "cairo-lang-utils", - "cairo-vm", + "cairo-vm 0.8.2", "colored", - "itertools 0.10.5", + "itertools 0.11.0", "num-bigint", - "num-traits 0.2.15", + "num-traits 0.2.16", "rayon", "salsa", "thiserror", @@ -1299,9 +1301,9 @@ dependencies = [ [[package]] name = "cairo-lang-test-utils" -version = "2.0.1" +version = "2.1.0-rc2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "d6beaf84deb4b10b795e0962ec34d8d4bd10a90c3395ada0d80ee5625d7990f9" +checksum = "9cbabe16e43999a8438029d4a96afc51ded8a91b859907b342cb5f091ab114cd" dependencies = [ "cairo-lang-utils", "log", @@ -1310,40 +1312,42 @@ dependencies = [ [[package]] name = "cairo-lang-utils" -version = "2.0.1" +version = "2.1.0-rc2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "25d0873d45a7f6020fa39ebda1386a20d328bf5e448056d5a507641d0bfde0cf" +checksum = "c5a2b7fdb915e2bee7ac65bb120c29562400ffdb8227eb8f0651960a9bb745ef" dependencies = [ - "env_logger 0.9.3", - "indexmap 1.9.3", - "itertools 0.10.5", + "env_logger", + "indexmap 2.0.0", + "itertools 0.11.0", "log", "num-bigint", "num-integer", - "num-traits 0.2.15", + "num-traits 0.2.16", "parity-scale-codec", "schemars", "serde", - "time 0.3.22", + "time 0.3.23", ] [[package]] name = "cairo-take_until_unbalanced" version = "0.30.0" -source = "git+/~https://github.com/dojoengine/cairo-rs.git?rev=b1a3683fe20bb668e4ab72cd9f99b8a0a33515a8#b1a3683fe20bb668e4ab72cd9f99b8a0a33515a8" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "32c366b2a52b63db19fcc20a761ea37aa9f5fdce1723016c458e3990ef4fdf2c" dependencies = [ "nom", ] [[package]] name = "cairo-vm" -version = "0.6.1" -source = "git+/~https://github.com/dojoengine/cairo-rs.git?rev=b1a3683fe20bb668e4ab72cd9f99b8a0a33515a8#b1a3683fe20bb668e4ab72cd9f99b8a0a33515a8" +version = "0.6.2" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "52f62944d2694a457cad49099504efbc6b91fa583cfc690e626d9db05bd925b1" dependencies = [ "anyhow", - "bincode 2.0.0-rc.2", + "bincode 2.0.0-rc.3 (registry+/~https://github.com/rust-lang/crates.io-index)", "bitvec", - "cairo-felt", + "cairo-felt 0.6.2", "cairo-take_until_unbalanced", "generic-array", "hashbrown 0.13.2", @@ -1355,7 +1359,7 @@ dependencies = [ "num-bigint", "num-integer", "num-prime", - "num-traits 0.2.15", + "num-traits 0.2.16", "rand", "rand_core", "serde", @@ -1368,20 +1372,49 @@ dependencies = [ "thiserror-no-std", ] +[[package]] +name = "cairo-vm" +version = "0.8.2" +source = "git+/~https://github.com/dojoengine/cairo-rs.git?rev=69f30bcd1acf99631645bcc4efc434553e2f146e#69f30bcd1acf99631645bcc4efc434553e2f146e" +dependencies = [ + "anyhow", + "bincode 2.0.0-rc.3 (git+/~https://github.com/bincode-org/bincode.git?tag=v2.0.0-rc.3)", + "bitvec", + "cairo-felt 0.8.2", + "generic-array", + "hashbrown 0.14.0", + "hex", + "keccak", + "lazy_static", + "mimalloc", + "nom", + "num-bigint", + "num-integer", + "num-prime", + "num-traits 0.2.16", + "rand", + "serde", + "serde_json", + "sha2", + "sha3", + "starknet-crypto 0.5.1", + "thiserror-no-std", +] + [[package]] name = "camino" -version = "1.1.4" +version = "1.1.6" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "c530edf18f37068ac2d977409ed5cd50d53d73bc653c7647b48eb78976ac9ae2" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" dependencies = [ "serde", ] [[package]] name = "cargo-platform" -version = "0.1.2" +version = "0.1.3" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" +checksum = "2cfa25e60aea747ec7e1124f238816749faa93759c6ff5b31f1ccdda137f4479" dependencies = [ "serde", ] @@ -1424,7 +1457,7 @@ dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", - "num-traits 0.2.15", + "num-traits 0.2.16", "serde", "time 0.1.45", "wasm-bindgen", @@ -1443,9 +1476,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.3.10" +version = "4.3.19" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "384e169cc618c613d5e3ca6404dda77a8685a63e08660dcc64abaf7da7cb0c7a" +checksum = "5fd304a20bff958a57f04c4e96a2e7594cc4490a0e809cbd48bb6437edaa452d" dependencies = [ "clap_builder", "clap_derive", @@ -1464,9 +1497,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.10" +version = "4.3.19" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "ef137bbe35aab78bdb468ccfba75a5f4d8321ae011d34063770780545176af2d" +checksum = "01c6a3f08f1fe5662a35cfe393aec09c4df95f60ee93b7556505260f75eee9e1" dependencies = [ "anstream", "anstyle", @@ -1476,14 +1509,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.3.2" +version = "4.3.12" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "b8cd2b2a819ad6eec39e8f1d6b53001af1e5469f8c177579cdaeb313115b825f" +checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050" dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] @@ -1506,13 +1539,13 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "colored" -version = "2.0.1" +version = "2.0.4" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "17bfac9400fe632590700de801b5dfbdca8b6944073832d1284bdbeef7f00e45" +checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6" dependencies = [ - "atty", + "is-terminal", "lazy_static", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -1567,9 +1600,9 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "cpufeatures" -version = "0.2.8" +version = "0.2.9" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "03e69e28e9f7f77debdedbaafa2866e1de9ba56df55a8bd7cfc724c25a09987c" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" dependencies = [ "libc", ] @@ -1601,7 +1634,7 @@ dependencies = [ [[package]] name = "create-output-dir" version = "1.0.0" -source = "git+/~https://github.com/software-mansion/scarb#798acce7f95f52746cc21e641de49537ececc66b" +source = "git+/~https://github.com/software-mansion/scarb?rev=c7b2e34#c7b2e34ff329e08e643907c3f699c4cfd66bbdab" dependencies = [ "anyhow", "core-foundation", @@ -1705,22 +1738,12 @@ dependencies = [ [[package]] name = "ctor" -version = "0.1.26" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" -dependencies = [ - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ctor" -version = "0.2.3" +version = "0.2.4" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "eed5fff0d93c7559121e9c72bf9c242295869396255071ff2cb1617147b608c5" +checksum = "1f34ba9a9bcb8645379e9de8cb3ecfcf4d1c85ba66d90deb3259206fa5aa193b" dependencies = [ "quote", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] @@ -1754,12 +1777,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.1" +version = "0.20.3" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "0558d22a7b463ed0241e993f76f09f30b126687447751a8638587b864e4b3944" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" dependencies = [ - "darling_core 0.20.1", - "darling_macro 0.20.1", + "darling_core 0.20.3", + "darling_macro 0.20.3", ] [[package]] @@ -1778,16 +1801,16 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.1" +version = "0.20.3" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "ab8bfa2e259f8ee1ce5e97824a3c55ec4404a0d772ca7fa96bf19f0752a046eb" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] @@ -1803,23 +1826,23 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.1" +version = "0.20.3" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "29a358ff9f12ec09c3e61fef9b5a9902623a695a46a917b07f269bff1445611a" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ - "darling_core 0.20.1", + "darling_core 0.20.3", "quote", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] name = "dashmap" -version = "5.4.0" +version = "5.5.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc" +checksum = "6943ae99c34386c84a470c499d3414f66502a41340aa895406e0d2e4a207b91d" dependencies = [ "cfg-if", - "hashbrown 0.12.3", + "hashbrown 0.14.0", "lock_api", "once_cell", "parking_lot_core 0.9.8", @@ -2027,11 +2050,13 @@ dependencies = [ "cairo-lang-test-utils", "cairo-lang-utils", "camino", + "cargo_metadata", "convert_case 0.6.0", "dojo-test-utils", "dojo-types", "dojo-world", - "env_logger 0.10.0", + "env_logger", + "indoc 1.0.9", "itertools 0.10.5", "pretty_assertions", "salsa", @@ -2066,7 +2091,7 @@ dependencies = [ "salsa", "smol_str", "tokio", - "tower-lsp", + "tower-lsp 0.17.0", ] [[package]] @@ -2101,7 +2126,7 @@ dependencies = [ "starknet", "thiserror", "tokio", - "toml 0.7.5", + "toml", "tracing", "url", ] @@ -2157,15 +2182,15 @@ checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" [[package]] name = "dyn-clone" -version = "1.0.11" +version = "1.0.12" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30" +checksum = "304e6508efa593091e97a9abbc10f90aa7ca635b6d2784feff3c89d41dd12272" [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" dependencies = [ "serde", ] @@ -2194,19 +2219,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "env_logger" -version = "0.9.3" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" -dependencies = [ - "atty", - "humantime", - "log", - "regex", - "termcolor", -] - [[package]] name = "env_logger" version = "0.10.0" @@ -2222,9 +2234,9 @@ dependencies = [ [[package]] name = "equivalent" -version = "1.0.0" +version = "1.0.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "88bffebc5d80432c9b140ee17875ff173a8ab62faad5b257da912bd2f6c1c0a1" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" @@ -2311,15 +2323,6 @@ dependencies = [ "ascii_utils", ] -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - [[package]] name = "fastrand" version = "2.0.0" @@ -2399,7 +2402,7 @@ version = "0.6.6" source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "2eeb4ed9e12f43b7fa0baae3f9cdda28352770132ef2e09a23760c29cae8bd47" dependencies = [ - "rustix 0.38.2", + "rustix", "windows-sys 0.48.0", ] @@ -2476,7 +2479,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] @@ -2574,8 +2577,8 @@ dependencies = [ "gix-date", "gix-diff", "gix-discover", - "gix-features", - "gix-fs", + "gix-features 0.31.1", + "gix-fs 0.3.0", "gix-glob", "gix-hash", "gix-hashtable", @@ -2641,27 +2644,27 @@ dependencies = [ [[package]] name = "gix-bitmap" -version = "0.2.5" +version = "0.2.6" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "311e2fa997be6560c564b070c5da2d56d038b645a94e1e5796d5d85a350da33c" +checksum = "0aa8bbde7551a9e3e783a2871f53bbb0f50aac7a77db5680c8709f69e8ce724f" dependencies = [ "thiserror", ] [[package]] name = "gix-chunk" -version = "0.4.3" +version = "0.4.4" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "39db5ed0fc0a2e9b1b8265993f7efdbc30379dec268f3b91b7af0c2de4672fdd" +checksum = "5b42ea64420f7994000130328f3c7a2038f639120518870436d31b8bde704493" dependencies = [ "thiserror", ] [[package]] name = "gix-command" -version = "0.2.6" +version = "0.2.8" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "bb49ab557a37b0abb2415bca2b10e541277dff0565deb5bd5e99fd95f93f51eb" +checksum = "2783ad148fb16bf9cfd46423706ba552a62a4d4a18fda5dd07648eb0228862dd" dependencies = [ "bstr", ] @@ -2674,7 +2677,7 @@ checksum = "ed42baa50075d41c1a0931074ce1a97c5797c7c6fe7591d9f1f2dcd448532c26" dependencies = [ "bstr", "gix-chunk", - "gix-features", + "gix-features 0.31.1", "gix-hash", "memmap2 0.7.1", "thiserror", @@ -2688,7 +2691,7 @@ checksum = "33b32541232a2c626849df7843e05b50cb43ac38a4f675abbe2f661874fc1e9d" dependencies = [ "bstr", "gix-config-value", - "gix-features", + "gix-features 0.31.1", "gix-glob", "gix-path", "gix-ref", @@ -2704,9 +2707,9 @@ dependencies = [ [[package]] name = "gix-config-value" -version = "0.12.3" +version = "0.12.5" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "83960be5e99266bcf55dae5a24731bbd39f643bfb68f27e939d6b06836b5b87d" +checksum = "6e874f41437441c02991dcea76990b9058fadfc54b02ab4dd06ab2218af43897" dependencies = [ "bitflags 2.3.3", "bstr", @@ -2740,7 +2743,7 @@ dependencies = [ "bstr", "itoa", "thiserror", - "time 0.3.22", + "time 0.3.23", ] [[package]] @@ -2792,13 +2795,33 @@ dependencies = [ "walkdir", ] +[[package]] +name = "gix-features" +version = "0.32.1" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "882695cccf38da4c3cc7ee687bdb412cf25e37932d7f8f2c306112ea712449f1" +dependencies = [ + "gix-hash", + "gix-trace", + "libc", +] + [[package]] name = "gix-fs" version = "0.3.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "bb15956bc0256594c62a2399fcf6958a02a11724217eddfdc2b49b21b6292496" dependencies = [ - "gix-features", + "gix-features 0.31.1", +] + +[[package]] +name = "gix-fs" +version = "0.4.1" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "4d5b6e9d34a2c61ea4a02bbca94c409ab6dbbca1348cbb67298cd7fed8758761" +dependencies = [ + "gix-features 0.32.1", ] [[package]] @@ -2809,15 +2832,15 @@ checksum = "c18bdff83143d61e7d60da6183b87542a870d026b2a2d0b30170b8e9c0cd321a" dependencies = [ "bitflags 2.3.3", "bstr", - "gix-features", + "gix-features 0.31.1", "gix-path", ] [[package]] name = "gix-hash" -version = "0.11.3" +version = "0.11.4" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "a0dd58cdbe7ffa4032fc111864c80d5f8cecd9a2c9736c97ae7e5be834188272" +checksum = "4b422ff2ad9a0628baaad6da468cf05385bf3f5ab495ad5a33cce99b9f41092f" dependencies = [ "hex", "thiserror", @@ -2825,9 +2848,9 @@ dependencies = [ [[package]] name = "gix-hashtable" -version = "0.2.3" +version = "0.2.4" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "9e133bc56d938eaec1c675af7c681a51de9662b0ada779f45607b967a10da77a" +checksum = "385f4ce6ecf3692d313ca3aa9bd3b3d8490de53368d6d94bedff3af8b6d9c58d" dependencies = [ "gix-hash", "hashbrown 0.14.0", @@ -2857,7 +2880,7 @@ dependencies = [ "btoi", "filetime", "gix-bitmap", - "gix-features", + "gix-features 0.31.1", "gix-hash", "gix-lock", "gix-object", @@ -2870,9 +2893,9 @@ dependencies = [ [[package]] name = "gix-lock" -version = "7.0.1" +version = "7.0.2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "714bcb13627995ac33716e9c5e4d25612b19947845395f64d2a9cbe6007728e4" +checksum = "7e82ec23c8a281f91044bf3ed126063b91b59f9c9340bf0ae746f385cc85a6fa" dependencies = [ "gix-tempfile", "gix-utils", @@ -2917,7 +2940,7 @@ dependencies = [ "btoi", "gix-actor", "gix-date", - "gix-features", + "gix-features 0.31.1", "gix-hash", "gix-validate", "hex", @@ -2935,7 +2958,7 @@ checksum = "6b73469f145d1e6afbcfd0ab6499a366fbbcb958c2999d41d283d6c7b94024b9" dependencies = [ "arc-swap", "gix-date", - "gix-features", + "gix-features 0.31.1", "gix-hash", "gix-object", "gix-pack", @@ -2955,7 +2978,7 @@ dependencies = [ "clru", "gix-chunk", "gix-diff", - "gix-features", + "gix-features 0.31.1", "gix-hash", "gix-hashtable", "gix-object", @@ -2971,9 +2994,9 @@ dependencies = [ [[package]] name = "gix-path" -version = "0.8.3" +version = "0.8.4" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "dfca182d2575ded2ed38280f1ebf75cd5d3790b77e0872de07854cf085821fbe" +checksum = "18609c8cbec8508ea97c64938c33cd305b75dfc04a78d0c3b78b8b3fd618a77c" dependencies = [ "bstr", "gix-trace", @@ -2984,22 +3007,22 @@ dependencies = [ [[package]] name = "gix-prompt" -version = "0.5.2" +version = "0.5.4" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "8dfd363fd89a40c1e7bff9c9c1b136cd2002480f724b0c627c1bc771cd5480ec" +checksum = "2f755e8eb83ee9a06642a8fbd3009b033db2b5bd774f3aaf3de0b07f9b6ebdc5" dependencies = [ "gix-command", "gix-config-value", "parking_lot 0.12.1", - "rustix 0.37.22", + "rustix", "thiserror", ] [[package]] name = "gix-quote" -version = "0.4.5" +version = "0.4.6" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "3874de636c2526de26a3405b8024b23ef1a327bebf4845d770d00d48700b6a40" +checksum = "dfd80d3d0c733508df9449b1d3795da36083807e31d851d7d61d29af13bd4b0a" dependencies = [ "bstr", "btoi", @@ -3014,8 +3037,8 @@ checksum = "9b6c74873a9d8ff5d1310f2325f09164c15a91402ab5cde4d479ae12ff55ed69" dependencies = [ "gix-actor", "gix-date", - "gix-features", - "gix-fs", + "gix-features 0.31.1", + "gix-fs 0.3.0", "gix-hash", "gix-lock", "gix-object", @@ -3073,9 +3096,9 @@ dependencies = [ [[package]] name = "gix-sec" -version = "0.8.3" +version = "0.8.4" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "ede298863db2a0574a14070991710551e76d1f47c9783b62d4fcbca17f56371c" +checksum = "9615cbd6b456898aeb942cd75e5810c382fbfc48dbbff2fa23ebd2d33dcbe9c7" dependencies = [ "bitflags 2.3.3", "gix-path", @@ -3085,11 +3108,11 @@ dependencies = [ [[package]] name = "gix-tempfile" -version = "7.0.0" +version = "7.0.2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "4fac8310c17406ea619af72f42ee46dac795110f68f41b4f4fa231b69889c6a2" +checksum = "fa28d567848cec8fdd77d36ad4f5f78ecfaba7d78f647d4f63c8ae1a2cec7243" dependencies = [ - "gix-fs", + "gix-fs 0.4.1", "libc", "once_cell", "parking_lot 0.12.1", @@ -3100,9 +3123,9 @@ dependencies = [ [[package]] name = "gix-trace" -version = "0.1.2" +version = "0.1.3" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "103eac621617be3ebe0605c9065ca51a223279a23218aaf67d10daa6e452f663" +checksum = "96b6d623a1152c3facb79067d6e2ecdae48130030cf27d6eb21109f13bd7b836" [[package]] name = "gix-traverse" @@ -3127,7 +3150,7 @@ source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "beaede6dbc83f408b19adfd95bb52f1dbf01fb8862c3faf6c6243e2e67fcdfa1" dependencies = [ "bstr", - "gix-features", + "gix-features 0.31.1", "gix-path", "home", "thiserror", @@ -3136,18 +3159,18 @@ dependencies = [ [[package]] name = "gix-utils" -version = "0.1.4" +version = "0.1.5" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "7058c94f4164fcf5b8457d35f6d8f6e1007f9f7f938c9c7684a7e01d23c6ddde" +checksum = "b85d89dc728613e26e0ed952a19583744e7f5240fcd4aa30d6c824ffd8b52f0f" dependencies = [ - "fastrand 2.0.0", + "fastrand", ] [[package]] name = "gix-validate" -version = "0.7.6" +version = "0.7.7" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "8d092b594c8af00a3a31fe526d363ee8a51a6f29d8496cdb991ed2f01ec0ec13" +checksum = "ba9b3737b2cef3dcd014633485f0034b0f1a931ee54aeb7d8f87f177f3c89040" dependencies = [ "bstr", "thiserror", @@ -3162,8 +3185,8 @@ dependencies = [ "bstr", "filetime", "gix-attributes", - "gix-features", - "gix-fs", + "gix-features 0.31.1", + "gix-fs 0.3.0", "gix-glob", "gix-hash", "gix-ignore", @@ -3182,11 +3205,11 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "globset" -version = "0.4.10" +version = "0.4.11" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "029d74589adefde59de1a0c4f4732695c32805624aec7b68d91503d4dba79afc" +checksum = "1391ab1f92ffcc08911957149833e682aa3fe252b9f45f966d2ef972274c97df" dependencies = [ - "aho-corasick 0.7.20", + "aho-corasick", "bstr", "fnv", "log", @@ -3206,9 +3229,9 @@ dependencies = [ [[package]] name = "good_lp" -version = "1.4.0" +version = "1.4.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "eed4d07599e3cdb52477f1d36bef936c89ce854c452e7026b2ba327b93c86f61" +checksum = "c0833c2bc3cee9906df9969ade12b0b3b8759faa7bc2682b428be767033cdcd4" dependencies = [ "fnv", "minilp", @@ -3274,6 +3297,7 @@ checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" dependencies = [ "ahash 0.8.3", "allocator-api2", + "serde", ] [[package]] @@ -3292,7 +3316,7 @@ source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "7f19b9f54f7c7f55e31401bb647626ce0cf0f67b0004982ce815b3ee72a02aa8" dependencies = [ "byteorder", - "num-traits 0.2.15", + "num-traits 0.2.16", ] [[package]] @@ -3340,18 +3364,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.1.19" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.3.1" +version = "0.3.2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" [[package]] name = "hex" @@ -3401,9 +3416,9 @@ dependencies = [ [[package]] name = "http-range-header" -version = "0.3.0" +version = "0.3.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" +checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" [[package]] name = "httparse" @@ -3455,13 +3470,14 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.24.0" +version = "0.24.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "0646026eb1b3eea4cd9ba47912ea5ce9cc07713d105b1a14698f4e6433d348b7" +checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" dependencies = [ + "futures-util", "http", "hyper", - "rustls 0.21.2", + "rustls 0.21.5", "tokio", "tokio-rustls 0.24.1", ] @@ -3595,6 +3611,12 @@ dependencies = [ "quote", ] +[[package]] +name = "indent" +version = "0.1.1" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "d9f1a0777d972970f204fdf8ef319f1f4f8459131636d7e3c96c5d59570d0fa6" + [[package]] name = "indexmap" version = "1.9.3" @@ -3614,6 +3636,7 @@ checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" dependencies = [ "equivalent", "hashbrown 0.14.0", + "serde", ] [[package]] @@ -3631,9 +3654,15 @@ dependencies = [ [[package]] name = "indoc" -version = "2.0.1" +version = "1.0.9" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "bfa799dd5ed20a7e349f3b4639aa80d74549c81716d9ec4f994c9b5815598306" + +[[package]] +name = "indoc" +version = "2.0.3" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "9f2cb48b81b1dc9f39676bf99f5499babfec7cd8fe14307f7b3d747208fb5690" +checksum = "2c785eefb63ebd0e33416dfcb8d6da0bf27ce752843a45632a67bf10d4d4b5c4" [[package]] name = "inout" @@ -3663,17 +3692,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi 0.3.1", - "libc", - "windows-sys 0.48.0", -] - [[package]] name = "ipnet" version = "2.8.0" @@ -3692,12 +3710,12 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.8" +version = "0.4.9" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "24fddda5af7e54bf7da53067d6e802dbcc381d0a8eef629df528e3ebf68755cb" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi 0.3.1", - "rustix 0.38.2", + "hermit-abi", + "rustix", "windows-sys 0.48.0", ] @@ -3721,9 +3739,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.7" +version = "1.0.9" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "c0aa48fab2893d8a49caa94082ae8488f4e1050d73b367881dcd2198f4199fd8" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "jobserver" @@ -3847,7 +3865,7 @@ version = "0.1.0" dependencies = [ "assert_matches", "clap", - "env_logger 0.10.0", + "env_logger", "katana-core", "katana-rpc", "log", @@ -3867,7 +3885,7 @@ dependencies = [ "blockifier", "cairo-lang-casm", "cairo-lang-starknet", - "cairo-vm", + "cairo-vm 0.8.2", "convert_case 0.6.0", "flate2", "futures", @@ -3890,7 +3908,7 @@ dependencies = [ "assert_matches", "blockifier", "cairo-lang-starknet", - "cairo-vm", + "cairo-vm 0.6.2", "dojo-test-utils", "flate2", "hex", @@ -3930,9 +3948,9 @@ dependencies = [ [[package]] name = "lalrpop" -version = "0.19.12" +version = "0.20.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "0a1cbf952127589f2851ab2046af368fd20645491bb4b376f04b7f94d7a9837b" +checksum = "da4081d44f4611b66c6dd725e6de3169f9f63905421e8626fcb86b6a898998b8" dependencies = [ "ascii-canvas", "bit-set", @@ -3942,8 +3960,9 @@ dependencies = [ "itertools 0.10.5", "lalrpop-util", "petgraph", + "pico-args", "regex", - "regex-syntax 0.6.29", + "regex-syntax 0.7.4", "string_cache", "term", "tiny-keccak", @@ -3952,9 +3971,9 @@ dependencies = [ [[package]] name = "lalrpop-util" -version = "0.19.12" +version = "0.20.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "d3c48237b9604c5a4702de6b824e02006c3214327564636aef27c1028a8fa0ed" +checksum = "3f35c735096c0293d313e8f2a641627472b83d01b937177fe76e5e2708d31e0d" dependencies = [ "regex", ] @@ -4001,12 +4020,6 @@ version = "0.5.6" source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" -[[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - [[package]] name = "linux-raw-sys" version = "0.4.3" @@ -4060,13 +4073,26 @@ dependencies = [ "url", ] +[[package]] +name = "lsp-types" +version = "0.94.0" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "0b63735a13a1f9cd4f4835223d828ed9c2e35c8c5e61837774399f558b6a1237" +dependencies = [ + "bitflags 1.3.2", + "serde", + "serde_json", + "serde_repr", + "url", +] + [[package]] name = "matchers" version = "0.1.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ - "regex-automata", + "regex-automata 0.1.10", ] [[package]] @@ -4205,7 +4231,7 @@ dependencies = [ "matrixmultiply", "num-complex", "num-integer", - "num-traits 0.2.15", + "num-traits 0.2.16", "rawpointer", ] @@ -4261,7 +4287,7 @@ checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" dependencies = [ "autocfg", "num-integer", - "num-traits 0.2.15", + "num-traits 0.2.16", "rand", "serde", ] @@ -4273,7 +4299,7 @@ source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" dependencies = [ "autocfg", - "num-traits 0.2.15", + "num-traits 0.2.16", ] [[package]] @@ -4283,7 +4309,7 @@ source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" dependencies = [ "autocfg", - "num-traits 0.2.15", + "num-traits 0.2.16", ] [[package]] @@ -4294,7 +4320,7 @@ checksum = "64a5fe11d4135c3bcdf3a95b18b194afa9608a5f6ff034f5d857bc9a27fb0119" dependencies = [ "num-bigint", "num-integer", - "num-traits 0.2.15", + "num-traits 0.2.16", ] [[package]] @@ -4309,7 +4335,7 @@ dependencies = [ "num-bigint", "num-integer", "num-modular", - "num-traits 0.2.15", + "num-traits 0.2.16", "rand", ] @@ -4319,14 +4345,14 @@ version = "0.1.43" source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" dependencies = [ - "num-traits 0.2.15", + "num-traits 0.2.16", ] [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.16" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ "autocfg", ] @@ -4337,7 +4363,7 @@ version = "1.16.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.1", + "hermit-abi", "libc", ] @@ -4405,15 +4431,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "output_vt100" -version = "0.1.3" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "628223faebab4e3e40667ee0b2336d34a5b960ff60ea743ddfdbcf7770bcfb66" -dependencies = [ - "winapi", -] - [[package]] name = "overload" version = "0.1.1" @@ -4422,9 +4439,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "parity-scale-codec" -version = "3.6.3" +version = "3.6.4" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "756d439303e94fae44f288ba881ad29670c65b0c4b0e05674ca81061bb65f2c5" +checksum = "dd8e946cc0cc711189c0b0249fb8b599cbeeab9784d83c415719368bb8d4ac64" dependencies = [ "arrayvec", "bitvec", @@ -4436,9 +4453,9 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.3" +version = "3.6.4" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "9d884d78fcf214d70b1e239fcd1c6e5e95aa3be1881918da2e488cc946c7a476" +checksum = "2a296c3079b5fefbc499e1de58dc26c09b1b9a5952d26694ee89f04a43ebbb3e" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -4496,15 +4513,15 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.12" +version = "1.0.14" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "path-clean" -version = "0.1.0" +version = "1.0.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "ecba01bf2678719532c5e3059e0b5f0811273d94b397088b82e3bd0a78c78fdd" +checksum = "17359afc20d7ab31fdb42bb844c8b3bb1dabd7dcf7e68428492da7f16966fcef" [[package]] name = "path-dedot" @@ -4541,9 +4558,9 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" -version = "2.7.0" +version = "2.7.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "f73935e4d55e2abf7f130186537b19e7a4abc886a0252380b59248af473a3fc9" +checksum = "0d2d1d55045829d65aad9d389139882ad623b33b904e7c9f1b10c5b8927298e5" dependencies = [ "thiserror", "ucd-trie", @@ -4551,9 +4568,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.0" +version = "2.7.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "aef623c9bbfa0eedf5a0efba11a5ee83209c326653ca31ff019bec3a95bfff2b" +checksum = "5f94bca7e7a599d89dea5dfa309e217e7906c3c007fb9c3299c40b10d6a315d3" dependencies = [ "pest", "pest_generator", @@ -4561,22 +4578,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.0" +version = "2.7.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "b3e8cba4ec22bada7fc55ffe51e2deb6a0e0db2d0b7ab0b103acc80d2510c190" +checksum = "99d490fe7e8556575ff6911e45567ab95e71617f43781e5c05490dc8d75c965c" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] name = "pest_meta" -version = "2.7.0" +version = "2.7.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "a01f71cb40bd8bb94232df14b946909e14660e33fc05db3e50ae2a82d7ea0ca0" +checksum = "2674c66ebb4b4d9036012091b537aae5878970d6999f81a265034d85b136b341" dependencies = [ "once_cell", "pest", @@ -4623,7 +4640,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] @@ -4664,6 +4681,12 @@ dependencies = [ "thiserror", ] +[[package]] +name = "pico-args" +version = "0.5.0" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" + [[package]] name = "pin-project" version = "1.1.2" @@ -4681,7 +4704,7 @@ checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] @@ -4704,9 +4727,9 @@ checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "poem" -version = "1.3.56" +version = "1.3.57" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "0a56df40b79ebdccf7986b337f9b0e51ac55cd5e9d21fb20b6aa7c7d49741854" +checksum = "f0d92c532a37a9e98c0e9a0411e6852b8acccf9ec07d5e6e450b01cbf947d90b" dependencies = [ "async-trait", "base64 0.21.2", @@ -4735,21 +4758,21 @@ dependencies = [ [[package]] name = "poem-derive" -version = "1.3.56" +version = "1.3.57" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "1701f977a2d650a03df42c053686ea0efdb83554f34c7b026b89383c0a1b7846" +checksum = "f5dd58846a1f582215370384c3090c62c9ef188e9d798ffc67ea90d0a1a8a3b8" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.27", ] [[package]] name = "portable-atomic" -version = "1.3.3" +version = "1.4.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "767eb9f07d4a5ebcb39bbf2d452058a93c011373abf6832e24194a1c3f004794" +checksum = "edc55135a600d700580e406b4de0d59cb9ad25e344a3a091a97ded2622ec4ec6" [[package]] name = "ppv-lite86" @@ -4793,13 +4816,11 @@ dependencies = [ [[package]] name = "pretty_assertions" -version = "1.3.0" +version = "1.4.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "a25e9bcb20aa780fd0bb16b72403a9064d6b3f22f026946029acb941a50af755" +checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66" dependencies = [ - "ctor 0.1.26", "diff", - "output_vt100", "yansi", ] @@ -4852,18 +4873,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.63" +version = "1.0.66" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "prodash" -version = "25.0.0" +version = "25.0.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "3236ce1618b6da4c7b618e0143c4d5b5dc190f75f81c49f248221382f7e9e9ae" +checksum = "c236e70b7f9b9ea00d33c69f63ec1ae6e9ae96118923cd37bd4e9c7396f0b107" dependencies = [ "bytesize", "human_format", @@ -4880,9 +4901,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.29" +version = "1.0.32" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" +checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" dependencies = [ "proc-macro2", ] @@ -4982,13 +5003,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.8.4" +version = "1.9.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" +checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" dependencies = [ - "aho-corasick 1.0.2", + "aho-corasick", "memchr", - "regex-syntax 0.7.2", + "regex-automata 0.3.3", + "regex-syntax 0.7.4", ] [[package]] @@ -5000,6 +5022,17 @@ dependencies = [ "regex-syntax 0.6.29", ] +[[package]] +name = "regex-automata" +version = "0.3.3" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.7.4", +] + [[package]] name = "regex-cache" version = "0.2.1" @@ -5020,9 +5053,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.2" +version = "0.7.4" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" +checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" [[package]] name = "relative-path" @@ -5053,7 +5086,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.2", + "rustls 0.21.5", "rustls-pemfile", "serde", "serde_json", @@ -5142,28 +5175,14 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.22" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "8818fa822adcc98b18fedbb3632a6a33213c070556b5aa7c4c8cc21cff565c4c" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] - -[[package]] -name = "rustix" -version = "0.38.2" +version = "0.38.4" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "aabcb0461ebd01d6b79945797c27f8529082226cb630a9865a71870ff63532a4" +checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" dependencies = [ "bitflags 2.3.3", "errno", "libc", - "linux-raw-sys 0.4.3", + "linux-raw-sys", "windows-sys 0.48.0", ] @@ -5181,9 +5200,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.2" +version = "0.21.5" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "e32ca28af694bc1bbf399c33a516dbdf1c90090b8ab23c2bc24f834aa2247f5f" +checksum = "79ea77c539259495ce8ca47f53e66ae0330a8819f67e23ac96ca02f50e7b7d36" dependencies = [ "log", "ring", @@ -5202,9 +5221,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.100.1" +version = "0.101.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "d6207cd5ed3d8dca7816f8f3725513a34609c0c765bf652b8c3cb4cfd87db46b" +checksum = "15f36a6828982f422756984e47912a7a51dcbc2a197aa791158f8ca61cd8204e" dependencies = [ "ring", "untrusted", @@ -5212,15 +5231,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.12" +version = "1.0.14" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.15" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "salsa" @@ -5276,7 +5295,7 @@ source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "319ea14c96a755fbf9394ec4e59dd9608db49b3cc08f73fb41cc5af484b653bd" dependencies = [ "heck 0.3.3", - "num-traits 0.2.15", + "num-traits 0.2.16", "paste", "phonenumber", "sanitizer_macros", @@ -5295,8 +5314,8 @@ dependencies = [ [[package]] name = "scarb" -version = "0.5.1" -source = "git+/~https://github.com/software-mansion/scarb#798acce7f95f52746cc21e641de49537ececc66b" +version = "0.6.0-alpha.1" +source = "git+/~https://github.com/software-mansion/scarb?rev=c7b2e34#c7b2e34ff329e08e643907c3f699c4cfd66bbdab" dependencies = [ "anyhow", "async-trait", @@ -5325,19 +5344,19 @@ dependencies = [ "ignore", "include_dir", "indicatif", - "indoc", + "indoc 2.0.3", "itertools 0.11.0", "once_cell", "pathdiff", "petgraph", - "scarb-metadata 1.4.2 (git+/~https://github.com/software-mansion/scarb)", + "scarb-metadata 1.4.2 (git+/~https://github.com/software-mansion/scarb?rev=c7b2e34)", "semver", "serde", "serde_json", "smol_str", "thiserror", "tokio", - "toml 0.7.5", + "toml", "toml_edit", "tracing", "tracing-futures", @@ -5367,7 +5386,7 @@ dependencies = [ [[package]] name = "scarb-metadata" version = "1.4.2" -source = "git+/~https://github.com/software-mansion/scarb#798acce7f95f52746cc21e641de49537ececc66b" +source = "git+/~https://github.com/software-mansion/scarb?rev=c7b2e34#c7b2e34ff329e08e643907c3f699c4cfd66bbdab" dependencies = [ "camino", "clap", @@ -5405,9 +5424,9 @@ dependencies = [ [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "scrypt" @@ -5433,40 +5452,40 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.17" +version = "1.0.18" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.165" +version = "1.0.175" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "c939f902bb7d0ccc5bce4f03297e161543c2dcb30914faf032c2bd0b7a0d48fc" +checksum = "5d25439cd7397d044e2748a6fe2432b5e85db703d6d097bd014b3c0ad1ebff0b" dependencies = [ "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.9" +version = "0.11.12" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "416bda436f9aab92e02c8e10d49a15ddd339cea90b6e340fe51ed97abb548294" +checksum = "ab33ec92f677585af6d88c65593ae2375adde54efdbf16d597f2cbc7a6d368ff" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.165" +version = "1.0.175" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "6eaae920e25fffe4019b75ff65e7660e72091e59dd204cb5849bbd6a3fd343d7" +checksum = "b23f7ade6f110613c0d63858ddb8b94c1041f550eab58a16b371bdf2c9c80ab4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] @@ -5482,9 +5501,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.99" +version = "1.0.103" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "46266871c240a00b8f503b877622fe33430b3c7d963bdc0f2adc511e54a1eae3" +checksum = "d03b412469450d4404fe8499a268edd7f8b79fecb074b0d812ad64ca21f4031b" dependencies = [ "itoa", "ryu", @@ -5504,13 +5523,13 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.12" +version = "0.1.15" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "bcec881020c684085e55a25f7fd888954d56609ef363479dc5a1305eb0d40cab" +checksum = "e168eaaf71e8f9bd6037feb05190485708e019f4fd87d161b3c0a0d37daf85e5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] @@ -5547,7 +5566,7 @@ dependencies = [ "serde", "serde_json", "serde_with_macros", - "time 0.3.22", + "time 0.3.23", ] [[package]] @@ -5556,10 +5575,10 @@ version = "2.3.3" source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" dependencies = [ - "darling 0.20.1", + "darling 0.20.3", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] @@ -5624,9 +5643,9 @@ dependencies = [ [[package]] name = "signal-hook" -version = "0.3.15" +version = "0.3.17" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "732768f1176d21d09e076c23a93123d40bba92d50c4058da34d45c8de8e682b9" +checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" dependencies = [ "libc", "signal-hook-registry", @@ -5664,9 +5683,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" [[package]] name = "smol_str" @@ -5758,7 +5777,7 @@ dependencies = [ "starknet", "thiserror", "tokio", - "toml 0.7.5", + "toml", "tracing", "tracing-log", "url", @@ -5857,7 +5876,7 @@ dependencies = [ "thiserror", "tokio-stream", "url", - "uuid 1.4.0", + "uuid 1.4.1", "webpki-roots", ] @@ -5902,7 +5921,7 @@ checksum = "7c2a1d8fc6a9747641a5a5fa7e8ae401be8bb73c817f16f573dd9cd440173d09" dependencies = [ "starknet-accounts", "starknet-contract", - "starknet-core", + "starknet-core 0.4.0", "starknet-ff", "starknet-macros", "starknet-providers", @@ -5916,7 +5935,7 @@ source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "44adbf4180a34e2697744506e91a114b46edbbd5261b1eb1c713a435638b3e69" dependencies = [ "async-trait", - "starknet-core", + "starknet-core 0.4.0", "starknet-providers", "starknet-signers", "thiserror", @@ -5932,7 +5951,7 @@ dependencies = [ "serde_json", "serde_with", "starknet-accounts", - "starknet-core", + "starknet-core 0.4.0", "starknet-providers", "thiserror", ] @@ -5955,6 +5974,24 @@ dependencies = [ "starknet-ff", ] +[[package]] +name = "starknet-core" +version = "0.5.1" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "91f89c79b641618de8aa9668d74c6b6634659ceca311c6318a35c025f9d4d969" +dependencies = [ + "base64 0.21.2", + "flate2", + "hex", + "serde", + "serde_json", + "serde_json_pythonic", + "serde_with", + "sha3", + "starknet-crypto 0.6.0", + "starknet-ff", +] + [[package]] name = "starknet-crypto" version = "0.5.1" @@ -5966,7 +6003,7 @@ dependencies = [ "hmac", "num-bigint", "num-integer", - "num-traits 0.2.15", + "num-traits 0.2.16", "rfc6979", "sha2", "starknet-crypto-codegen", @@ -5986,7 +6023,7 @@ dependencies = [ "hmac", "num-bigint", "num-integer", - "num-traits 0.2.15", + "num-traits 0.2.16", "rfc6979", "sha2", "starknet-crypto-codegen", @@ -6003,7 +6040,7 @@ checksum = "af6527b845423542c8a16e060ea1bc43f67229848e7cd4c4d80be994a84220ce" dependencies = [ "starknet-curve 0.4.0", "starknet-ff", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] @@ -6041,19 +6078,19 @@ dependencies = [ [[package]] name = "starknet-macros" -version = "0.1.1" +version = "0.1.2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "ee54312bed7bada6ec5db9a11cac0d0342ecdba801731a163592432abda6365b" +checksum = "28a5865ee0ed22ade86bdf45e7c09c5641f1c59ccae12c21ecde535b2b6bf64a" dependencies = [ - "starknet-core", - "syn 2.0.23", + "starknet-core 0.5.1", + "syn 2.0.27", ] [[package]] name = "starknet-providers" -version = "0.4.0" +version = "0.4.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "759f577c787ec9ae75daa591ece0150f7e655fa9f73c58152ce267cd8e5db068" +checksum = "4554a49009d0a9414f6958edaaa337bc03a7ac5a8630c5162ab9cd5a417c6b1d" dependencies = [ "async-trait", "auto_impl 1.1.0", @@ -6063,7 +6100,7 @@ dependencies = [ "serde", "serde_json", "serde_with", - "starknet-core", + "starknet-core 0.4.0", "thiserror", "url", ] @@ -6079,15 +6116,15 @@ dependencies = [ "crypto-bigint", "eth-keystore", "rand", - "starknet-core", + "starknet-core 0.4.0", "starknet-crypto 0.6.0", "thiserror", ] [[package]] name = "starknet_api" -version = "0.1.0" -source = "git+/~https://github.com/starkware-libs/starknet-api?rev=a4c78ff#a4c78ff11e8b661eb8824e6d5adb2cbd36e77a2a" +version = "0.2.0" +source = "git+/~https://github.com/starkware-libs/starknet-api?rev=ecc9b6946ef13003da202838e4124a9ad2efabb0#ecc9b6946ef13003da202838e4124a9ad2efabb0" dependencies = [ "cairo-lang-starknet", "derive_more", @@ -6122,9 +6159,9 @@ dependencies = [ [[package]] name = "stringprep" -version = "0.1.2" +version = "0.1.3" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "8ee348cb74b87454fff4b551cbf727025810a004f88aeacae7f85b87f4e9a1c1" +checksum = "db3737bde7edce97102e0e2b15365bf7a20bfdb5f60f4f9e8d7004258a51a8da" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -6174,9 +6211,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.23" +version = "2.0.27" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "59fb7d6d8281a51045d62b8eb3a7d1ce347b76f312af50cd3dc0af39c87c1737" +checksum = "b60f673f44a8255b9c8c657daf66a596d435f2da81a555b06dc644d080ba45e0" dependencies = [ "proc-macro2", "quote", @@ -6191,15 +6228,14 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.6.0" +version = "3.7.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" +checksum = "5486094ee78b2e5038a6382ed7645bc084dc2ec433426ca4c3cb61e2007b8998" dependencies = [ - "autocfg", "cfg-if", - "fastrand 1.9.0", + "fastrand", "redox_syscall 0.3.5", - "rustix 0.37.22", + "rustix", "windows-sys 0.48.0", ] @@ -6242,22 +6278,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.44" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.44" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] @@ -6303,9 +6339,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.22" +version = "0.3.23" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "ea9e1b3cf1243ae005d9e74085d4d542f3125458f3a81af210d901dcd7411efd" +checksum = "59e399c068f43a5d116fedaf73b203fa4f9c519f17e2b34f63221d3792f81446" dependencies = [ "itoa", "libc", @@ -6323,9 +6359,9 @@ checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "time-macros" -version = "0.2.9" +version = "0.2.10" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b" +checksum = "96ba15a897f3c86766b757e5ac7221554c6750054d74d5b28844fce5fb36a6c4" dependencies = [ "time-core", ] @@ -6382,7 +6418,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] @@ -6402,7 +6438,7 @@ version = "0.24.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.2", + "rustls 0.21.5", "tokio", ] @@ -6419,9 +6455,9 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.18.0" +version = "0.19.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "54319c93411147bced34cb5609a80e0a8e44c5999c93903a81cd866630ec0bfd" +checksum = "ec509ac96e9a0c43427c74f003127d953a265737636129424288d27cb5c4b12c" dependencies = [ "futures-util", "log", @@ -6446,18 +6482,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.4.10" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "758664fc71a3a69038656bee8b6be6477d2a6c315a6b81f7081f591bffa4111f" -dependencies = [ - "serde", -] - -[[package]] -name = "toml" -version = "0.7.5" +version = "0.7.6" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "1ebafdf5ad1220cb59e7d17cf4d2c72015297b75b19a10472f99b89225089240" +checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542" dependencies = [ "serde", "serde_spanned", @@ -6476,9 +6503,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.11" +version = "0.19.14" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "266f016b7f039eec8a1a80dfe6156b633d208b9fccca5e4db1d6775b0c4e34a7" +checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" dependencies = [ "indexmap 2.0.0", "serde", @@ -6540,12 +6567,12 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.4.1" +version = "0.4.3" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "a8bd22a874a2d0b70452d5597b12c537331d49060824a95f49f108994f94aa4c" +checksum = "55ae70283aba8d2a8b411c695c437fe25b8b5e44e23e780662002fc72fb47a82" dependencies = [ "async-compression", - "base64 0.20.0", + "base64 0.21.2", "bitflags 2.3.3", "bytes", "futures-core", @@ -6565,7 +6592,7 @@ dependencies = [ "tower-layer", "tower-service", "tracing", - "uuid 1.4.0", + "uuid 1.4.1", ] [[package]] @@ -6587,14 +6614,37 @@ dependencies = [ "futures", "httparse", "log", - "lsp-types", + "lsp-types 0.93.2", "memchr", "serde", "serde_json", "tokio", "tokio-util", "tower", - "tower-lsp-macros", + "tower-lsp-macros 0.6.0", +] + +[[package]] +name = "tower-lsp" +version = "0.19.0" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "9b38fb0e6ce037835174256518aace3ca621c4f96383c56bb846cfc11b341910" +dependencies = [ + "async-trait", + "auto_impl 1.1.0", + "bytes", + "dashmap", + "futures", + "httparse", + "lsp-types 0.94.0", + "memchr", + "serde", + "serde_json", + "tokio", + "tokio-util", + "tower", + "tower-lsp-macros 0.8.0", + "tracing", ] [[package]] @@ -6608,6 +6658,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "tower-lsp-macros" +version = "0.8.0" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "34723c06344244474fdde365b76aebef8050bf6be61a935b91ee9ff7c4e91157" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "tower-service" version = "0.3.2" @@ -6635,7 +6696,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] @@ -6695,13 +6756,13 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "tungstenite" -version = "0.18.0" +version = "0.19.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "30ee6ab729cd4cf0fd55218530c4522ed30b7b6081752839b68fcec8d0960788" +checksum = "15fba1a6d6bb030745759a9a2a588bfe8490fc8b4751a277db3a0be1c9ebbf67" dependencies = [ - "base64 0.13.1", "byteorder", "bytes", + "data-encoding", "http", "httparse", "log", @@ -6731,9 +6792,9 @@ checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "ucd-trie" -version = "0.1.5" +version = "0.1.6" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" [[package]] name = "uint" @@ -6797,9 +6858,9 @@ checksum = "98e90c70c9f0d4d1ee6d0a7d04aa06cb9bbd53d8cfbdd62a0269a7c2eb640552" [[package]] name = "unicode-ident" -version = "1.0.9" +version = "1.0.11" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" [[package]] name = "unicode-normalization" @@ -6876,9 +6937,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.4.0" +version = "1.4.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "d023da39d1fde5a8a3fe1f3e01ca9632ada0a63e9797de55a879d6e2236277be" +checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" dependencies = [ "getrandom", ] @@ -6953,7 +7014,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", "wasm-bindgen-shared", ] @@ -6987,7 +7048,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -7212,9 +7273,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.4.7" +version = "0.5.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "ca0ace3845f0d96209f0375e6d367e3eb87eb65d27d445bdc9f1843a26f39448" +checksum = "25b5872fa2e10bd067ae946f927e726d7d603eaeb6e02fa6a350e0722d2b8c11" dependencies = [ "memchr", ] @@ -7239,18 +7300,18 @@ dependencies = [ [[package]] name = "xshell" -version = "0.2.3" +version = "0.2.5" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "962c039b3a7b16cf4e9a4248397c6585c07547412e7d6a6e035389a802dcfe90" +checksum = "ce2107fe03e558353b4c71ad7626d58ed82efaf56c54134228608893c77023ad" dependencies = [ "xshell-macros", ] [[package]] name = "xshell-macros" -version = "0.2.3" +version = "0.2.5" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "1dbabb1cbd15a1d6d12d9ed6b35cc6777d4af87ab3ba155ea37215f20beab80c" +checksum = "7e2c411759b501fb9501aac2b1b2d287a6e93e5bdcf13c25306b23e1b716dd0e" [[package]] name = "xxhash-rust" @@ -7281,7 +7342,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] @@ -7298,18 +7359,18 @@ dependencies = [ [[package]] name = "zstd" -version = "0.11.2+zstd.1.5.2" +version = "0.12.4" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "5.0.2+zstd.1.5.2" +version = "6.0.6" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" dependencies = [ "libc", "zstd-sys", diff --git a/Cargo.toml b/Cargo.toml index af50fb2e30..dedb09e350 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,31 +28,31 @@ version = "0.1.0" anyhow = "1.0.66" async-trait = "0.1.68" blockifier = { git = "/~https://github.com/starkware-libs/blockifier" } -cairo-lang-casm = "2.0.1" -cairo-lang-compiler = "2.0.1" -cairo-lang-debug = "2.0.1" -cairo-lang-defs = "2.0.1" -cairo-lang-diagnostics = "2.0.1" -cairo-lang-filesystem = "2.0.1" -cairo-lang-formatter = "2.0.1" -cairo-lang-language-server = "2.0.1" -cairo-lang-lowering = "2.0.1" -cairo-lang-parser = "2.0.1" -cairo-lang-plugins = "2.0.1" -cairo-lang-project = "2.0.1" -cairo-lang-semantic = { version = "2.0.1", features = [ "testing" ] } -cairo-lang-sierra = "2.0.1" -cairo-lang-sierra-generator = "2.0.1" -cairo-lang-sierra-to-casm = "2.0.1" -cairo-lang-starknet = "2.0.1" -cairo-lang-syntax = "2.0.1" -cairo-lang-test-runner = "2.0.1" -cairo-lang-test-utils = "2.0.1" -cairo-lang-utils = "2.0.1" +cairo-lang-casm = "2.1.0-rc1" +cairo-lang-compiler = "2.1.0-rc1" +cairo-lang-debug = "2.1.0-rc1" +cairo-lang-defs = "2.1.0-rc1" +cairo-lang-diagnostics = "2.1.0-rc1" +cairo-lang-filesystem = "2.1.0-rc1" +cairo-lang-formatter = "2.1.0-rc1" +cairo-lang-language-server = "2.1.0-rc1" +cairo-lang-lowering = "2.1.0-rc1" +cairo-lang-parser = "2.1.0-rc1" +cairo-lang-plugins = "2.1.0-rc1" +cairo-lang-project = "2.1.0-rc1" +cairo-lang-semantic = { version = "2.1.0-rc1", features = ["testing"] } +cairo-lang-sierra = "2.1.0-rc1" +cairo-lang-sierra-generator = "2.1.0-rc1" +cairo-lang-sierra-to-casm = "2.1.0-rc1" +cairo-lang-starknet = "2.1.0-rc1" +cairo-lang-syntax = "2.1.0-rc1" +cairo-lang-test-runner = "2.1.0-rc1" +cairo-lang-test-utils = "2.1.0-rc1" +cairo-lang-utils = "2.1.0-rc1" cairo-vm = "0.6.0" -camino = { version = "1.1.2", features = [ "serde1" ] } -chrono = { version = "0.4.24", features = [ "serde" ] } -clap = { version = "4.2", features = [ "derive" ] } +camino = { version = "1.1.2", features = ["serde1"] } +chrono = { version = "0.4.24", features = ["serde"] } +clap = { version = "4.2", features = ["derive"] } colored = "2" console = "0.15.7" convert_case = "0.6.0" @@ -65,26 +65,26 @@ num-bigint = "0.4" pretty_assertions = "1.2.1" rayon = "0.9.0" salsa = "0.16.1" -scarb = { git="/~https://github.com/software-mansion/scarb", version="0.5.1" } +scarb = { git = "/~https://github.com/software-mansion/scarb", rev = "c7b2e34" } semver = "1.0.5" -serde = { version = "1.0.156", features = [ "derive" ] } +serde = { version = "1.0.156", features = ["derive"] } serde_json = "1.0" serde_with = "2.3.1" -smol_str = { version = "0.2.0", features = [ "serde" ] } +smol_str = { version = "0.2.0", features = ["serde"] } starknet = "0.4.0" starknet-crypto = "0.5.1" -starknet_api = { git = "/~https://github.com/starkware-libs/starknet-api", rev = "a4c78ff" } +starknet_api = { git = "/~https://github.com/starkware-libs/starknet-api", rev = "ecc9b6946ef13003da202838e4124a9ad2efabb0" } test-log = "0.2.11" thiserror = "1.0.32" -tokio = { version = "1.16", features = [ "full" ] } +tokio = { version = "1.16", features = ["full"] } toml = "0.7.4" tracing = "0.1" tracing-subscriber = "0.3.16" yansi = "0.5.1" [patch."/~https://github.com/starkware-libs/blockifier"] -blockifier = { git = "/~https://github.com/dojoengine/blockifier", rev = "f5b684d" } +blockifier = { git = "/~https://github.com/dojoengine/blockifier", rev = "007a4aafad49acd751e408b4e37d963d72a26792" } [patch.crates-io] -cairo-felt = { git = "/~https://github.com/dojoengine/cairo-rs.git", rev = "b1a3683fe20bb668e4ab72cd9f99b8a0a33515a8" } -cairo-vm = { git = "/~https://github.com/dojoengine/cairo-rs.git", rev = "b1a3683fe20bb668e4ab72cd9f99b8a0a33515a8" } +cairo-felt = { git = "/~https://github.com/dojoengine/cairo-rs.git", rev = "69f30bcd1acf99631645bcc4efc434553e2f146e" } +cairo-vm = { git = "/~https://github.com/dojoengine/cairo-rs.git", rev = "69f30bcd1acf99631645bcc4efc434553e2f146e" } diff --git a/crates/dojo-core/Scarb.toml b/crates/dojo-core/Scarb.toml index 88f68b9315..b58fd57461 100644 --- a/crates/dojo-core/Scarb.toml +++ b/crates/dojo-core/Scarb.toml @@ -1,9 +1,9 @@ [package] name = "dojo" version = "0.1.0" -cairo-version = "2.0.0" +cairo-version = "2.1.0-rc1" description = "The Dojo Core library for autonomous worlds." [dependencies] dojo_plugin = { git = "/~https://github.com/dojoengine/dojo" } -starknet = "2.0.0" +starknet = "2.1.0-rc1" diff --git a/crates/dojo-core/src/interfaces.cairo b/crates/dojo-core/src/interfaces.cairo index 0b2c598063..d7bde12224 100644 --- a/crates/dojo-core/src/interfaces.cairo +++ b/crates/dojo-core/src/interfaces.cairo @@ -8,5 +8,4 @@ trait IComponent { #[starknet::interface] trait ISystem { fn name(self: @T) -> felt252; - fn dependencies(self: @T) -> Array<(felt252, bool)>; } diff --git a/crates/dojo-core/src/world.cairo b/crates/dojo-core/src/world.cairo index 3c3c0999da..a6e7730eea 100644 --- a/crates/dojo-core/src/world.cairo +++ b/crates/dojo-core/src/world.cairo @@ -1,4 +1,4 @@ -use starknet::{ContractAddress, ClassHash, StorageAccess, StorageBaseAddress, SyscallResult}; +use starknet::{ContractAddress, ClassHash, StorageBaseAddress, SyscallResult}; use traits::{Into, TryInto}; use option::OptionTrait; diff --git a/crates/dojo-lang/Cargo.toml b/crates/dojo-lang/Cargo.toml index 64ebc0f0bc..69516fea27 100644 --- a/crates/dojo-lang/Cargo.toml +++ b/crates/dojo-lang/Cargo.toml @@ -29,6 +29,7 @@ cairo-lang-utils.workspace = true convert_case.workspace = true dojo-types = { path = "../dojo-types" } dojo-world = { path = "../dojo-world" } +indoc.workspace = true itertools.workspace = true scarb.workspace = true semver.workspace = true @@ -51,3 +52,6 @@ env_logger = "0.10.0" pretty_assertions.workspace = true test-log.workspace = true dojo-test-utils = { path = "../dojo-test-utils" } + +[build-dependencies] +cargo_metadata = "0.15.4" \ No newline at end of file diff --git a/crates/dojo-lang/build.rs b/crates/dojo-lang/build.rs new file mode 100644 index 0000000000..40ceb0ed74 --- /dev/null +++ b/crates/dojo-lang/build.rs @@ -0,0 +1,89 @@ +use std::path::{Path, PathBuf}; +use std::process::Command; + +use cargo_metadata::MetadataCommand; + +fn main() { + commit_info(); + cairo_version(); +} + +fn commit_info() { + if !Path::new("../../.git").exists() { + return; + } + println!("cargo:rerun-if-changed=../../.git/index"); + let output = match Command::new("git") + .arg("log") + .arg("-1") + .arg("--date=short") + .arg("--format=%H %h %cd") + .arg("--abbrev=9") + .current_dir("..") + .output() + { + Ok(output) if output.status.success() => output, + _ => return, + }; + let stdout = String::from_utf8(output.stdout).unwrap(); + let mut parts = stdout.split_whitespace(); + let mut next = || parts.next().unwrap(); + println!("cargo:rustc-env=DOJO_COMMIT_HASH={}", next()); + println!("cargo:rustc-env=DOJO_COMMIT_SHORT_HASH={}", next()); + println!("cargo:rustc-env=DOJO_COMMIT_DATE={}", next()) +} + +fn cairo_version() { + let cargo_lock = find_cargo_lock(); + println!("cargo:rerun-if-changed={}", cargo_lock.display()); + + let metadata = MetadataCommand::new() + .manifest_path("./Cargo.toml") + .verbose(true) + .exec() + .expect("Failed to execute cargo metadata"); + + let resolve = metadata.resolve.expect("Expected metadata resolve to be present."); + + let root = resolve.root.expect("Expected metadata resolve root to be present."); + assert!(root.repr.starts_with("dojo"), "Expected metadata resolve root to be `dojo`."); + + let dojo_node = resolve.nodes.iter().find(|node| node.id == root).unwrap(); + let compiler_dep = dojo_node.deps.iter().find(|dep| dep.name == "cairo_lang_compiler").unwrap(); + let compiler_package = metadata.packages.iter().find(|pkg| pkg.id == compiler_dep.pkg).unwrap(); + + let version = compiler_package.version.to_string(); + println!("cargo:rustc-env=DOJO_CAIRO_VERSION={version}"); + + let mut rev = format!("refs/tags/v{version}"); + if let Some(source) = &compiler_package.source { + let source = source.to_string(); + if source.starts_with("git+") { + if let Some((_, commit)) = source.split_once('#') { + println!("cargo:rustc-env=DOJO_CAIRO_COMMIT_HASH={commit}"); + let mut short_commit = commit.to_string(); + short_commit.truncate(9); + println!("cargo:rustc-env=DOJO_CAIRO_SHORT_COMMIT_HASH={short_commit}"); + rev = commit.to_string(); + } + } + } + println!("cargo:rustc-env=DOJO_CAIRO_COMMIT_REV={rev}"); +} + +fn find_cargo_lock() -> PathBuf { + let in_workspace = PathBuf::from("../../Cargo.lock"); + if in_workspace.exists() { + return in_workspace; + } + + let in_package = PathBuf::from("Cargo.lock"); + if in_package.exists() { + return in_package; + } + + panic!( + "Couldn't find Cargo.lock of this package. Something's wrong with build execution \ + environment." + ) +} diff --git a/crates/dojo-lang/src/commands/set.rs b/crates/dojo-lang/src/commands/set.rs deleted file mode 100644 index 01c010fdc1..0000000000 --- a/crates/dojo-lang/src/commands/set.rs +++ /dev/null @@ -1,103 +0,0 @@ -use cairo_lang_defs::plugin::PluginDiagnostic; -use cairo_lang_semantic::patcher::RewriteNode; -use cairo_lang_syntax::node::db::SyntaxGroup; -use cairo_lang_syntax::node::{ast, Terminal, TypedSyntaxNode}; -use cairo_lang_utils::unordered_hash_map::UnorderedHashMap; -use dojo_types::system::Dependency; - -use super::{Command, CommandData, CommandMacroTrait}; - -#[derive(Clone)] -pub struct SetCommand { - data: CommandData, - component_deps: Vec, -} - -impl SetCommand { - fn handle_struct( - &mut self, - db: &dyn SyntaxGroup, - world: &ast::Arg, - query: ast::Arg, - expr: ast::Expr, - ) { - if let ast::Expr::StructCtorCall(ctor) = expr { - if let Some(ast::PathSegment::Simple(segment)) = ctor.path(db).elements(db).last() { - let component_name = segment.ident(db).text(db); - - self.component_deps.push(Dependency { - name: component_name.to_string(), - write: true, - read: false, - }); - self.data.rewrite_nodes.push(RewriteNode::interpolate_patched( - " - { - let mut calldata = array::ArrayTrait::new(); - serde::Serde::serialize(@$ctor$, ref calldata); - $world$.set_entity('$component$', $query$, 0_u8, \ - array::ArrayTrait::span(@calldata)); - } - ", - UnorderedHashMap::from([ - ("world".to_string(), RewriteNode::new_trimmed(world.as_syntax_node())), - ("component".to_string(), RewriteNode::Text(component_name.to_string())), - ("ctor".to_string(), RewriteNode::new_trimmed(ctor.as_syntax_node())), - ("query".to_string(), RewriteNode::new_trimmed(query.as_syntax_node())), - ]), - )); - } - } - } -} - -impl CommandMacroTrait for SetCommand { - fn from_ast( - db: &dyn SyntaxGroup, - _let_pattern: Option, - command_ast: ast::ExprInlineMacro, - ) -> Self { - let mut command = SetCommand { data: CommandData::new(), component_deps: vec![] }; - - let elements = command_ast.arguments(db).args(db).elements(db); - - if elements.len() != 3 { - command.data.diagnostics.push(PluginDiagnostic { - message: "Invalid arguments. Expected \"(world, query, (components,))\"" - .to_string(), - stable_ptr: command_ast.arguments(db).as_syntax_node().stable_ptr(), - }); - return command; - } - - let world = &elements[0]; - let query = elements[1].clone(); - let bundle = &elements[2]; - if let ast::ArgClause::Unnamed(clause) = bundle.arg_clause(db) { - match clause.value(db) { - ast::Expr::Parenthesized(bundle) => { - command.handle_struct(db, world, query, bundle.expr(db)); - } - ast::Expr::Tuple(tuple) => { - for expr in tuple.expressions(db).elements(db) { - command.handle_struct(db, world, query.clone(), expr); - } - } - _ => { - command.data.diagnostics.push(PluginDiagnostic { - message: "Invalid storage key. Expected \"(...)\"".to_string(), - stable_ptr: clause.as_syntax_node().stable_ptr(), - }); - } - } - } - - command - } -} - -impl From for Command { - fn from(val: SetCommand) -> Self { - Command::with_cmp_deps(val.data, val.component_deps) - } -} diff --git a/crates/dojo-lang/src/inline_macro_plugin.rs b/crates/dojo-lang/src/inline_macro_plugin.rs new file mode 100644 index 0000000000..69bf5b05a9 --- /dev/null +++ b/crates/dojo-lang/src/inline_macro_plugin.rs @@ -0,0 +1,146 @@ +use std::sync::Arc; + +use cairo_lang_defs::plugin::{ + DynGeneratedFileAuxData, MacroPlugin, PluginDiagnostic, PluginGeneratedFile, PluginResult, +}; +use cairo_lang_semantic::plugin::{AsDynMacroPlugin, SemanticPlugin, TrivialPluginAuxData}; +use cairo_lang_syntax::node::ast::{self}; +use cairo_lang_syntax::node::db::SyntaxGroup; +use cairo_lang_syntax::node::kind::SyntaxKind; +use cairo_lang_syntax::node::{SyntaxNode, TypedSyntaxNode}; + +// use super::inline_macros::array::ArrayMacro; +// use super::inline_macros::consteval_int::ConstevalIntMacro; + +/// The result of expanding an inline macro. +#[derive(Debug, Default)] +pub struct InlineMacroExpanderData { + pub result_code: String, + pub code_changed: bool, + pub diagnostics: Vec, +} + +/// A trait for inline macros. +pub trait InlineMacro { + /// A function that appends the expanded code of the macro to the result code. + fn append_macro_code( + &self, + macro_expander_data: &mut InlineMacroExpanderData, + db: &dyn SyntaxGroup, + macro_arguments: &ast::ExprList, + ); + /// A function that returns true if the macro supports the given bracket type. + fn is_bracket_type_allowed( + &self, + db: &dyn SyntaxGroup, + macro_ast: &ast::ExprInlineMacro, + ) -> bool; +} + +/// Returns the inline macro plugin for the given macro name, or None if no such plugin exists. +fn get_inline_macro_plugin(macro_name: &str) -> Option> { + match macro_name { + // "array" => Some(Box::new(ArrayMacro)), + // "consteval_int" => Some(Box::new(ConstevalIntMacro)), + _ => None, + } +} + +#[derive(Debug, Default)] +pub struct InlineMacroPlugin; +impl MacroPlugin for InlineMacroPlugin { + fn generate_code(&self, db: &dyn SyntaxGroup, item_ast: ast::Item) -> PluginResult { + let mut expander_data = InlineMacroExpanderData::default(); + expander_data.expand_node(db, &item_ast.as_syntax_node()); + if expander_data.code_changed { + PluginResult { + code: Some(PluginGeneratedFile { + name: "inline_macros".into(), + content: expander_data.result_code.clone(), + aux_data: DynGeneratedFileAuxData(Arc::new(TrivialPluginAuxData {})), + }), + diagnostics: expander_data.diagnostics, + remove_original_item: true, + } + } else { + PluginResult { + code: None, + diagnostics: expander_data.diagnostics, + remove_original_item: false, + } + } + } +} + +impl AsDynMacroPlugin for InlineMacroPlugin { + fn as_dyn_macro_plugin<'a>(self: Arc) -> Arc + where + Self: 'a, + { + self + } +} +impl SemanticPlugin for InlineMacroPlugin {} + +impl InlineMacroExpanderData { + /// Traverse the syntax tree, accumolates any non-macro code and expand all inline macros. + fn expand_node(&mut self, db: &dyn SyntaxGroup, syntax_node: &SyntaxNode) { + let node_kind = syntax_node.kind(db); + if let SyntaxKind::ExprInlineMacro = node_kind { + let inline_macro = ast::ExprInlineMacro::from_syntax_node(db, syntax_node.clone()); + self.handle_macro(db, &inline_macro); + } else { + if let Some(text) = syntax_node.text(db) { + self.result_code.push_str(&text); + } + for child in syntax_node.children(db) { + self.expand_node(db, &child); + } + } + } + + /// Expand a single inline macro. + fn handle_macro(&mut self, db: &dyn SyntaxGroup, inline_macro: &ast::ExprInlineMacro) { + let macro_name = inline_macro.path(db).as_syntax_node().get_text(db).trim().to_string(); + let macro_plugin = get_inline_macro_plugin(¯o_name); + if let Some(macro_plugin) = macro_plugin { + if let Some(macro_arguments) = + self.extract_macro_args(db, macro_plugin.as_ref(), inline_macro) + { + macro_plugin.append_macro_code(self, db, ¯o_arguments); + } + } else { + self.result_code.push_str(&inline_macro.as_syntax_node().get_text(db)); + self.diagnostics.push(PluginDiagnostic { + stable_ptr: inline_macro.stable_ptr().untyped(), + message: format!("Unknown inline macro: {}", macro_name), + }); + } + } + + /// Extract the macro arguments from the inline macro if the macro supports the given bracket + /// type. Otherwise, add a diagnostic. + fn extract_macro_args( + &mut self, + db: &dyn SyntaxGroup, + macro_plugin: &dyn InlineMacro, + macro_ast: &ast::ExprInlineMacro, + ) -> Option { + if macro_plugin.is_bracket_type_allowed(db, macro_ast) { + Some(match macro_ast.arguments(db) { + ast::WrappedExprList::BracketedExprList(expr_list) => expr_list.expressions(db), + ast::WrappedExprList::ParenthesizedExprList(expr_list) => expr_list.expressions(db), + ast::WrappedExprList::BracedExprList(expr_list) => expr_list.expressions(db), + }) + } else { + self.diagnostics.push(PluginDiagnostic { + stable_ptr: macro_ast.stable_ptr().untyped(), + message: format!( + "Macro {} does not support this bracket type", + macro_ast.path(db).as_syntax_node().get_text(db) + ), + }); + None + } + } +} diff --git a/crates/dojo-lang/src/commands/execute.rs b/crates/dojo-lang/src/inline_macros/execute.rs similarity index 72% rename from crates/dojo-lang/src/commands/execute.rs rename to crates/dojo-lang/src/inline_macros/execute.rs index bb7945cd7b..85c4983699 100644 --- a/crates/dojo-lang/src/commands/execute.rs +++ b/crates/dojo-lang/src/inline_macros/execute.rs @@ -18,20 +18,33 @@ impl CommandMacroTrait for ExecuteCommand { ) -> Self { let mut command = ExecuteCommand { data: CommandData::new() }; - let elements = macro_ast.arguments(db).args(db).elements(db); + let wrapped_args = macro_ast.arguments(db); + let exprs = match wrapped_args { + ast::WrappedExprList::ParenthesizedExprList(args_list) => { + args_list.expressions(db).elements(db) + } + _ => { + command.data.diagnostics.push(PluginDiagnostic { + message: "Invalid macro. Expected \"execute!(world, system, query, calldata)\"" + .to_string(), + stable_ptr: macro_ast.arguments(db).as_syntax_node().stable_ptr(), + }); + return command; + } + }; - if elements.len() != 4 { + if exprs.len() != 4 { command.data.diagnostics.push(PluginDiagnostic { - message: "Invalid arguments. Expected \"(world, system, query, calldata)\"" + message: "Invalid arguments. Expected \"execute!(world, system, query, calldata)\"" .to_string(), stable_ptr: macro_ast.arguments(db).as_syntax_node().stable_ptr(), }); return command; } - let world = &elements[0]; - let system = &elements[1]; - let calldata = &elements[3]; + let world = &exprs[0]; + let system = &exprs[1]; + let calldata = &exprs[3]; if let Some(var_name) = let_pattern { command.data.rewrite_nodes.push(RewriteNode::interpolate_patched( diff --git a/crates/dojo-lang/src/commands/find.rs b/crates/dojo-lang/src/inline_macros/find.rs similarity index 88% rename from crates/dojo-lang/src/commands/find.rs rename to crates/dojo-lang/src/inline_macros/find.rs index f70190cd41..daff4a7083 100644 --- a/crates/dojo-lang/src/commands/find.rs +++ b/crates/dojo-lang/src/inline_macros/find.rs @@ -7,7 +7,6 @@ use dojo_types::system::Dependency; use sanitizer::StringSanitizer; use smol_str::SmolStr; -use super::helpers::ast_arg_to_expr; use super::{Command, CommandData, CommandMacroTrait, CAIRO_ERR_MSG_LEN}; pub struct FindCommand { @@ -31,9 +30,22 @@ impl CommandMacroTrait for FindCommand { component_deps: vec![], }; - let elements = macro_ast.arguments(db).args(db).elements(db); + let wrapped_args = macro_ast.arguments(db); + let exprs = match wrapped_args { + ast::WrappedExprList::ParenthesizedExprList(args_list) => { + args_list.expressions(db).elements(db) + } + _ => { + command.data.diagnostics.push(PluginDiagnostic { + message: "Invalid macro. Expected \"find!(world, query, (components,))\"" + .to_string(), + stable_ptr: macro_ast.arguments(db).as_syntax_node().stable_ptr(), + }); + return command; + } + }; - if elements.len() != 3 { + if exprs.len() != 3 { command.data.diagnostics.push(PluginDiagnostic { message: "Invalid arguments. Expected \"(world, query, (components,))\"" .to_string(), @@ -42,9 +54,9 @@ impl CommandMacroTrait for FindCommand { return command; } - let world = &elements[0]; - let partition = &elements[1]; - let types = &elements[2]; + let world = &exprs[0]; + let partition = &exprs[1]; + let types = &exprs[2]; command.data.rewrite_nodes.push(RewriteNode::interpolate_patched( " @@ -58,7 +70,7 @@ impl CommandMacroTrait for FindCommand { )]), )); - let components = find_components(db, ast_arg_to_expr(db, types).unwrap()); + let components = find_components(db, types); command.data.rewrite_nodes.extend( components @@ -184,16 +196,16 @@ impl From for Command { } } -pub fn find_components(db: &dyn SyntaxGroup, expression: ast::Expr) -> Vec { +pub fn find_components(db: &dyn SyntaxGroup, expression: &ast::Expr) -> Vec { let mut components = vec![]; match expression { ast::Expr::Tuple(tuple) => { for element in tuple.expressions(db).elements(db) { - components.extend(find_components(db, element)); + components.extend(find_components(db, &element)); } } ast::Expr::Parenthesized(parenthesized) => { - components.extend(find_components(db, parenthesized.expr(db))); + components.extend(find_components(db, &parenthesized.expr(db))); } ast::Expr::Path(path) => match path.elements(db).last().unwrap() { ast::PathSegment::WithGenericArgs(segment) => { @@ -201,7 +213,7 @@ pub fn find_components(db: &dyn SyntaxGroup, expression: ast::Expr) -> Vec { + args_list.expressions(db).elements(db) + } + _ => { + command.data.diagnostics.push(PluginDiagnostic { + message: "Invalid macro. Expected \"get!(world, query, (components,))\"" + .to_string(), + stable_ptr: macro_ast.arguments(db).as_syntax_node().stable_ptr(), + }); + return command; + } + }; - if elements.len() != 3 { + if exprs.len() != 3 { command.data.diagnostics.push(PluginDiagnostic { - message: "Invalid arguments. Expected \"(world, query, (components,))\"" + message: "Invalid arguments. Expected \"get!(world, query, (components,))\"" .to_string(), stable_ptr: macro_ast.arguments(db).as_syntax_node().stable_ptr(), }); return command; } - let world = &elements[0]; - let query = &elements[1]; - let types = &elements[2]; + let world = &exprs[0]; + let query = &exprs[1]; + let types = &exprs[2]; - let components = find_components(db, ast_arg_to_expr(db, types).unwrap()); + let components = find_components(db, types); if components.is_empty() { command.data.diagnostics.push(PluginDiagnostic { @@ -98,8 +111,8 @@ impl GetCommand { fn handle_get( &mut self, components: Vec, - world: &Arg, - query: &Arg, + world: &Expr, + query: &Expr, part_names: Vec, ) { for component in components.iter() { @@ -151,8 +164,8 @@ impl GetCommand { fn handle_try_get( &mut self, components: Vec, - world: &Arg, - query: &Arg, + world: &Expr, + query: &Expr, part_names: Vec, ) { for component in components.iter() { diff --git a/crates/dojo-lang/src/commands/helpers.rs b/crates/dojo-lang/src/inline_macros/helpers.rs similarity index 70% rename from crates/dojo-lang/src/commands/helpers.rs rename to crates/dojo-lang/src/inline_macros/helpers.rs index e65451d5d0..e34dd91c74 100644 --- a/crates/dojo-lang/src/commands/helpers.rs +++ b/crates/dojo-lang/src/inline_macros/helpers.rs @@ -11,10 +11,3 @@ pub fn macro_name(db: &dyn SyntaxGroup, macro_ast: ast::ExprInlineMacro) -> Smol _ => panic!("Macro's name must be a simple identifier!"), } } - -pub fn ast_arg_to_expr(db: &dyn SyntaxGroup, arg: &ast::Arg) -> Option { - match arg.arg_clause(db) { - ast::ArgClause::Unnamed(clause) => Some(clause.value(db)), - _ => None, - } -} diff --git a/crates/dojo-lang/src/commands/mod.rs b/crates/dojo-lang/src/inline_macros/mod.rs similarity index 100% rename from crates/dojo-lang/src/commands/mod.rs rename to crates/dojo-lang/src/inline_macros/mod.rs diff --git a/crates/dojo-lang/src/inline_macros/set.rs b/crates/dojo-lang/src/inline_macros/set.rs new file mode 100644 index 0000000000..05ca2a0bec --- /dev/null +++ b/crates/dojo-lang/src/inline_macros/set.rs @@ -0,0 +1,153 @@ +use cairo_lang_defs::plugin::PluginDiagnostic; +use cairo_lang_semantic::patcher::RewriteNode; +use cairo_lang_syntax::node::db::SyntaxGroup; +use cairo_lang_syntax::node::{ast, Terminal, TypedSyntaxNode}; +use cairo_lang_utils::unordered_hash_map::UnorderedHashMap; +use dojo_types::system::Dependency; + +use super::{Command, CommandData, CommandMacroTrait}; + +#[derive(Clone)] +pub struct SetCommand { + data: CommandData, + component_deps: Vec, +} + +impl SetCommand { + fn handle_struct( + &mut self, + db: &dyn SyntaxGroup, + world: &ast::Expr, + query: &ast::Expr, + expr: &ast::Expr, + ) { + if let ast::Expr::StructCtorCall(ctor) = expr { + if let Some(ast::PathSegment::Simple(segment)) = ctor.path(db).elements(db).last() { + let component_name = segment.ident(db).text(db); + + self.component_deps.push(Dependency { + name: component_name.to_string(), + write: true, + read: false, + }); + self.data.rewrite_nodes.push(RewriteNode::interpolate_patched( + " + { + let mut calldata = array::ArrayTrait::new(); + serde::Serde::serialize(@$ctor$, ref calldata); + $world$.set_entity('$component$', $query$, 0_u8, \ + array::ArrayTrait::span(@calldata)); + } + ", + UnorderedHashMap::from([ + ("world".to_string(), RewriteNode::new_trimmed(world.as_syntax_node())), + ("component".to_string(), RewriteNode::Text(component_name.to_string())), + ("ctor".to_string(), RewriteNode::new_trimmed(ctor.as_syntax_node())), + ("query".to_string(), RewriteNode::new_trimmed(query.as_syntax_node())), + ]), + )); + } + } + } +} + +impl CommandMacroTrait for SetCommand { + fn from_ast( + db: &dyn SyntaxGroup, + _let_pattern: Option, + macro_ast: ast::ExprInlineMacro, + ) -> Self { + let mut command = SetCommand { data: CommandData::new(), component_deps: vec![] }; + + let wrapped_args = macro_ast.arguments(db); + let exprs = match wrapped_args { + ast::WrappedExprList::ParenthesizedExprList(args_list) => { + args_list.expressions(db).elements(db) + } + _ => { + command.data.diagnostics.push(PluginDiagnostic { + message: "Invalid macro. Expected \"set!(world, query, (components,))\"" + .to_string(), + stable_ptr: macro_ast.arguments(db).as_syntax_node().stable_ptr(), + }); + return command; + } + }; + + if exprs.len() != 3 { + command.data.diagnostics.push(PluginDiagnostic { + message: "Invalid arguments. Expected \"(world, query, (components,))\"" + .to_string(), + stable_ptr: macro_ast.arguments(db).as_syntax_node().stable_ptr(), + }); + return command; + } + + let world = &exprs[0]; + let query = &exprs[1].clone(); + let bundle = &exprs[2]; + command.handle_struct(db, world, query, bundle); + + command + } +} + +impl From for Command { + fn from(val: SetCommand) -> Self { + Command::with_cmp_deps(val.data, val.component_deps) + } +} + +use crate::inline_macro_plugin::{InlineMacro, InlineMacroExpanderData}; + +pub struct SetMacro; +impl InlineMacro for SetMacro { + fn append_macro_code( + &self, + macro_expander_data: &mut InlineMacroExpanderData, + db: &dyn cairo_lang_syntax::node::db::SyntaxGroup, + macro_arguments: &cairo_lang_syntax::node::ast::ExprList, + ) { + let args = macro_arguments.elements(db); + + if args.len() != 3 { + macro_expander_data.diagnostics.push(PluginDiagnostic { + message: "Invalid arguments. Expected \"(world, query, (components,))\"" + .to_string(), + stable_ptr: macro_arguments.as_syntax_node().stable_ptr(), + }); + return; + } + + let world = &args[0]; + let query = &args[1].clone(); + let bundle = &args[2]; + + let mut expanded_code = "{ + let mut __array_builder_macro_result__ = ArrayTrait::new();" + .to_string(); + for arg in args { + expanded_code.push_str(&format!( + "\n array::ArrayTrait::append(ref __array_builder_macro_result__, {});", + arg.as_syntax_node().get_text(db) + )); + } + expanded_code.push_str( + "\n __array_builder_macro_result__ + }", + ); + macro_expander_data.result_code.push_str(&expanded_code); + macro_expander_data.code_changed = true; + } + + fn is_bracket_type_allowed( + &self, + db: &dyn cairo_lang_syntax::node::db::SyntaxGroup, + macro_ast: &cairo_lang_syntax::node::ast::ExprInlineMacro, + ) -> bool { + matches!( + macro_ast.arguments(db), + cairo_lang_syntax::node::ast::WrappedExprList::ParenthesizedExprList(_) + ) + } +} diff --git a/crates/dojo-lang/src/lib.rs b/crates/dojo-lang/src/lib.rs index 686922a7b9..34fede342d 100644 --- a/crates/dojo-lang/src/lib.rs +++ b/crates/dojo-lang/src/lib.rs @@ -3,11 +3,13 @@ //! Dojo is a full stack toolchain for developing onchain games in Cairo. //! //! Learn more at [dojoengine.gg](http://dojoengine.gg). -mod commands; pub mod compiler; pub mod component; pub mod db; +mod inline_macros; +mod inline_macro_plugin; mod manifest; pub mod plugin; mod serde; pub mod system; +pub(crate) mod version; diff --git a/crates/dojo-lang/src/plugin.rs b/crates/dojo-lang/src/plugin.rs index cd8c160e85..41b03c0e65 100644 --- a/crates/dojo-lang/src/plugin.rs +++ b/crates/dojo-lang/src/plugin.rs @@ -61,11 +61,7 @@ impl GeneratedFileAuxData for DojoAuxData { self } fn eq(&self, other: &dyn GeneratedFileAuxData) -> bool { - if let Some(other) = other.as_any().downcast_ref::() { - self == other - } else { - false - } + if let Some(other) = other.as_any().downcast_ref::() { self == other } else { false } } } impl AsDynGeneratedFileAuxData for DojoAuxData { diff --git a/crates/dojo-lang/src/plugin_test.rs b/crates/dojo-lang/src/plugin_test.rs index 9776b0f558..df374ebc82 100644 --- a/crates/dojo-lang/src/plugin_test.rs +++ b/crates/dojo-lang/src/plugin_test.rs @@ -42,9 +42,7 @@ struct ExpandContractTestRunner { impl Default for ExpandContractTestRunner { fn default() -> Self { let parser_db = SimpleParserDatabase::default(); - let config = build_test_config("src/manifest_test_crate/Scarb.toml").unwrap(); - let ws = ops::read_workspace(config.manifest_path(), &config).unwrap(); - Self { db: build_test_db(&ws).unwrap(), parser_db } + Self { db: build_test_db("src/manifest_test_crate/Scarb.toml").unwrap(), parser_db } } } @@ -56,13 +54,6 @@ impl TestFileRunner for ExpandContractTestRunner { let file_id = self.db.module_main_file(test_module.module_id).unwrap(); let syntax_file = self.db.file_syntax(file_id).unwrap(); - let mut current_path = current_dir().unwrap(); - current_path.push("../dojo-core/src"); - - let crate_id = self.db.intern_crate(CrateLongId("dojo".into())); - let root = Directory(current_path); - self.db.set_crate_root(crate_id, Some(root)); - let plugin = DojoPlugin {}; let mut generated_items: Vec = Vec::new(); diff --git a/crates/dojo-lang/src/plugin_test_data/system b/crates/dojo-lang/src/plugin_test_data/system index 26945a984c..4c2e434409 100644 --- a/crates/dojo-lang/src/plugin_test_data/system +++ b/crates/dojo-lang/src/plugin_test_data/system @@ -296,15 +296,6 @@ mod spawn { 'spawn' } - #[external(v0)] - fn dependencies(self: @ContractState) -> Array<(felt252, bool)> { - let mut arr = array::ArrayTrait::new(); - array::ArrayTrait::append(ref arr, ('Player'.into(), true)); - array::ArrayTrait::append(ref arr, ('Position'.into(), true)); - - arr - } - use traits::Into; use dojo::world::Context; use super::Position; @@ -436,15 +427,6 @@ mod move { 'move' } - #[external(v0)] - fn dependencies(self: @ContractState) -> Array<(felt252, bool)> { - let mut arr = array::ArrayTrait::new(); - array::ArrayTrait::append(ref arr, ('Player'.into(), false)); - array::ArrayTrait::append(ref arr, ('Position'.into(), false)); - - arr - } - use traits::Into; use array::ArrayTrait; use dojo::world::Context; @@ -977,13 +959,6 @@ mod proxy { 'proxy' } - #[external(v0)] - fn dependencies(self: @ContractState) -> Array<(felt252, bool)> { - let mut arr = array::ArrayTrait::new(); - - arr - } - #[external(v0)] fn execute(self: @ContractState, _ctx: dojo::world::Context, value: felt252) -> felt252 { diff --git a/crates/dojo-lang/src/system.rs b/crates/dojo-lang/src/system.rs deleted file mode 100644 index 0104baf518..0000000000 --- a/crates/dojo-lang/src/system.rs +++ /dev/null @@ -1,381 +0,0 @@ -use std::collections::HashMap; - -use cairo_lang_defs::plugin::{ - DynGeneratedFileAuxData, PluginDiagnostic, PluginGeneratedFile, PluginResult, -}; -use cairo_lang_semantic::patcher::{PatchBuilder, RewriteNode}; -use cairo_lang_semantic::plugin::DynPluginAuxData; -use cairo_lang_syntax::node::ast::MaybeModuleBody; -use cairo_lang_syntax::node::ast::OptionReturnTypeClause::ReturnTypeClause; -use cairo_lang_syntax::node::db::SyntaxGroup; -use cairo_lang_syntax::node::{ast, Terminal, TypedSyntaxNode}; -use cairo_lang_utils::unordered_hash_map::UnorderedHashMap; -use dojo_types::system::Dependency; -use itertools::Itertools; -use smol_str::SmolStr; - -use crate::commands::Command; -use crate::plugin::{DojoAuxData, SystemAuxData}; - -pub struct System { - diagnostics: Vec, - dependencies: HashMap, -} - -impl System { - pub fn from_module(db: &dyn SyntaxGroup, module_ast: ast::ItemModule) -> PluginResult { - let name = module_ast.name(db).text(db); - let mut system = System { diagnostics: vec![], dependencies: HashMap::new() }; - - if let MaybeModuleBody::Some(body) = module_ast.body(db) { - let body_nodes = body - .items(db) - .elements(db) - .iter() - .flat_map(|el| { - if let ast::Item::FreeFunction(fn_ast) = el { - if fn_ast.declaration(db).name(db).text(db).to_string() == "execute" { - return system.from_function(db, fn_ast.clone()); - } - } - - vec![RewriteNode::Copied(el.as_syntax_node())] - }) - .collect(); - - let mut builder = PatchBuilder::new(db); - builder.add_modified(RewriteNode::interpolate_patched( - " - #[starknet::contract] - mod $name$ { - use option::OptionTrait; - use array::SpanTrait; - - use dojo::world; - use dojo::world::IWorldDispatcher; - use dojo::world::IWorldDispatcherTrait; - use dojo::database::query::Query; - use dojo::database::query::QueryTrait; - use dojo::database::query::LiteralIntoQuery; - use dojo::database::query::TupleSize1IntoQuery; - use dojo::database::query::TupleSize2IntoQuery; - use dojo::database::query::TupleSize3IntoQuery; - use dojo::database::query::IntoPartitioned; - use dojo::database::query::IntoPartitionedQuery; - - #[storage] - struct Storage {} - - #[external(v0)] - fn name(self: @ContractState) -> felt252 { - '$name$' - } - - #[external(v0)] - fn dependencies(self: @ContractState) -> Array<(felt252, bool)> { - let mut arr = array::ArrayTrait::new(); - $dependencies$ - arr - } - - $body$ - } - ", - UnorderedHashMap::from([ - ("name".to_string(), RewriteNode::Text(name.to_string())), - ("body".to_string(), RewriteNode::new_modified(body_nodes)), - ( - "dependencies".to_string(), - RewriteNode::new_modified( - system - .dependencies - .iter() - .sorted_by(|a, b| a.0.cmp(b.0)) - .map(|(_, dep): (&smol_str::SmolStr, &Dependency)| { - RewriteNode::interpolate_patched( - "array::ArrayTrait::append(ref arr, ('$name$'.into(), \ - $write$));\n", - UnorderedHashMap::from([ - ( - "name".to_string(), - RewriteNode::Text(dep.name.to_string()), - ), - ( - "write".to_string(), - RewriteNode::Text( - if dep.write { "true" } else { "false" } - .to_string(), - ), - ), - ]), - ) - }) - .collect(), - ), - ), - ]), - )); - - return PluginResult { - code: Some(PluginGeneratedFile { - name: name.clone(), - content: builder.code, - aux_data: DynGeneratedFileAuxData::new(DynPluginAuxData::new(DojoAuxData { - patches: builder.patches, - components: vec![], - systems: vec![SystemAuxData { - name, - dependencies: system.dependencies.values().cloned().collect(), - }], - })), - }), - diagnostics: system.diagnostics, - remove_original_item: true, - }; - } - - PluginResult::default() - } - - pub fn from_function( - &mut self, - db: &dyn SyntaxGroup, - function_ast: ast::FunctionWithBody, - ) -> Vec { - let mut rewrite_nodes = vec![]; - - let signature = function_ast.declaration(db).signature(db); - - let body_nodes: Vec = function_ast - .body(db) - .statements(db) - .elements(db) - .iter() - .flat_map(|statement| self.handle_statement(db, statement.clone())) - .collect(); - - let parameters = signature.parameters(db); - - // Collect all the parameters in a Vec - let param_nodes: Vec<_> = parameters.elements(db); - - // Check if there is a parameter 'ctx: Context' - // If yes, make sure it's the first one. - // If not, add it as the first parameter. - let mut context = RewriteNode::Text("".to_string()); - match param_nodes - .iter() - .position(|p| p.as_syntax_node().get_text(db).trim() == "ctx: Context") - { - Some(0) => { /* 'ctx: Context' is already the first parameter, do nothing */ } - Some(_) => panic!("The first parameter must be 'ctx: Context'"), - None => { - // 'ctx: Context' is not found at all, add it as the first parameter - context = RewriteNode::Text("_ctx: dojo::world::Context,".to_string()); - } - }; - - let ret_clause = if let ReturnTypeClause(clause) = signature.ret_ty(db) { - RewriteNode::new_trimmed(clause.as_syntax_node()) - } else { - RewriteNode::Text("".to_string()) - }; - - rewrite_nodes.push(RewriteNode::interpolate_patched( - " - #[external(v0)] - fn execute(self: @ContractState, $context$$parameters$) $ret_clause$ { - $body$ - } - ", - UnorderedHashMap::from([ - ("context".to_string(), context), - ("parameters".to_string(), RewriteNode::new_trimmed(parameters.as_syntax_node())), - ("body".to_string(), RewriteNode::new_modified(body_nodes)), - ("ret_clause".to_string(), ret_clause), - ]), - )); - - rewrite_nodes - } - - fn handle_statement( - &mut self, - db: &dyn SyntaxGroup, - statement_ast: ast::Statement, - ) -> Vec { - match statement_ast.clone() { - ast::Statement::Let(statement_let) => { - if let ast::Expr::InlineMacro(expr_macro) = statement_let.rhs(db) { - if let Some(rewrite_nodes) = - self.handle_inline_macro(db, Some(statement_let.pattern(db)), expr_macro) - { - return rewrite_nodes; - } - } - } - ast::Statement::Expr(expr) => { - if let Some(rewrite_nodes) = self.handle_expr(db, expr.expr(db)) { - return rewrite_nodes; - } - } - _ => {} - } - - vec![RewriteNode::Copied(statement_ast.as_syntax_node())] - } - - fn handle_expr(&mut self, db: &dyn SyntaxGroup, expr: ast::Expr) -> Option> { - match expr { - ast::Expr::If(expr_if) => Some(self.handle_if(db, expr_if, false)), - ast::Expr::Block(expr_block) => Some(self.handle_block(db, expr_block)), - ast::Expr::Match(expr_match) => Some(self.handle_match(db, expr_match)), - ast::Expr::Loop(expr_loop) => Some(self.handle_loop(db, expr_loop)), - ast::Expr::InlineMacro(expr_macro) => self.handle_inline_macro(db, None, expr_macro), - _ => None, - } - } - - fn handle_inline_macro( - &mut self, - db: &dyn SyntaxGroup, - var_name: Option, - expr_macro: ast::ExprInlineMacro, - ) -> Option> { - let command = Command::try_from_ast(db, var_name, expr_macro); - - match command { - Some(c) => { - self.diagnostics.extend(c.diagnostics); - self.update_deps(c.component_deps); - Some(c.rewrite_nodes) - } - None => None, - } - } - - fn handle_if( - &mut self, - db: &dyn SyntaxGroup, - expr_if: ast::ExprIf, - is_else_if: bool, - ) -> Vec { - // recurse thru if blocks - let if_block: Vec = self.handle_block(db, expr_if.if_block(db)); - let else_prefix = if is_else_if { "else " } else { "" }; - let code = format!("{else_prefix}if $condition$ $block$"); - let if_rewrite = RewriteNode::interpolate_patched( - &code, - UnorderedHashMap::from([ - ( - "condition".to_string(), - RewriteNode::Copied(expr_if.condition(db).as_syntax_node()), - ), - ("block".to_string(), RewriteNode::new_modified(if_block)), - ]), - ); - - // recurse thru else/if blocks - if let ast::OptionElseClause::ElseClause(else_clause) = expr_if.else_clause(db) { - match else_clause.else_block_or_if(db) { - ast::BlockOrIf::Block(expr_else_block) => { - let else_block = self.handle_block(db, expr_else_block); - let else_rewrite = RewriteNode::interpolate_patched( - "else $block$", - UnorderedHashMap::from([( - "block".to_string(), - RewriteNode::new_modified(else_block), - )]), - ); - return vec![if_rewrite, else_rewrite]; - } - ast::BlockOrIf::If(expr_else_if) => { - let else_if_nodes: Vec = self.handle_if(db, expr_else_if, true); - return vec![if_rewrite].into_iter().chain(else_if_nodes.into_iter()).collect(); - } - }; - } - - vec![if_rewrite] - } - - fn handle_loop(&mut self, db: &dyn SyntaxGroup, expr_loop: ast::ExprLoop) -> Vec { - let loop_nodes: Vec = self.handle_block(db, expr_loop.body(db)); - let loop_rewrite = RewriteNode::interpolate_patched( - "loop $block$;", - UnorderedHashMap::from([("block".to_string(), RewriteNode::new_modified(loop_nodes))]), - ); - vec![loop_rewrite] - } - - fn handle_block( - &mut self, - db: &dyn SyntaxGroup, - expr_block: ast::ExprBlock, - ) -> Vec { - let block_nodes: Vec = expr_block - .statements(db) - .elements(db) - .iter() - .flat_map(|statement| self.handle_statement(db, statement.clone())) - .collect(); - - let block_rewrite = RewriteNode::interpolate_patched( - "{ $nodes$ }", - UnorderedHashMap::from([("nodes".to_string(), RewriteNode::new_modified(block_nodes))]), - ); - vec![block_rewrite] - } - - fn handle_match( - &mut self, - db: &dyn SyntaxGroup, - expr_match: ast::ExprMatch, - ) -> Vec { - let match_nodes: Vec = expr_match - .arms(db) - .elements(db) - .iter() - .flat_map(|arm| { - if let ast::Expr::Block(arm_block) = arm.expression(db) { - let arm_pat = arm.pattern(db); - let arm_block = self.handle_block(db, arm_block); - let arm_rewrite = RewriteNode::interpolate_patched( - "$pattern$ => $block$,", - UnorderedHashMap::from([ - ("pattern".to_string(), RewriteNode::Copied(arm_pat.as_syntax_node())), - ("block".to_string(), RewriteNode::new_modified(arm_block)), - ]), - ); - return vec![arm_rewrite]; - } - - vec![RewriteNode::Copied(arm.as_syntax_node())] - }) - .collect(); - - let match_rewrite = RewriteNode::interpolate_patched( - "match $expr$ { $arms$ }", - UnorderedHashMap::from([ - ("expr".to_string(), RewriteNode::Copied(expr_match.expr(db).as_syntax_node())), - ("arms".to_string(), RewriteNode::new_modified(match_nodes)), - ]), - ); - vec![match_rewrite] - } - - fn update_deps(&mut self, deps: Vec) { - for dep in deps { - if let Some(existing) = self.dependencies.get(&SmolStr::from(dep.name.as_str())) { - self.dependencies - .insert(dep.name.clone().into(), merge_deps(dep.clone(), existing.clone())); - } else { - self.dependencies.insert(dep.name.clone().into(), dep.clone()); - } - } - } -} - -fn merge_deps(a: Dependency, b: Dependency) -> Dependency { - Dependency { name: a.name, read: a.read || b.read, write: a.write || b.write } -} diff --git a/crates/dojo-lang/src/system/deps.rs b/crates/dojo-lang/src/system/deps.rs new file mode 100644 index 0000000000..8650d509b4 --- /dev/null +++ b/crates/dojo-lang/src/system/deps.rs @@ -0,0 +1,40 @@ +use std::collections::{HashMap, HashSet}; + +use cairo_lang_defs::ids::{ + FunctionWithBodyId, ImplDefId, ImplFunctionId, LanguageElementId, ModuleId, ModuleItemId, + SubmoduleId, TopLevelLanguageElementId, TraitFunctionId, TraitId, +}; +use cairo_lang_diagnostics::{DiagnosticAdded, Maybe}; +use cairo_lang_semantic::corelib::core_submodule; +use cairo_lang_semantic::db::SemanticGroup; +// use cairo_lang_semantic::items::attribute::SemanticQueryAttrs; +use cairo_lang_semantic::items::enm::SemanticEnumEx; +use cairo_lang_semantic::items::structure::SemanticStructEx; +use cairo_lang_semantic::plugin::DynPluginAuxData; +use cairo_lang_semantic::types::{ConcreteEnumLongId, ConcreteStructLongId}; +use cairo_lang_semantic::{ + ConcreteTypeId, GenericArgumentId, GenericParam, Mutability, TypeId, TypeLongId, +}; +use cairo_lang_utils::{extract_matches, try_extract_matches}; +use itertools::zip_eq; +use serde::{Deserialize, Serialize}; +use smol_str::SmolStr; +use thiserror::Error; + +#[cfg(test)] +#[path = "deps_test.rs"] +mod test; + +#[derive(Default)] +pub struct DepsExtractor { + /// List of type that were included abi. + /// Used to avoid redundancy. + types: HashSet, +} + +impl DepsExtractor {} + +fn get_type_name(db: &dyn SemanticGroup, ty: TypeId) -> Option { + let concrete_ty = try_extract_matches!(db.lookup_intern_type(ty), TypeLongId::Concrete)?; + Some(concrete_ty.generic_type(db).name(db.upcast())) +} diff --git a/crates/dojo-lang/src/system/deps_test.rs b/crates/dojo-lang/src/system/deps_test.rs new file mode 100644 index 0000000000..49ade71ebb --- /dev/null +++ b/crates/dojo-lang/src/system/deps_test.rs @@ -0,0 +1,192 @@ +use std::sync::Arc; + +use cairo_lang_compiler::db::RootDatabase; +use cairo_lang_defs::db::DefsGroup; +use cairo_lang_defs::ids::ModuleItemId; +use cairo_lang_semantic::db::SemanticGroup; +use cairo_lang_semantic::test_utils::setup_test_module; +use cairo_lang_syntax::node::helpers::QueryAttrs; +use cairo_lang_utils::{extract_matches, Upcast}; +use dojo_test_utils::compiler::{build_test_config, build_test_db}; +use indoc::indoc; +use scarb::ops; + +#[test] +fn test_deps_extraction() { + let mut db = build_test_db("src/manifest_test_crate/Scarb.toml").unwrap(); + let module_id = setup_test_module( + &mut db, + indoc! {" + #[derive(Component, Copy, Drop, Serde, SerdeLen)] + struct Moves { + remaining: u8, + } + + #[derive(Component, Copy, Drop, Serde, SerdeLen)] + struct Position { + x: u32, + y: u32 + } + + #[system] + mod spawn { + use array::ArrayTrait; + use box::BoxTrait; + use traits::Into; + use dojo::world::Context; + + use super::Position; + use super::Moves; + + fn execute(ctx: Context) { + set!( + ctx.world, ctx.origin.into(), (Moves { remaining: 10 }, Position { x: 0, y: 0 }, ) + ); + let value = get!(ctx.world, ctx.origin.into(), (Moves, Position, )); + return (); + } + } + "}, + ) + .unwrap() + .module_id; + + let system_id = extract_matches!( + db.module_item_by_name(module_id, "spawn".into()).unwrap().unwrap(), + ModuleItemId::Submodule + ); + + // system_id + // .has_attr(db.upcast(), "system")? + // let extractor = DepsExtractor::trait_as_interface_abi(db, system_id).unwrap(); + // let actual_serialization = serde_json::to_string_pretty(&abi).unwrap(); + // assert_eq!( + // actual_serialization, + // indoc! { + // r#"[ + // { + // "type": "enum", + // "name": "core::option::Option::<()>", + // "variants": [ + // { + // "name": "Some", + // "type": "()" + // }, + // { + // "name": "None", + // "type": "()" + // } + // ] + // }, + // { + // "type": "function", + // "name": "foo", + // "inputs": [ + // { + // "name": "a", + // "type": "core::felt252" + // }, + // { + // "name": "b", + // "type": "core::integer::u128" + // } + // ], + // "outputs": [ + // { + // "type": "core::option::Option::<()>" + // } + // ], + // "state_mutability": "external" + // }, + // { + // "type": "struct", + // "name": "core::integer::u256", + // "members": [ + // { + // "name": "low", + // "type": "core::integer::u128" + // }, + // { + // "name": "high", + // "type": "core::integer::u128" + // } + // ] + // }, + // { + // "type": "struct", + // "name": "test::MyStruct::", + // "members": [ + // { + // "name": "a", + // "type": "core::integer::u256" + // }, + // { + // "name": "b", + // "type": "core::felt252" + // } + // ] + // }, + // { + // "type": "function", + // "name": "foo_external", + // "inputs": [ + // { + // "name": "a", + // "type": "core::felt252" + // }, + // { + // "name": "b", + // "type": "core::integer::u128" + // } + // ], + // "outputs": [ + // { + // "type": "test::MyStruct::" + // } + // ], + // "state_mutability": "external" + // }, + // { + // "type": "enum", + // "name": "test::MyEnum::", + // "variants": [ + // { + // "name": "a", + // "type": "core::integer::u256" + // }, + // { + // "name": "b", + // "type": "test::MyStruct::" + // } + // ] + // }, + // { + // "type": "function", + // "name": "foo_view", + // "inputs": [ + // { + // "name": "a", + // "type": "core::felt252" + // }, + // { + // "name": "b", + // "type": "core::integer::u128" + // } + // ], + // "outputs": [ + // { + // "type": "test::MyEnum::" + // } + // ], + // "state_mutability": "view" + // }, + // { + // "type": "function", + // "name": "empty", + // "inputs": [], + // "outputs": [], + // "state_mutability": "external" + // } + // ]"#} + // ); +} diff --git a/crates/dojo-lang/src/system/mod.rs b/crates/dojo-lang/src/system/mod.rs new file mode 100644 index 0000000000..05a2da77dc --- /dev/null +++ b/crates/dojo-lang/src/system/mod.rs @@ -0,0 +1,172 @@ +use std::collections::HashMap; + +use cairo_lang_defs::plugin::{ + DynGeneratedFileAuxData, PluginDiagnostic, PluginGeneratedFile, PluginResult, +}; +use cairo_lang_semantic::patcher::{PatchBuilder, RewriteNode}; +use cairo_lang_semantic::plugin::DynPluginAuxData; +use cairo_lang_syntax::node::ast::MaybeModuleBody; +use cairo_lang_syntax::node::ast::OptionReturnTypeClause::ReturnTypeClause; +use cairo_lang_syntax::node::db::SyntaxGroup; +use cairo_lang_syntax::node::{ast, Terminal, TypedSyntaxNode}; +use cairo_lang_utils::unordered_hash_map::UnorderedHashMap; +use dojo_types::system::Dependency; +use smol_str::SmolStr; + +// mod deps; + +use crate::plugin::{DojoAuxData, SystemAuxData}; + +pub struct System { + diagnostics: Vec, + dependencies: HashMap, +} + +impl System { + pub fn from_module(db: &dyn SyntaxGroup, module_ast: ast::ItemModule) -> PluginResult { + let name = module_ast.name(db).text(db); + let mut system = System { diagnostics: vec![], dependencies: HashMap::new() }; + + if let MaybeModuleBody::Some(body) = module_ast.body(db) { + let body_nodes = body + .items(db) + .elements(db) + .iter() + .flat_map(|el| { + if let ast::Item::FreeFunction(fn_ast) = el { + if fn_ast.declaration(db).name(db).text(db).to_string() == "execute" { + return system.handle_execute(db, fn_ast.clone()); + } + } + + vec![RewriteNode::Copied(el.as_syntax_node())] + }) + .collect(); + + let mut builder = PatchBuilder::new(db); + builder.add_modified(RewriteNode::interpolate_patched( + " + #[starknet::contract] + mod $name$ { + use option::OptionTrait; + use array::SpanTrait; + + use dojo::world; + use dojo::world::IWorldDispatcher; + use dojo::world::IWorldDispatcherTrait; + use dojo::database::query::Query; + use dojo::database::query::QueryTrait; + use dojo::database::query::LiteralIntoQuery; + use dojo::database::query::TupleSize1IntoQuery; + use dojo::database::query::TupleSize2IntoQuery; + use dojo::database::query::TupleSize3IntoQuery; + use dojo::database::query::IntoPartitioned; + use dojo::database::query::IntoPartitionedQuery; + + #[storage] + struct Storage {} + + #[external(v0)] + fn name(self: @ContractState) -> felt252 { + '$name$' + } + + $body$ + } + ", + UnorderedHashMap::from([ + ("name".to_string(), RewriteNode::Text(name.to_string())), + ("body".to_string(), RewriteNode::new_modified(body_nodes)), + ]), + )); + + return PluginResult { + code: Some(PluginGeneratedFile { + name: name.clone(), + content: builder.code, + aux_data: DynGeneratedFileAuxData::new(DynPluginAuxData::new(DojoAuxData { + patches: builder.patches, + components: vec![], + systems: vec![SystemAuxData { + name, + dependencies: system.dependencies.values().cloned().collect(), + }], + })), + }), + diagnostics: system.diagnostics, + remove_original_item: true, + }; + } + + PluginResult::default() + } + + pub fn handle_execute( + &mut self, + db: &dyn SyntaxGroup, + function_ast: ast::FunctionWithBody, + ) -> Vec { + let mut rewrite_nodes = vec![]; + + let signature = function_ast.declaration(db).signature(db); + + let parameters = signature.parameters(db); + + // Collect all the parameters in a Vec + let param_nodes: Vec<_> = parameters.elements(db); + + // Check if there is a parameter 'ctx: Context' + // If yes, make sure it's the first one. + // If not, add it as the first parameter. + let mut context = RewriteNode::Text("".to_string()); + match param_nodes + .iter() + .position(|p| p.as_syntax_node().get_text(db).trim() == "ctx: Context") + { + Some(0) => { /* 'ctx: Context' is already the first parameter, do nothing */ } + Some(_) => panic!("The first parameter must be 'ctx: Context'"), + None => { + // 'ctx: Context' is not found at all, add it as the first parameter + context = RewriteNode::Text("_ctx: dojo::world::Context,".to_string()); + } + }; + + let ret_clause = if let ReturnTypeClause(clause) = signature.ret_ty(db) { + RewriteNode::new_trimmed(clause.as_syntax_node()) + } else { + RewriteNode::Text("".to_string()) + }; + + rewrite_nodes.push(RewriteNode::interpolate_patched( + " + #[external(v0)] + fn execute(self: @ContractState, $context$$parameters$) $ret_clause$ { + $body$ + } + ", + UnorderedHashMap::from([ + ("context".to_string(), context), + ("parameters".to_string(), RewriteNode::new_trimmed(parameters.as_syntax_node())), + ("body".to_string(), RewriteNode::new_trimmed(function_ast.as_syntax_node())), + ("ret_clause".to_string(), ret_clause), + ]), + )); + + rewrite_nodes + } + + fn update_deps(&mut self, deps: Vec) { + for dep in deps { + if let Some(existing) = self.dependencies.get(&SmolStr::from(dep.name.as_str())) { + self.dependencies + .insert(dep.name.clone().into(), merge_deps(dep.clone(), existing.clone())); + } else { + self.dependencies.insert(dep.name.clone().into(), dep.clone()); + } + } + } +} + +fn merge_deps(a: Dependency, b: Dependency) -> Dependency { + Dependency { name: a.name, read: a.read || b.read, write: a.write || b.write } +} diff --git a/crates/dojo-lang/src/version.rs b/crates/dojo-lang/src/version.rs new file mode 100644 index 0000000000..1a1c023dad --- /dev/null +++ b/crates/dojo-lang/src/version.rs @@ -0,0 +1,31 @@ +use anyhow::Result; +use semver::Version; + +pub trait ToVersion { + fn to_version(self) -> Result; +} + +impl ToVersion for Version { + fn to_version(self) -> Result { + Ok(self) + } +} + +impl<'a> ToVersion for &'a str { + fn to_version(self) -> Result { + Version::parse(self.trim()) + .map_err(|_| anyhow::format_err!("cannot parse '{}' as a semver", self)) + } +} + +impl<'a> ToVersion for &'a String { + fn to_version(self) -> Result { + (**self).to_version() + } +} + +impl<'a> ToVersion for &'a Version { + fn to_version(self) -> Result { + Ok(self.clone()) + } +} diff --git a/crates/dojo-test-utils/src/compiler.rs b/crates/dojo-test-utils/src/compiler.rs index cd01eb4503..5864ca6839 100644 --- a/crates/dojo-test-utils/src/compiler.rs +++ b/crates/dojo-test-utils/src/compiler.rs @@ -1,16 +1,17 @@ -use std::env; +use std::env::{self, current_dir}; use anyhow::Result; use assert_fs::TempDir; use cairo_lang_compiler::db::RootDatabase; -use cairo_lang_filesystem::ids::Directory; +use cairo_lang_filesystem::db::{FilesGroup, FilesGroupEx}; +use cairo_lang_filesystem::ids::{CrateLongId, Directory}; use cairo_lang_project::{ProjectConfig, ProjectConfigContent}; use camino::{Utf8Path, Utf8PathBuf}; use dojo_lang::compiler::DojoCompiler; use dojo_lang::db::DojoRootDatabaseBuilderEx; use dojo_lang::plugin::CairoPluginRepository; use scarb::compiler::{CompilationUnit, CompilerRepository}; -use scarb::core::{Config, Workspace}; +use scarb::core::Config; use scarb::ops; use scarb::ui::Verbosity; use tracing::trace; @@ -35,17 +36,26 @@ pub fn build_test_config(path: &str) -> anyhow::Result { .build() } -pub fn build_test_db(ws: &Workspace<'_>) -> anyhow::Result { - let resolve = ops::resolve_workspace(ws)?; - let compilation_units = ops::generate_compilation_units(&resolve, ws)?; +pub fn build_test_db(manifest_path: &str) -> anyhow::Result { + let config = build_test_config(manifest_path).unwrap(); + let ws = ops::read_workspace(config.manifest_path(), &config).unwrap(); + let resolve = ops::resolve_workspace(&ws)?; + let compilation_units = ops::generate_compilation_units(&resolve, &ws)?; - let unit = compilation_units[0].clone(); + let unit: CompilationUnit = compilation_units[0].clone(); - let db = RootDatabase::builder() + let mut db = RootDatabase::builder() .with_project_config(build_project_config(&unit)?) .with_dojo() .build()?; + let mut current_path = current_dir().unwrap(); + current_path.push("../dojo-core/src"); + + let crate_id = db.intern_crate(CrateLongId("dojo".into())); + let root = Directory(current_path); + db.set_crate_root(crate_id, Some(root)); + Ok(db) } diff --git a/crates/katana/core/Cargo.toml b/crates/katana/core/Cargo.toml index a9bcc5b14f..964eba2ea3 100644 --- a/crates/katana/core/Cargo.toml +++ b/crates/katana/core/Cargo.toml @@ -13,7 +13,7 @@ auto_impl = "1.1.0" blockifier.workspace = true cairo-lang-casm.workspace = true cairo-lang-starknet.workspace = true -cairo-vm = "0.6" +cairo-vm = "0.8.2" convert_case.workspace = true flate2 = "1.0.26" futures = "0.3" diff --git a/crates/katana/core/src/backend/config.rs b/crates/katana/core/src/backend/config.rs index 5163d1e863..0943c14a89 100644 --- a/crates/katana/core/src/backend/config.rs +++ b/crates/katana/core/src/backend/config.rs @@ -30,10 +30,11 @@ impl StarknetConfig { block_timestamp: BlockTimestamp::default(), sequencer_address: ContractAddress(patricia_key!(*SEQUENCER_ADDRESS)), fee_token_address: ContractAddress(patricia_key!(*FEE_TOKEN_ADDRESS)), - vm_resource_fee_cost: get_default_vm_resource_fee_cost(), + vm_resource_fee_cost: get_default_vm_resource_fee_cost().into(), gas_price: self.env.gas_price, validate_max_n_steps: self.env.validate_max_steps, invoke_tx_max_n_steps: self.env.invoke_max_steps, + max_recursion_depth: 1000, } } diff --git a/crates/katana/core/src/backend/mod.rs b/crates/katana/core/src/backend/mod.rs index ff5f6fbf18..aea510bdcf 100644 --- a/crates/katana/core/src/backend/mod.rs +++ b/crates/katana/core/src/backend/mod.rs @@ -17,10 +17,10 @@ use blockifier::transaction::transactions::ExecutableTransaction; use convert_case::{Case, Casing}; use starknet::core::types::{FeeEstimate, FieldElement, StateUpdate, TransactionStatus}; use starknet_api::block::{BlockHash, BlockNumber, BlockTimestamp, GasPrice}; -use starknet_api::core::{ClassHash, ContractAddress, GlobalRoot, PatriciaKey}; -use starknet_api::hash::{StarkFelt, StarkHash}; +use starknet_api::core::{ClassHash, GlobalRoot}; +use starknet_api::hash::StarkFelt; +use starknet_api::stark_felt; use starknet_api::transaction::{DeclareTransactionV0V1, DeployTransaction, TransactionHash}; -use starknet_api::{patricia_key, stark_felt}; use tracing::{info, trace, warn}; pub mod block; @@ -298,7 +298,7 @@ impl StarknetWrapper { fn check_tx_fee(&self, transaction: &AccountTransaction) { let max_fee = match transaction { AccountTransaction::Invoke(tx) => tx.max_fee(), - AccountTransaction::DeployAccount(tx) => tx.max_fee, + AccountTransaction::DeployAccount(tx) => tx.max_fee(), AccountTransaction::Declare(tx) => match tx.tx() { starknet_api::transaction::DeclareTransaction::V0(tx) => tx.max_fee, starknet_api::transaction::DeclareTransaction::V1(tx) => tx.max_fee, @@ -344,7 +344,6 @@ impl StarknetWrapper { let deploy_tx = starknet_api::transaction::Transaction::Deploy(DeployTransaction { class_hash: ClassHash(class_hash), transaction_hash: TransactionHash(stark_felt!(self.transactions.total() as u32)), - contract_address: ContractAddress(patricia_key!(address)), ..Default::default() }); @@ -436,8 +435,8 @@ fn execute_transaction( block_context: &BlockContext, ) -> Result { let res = match transaction { - Transaction::AccountTransaction(tx) => tx.execute(state, block_context), - Transaction::L1HandlerTransaction(tx) => tx.execute(state, block_context), + Transaction::AccountTransaction(tx) => tx.execute(state, block_context, true), + Transaction::L1HandlerTransaction(tx) => tx.execute(state, block_context, true), }; match res { diff --git a/crates/katana/core/src/backend/transaction.rs b/crates/katana/core/src/backend/transaction.rs index 179761f1a7..d892fd7df9 100644 --- a/crates/katana/core/src/backend/transaction.rs +++ b/crates/katana/core/src/backend/transaction.rs @@ -6,14 +6,14 @@ use blockifier::transaction::errors::TransactionExecutionError; use blockifier::transaction::objects::TransactionExecutionInfo; use starknet::core::types::TransactionStatus; use starknet_api::block::{BlockHash, BlockNumber}; -use starknet_api::core::{ContractAddress, EntryPointSelector}; -use starknet_api::hash::StarkFelt; -use starknet_api::stark_felt; +use starknet_api::core::{ContractAddress, EntryPointSelector, PatriciaKey}; +use starknet_api::hash::{StarkFelt, StarkHash}; use starknet_api::transaction::{ Calldata, DeclareTransactionOutput, DeployAccountTransactionOutput, DeployTransactionOutput, Event, Fee, InvokeTransactionOutput, L1HandlerTransactionOutput, MessageToL1, Transaction, TransactionHash, TransactionOutput, TransactionReceipt, }; +use starknet_api::{patricia_key, stark_felt}; pub struct ExternalFunctionCall { pub calldata: Calldata, @@ -161,6 +161,8 @@ impl StarknetTransaction { }), Transaction::DeployAccount(_) => { TransactionOutput::DeployAccount(DeployAccountTransactionOutput { + // TODO: Set contract address + contract_address: ContractAddress(patricia_key!("0x0")), events, actual_fee, messages_sent, @@ -172,6 +174,8 @@ impl StarknetTransaction { messages_sent, }), Transaction::Deploy(_) => TransactionOutput::Deploy(DeployTransactionOutput { + // TODO: Set contract address + contract_address: ContractAddress(patricia_key!("0x0")), events, actual_fee, messages_sent, diff --git a/crates/katana/core/src/block_context.rs b/crates/katana/core/src/block_context.rs index da128a7e00..93a0742376 100644 --- a/crates/katana/core/src/block_context.rs +++ b/crates/katana/core/src/block_context.rs @@ -25,10 +25,11 @@ impl Base for BlockContext { block_timestamp: BlockTimestamp::default(), sequencer_address: ContractAddress(patricia_key!(*SEQUENCER_ADDRESS)), fee_token_address: ContractAddress(patricia_key!(*FEE_TOKEN_ADDRESS)), - vm_resource_fee_cost: get_default_vm_resource_fee_cost(), + vm_resource_fee_cost: get_default_vm_resource_fee_cost().into(), gas_price: DEFAULT_GAS_PRICE, invoke_tx_max_n_steps: 1_000_000, validate_max_n_steps: 1_000_000, + max_recursion_depth: 1_000, } } } diff --git a/crates/katana/core/src/sequencer.rs b/crates/katana/core/src/sequencer.rs index 75c286aaed..7d9ef34e9c 100644 --- a/crates/katana/core/src/sequencer.rs +++ b/crates/katana/core/src/sequencer.rs @@ -13,14 +13,14 @@ use starknet::core::types::{ BlockId, BlockTag, FeeEstimate, FlattenedSierraClass, StateUpdate, TransactionStatus, }; use starknet_api::block::{BlockHash, BlockNumber}; -use starknet_api::core::{ChainId, ClassHash, ContractAddress, Nonce}; -use starknet_api::hash::StarkFelt; -use starknet_api::stark_felt; +use starknet_api::core::{ChainId, ClassHash, ContractAddress, Nonce, PatriciaKey}; +use starknet_api::hash::{StarkFelt, StarkHash}; use starknet_api::state::StorageKey; use starknet_api::transaction::{ DeployAccountTransaction, InvokeTransaction, Transaction as StarknetApiTransaction, TransactionHash, }; +use starknet_api::{patricia_key, stark_felt}; use tokio::sync::{RwLock, RwLockReadGuard, RwLockWriteGuard}; use tokio::time; @@ -151,10 +151,16 @@ impl Sequencer for KatanaSequencer { transaction: DeployAccountTransaction, ) -> (TransactionHash, ContractAddress) { let transaction_hash = transaction.transaction_hash; - let contract_address = transaction.contract_address; + // TODO: Set contract address + let contract_address = ContractAddress(patricia_key!("0x0")); self.starknet.write().await.handle_transaction(Transaction::AccountTransaction( - AccountTransaction::DeployAccount(transaction), + AccountTransaction::DeployAccount( + blockifier::transaction::transactions::DeployAccountTransaction { + tx: transaction, + contract_address, + }, + ), )); (transaction_hash, contract_address) @@ -198,9 +204,10 @@ impl Sequencer for KatanaSequencer { } match &account_transaction { - AccountTransaction::Invoke(tx) => tx.sender_address(), + AccountTransaction::Invoke(InvokeTransaction::V1(tx)) => tx.sender_address, AccountTransaction::Declare(tx) => tx.tx().sender_address(), AccountTransaction::DeployAccount(tx) => tx.contract_address, + _ => return Err(SequencerError::UnsupportedTransaction), }; let state = self.state(&block_id).await?; diff --git a/crates/katana/core/src/sequencer_error.rs b/crates/katana/core/src/sequencer_error.rs index 78e0dcad6b..1cb7d76418 100644 --- a/crates/katana/core/src/sequencer_error.rs +++ b/crates/katana/core/src/sequencer_error.rs @@ -30,4 +30,6 @@ pub enum SequencerError { EntryPointExecution(#[from] EntryPointExecutionError), #[error("Wait for pending transactions")] PendingTransactions, + #[error("Unsupported Transaction")] + UnsupportedTransaction, } diff --git a/crates/katana/core/src/util.rs b/crates/katana/core/src/util.rs index 2390526f49..e7448bef58 100644 --- a/crates/katana/core/src/util.rs +++ b/crates/katana/core/src/util.rs @@ -9,14 +9,13 @@ use starknet::core::types::{ ContractStorageDiffItem, DeclaredClassItem, DeployedContractItem, FieldElement, NonceUpdate, StateDiff, StorageEntry, }; -use starknet_api::core::ClassHash; -use starknet_api::hash::StarkFelt; +use starknet_api::core::{ClassHash, ContractAddress, Nonce, PatriciaKey}; +use starknet_api::hash::{StarkFelt, StarkHash}; use starknet_api::transaction::{ DeployAccountTransaction, InvokeTransaction, InvokeTransactionV1, L1HandlerTransaction, Transaction, }; -use starknet_api::StarknetApiError; - +use starknet_api::{patricia_key, StarknetApiError}; pub fn get_current_timestamp() -> Duration { SystemTime::now() .duration_since(SystemTime::UNIX_EPOCH) @@ -30,25 +29,26 @@ pub fn convert_blockifier_tx_to_starknet_api_tx( BlockifierTransaction::AccountTransaction(tx) => match tx { AccountTransaction::Invoke(tx) => { Transaction::Invoke(InvokeTransaction::V1(InvokeTransactionV1 { - nonce: tx.nonce(), + // TODO: Set nonce + nonce: Nonce(0_u8.into()), max_fee: tx.max_fee(), calldata: tx.calldata(), signature: tx.signature(), - sender_address: tx.sender_address(), + // TODO: Set sender address + sender_address: ContractAddress(patricia_key!("0x0")), transaction_hash: tx.transaction_hash(), })) } AccountTransaction::DeployAccount(tx) => { Transaction::DeployAccount(DeployAccountTransaction { - nonce: tx.nonce, - max_fee: tx.max_fee, - version: tx.version, - class_hash: tx.class_hash, - signature: tx.signature.clone(), - transaction_hash: tx.transaction_hash, - contract_address: tx.contract_address, - contract_address_salt: tx.contract_address_salt, - constructor_calldata: tx.constructor_calldata.clone(), + nonce: tx.nonce(), + max_fee: tx.max_fee(), + version: tx.version(), + class_hash: tx.class_hash(), + signature: tx.signature(), + transaction_hash: tx.transaction_hash(), + contract_address_salt: tx.contract_address_salt(), + constructor_calldata: tx.constructor_calldata(), }) } AccountTransaction::Declare(tx) => match tx.tx() { diff --git a/examples/ecs/Scarb.toml b/examples/ecs/Scarb.toml index 0e5b7b115d..993db5e653 100644 --- a/examples/ecs/Scarb.toml +++ b/examples/ecs/Scarb.toml @@ -1,7 +1,7 @@ [package] name = "dojo_examples" version = "0.1.0" -cairo-version = "2.0.0" +cairo-version = "2.1.0-rc1" [cairo] sierra-replace-ids = true diff --git a/examples/ecs/src/systems.cairo b/examples/ecs/src/systems.cairo index 4c4f47e936..de802bfe0f 100644 --- a/examples/ecs/src/systems.cairo +++ b/examples/ecs/src/systems.cairo @@ -9,7 +9,7 @@ mod spawn { use dojo_examples::components::Moves; fn execute(ctx: Context) { - set !( + set!( ctx.world, ctx.origin.into(), (Moves { remaining: 10 }, Position { x: 0, y: 0 }, ) ); return (); @@ -46,9 +46,9 @@ mod move { } fn execute(ctx: Context, direction: Direction) { - let (position, moves) = get !(ctx.world, ctx.origin.into(), (Position, Moves)); + let (position, moves) = get!(ctx.world, ctx.origin.into(), (Position, Moves)); let next = next_position(position, direction); - set !( + set!( ctx.world, ctx.origin.into(), (Moves { remaining: moves.remaining - 1 }, Position { x: next.x, y: next.y }, )