diff --git a/Cargo.lock b/Cargo.lock index fdb085e494..483a21acff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -178,7 +178,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -348,7 +348,7 @@ dependencies = [ "nom", "num-traits 0.2.19", "rusticata-macros", - "thiserror", + "thiserror 1.0.66", "time", ] @@ -360,7 +360,7 @@ checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", "synstructure", ] @@ -372,7 +372,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -500,7 +500,7 @@ dependencies = [ "futures-lite 2.4.0", "parking", "polling 3.7.3", - "rustix 0.38.38", + "rustix 0.38.40", "slab", "tracing", "windows-sys 0.59.0", @@ -550,7 +550,7 @@ dependencies = [ "cfg-if", "event-listener 3.1.0", "futures-lite 1.13.0", - "rustix 0.38.38", + "rustix 0.38.40", "windows-sys 0.48.0", ] @@ -562,7 +562,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -577,7 +577,7 @@ dependencies = [ "cfg-if", "futures-core", "futures-io", - "rustix 0.38.38", + "rustix 0.38.40", "signal-hook-registry", "slab", "windows-sys 0.59.0", @@ -628,7 +628,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -645,7 +645,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -710,7 +710,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -890,7 +890,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -902,7 +902,7 @@ dependencies = [ "bitflags 2.6.0", "cexpr", "clang-sys", - "itertools 0.12.1", + "itertools 0.10.5", "lazy_static", "lazycell", "log", @@ -912,7 +912,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.86", + "syn 2.0.87", "which", ] @@ -933,7 +933,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -1049,7 +1049,7 @@ dependencies = [ "strum_macros 0.25.3", "tempfile", "test-case", - "thiserror", + "thiserror 1.0.66", "tikv-jemallocator", "toml", "tracing", @@ -1155,7 +1155,7 @@ dependencies = [ "hashbrown 0.13.2", "instant", "once_cell", - "thiserror", + "thiserror 1.0.66", "tokio", ] @@ -1216,7 +1216,7 @@ dependencies = [ "rust-analyzer-salsa", "semver", "smol_str", - "thiserror", + "thiserror 1.0.66", ] [[package]] @@ -1300,7 +1300,7 @@ dependencies = [ "rust-analyzer-salsa", "serde", "smol_str", - "thiserror", + "thiserror 1.0.66", ] [[package]] @@ -1374,7 +1374,7 @@ checksum = "d72f17373740f242d6995e896b9195c2cedff7e8b14e496afdd16b405039d1fb" dependencies = [ "cairo-lang-debug", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -1387,7 +1387,7 @@ dependencies = [ "cairo-lang-utils", "serde", "smol_str", - "thiserror", + "thiserror 1.0.66", "toml", ] @@ -1419,7 +1419,7 @@ dependencies = [ "sha2", "smol_str", "starknet-types-core", - "thiserror", + "thiserror 1.0.66", ] [[package]] @@ -1472,7 +1472,7 @@ dependencies = [ "sha3", "smol_str", "starknet-types-core", - "thiserror", + "thiserror 1.0.66", ] [[package]] @@ -1488,7 +1488,7 @@ dependencies = [ "itertools 0.12.1", "num-bigint 0.4.6", "num-traits 0.2.19", - "thiserror", + "thiserror 1.0.66", ] [[package]] @@ -1504,7 +1504,7 @@ dependencies = [ "itertools 0.12.1", "num-bigint 0.4.6", "num-traits 0.2.19", - "thiserror", + "thiserror 1.0.66", ] [[package]] @@ -1549,7 +1549,7 @@ dependencies = [ "num-bigint 0.4.6", "num-traits 0.2.19", "starknet-types-core", - "thiserror", + "thiserror 1.0.66", ] [[package]] @@ -1589,7 +1589,7 @@ dependencies = [ "serde_json", "smol_str", "starknet-types-core", - "thiserror", + "thiserror 1.0.66", ] [[package]] @@ -1612,7 +1612,7 @@ dependencies = [ "sha3", "smol_str", "starknet-types-core", - "thiserror", + "thiserror 1.0.66", ] [[package]] @@ -1700,7 +1700,7 @@ dependencies = [ [[package]] name = "cairo-native" version = "0.2.0-alpha.4" -source = "git+https://github.com/lambdaclass/cairo_native?rev=acc3a3b8c38c5ae52bad56c3388bad660bfadca6#acc3a3b8c38c5ae52bad56c3388bad660bfadca6" +source = "git+https://github.com/lambdaclass/cairo_native?rev=e5e000a50e4bff15b815f23b76de90dd8aae40fc#e5e000a50e4bff15b815f23b76de90dd8aae40fc" dependencies = [ "anyhow", "aquamarine", @@ -1744,7 +1744,7 @@ dependencies = [ "starknet-types-core", "stats_alloc", "tempfile", - "thiserror", + "thiserror 1.0.66", "tracing", "tracing-subscriber", "utf8_iter", @@ -1753,7 +1753,7 @@ dependencies = [ [[package]] name = "cairo-native-runtime" version = "0.2.0-alpha.4" -source = "git+https://github.com/lambdaclass/cairo_native?rev=acc3a3b8c38c5ae52bad56c3388bad660bfadca6#acc3a3b8c38c5ae52bad56c3388bad660bfadca6" +source = "git+https://github.com/lambdaclass/cairo_native?rev=e5e000a50e4bff15b815f23b76de90dd8aae40fc#e5e000a50e4bff15b815f23b76de90dd8aae40fc" dependencies = [ "cairo-lang-sierra-gas", "itertools 0.13.0", @@ -1830,7 +1830,7 @@ dependencies = [ "semver", "serde", "serde_json", - "thiserror", + "thiserror 1.0.66", ] [[package]] @@ -2000,7 +2000,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -2031,7 +2031,7 @@ dependencies = [ "k256", "serde", "sha2", - "thiserror", + "thiserror 1.0.66", ] [[package]] @@ -2047,7 +2047,7 @@ dependencies = [ "pbkdf2 0.12.2", "rand 0.8.5", "sha2", - "thiserror", + "thiserror 1.0.66", ] [[package]] @@ -2067,7 +2067,7 @@ dependencies = [ "serde_derive", "sha2", "sha3", - "thiserror", + "thiserror 1.0.66", ] [[package]] @@ -2109,7 +2109,7 @@ dependencies = [ "strum 0.25.0", "strum_macros 0.25.3", "tempfile", - "thiserror", + "thiserror 1.0.66", "tokio", "tracing", "tracing-subscriber", @@ -2432,7 +2432,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -2480,7 +2480,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -2502,7 +2502,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core 0.20.10", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -2624,7 +2624,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -2634,7 +2634,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" dependencies = [ "derive_builder_core", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -2647,7 +2647,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -2667,7 +2667,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -2762,7 +2762,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -2843,7 +2843,7 @@ dependencies = [ "enum-ordinalize", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -2929,7 +2929,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -2960,7 +2960,7 @@ checksum = "a1ab991c1362ac86c61ab6f556cff143daa22e5a15e4e189df818b2fd19fe65b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -2980,7 +2980,7 @@ checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -3038,7 +3038,7 @@ dependencies = [ "serde_json", "sha2", "sha3", - "thiserror", + "thiserror 1.0.66", "uuid 0.8.2", ] @@ -3055,7 +3055,7 @@ dependencies = [ "serde", "serde_json", "sha3", - "thiserror", + "thiserror 1.0.66", "uint", ] @@ -3134,7 +3134,7 @@ dependencies = [ "pin-project", "serde", "serde_json", - "thiserror", + "thiserror 1.0.66", ] [[package]] @@ -3156,7 +3156,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "syn 2.0.86", + "syn 2.0.87", "toml", "walkdir", ] @@ -3174,7 +3174,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -3200,9 +3200,9 @@ dependencies = [ "serde", "serde_json", "strum 0.26.3", - "syn 2.0.86", + "syn 2.0.87", "tempfile", - "thiserror", + "thiserror 1.0.66", "tiny-keccak", "unicode-xid", ] @@ -3219,7 +3219,7 @@ dependencies = [ "semver", "serde", "serde_json", - "thiserror", + "thiserror 1.0.66", "tracing", ] @@ -3243,7 +3243,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "thiserror", + "thiserror 1.0.66", "tokio", "tracing", "tracing-futures", @@ -3275,7 +3275,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "thiserror", + "thiserror 1.0.66", "tokio", "tokio-tungstenite", "tracing", @@ -3302,7 +3302,7 @@ dependencies = [ "ethers-core", "rand 0.8.5", "sha2", - "thiserror", + "thiserror 1.0.66", "tracing", ] @@ -3330,7 +3330,7 @@ dependencies = [ "serde_json", "solang-parser", "svm-rs", - "thiserror", + "thiserror 1.0.66", "tiny-keccak", "tokio", "tracing", @@ -3664,7 +3664,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -3757,7 +3757,7 @@ checksum = "553630feadf7b76442b0849fd25fdf89b860d933623aec9693fed19af0400c78" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -3834,7 +3834,7 @@ dependencies = [ "pin-project", "serde", "serde_json", - "thiserror", + "thiserror 1.0.66", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -4108,7 +4108,7 @@ dependencies = [ "once_cell", "rand 0.8.5", "socket2 0.5.7", - "thiserror", + "thiserror 1.0.66", "tinyvec", "tokio", "tracing", @@ -4131,7 +4131,7 @@ dependencies = [ "rand 0.8.5", "resolv-conf", "smallvec", - "thiserror", + "thiserror 1.0.66", "tokio", "tracing", ] @@ -4770,7 +4770,7 @@ dependencies = [ "pin-project", "rustls-native-certs", "soketto", - "thiserror", + "thiserror 1.0.66", "tokio", "tokio-rustls", "tokio-util", @@ -4799,7 +4799,7 @@ dependencies = [ "serde", "serde_json", "soketto", - "thiserror", + "thiserror 1.0.66", "tokio", "tracing", "wasm-bindgen-futures", @@ -4818,7 +4818,7 @@ dependencies = [ "jsonrpsee-types", "serde", "serde_json", - "thiserror", + "thiserror 1.0.66", "tokio", "tower", "tracing", @@ -4853,7 +4853,7 @@ dependencies = [ "serde", "serde_json", "soketto", - "thiserror", + "thiserror 1.0.66", "tokio", "tokio-stream", "tokio-util", @@ -4871,7 +4871,7 @@ dependencies = [ "beef", "serde", "serde_json", - "thiserror", + "thiserror 1.0.66", "tracing", ] @@ -5079,7 +5079,7 @@ dependencies = [ "lifetimed-bytes", "mdbx-sys", "parking_lot", - "thiserror", + "thiserror 1.0.66", ] [[package]] @@ -5113,7 +5113,7 @@ dependencies = [ "multiaddr", "pin-project", "rw-stream-sink", - "thiserror", + "thiserror 1.0.66", ] [[package]] @@ -5162,7 +5162,7 @@ dependencies = [ "rw-stream-sink", "serde", "smallvec", - "thiserror", + "thiserror 1.0.66", "tracing", "unsigned-varint 0.8.0", "void", @@ -5235,7 +5235,7 @@ dependencies = [ "quick-protobuf", "quick-protobuf-codec 0.3.1", "smallvec", - "thiserror", + "thiserror 1.0.66", "tracing", "void", ] @@ -5254,7 +5254,7 @@ dependencies = [ "rand 0.8.5", "serde", "sha2", - "thiserror", + "thiserror 1.0.66", "tracing", "zeroize", ] @@ -5283,7 +5283,7 @@ dependencies = [ "serde", "sha2", "smallvec", - "thiserror", + "thiserror 1.0.66", "tracing", "uint", "void", @@ -5348,7 +5348,7 @@ dependencies = [ "sha2", "snow", "static_assertions", - "thiserror", + "thiserror 1.0.66", "tracing", "x25519-dalek", "zeroize", @@ -5389,7 +5389,7 @@ dependencies = [ "ring 0.17.8", "rustls 0.23.16", "socket2 0.5.7", - "thiserror", + "thiserror 1.0.66", "tokio", "tracing", ] @@ -5428,7 +5428,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -5482,7 +5482,7 @@ dependencies = [ "ring 0.17.8", "rustls 0.23.16", "rustls-webpki 0.101.7", - "thiserror", + "thiserror 1.0.66", "x509-parser", "yasna", ] @@ -5512,7 +5512,7 @@ dependencies = [ "either", "futures", "libp2p-core", - "thiserror", + "thiserror 1.0.66", "tracing", "yamux 0.12.1", "yamux 0.13.3", @@ -5708,7 +5708,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.86", + "syn 2.0.87", "tblgen-alt", "unindent 0.2.3", ] @@ -5781,7 +5781,7 @@ dependencies = [ "metrics 0.21.1", "metrics-util", "quanta", - "thiserror", + "thiserror 1.0.66", "tokio", "tracing", ] @@ -5794,7 +5794,7 @@ checksum = "38b4faf00617defe497754acde3024865bc143d44a86799b24e191ecff91354f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -5903,7 +5903,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -6055,7 +6055,7 @@ dependencies = [ "starknet-types-core", "starknet_api", "tempfile", - "thiserror", + "thiserror 1.0.66", ] [[package]] @@ -6106,7 +6106,7 @@ dependencies = [ "anyhow", "byteorder", "paste", - "thiserror", + "thiserror 1.0.66", ] [[package]] @@ -6120,7 +6120,7 @@ dependencies = [ "log", "netlink-packet-core", "netlink-sys", - "thiserror", + "thiserror 1.0.66", "tokio", ] @@ -6403,7 +6403,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -6499,7 +6499,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -6582,7 +6582,7 @@ dependencies = [ "tar", "tempfile", "test-with", - "thiserror", + "thiserror 1.0.66", "tokio", "url", ] @@ -6595,7 +6595,7 @@ dependencies = [ "papyrus_test_utils", "pretty_assertions", "starknet_api", - "thiserror", + "thiserror 1.0.66", "tracing", ] @@ -6617,7 +6617,7 @@ dependencies = [ "sha3", "starknet-types-core", "starknet_api", - "thiserror", + "thiserror 1.0.66", ] [[package]] @@ -6633,7 +6633,7 @@ dependencies = [ "serde_json", "strum_macros 0.25.3", "tempfile", - "thiserror", + "thiserror 1.0.66", "validator", ] @@ -6657,7 +6657,7 @@ dependencies = [ "starknet-types-core", "starknet_api", "test-case", - "thiserror", + "thiserror 1.0.66", "tokio", "tracing", ] @@ -6687,7 +6687,7 @@ dependencies = [ "serde_json", "starknet-types-core", "starknet_api", - "thiserror", + "thiserror 1.0.66", "tracing", ] @@ -6725,7 +6725,7 @@ dependencies = [ "serde", "serde_json", "starknet_client", - "thiserror", + "thiserror 1.0.66", "tokio", "tower", "tracing", @@ -6754,7 +6754,7 @@ dependencies = [ "replace_with", "serde", "starknet_api", - "thiserror", + "thiserror 1.0.66", "tokio", "tokio-retry", "tokio-stream", @@ -6831,7 +6831,7 @@ dependencies = [ "starknet-types-core", "starknet_api", "static_assertions", - "thiserror", + "thiserror 1.0.66", "tokio", "tokio-stream", "tracing", @@ -6847,7 +6847,7 @@ dependencies = [ "papyrus_test_utils", "prometheus-parse", "quote", - "syn 2.0.86", + "syn 2.0.87", "tracing", ] @@ -6866,7 +6866,7 @@ dependencies = [ "rand_chacha 0.3.1", "starknet-types-core", "starknet_api", - "thiserror", + "thiserror 1.0.66", ] [[package]] @@ -6966,7 +6966,7 @@ dependencies = [ "tempfile", "test-case", "test-log", - "thiserror", + "thiserror 1.0.66", "tokio", "tracing", "validator", @@ -7002,7 +7002,7 @@ dependencies = [ "starknet-types-core", "starknet_api", "starknet_client", - "thiserror", + "thiserror 1.0.66", "tokio", "tokio-stream", "tracing", @@ -7225,7 +7225,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -7269,7 +7269,7 @@ checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -7365,7 +7365,7 @@ dependencies = [ "concurrent-queue", "hermit-abi 0.4.0", "pin-project-lite", - "rustix 0.38.38", + "rustix 0.38.40", "tracing", "windows-sys 0.59.0", ] @@ -7463,7 +7463,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -7551,7 +7551,7 @@ dependencies = [ "hex", "lazy_static", "procfs-core", - "rustix 0.38.38", + "rustix 0.38.40", ] [[package]] @@ -7584,7 +7584,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -7633,7 +7633,7 @@ checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" dependencies = [ "bytes", "heck 0.5.0", - "itertools 0.12.1", + "itertools 0.10.5", "log", "multimap", "once_cell", @@ -7642,7 +7642,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 2.0.86", + "syn 2.0.87", "tempfile", ] @@ -7653,10 +7653,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" dependencies = [ "anyhow", - "itertools 0.12.1", + "itertools 0.10.5", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -7691,7 +7691,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e681a6cfdc4adcc93b4d3cf993749a4552018ee0a9b65fc0ccfad74352c72a38" dependencies = [ "cfg-if", - "hashbrown 0.14.5", + "hashbrown 0.13.2", "indoc 1.0.9", "libc", "memoffset", @@ -7797,7 +7797,7 @@ dependencies = [ "asynchronous-codec 0.6.2", "bytes", "quick-protobuf", - "thiserror", + "thiserror 1.0.66", "unsigned-varint 0.7.2", ] @@ -7810,7 +7810,7 @@ dependencies = [ "asynchronous-codec 0.7.0", "bytes", "quick-protobuf", - "thiserror", + "thiserror 1.0.66", "unsigned-varint 0.8.0", ] @@ -7828,7 +7828,7 @@ dependencies = [ "rustc-hash 2.0.0", "rustls 0.23.16", "socket2 0.5.7", - "thiserror", + "thiserror 1.0.66", "tokio", "tracing", ] @@ -7845,7 +7845,7 @@ dependencies = [ "rustc-hash 2.0.0", "rustls 0.23.16", "slab", - "thiserror", + "thiserror 1.0.66", "tinyvec", "tracing", ] @@ -8107,7 +8107,7 @@ checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", - "thiserror", + "thiserror 1.0.66", ] [[package]] @@ -8354,7 +8354,7 @@ dependencies = [ "netlink-packet-route", "netlink-proto", "nix 0.24.3", - "thiserror", + "thiserror 1.0.66", "tokio", ] @@ -8384,7 +8384,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -8455,9 +8455,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.38" +version = "0.38.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa260229e6538e52293eeb577aabd09945a09d6d9cc0fc550ed7529056c2e32a" +checksum = "99e4ea3e1cdc4b559b8e5650f9c8e5998e3e5c1343b4eaf034565f32318d63c0" dependencies = [ "bitflags 2.6.0", "errno", @@ -8602,7 +8602,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -8636,7 +8636,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -8742,7 +8742,7 @@ checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -8753,7 +8753,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -8797,7 +8797,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -8845,7 +8845,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -8911,7 +8911,7 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "sierra-emu" version = "0.1.0" -source = "git+https://github.com/lambdaclass/sierra-emu.git#071caea75a403fb940a96b574f2a70dc431e0662" +source = "git+https://github.com/lambdaclass/sierra-emu.git#783b57767f36928ded909ae1e17fded6262dbf32" dependencies = [ "cairo-lang-compiler", "cairo-lang-filesystem", @@ -8931,11 +8931,11 @@ dependencies = [ "serde_json", "sha2", "smallvec", - "starknet-crypto 0.7.2", + "starknet-crypto 0.7.3", "starknet-curve 0.5.1", "starknet-types-core", "tempfile", - "thiserror", + "thiserror 2.0.3", "tracing", "tracing-subscriber", ] @@ -8973,7 +8973,7 @@ checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" dependencies = [ "num-bigint 0.4.6", "num-traits 0.2.19", - "thiserror", + "thiserror 1.0.66", "time", ] @@ -9126,7 +9126,7 @@ dependencies = [ "lalrpop", "lalrpop-util", "phf", - "thiserror", + "thiserror 1.0.66", "unicode-xid", ] @@ -9232,9 +9232,9 @@ dependencies = [ [[package]] name = "starknet-crypto" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a5064173a8e8d2675e67744fd07f310de44573924b6b7af225a6bdd8102913" +checksum = "ded22ccf4cb9e572ce3f77de6066af53560cd2520d508876c83bb1e6b29d5cbc" dependencies = [ "crypto-bigint", "hex", @@ -9257,7 +9257,7 @@ checksum = "bbc159a1934c7be9761c237333a57febe060ace2bc9e3b337a59a37af206d19f" dependencies = [ "starknet-curve 0.4.2", "starknet-ff", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -9336,7 +9336,7 @@ dependencies = [ "starknet-types-core", "strum 0.24.1", "strum_macros 0.24.3", - "thiserror", + "thiserror 1.0.66", ] [[package]] @@ -9352,7 +9352,7 @@ dependencies = [ "starknet_batcher_types", "starknet_mempool_infra", "starknet_mempool_types", - "thiserror", + "thiserror 1.0.66", "tokio", "tracing", "validator", @@ -9367,7 +9367,7 @@ dependencies = [ "papyrus_proc_macros", "serde", "starknet_mempool_infra", - "thiserror", + "thiserror 1.0.66", ] [[package]] @@ -9398,7 +9398,7 @@ dependencies = [ "starknet_api", "strum 0.25.0", "strum_macros 0.25.3", - "thiserror", + "thiserror 1.0.66", "tokio", "tokio-retry", "tracing", @@ -9415,7 +9415,7 @@ dependencies = [ "serde_json", "starknet-types-core", "starknet_patricia", - "thiserror", + "thiserror 1.0.66", "tokio", "tracing", ] @@ -9443,7 +9443,7 @@ dependencies = [ "papyrus_proc_macros", "serde", "starknet_mempool_infra", - "thiserror", + "thiserror 1.0.66", ] [[package]] @@ -9475,7 +9475,7 @@ dependencies = [ "starknet_mempool_infra", "starknet_mempool_types", "starknet_sierra_compile", - "thiserror", + "thiserror 1.0.66", "tokio", "tracing", "tracing-test", @@ -9512,7 +9512,7 @@ dependencies = [ "pretty_assertions", "rstest", "serde", - "thiserror", + "thiserror 1.0.66", "tokio", "tracing", "tracing-subscriber", @@ -9590,7 +9590,7 @@ dependencies = [ "serde", "starknet_api", "starknet_mempool_infra", - "thiserror", + "thiserror 1.0.66", ] [[package]] @@ -9609,7 +9609,7 @@ dependencies = [ "starknet-types-core", "strum 0.25.0", "strum_macros 0.25.3", - "thiserror", + "thiserror 1.0.66", "tokio", "tracing", ] @@ -9629,7 +9629,7 @@ dependencies = [ "serde_json", "starknet-types-core", "starknet_api", - "thiserror", + "thiserror 1.0.66", "validator", ] @@ -9734,7 +9734,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -9747,7 +9747,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -9771,7 +9771,7 @@ dependencies = [ "serde", "serde_json", "sha2", - "thiserror", + "thiserror 1.0.66", "url", "zip", ] @@ -9789,9 +9789,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.86" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89275301d38033efb81a6e60e3497e734dfcc62571f2854bf4b16690398824c" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" dependencies = [ "proc-macro2", "quote", @@ -9812,7 +9812,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -9868,19 +9868,19 @@ dependencies = [ "bindgen 0.69.5", "cc", "paste", - "thiserror", + "thiserror 1.0.66", ] [[package]] name = "tempfile" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if", "fastrand 2.1.1", "once_cell", - "rustix 0.38.38", + "rustix 0.38.40", "windows-sys 0.59.0", ] @@ -9928,7 +9928,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -9939,7 +9939,7 @@ checksum = "5c89e72a01ed4c579669add59014b9a524d609c0c88c6a585ce37485879f6ffb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", "test-case-core", ] @@ -9962,7 +9962,7 @@ checksum = "5999e24eaa32083191ba4e425deb75cdf25efefabe5aaccb7446dd0d4122a3f5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -9975,7 +9975,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.86", + "syn 2.0.87", "which", ] @@ -9985,7 +9985,16 @@ version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d171f59dbaa811dbbb1aee1e73db92ec2b122911a48e1390dfe327a821ddede" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.66", +] + +[[package]] +name = "thiserror" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c006c85c7651b3cf2ada4584faa36773bd07bac24acfb39f3c431b36d7e667aa" +dependencies = [ + "thiserror-impl 2.0.3", ] [[package]] @@ -9996,7 +10005,18 @@ checksum = "b08be0f17bd307950653ce45db00cd31200d82b624b36e181337d9c7d92765b5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] @@ -10142,7 +10162,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -10327,7 +10347,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -10410,7 +10430,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568" dependencies = [ "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -10444,7 +10464,7 @@ dependencies = [ "rand 0.8.5", "rustls 0.21.12", "sha1", - "thiserror", + "thiserror 1.0.66", "url", "utf-8", ] @@ -10485,7 +10505,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c878a167baa8afd137494101a688ef8c67125089ff2249284bd2b5f9bfedb815" dependencies = [ - "thiserror", + "thiserror 1.0.66", ] [[package]] @@ -10744,7 +10764,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", "wasm-bindgen-shared", ] @@ -10778,7 +10798,7 @@ checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -10824,7 +10844,7 @@ dependencies = [ "either", "home", "once_cell", - "rustix 0.38.38", + "rustix 0.38.40", ] [[package]] @@ -11118,7 +11138,7 @@ dependencies = [ "pharos", "rustc_version", "send_wrapper 0.6.0", - "thiserror", + "thiserror 1.0.66", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -11158,7 +11178,7 @@ dependencies = [ "nom", "oid-registry", "rusticata-macros", - "thiserror", + "thiserror 1.0.66", "time", ] @@ -11170,7 +11190,7 @@ checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" dependencies = [ "libc", "linux-raw-sys 0.4.14", - "rustix 0.38.38", + "rustix 0.38.40", ] [[package]] @@ -11273,7 +11293,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -11293,7 +11313,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index d861f2184b..cc844cc290 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -81,7 +81,7 @@ cairo-lang-sierra-to-casm = "2.8.4" cairo-lang-starknet-classes = "2.8.4" cairo-lang-utils = "2.8.4" # This is a temporary dependency, will be removed once the new version of cairo-native is released to main. -cairo-native = { git = "https://github.com/lambdaclass/cairo_native", rev = "acc3a3b8c38c5ae52bad56c3388bad660bfadca6" } +cairo-native = { git = "https://github.com/lambdaclass/cairo_native", rev = "e5e000a50e4bff15b815f23b76de90dd8aae40fc" } cairo-vm = "1.0.1" camelpaste = "0.1.0" chrono = "0.4.26" diff --git a/crates/blockifier/src/execution/native/syscall_handler.rs b/crates/blockifier/src/execution/native/syscall_handler.rs index 6b364bf1bd..a0e95ac741 100644 --- a/crates/blockifier/src/execution/native/syscall_handler.rs +++ b/crates/blockifier/src/execution/native/syscall_handler.rs @@ -119,7 +119,7 @@ impl<'state> NativeSyscallHandler<'state> { pub fn execute_inner_call( &mut self, entry_point: CallEntryPoint, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult { let call_info = entry_point .execute(self.state, self.execution_resources, self.execution_context) @@ -138,15 +138,9 @@ impl<'state> NativeSyscallHandler<'state> { Ok(call_info) } - pub fn update_remaining_gas(&mut self, remaining_gas: &mut u128, call_info: &CallInfo) { - // create a new variable with converted type - let mut remaining_gas_u64 = u64::try_from(*remaining_gas).unwrap(); - + pub fn update_remaining_gas(&mut self, remaining_gas: &mut u64, call_info: &CallInfo) { // pass the reference to the function - update_remaining_gas(&mut remaining_gas_u64, call_info); - - // change the remaining gas value - *remaining_gas = u128::from(remaining_gas_u64); + update_remaining_gas(remaining_gas, call_info); } pub fn increment_syscall_count_by(&mut self, selector: &SyscallSelector, n: usize) { @@ -163,7 +157,7 @@ impl<'state> NativeSyscallHandler<'state> { // syscalls are called directly, so we need to implement this logic here pub fn pre_execute_syscall( &mut self, - remaining_gas: &mut u128, + remaining_gas: &mut u64, syscall_selector: SyscallSelector, syscall_gas_cost: u64, ) -> SyscallResult<()> { @@ -174,8 +168,7 @@ impl<'state> NativeSyscallHandler<'state> { } // Refund `SYSCALL_BASE_GAS_COST` as it was pre-charged. - let required_gas = - u128::from(syscall_gas_cost - self.execution_context.gas_costs().syscall_base_gas_cost); + let required_gas = syscall_gas_cost - self.execution_context.gas_costs().syscall_base_gas_cost; if *remaining_gas < required_gas { // Out of gas failure. @@ -192,7 +185,7 @@ impl<'state> StarknetSyscallHandler for &mut NativeSyscallHandler<'state> { fn get_block_hash( &mut self, block_number: u64, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult { self.pre_execute_syscall( remaining_gas, @@ -238,7 +231,7 @@ impl<'state> StarknetSyscallHandler for &mut NativeSyscallHandler<'state> { } } - fn get_execution_info(&mut self, remaining_gas: &mut u128) -> SyscallResult { + fn get_execution_info(&mut self, remaining_gas: &mut u64) -> SyscallResult { self.pre_execute_syscall( remaining_gas, SyscallSelector::GetExecutionInfo, @@ -304,7 +297,7 @@ impl<'state> StarknetSyscallHandler for &mut NativeSyscallHandler<'state> { fn get_execution_info_v2( &mut self, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult { self.pre_execute_syscall( remaining_gas, @@ -393,7 +386,7 @@ impl<'state> StarknetSyscallHandler for &mut NativeSyscallHandler<'state> { contract_address_salt: Felt, calldata: &[Felt], deploy_from_zero: bool, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult<(Felt, Vec)> { self.pre_execute_syscall( remaining_gas, @@ -430,7 +423,7 @@ impl<'state> StarknetSyscallHandler for &mut NativeSyscallHandler<'state> { // Warning: converting of reference would create a new reference to different data, // example: // let mut a: u128 = 1; - // let a_ref: &mut u128 = &mut a; + // let a_ref: &mut u64 = &mut a; // // let mut b: u64 = u64::try_from(*a_ref).unwrap(); // @@ -442,7 +435,7 @@ impl<'state> StarknetSyscallHandler for &mut NativeSyscallHandler<'state> { // assert_eq!(a, 1); // in this case we don't pass a reference, so everything is OK, but still can cause // conversion issues - u64::try_from(*remaining_gas).unwrap(), + *remaining_gas, ) .map_err(|error| encode_str_as_felts(&error.to_string()))?; @@ -456,7 +449,7 @@ impl<'state> StarknetSyscallHandler for &mut NativeSyscallHandler<'state> { Ok((contract_address_felt, return_data)) } - fn replace_class(&mut self, class_hash: Felt, remaining_gas: &mut u128) -> SyscallResult<()> { + fn replace_class(&mut self, class_hash: Felt, remaining_gas: &mut u64) -> SyscallResult<()> { self.pre_execute_syscall( remaining_gas, SyscallSelector::ReplaceClass, @@ -488,7 +481,7 @@ impl<'state> StarknetSyscallHandler for &mut NativeSyscallHandler<'state> { class_hash: Felt, function_selector: Felt, calldata: &[Felt], - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult> { self.pre_execute_syscall( remaining_gas, @@ -510,7 +503,7 @@ impl<'state> StarknetSyscallHandler for &mut NativeSyscallHandler<'state> { storage_address: self.contract_address, caller_address: self.caller_address, call_type: CallType::Delegate, - initial_gas: u64::try_from(*remaining_gas).unwrap(), + initial_gas: *remaining_gas, }; let retdata = self @@ -525,7 +518,7 @@ impl<'state> StarknetSyscallHandler for &mut NativeSyscallHandler<'state> { address: Felt, entry_point_selector: Felt, calldata: &[Felt], - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult> { self.pre_execute_syscall( remaining_gas, @@ -558,7 +551,7 @@ impl<'state> StarknetSyscallHandler for &mut NativeSyscallHandler<'state> { storage_address: contract_address, caller_address: self.contract_address, call_type: CallType::Call, - initial_gas: u64::try_from(*remaining_gas).unwrap(), + initial_gas: *remaining_gas, }; let retdata = self @@ -572,7 +565,7 @@ impl<'state> StarknetSyscallHandler for &mut NativeSyscallHandler<'state> { &mut self, _address_domain: u32, address: Felt, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult { self.pre_execute_syscall( remaining_gas, @@ -598,7 +591,7 @@ impl<'state> StarknetSyscallHandler for &mut NativeSyscallHandler<'state> { _address_domain: u32, address: Felt, value: Felt, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult<()> { self.pre_execute_syscall( remaining_gas, @@ -621,7 +614,7 @@ impl<'state> StarknetSyscallHandler for &mut NativeSyscallHandler<'state> { &mut self, keys: &[Felt], data: &[Felt], - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult<()> { self.pre_execute_syscall( remaining_gas, @@ -652,7 +645,7 @@ impl<'state> StarknetSyscallHandler for &mut NativeSyscallHandler<'state> { &mut self, to_address: Felt, payload: &[Felt], - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult<()> { self.pre_execute_syscall( remaining_gas, @@ -676,7 +669,7 @@ impl<'state> StarknetSyscallHandler for &mut NativeSyscallHandler<'state> { Ok(()) } - fn keccak(&mut self, input: &[u64], remaining_gas: &mut u128) -> SyscallResult { + fn keccak(&mut self, input: &[u64], remaining_gas: &mut u64) -> SyscallResult { self.pre_execute_syscall( remaining_gas, SyscallSelector::Keccak, @@ -696,9 +689,7 @@ impl<'state> StarknetSyscallHandler for &mut NativeSyscallHandler<'state> { // TODO(Ori, 1/2/2024): Write an indicative expect message explaining why the conversion // works. let n_rounds_as_u64 = u64::try_from(n_rounds).expect("Failed to convert usize to u64."); - let gas_cost = u128::from( - n_rounds_as_u64 * self.execution_context.gas_costs().keccak_round_cost_gas_cost, - ); + let gas_cost = n_rounds_as_u64 * self.execution_context.gas_costs().keccak_round_cost_gas_cost; if gas_cost > *remaining_gas { // In VM this error is wrapped into `SyscallExecutionError::SyscallError` @@ -729,7 +720,7 @@ impl<'state> StarknetSyscallHandler for &mut NativeSyscallHandler<'state> { &mut self, x: U256, y: U256, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult> { self.pre_execute_syscall( remaining_gas, @@ -744,7 +735,7 @@ impl<'state> StarknetSyscallHandler for &mut NativeSyscallHandler<'state> { &mut self, p0: Secp256k1Point, p1: Secp256k1Point, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult { self.pre_execute_syscall( remaining_gas, @@ -759,7 +750,7 @@ impl<'state> StarknetSyscallHandler for &mut NativeSyscallHandler<'state> { &mut self, p: Secp256k1Point, m: U256, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult { self.pre_execute_syscall( remaining_gas, @@ -774,7 +765,7 @@ impl<'state> StarknetSyscallHandler for &mut NativeSyscallHandler<'state> { &mut self, x: U256, y_parity: bool, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult> { self.pre_execute_syscall( remaining_gas, @@ -788,7 +779,7 @@ impl<'state> StarknetSyscallHandler for &mut NativeSyscallHandler<'state> { fn secp256k1_get_xy( &mut self, p: Secp256k1Point, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult<(U256, U256)> { self.pre_execute_syscall( remaining_gas, @@ -803,7 +794,7 @@ impl<'state> StarknetSyscallHandler for &mut NativeSyscallHandler<'state> { &mut self, x: U256, y: U256, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult> { self.pre_execute_syscall( remaining_gas, @@ -818,7 +809,7 @@ impl<'state> StarknetSyscallHandler for &mut NativeSyscallHandler<'state> { &mut self, p0: Secp256r1Point, p1: Secp256r1Point, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult { self.pre_execute_syscall( remaining_gas, @@ -833,7 +824,7 @@ impl<'state> StarknetSyscallHandler for &mut NativeSyscallHandler<'state> { &mut self, p: Secp256r1Point, m: U256, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult { self.pre_execute_syscall( remaining_gas, @@ -848,7 +839,7 @@ impl<'state> StarknetSyscallHandler for &mut NativeSyscallHandler<'state> { &mut self, x: U256, y_parity: bool, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult> { self.pre_execute_syscall( remaining_gas, @@ -862,7 +853,7 @@ impl<'state> StarknetSyscallHandler for &mut NativeSyscallHandler<'state> { fn secp256r1_get_xy( &mut self, p: Secp256r1Point, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult<(U256, U256)> { self.pre_execute_syscall( remaining_gas, @@ -877,7 +868,7 @@ impl<'state> StarknetSyscallHandler for &mut NativeSyscallHandler<'state> { &mut self, prev_state: &mut [u32; 8], current_block: &[u32; 16], - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult<()> { self.pre_execute_syscall( remaining_gas, @@ -959,7 +950,7 @@ pub mod sierra_emu_impl { fn get_block_hash( &mut self, block_number: u64, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult { self.pre_execute_syscall( remaining_gas, @@ -1005,7 +996,7 @@ pub mod sierra_emu_impl { } } - fn get_execution_info(&mut self, remaining_gas: &mut u128) -> SyscallResult { + fn get_execution_info(&mut self, remaining_gas: &mut u64) -> SyscallResult { self.pre_execute_syscall( remaining_gas, SyscallSelector::GetExecutionInfo, @@ -1073,7 +1064,7 @@ pub mod sierra_emu_impl { fn get_execution_info_v2( &mut self, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult { self.pre_execute_syscall( remaining_gas, @@ -1171,7 +1162,7 @@ pub mod sierra_emu_impl { contract_address_salt: Felt, calldata: Vec, deploy_from_zero: bool, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult<(Felt, Vec)> { self.pre_execute_syscall( remaining_gas, @@ -1208,7 +1199,7 @@ pub mod sierra_emu_impl { // Warning: converting of reference would create a new reference to different data, // example: // let mut a: u128 = 1; - // let a_ref: &mut u128 = &mut a; + // let a_ref: &mut u64 = &mut a; // // let mut b: u64 = u64::try_from(*a_ref).unwrap(); // @@ -1220,7 +1211,7 @@ pub mod sierra_emu_impl { // assert_eq!(a, 1); // in this case we don't pass a reference, so everything is OK, but still can cause // conversion issues - u64::try_from(*remaining_gas).unwrap(), + *remaining_gas, ) .map_err(|error| encode_str_as_felts(&error.to_string()))?; @@ -1237,7 +1228,7 @@ pub mod sierra_emu_impl { fn replace_class( &mut self, class_hash: Felt, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult<()> { self.pre_execute_syscall( remaining_gas, @@ -1270,7 +1261,7 @@ pub mod sierra_emu_impl { class_hash: Felt, function_selector: Felt, calldata: Vec, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult> { self.pre_execute_syscall( remaining_gas, @@ -1292,7 +1283,7 @@ pub mod sierra_emu_impl { storage_address: self.contract_address, caller_address: self.caller_address, call_type: CallType::Delegate, - initial_gas: u64::try_from(*remaining_gas).unwrap(), + initial_gas: *remaining_gas, }; let retdata = self @@ -1307,7 +1298,7 @@ pub mod sierra_emu_impl { address: Felt, entry_point_selector: Felt, calldata: Vec, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult> { self.pre_execute_syscall( remaining_gas, @@ -1340,7 +1331,7 @@ pub mod sierra_emu_impl { storage_address: contract_address, caller_address: self.contract_address, call_type: CallType::Call, - initial_gas: u64::try_from(*remaining_gas).unwrap(), + initial_gas: *remaining_gas, }; let retdata = self @@ -1354,7 +1345,7 @@ pub mod sierra_emu_impl { &mut self, _address_domain: u32, address: Felt, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult { self.pre_execute_syscall( remaining_gas, @@ -1380,7 +1371,7 @@ pub mod sierra_emu_impl { _address_domain: u32, address: Felt, value: Felt, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult<()> { self.pre_execute_syscall( remaining_gas, @@ -1403,7 +1394,7 @@ pub mod sierra_emu_impl { &mut self, keys: Vec, data: Vec, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult<()> { self.pre_execute_syscall( remaining_gas, @@ -1434,7 +1425,7 @@ pub mod sierra_emu_impl { &mut self, to_address: Felt, payload: Vec, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult<()> { self.pre_execute_syscall( remaining_gas, @@ -1458,7 +1449,7 @@ pub mod sierra_emu_impl { Ok(()) } - fn keccak(&mut self, input: Vec, remaining_gas: &mut u128) -> SyscallResult { + fn keccak(&mut self, input: Vec, remaining_gas: &mut u64) -> SyscallResult { self.pre_execute_syscall( remaining_gas, SyscallSelector::Keccak, @@ -1478,9 +1469,7 @@ pub mod sierra_emu_impl { // TODO(Ori, 1/2/2024): Write an indicative expect message explaining why the conversion // works. let n_rounds_as_u64 = u64::try_from(n_rounds).expect("Failed to convert usize to u64."); - let gas_cost = u128::from( - n_rounds_as_u64 * self.execution_context.gas_costs().keccak_round_cost_gas_cost, - ); + let gas_cost = n_rounds_as_u64 * self.execution_context.gas_costs().keccak_round_cost_gas_cost; if gas_cost > *remaining_gas { // In VM this error is wrapped into `SyscallExecutionError::SyscallError` @@ -1511,7 +1500,7 @@ pub mod sierra_emu_impl { &mut self, x: U256, y: U256, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult> { self.pre_execute_syscall( remaining_gas, @@ -1526,7 +1515,7 @@ pub mod sierra_emu_impl { &mut self, p0: Secp256k1Point, p1: Secp256k1Point, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult { self.pre_execute_syscall( remaining_gas, @@ -1541,7 +1530,7 @@ pub mod sierra_emu_impl { &mut self, p: Secp256k1Point, m: U256, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult { self.pre_execute_syscall( remaining_gas, @@ -1556,7 +1545,7 @@ pub mod sierra_emu_impl { &mut self, x: U256, y_parity: bool, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult> { self.pre_execute_syscall( remaining_gas, @@ -1571,7 +1560,7 @@ pub mod sierra_emu_impl { fn secp256k1_get_xy( &mut self, p: Secp256k1Point, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult<(U256, U256)> { self.pre_execute_syscall( remaining_gas, @@ -1586,7 +1575,7 @@ pub mod sierra_emu_impl { &mut self, x: U256, y: U256, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult> { self.pre_execute_syscall( remaining_gas, @@ -1601,7 +1590,7 @@ pub mod sierra_emu_impl { &mut self, p0: Secp256r1Point, p1: Secp256r1Point, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult { self.pre_execute_syscall( remaining_gas, @@ -1616,7 +1605,7 @@ pub mod sierra_emu_impl { &mut self, p: Secp256r1Point, m: U256, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult { self.pre_execute_syscall( remaining_gas, @@ -1631,7 +1620,7 @@ pub mod sierra_emu_impl { &mut self, x: U256, y_parity: bool, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult> { self.pre_execute_syscall( remaining_gas, @@ -1646,7 +1635,7 @@ pub mod sierra_emu_impl { fn secp256r1_get_xy( &mut self, p: Secp256r1Point, - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult<(U256, U256)> { self.pre_execute_syscall( remaining_gas, @@ -1661,7 +1650,7 @@ pub mod sierra_emu_impl { &mut self, prev_state: [u32; 8], current_block: [u32; 16], - remaining_gas: &mut u128, + remaining_gas: &mut u64, ) -> SyscallResult<[u32; 8]> { const SHA256_STATE_SIZE: usize = 8; diff --git a/crates/blockifier/src/execution/native/utils.rs b/crates/blockifier/src/execution/native/utils.rs index ea76c4a80e..5afc6c10a9 100644 --- a/crates/blockifier/src/execution/native/utils.rs +++ b/crates/blockifier/src/execution/native/utils.rs @@ -55,7 +55,7 @@ pub fn run_native_executor( let execution_result = native_executor.run( selector, &call.calldata.0, - Some(call.initial_gas.into()), + Some(call.initial_gas), None, &mut syscall_handler, ); @@ -87,7 +87,7 @@ pub fn run_sierra_emu_executor( static COUNTER: AtomicUsize = AtomicUsize::new(0); let counter_value = COUNTER.fetch_add(1, std::sync::atomic::Ordering::Relaxed); - vm.call_contract(&function, call.initial_gas.into(), call.calldata.0.iter().cloned()); + vm.call_contract(&function, call.initial_gas, call.calldata.0.iter().cloned()); let mut trace = ProgramTrace::new(); @@ -130,14 +130,7 @@ fn create_callinfo( syscall_handler: NativeSyscallHandler<'_>, ) -> Result { let gas_consumed = { - let low: u64 = run_result.remaining_gas.try_into().unwrap(); - let high: u64 = (run_result.remaining_gas >> 64).try_into().unwrap(); - if high != 0 { - return Err(EntryPointExecutionError::NativeExecutionError { - info: "Overflow: gas consumed bigger than 64 bit".into(), - }); - } - call.initial_gas - low + call.initial_gas - run_result.remaining_gas }; Ok(CallInfo { @@ -170,14 +163,7 @@ pub fn create_callinfo_emu( accessed_storage_keys: HashSet, ) -> Result { let gas_consumed = { - let low: u64 = run_result.remaining_gas.try_into().unwrap(); - let high: u64 = (run_result.remaining_gas >> 64).try_into().unwrap(); - if high != 0 { - return Err(EntryPointExecutionError::NativeExecutionError { - info: "Overflow: gas consumed bigger than 64 bit".into(), - }); - } - call.initial_gas - low + call.initial_gas - run_result.remaining_gas }; Ok(CallInfo {