diff --git a/Cargo.lock b/Cargo.lock index fbcaf522..121a1818 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "Inflector" @@ -209,7 +209,7 @@ dependencies = [ "alloy-transport", "futures", "futures-util", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -316,7 +316,7 @@ dependencies = [ "alloy-sol-types", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "tracing", ] @@ -338,7 +338,7 @@ dependencies = [ "async-trait", "auto_impl", "futures-utils-wasm", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -366,7 +366,7 @@ dependencies = [ "rand 0.8.5", "serde_json", "tempfile", - "thiserror", + "thiserror 1.0.69", "tracing", "url", ] @@ -434,7 +434,7 @@ dependencies = [ "schnellru", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", "url", @@ -570,7 +570,7 @@ dependencies = [ "auto_impl", "elliptic-curve", "k256", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -586,7 +586,7 @@ dependencies = [ "async-trait", "k256", "rand 0.8.5", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -674,7 +674,7 @@ dependencies = [ "futures-utils-wasm", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "tokio", "tower 0.5.1", "tracing", @@ -1228,7 +1228,7 @@ dependencies = [ "nom", "num-traits", "rusticata-macros", - "thiserror", + "thiserror 1.0.69", "time", ] @@ -2008,7 +2008,7 @@ dependencies = [ "semver 1.0.23", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -3688,7 +3688,7 @@ dependencies = [ "serde", "serde_json", "sp-core 21.0.0", - "thiserror", + "thiserror 2.0.11", "tokio", ] @@ -4637,7 +4637,7 @@ dependencies = [ "hex", "parity-scale-codec", "subxt", - "thiserror", + "thiserror 1.0.69", "url", "wabt", ] @@ -5105,7 +5105,7 @@ dependencies = [ "parity-scale-codec", "sp-wasm-interface-common 15.0.0", "tempfile", - "thiserror", + "thiserror 1.0.69", "uluru", "wasmer", "wasmer-cache", @@ -5126,7 +5126,7 @@ dependencies = [ "sp-allocator", "sp-wasm-interface-common 7.0.0", "tempfile", - "thiserror", + "thiserror 1.0.69", "uluru", "wasmer", "wasmer-cache", @@ -5232,7 +5232,7 @@ dependencies = [ "pathdiff", "regex", "rustc_version 0.4.1", - "thiserror", + "thiserror 1.0.69", "toml 0.8.19", ] @@ -5254,7 +5254,7 @@ dependencies = [ "pathdiff", "regex", "rustc_version 0.4.1", - "thiserror", + "thiserror 1.0.69", "toml 0.8.19", ] @@ -5320,7 +5320,7 @@ dependencies = [ "gstd 1.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec", "scale-info", - "thiserror", + "thiserror 2.0.11", ] [[package]] @@ -5515,7 +5515,7 @@ dependencies = [ "log", "parity-scale-codec", "sp-wasm-interface-common 15.0.0", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -5633,7 +5633,7 @@ dependencies = [ "sp-core 22.0.0", "sp-runtime 25.0.0", "subxt", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -5810,7 +5810,7 @@ dependencies = [ "pest_derive", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -6729,7 +6729,7 @@ dependencies = [ "combine", "jni-sys", "log", - "thiserror", + "thiserror 1.0.69", "walkdir", ] @@ -6805,7 +6805,7 @@ dependencies = [ "pin-project", "rustls-native-certs 0.6.3", "soketto 0.7.1", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-rustls 0.24.1", "tokio-util", @@ -6826,7 +6826,7 @@ dependencies = [ "rustls-native-certs 0.7.3", "rustls-pki-types", "soketto 0.7.1", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-rustls 0.25.0", "tokio-util", @@ -6849,7 +6849,7 @@ dependencies = [ "rustls-pki-types", "rustls-platform-verifier", "soketto 0.8.0", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-rustls 0.26.0", "tokio-util", @@ -6875,7 +6875,7 @@ dependencies = [ "rustc-hash 1.1.0", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", ] @@ -6897,7 +6897,7 @@ dependencies = [ "rustc-hash 1.1.0", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-stream", "tracing", @@ -6919,7 +6919,7 @@ dependencies = [ "rustc-hash 1.1.0", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-stream", "tracing", @@ -6939,7 +6939,7 @@ dependencies = [ "rustc-hash 1.1.0", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", ] @@ -6957,7 +6957,7 @@ dependencies = [ "jsonrpsee-types 0.22.5", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "tokio", "tower 0.4.13", "tracing", @@ -6974,7 +6974,7 @@ dependencies = [ "beef", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "tracing", ] @@ -6988,7 +6988,7 @@ dependencies = [ "beef", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -7001,7 +7001,7 @@ dependencies = [ "http 1.1.0", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -7236,7 +7236,7 @@ dependencies = [ "rand 0.8.5", "rw-stream-sink", "smallvec", - "thiserror", + "thiserror 1.0.69", "unsigned-varint", "void", ] @@ -7273,7 +7273,7 @@ dependencies = [ "quick-protobuf", "quick-protobuf-codec", "smallvec", - "thiserror", + "thiserror 1.0.69", "void", ] @@ -7291,7 +7291,7 @@ dependencies = [ "quick-protobuf", "rand 0.8.5", "sha2 0.10.8", - "thiserror", + "thiserror 1.0.69", "zeroize", ] @@ -7317,7 +7317,7 @@ dependencies = [ "rand 0.8.5", "sha2 0.10.8", "smallvec", - "thiserror", + "thiserror 1.0.69", "uint 0.9.5", "unsigned-varint", "void", @@ -7376,7 +7376,7 @@ dependencies = [ "sha2 0.10.8", "snow", "static_assertions", - "thiserror", + "thiserror 1.0.69", "x25519-dalek 1.1.1", "zeroize", ] @@ -7416,7 +7416,7 @@ dependencies = [ "quinn-proto", "rand 0.8.5", "rustls 0.20.9", - "thiserror", + "thiserror 1.0.69", "tokio", ] @@ -7497,7 +7497,7 @@ dependencies = [ "rcgen", "ring 0.16.20", "rustls 0.20.9", - "thiserror", + "thiserror 1.0.69", "webpki", "x509-parser", "yasna", @@ -7545,7 +7545,7 @@ dependencies = [ "futures", "libp2p-core", "log", - "thiserror", + "thiserror 1.0.69", "yamux", ] @@ -8239,7 +8239,7 @@ dependencies = [ "anyhow", "byteorder", "paste", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -8253,7 +8253,7 @@ dependencies = [ "log", "netlink-packet-core", "netlink-sys", - "thiserror", + "thiserror 1.0.69", "tokio", ] @@ -9126,7 +9126,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "879952a81a83930934cbf1786752d6dedc3b1f29e8f8fb2ad1d0a36f377cf442" dependencies = [ "memchr", - "thiserror", + "thiserror 1.0.69", "ucd-trie", ] @@ -9596,7 +9596,7 @@ version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" dependencies = [ - "thiserror", + "thiserror 1.0.69", "toml 0.5.11", ] @@ -9697,7 +9697,7 @@ dependencies = [ "lazy_static", "memchr", "parking_lot 0.12.3", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -9884,7 +9884,7 @@ dependencies = [ "asynchronous-codec", "bytes", "quick-protobuf", - "thiserror", + "thiserror 1.0.69", "unsigned-varint", ] @@ -9911,7 +9911,7 @@ dependencies = [ "rustc-hash 1.1.0", "rustls 0.20.9", "slab", - "thiserror", + "thiserror 1.0.69", "tinyvec", "tracing", "webpki", @@ -10062,7 +10062,7 @@ dependencies = [ "futures", "jsonrpsee 0.23.2", "serde_json", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", ] @@ -10093,7 +10093,7 @@ checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom 0.2.15", "libredox", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -10250,7 +10250,7 @@ dependencies = [ "serde_json", "sled", "sp-core 21.0.0", - "thiserror", + "thiserror 2.0.11", "tokio", "utils-prometheus", "vft-manager-client", @@ -10479,7 +10479,7 @@ dependencies = [ "netlink-proto", "netlink-sys", "nix", - "thiserror", + "thiserror 1.0.69", "tokio", ] @@ -10821,7 +10821,7 @@ dependencies = [ "scale-info", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -10833,7 +10833,7 @@ dependencies = [ "lalrpop", "lalrpop-util", "logos", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -10992,7 +10992,7 @@ dependencies = [ "sp-runtime 24.0.0", "sp-state-machine 0.28.0", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -11034,7 +11034,7 @@ dependencies = [ "sp-keystore 0.27.0", "sp-runtime 24.0.0", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -11068,7 +11068,7 @@ dependencies = [ "sp-allocator", "sp-maybe-compressed-blob", "sp-wasm-interface 14.0.0", - "thiserror", + "thiserror 1.0.69", "wasm-instrument", ] @@ -11125,7 +11125,7 @@ dependencies = [ "sp-core 21.0.0", "sp-runtime 24.0.0", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.69", "unsigned-varint", "wasm-timer", "zeroize", @@ -11198,7 +11198,7 @@ dependencies = [ "sp-core 21.0.0", "sp-runtime 24.0.0", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-stream", ] @@ -11218,7 +11218,7 @@ dependencies = [ "sc-utils", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "wasm-timer", ] @@ -11235,7 +11235,7 @@ dependencies = [ "sp-blockchain", "sp-core 21.0.0", "sp-runtime 24.0.0", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -11366,7 +11366,7 @@ dependencies = [ "quote", "scale-info", "syn 2.0.89", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -12032,7 +12032,7 @@ dependencies = [ "log", "parity-scale-codec", "sp-wasm-interface-common 7.0.0", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -12053,7 +12053,7 @@ dependencies = [ "sp-std 8.0.0 (git+https://github.com/gear-tech/polkadot-sdk.git?branch=gear-v1.4.0)", "sp-trie 22.0.0", "sp-version 22.0.0", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -12075,7 +12075,7 @@ dependencies = [ "sp-std 9.0.0", "sp-trie 23.0.0", "sp-version 23.0.0", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -12207,7 +12207,7 @@ dependencies = [ "sp-database", "sp-runtime 24.0.0", "sp-state-machine 0.28.0", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -12222,7 +12222,7 @@ dependencies = [ "sp-inherents 4.0.0-dev", "sp-runtime 24.0.0", "sp-state-machine 0.28.0", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -12317,7 +12317,7 @@ dependencies = [ "sp-storage 13.0.0", "ss58-registry", "substrate-bip39", - "thiserror", + "thiserror 1.0.69", "tracing", "w3f-bls", "zeroize", @@ -12363,7 +12363,7 @@ dependencies = [ "sp-storage 14.0.0", "ss58-registry", "substrate-bip39", - "thiserror", + "thiserror 1.0.69", "tiny-bip39", "tracing", "zeroize", @@ -12567,7 +12567,7 @@ dependencies = [ "scale-info", "sp-runtime 24.0.0", "sp-std 8.0.0 (git+https://github.com/gear-tech/polkadot-sdk.git?branch=gear-v1.4.0)", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -12582,7 +12582,7 @@ dependencies = [ "scale-info", "sp-runtime 25.0.0", "sp-std 9.0.0", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -12644,7 +12644,7 @@ dependencies = [ "parking_lot 0.12.3", "sp-core 21.0.0", "sp-externalities 0.19.0", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -12657,7 +12657,7 @@ dependencies = [ "parking_lot 0.12.3", "sp-core 22.0.0", "sp-externalities 0.20.0", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -12665,7 +12665,7 @@ name = "sp-maybe-compressed-blob" version = "4.1.0-dev" source = "git+https://github.com/gear-tech/polkadot-sdk.git?branch=gear-v1.4.0#09bdd2a6953d057ae360ec3ef6ec735f9306cc04" dependencies = [ - "thiserror", + "thiserror 1.0.69", "zstd 0.12.4", ] @@ -12926,7 +12926,7 @@ dependencies = [ "sp-panic-handler 8.0.0", "sp-std 8.0.0 (git+https://github.com/gear-tech/polkadot-sdk.git?branch=gear-v1.4.0)", "sp-trie 22.0.0", - "thiserror", + "thiserror 1.0.69", "tracing", "trie-db 0.28.0", ] @@ -12948,7 +12948,7 @@ dependencies = [ "sp-panic-handler 9.0.0", "sp-std 9.0.0", "sp-trie 23.0.0", - "thiserror", + "thiserror 1.0.69", "tracing", "trie-db 0.27.1", ] @@ -12973,7 +12973,7 @@ dependencies = [ "sp-runtime 24.0.0", "sp-runtime-interface 17.0.0", "sp-std 8.0.0 (git+https://github.com/gear-tech/polkadot-sdk.git?branch=gear-v1.4.0)", - "thiserror", + "thiserror 1.0.69", "x25519-dalek 2.0.1", ] @@ -13048,7 +13048,7 @@ dependencies = [ "sp-inherents 4.0.0-dev", "sp-runtime 24.0.0", "sp-std 8.0.0 (git+https://github.com/gear-tech/polkadot-sdk.git?branch=gear-v1.4.0)", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -13118,7 +13118,7 @@ dependencies = [ "schnellru", "sp-core 21.0.0", "sp-std 8.0.0 (git+https://github.com/gear-tech/polkadot-sdk.git?branch=gear-v1.4.0)", - "thiserror", + "thiserror 1.0.69", "tracing", "trie-db 0.28.0", "trie-root", @@ -13142,7 +13142,7 @@ dependencies = [ "schnellru", "sp-core 22.0.0", "sp-std 9.0.0", - "thiserror", + "thiserror 1.0.69", "tracing", "trie-db 0.27.1", "trie-root", @@ -13162,7 +13162,7 @@ dependencies = [ "sp-runtime 24.0.0", "sp-std 8.0.0 (git+https://github.com/gear-tech/polkadot-sdk.git?branch=gear-v1.4.0)", "sp-version-proc-macro 8.0.0", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -13180,7 +13180,7 @@ dependencies = [ "sp-runtime 25.0.0", "sp-std 9.0.0", "sp-version-proc-macro 9.0.0", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -13421,7 +13421,7 @@ dependencies = [ "hyper 0.14.31", "log", "prometheus", - "thiserror", + "thiserror 1.0.69", "tokio", ] @@ -13461,7 +13461,7 @@ dependencies = [ "subxt-lightclient", "subxt-macro", "subxt-metadata", - "thiserror", + "thiserror 1.0.69", "tokio-util", "tracing", "url", @@ -13484,7 +13484,7 @@ dependencies = [ "scale-typegen", "subxt-metadata", "syn 2.0.89", - "thiserror", + "thiserror 1.0.69", "tokio", ] @@ -13526,7 +13526,7 @@ dependencies = [ "serde", "serde_json", "smoldot-light", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-stream", "tracing", @@ -13741,7 +13741,16 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" +dependencies = [ + "thiserror-impl 2.0.11", ] [[package]] @@ -13755,6 +13764,17 @@ dependencies = [ "syn 2.0.89", ] +[[package]] +name = "thiserror-impl" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + [[package]] name = "thiserror-impl-no-std" version = "2.0.2" @@ -13838,7 +13858,7 @@ dependencies = [ "rand 0.8.5", "rustc-hash 1.1.0", "sha2 0.10.8", - "thiserror", + "thiserror 1.0.69", "unicode-normalization", "wasm-bindgen", "zeroize", @@ -14254,7 +14274,7 @@ dependencies = [ "rand 0.8.5", "smallvec", "socket2 0.4.10", - "thiserror", + "thiserror 1.0.69", "tinyvec", "tokio", "tracing", @@ -14275,7 +14295,7 @@ dependencies = [ "parking_lot 0.12.3", "resolv-conf", "smallvec", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", "trust-dns-proto", @@ -14614,7 +14634,7 @@ dependencies = [ "rand_core 0.6.4", "sha2 0.10.8", "sha3", - "thiserror", + "thiserror 1.0.69", "zeroize", ] @@ -14804,7 +14824,7 @@ dependencies = [ "serde-wasm-bindgen", "shared-buffer", "target-lexicon", - "thiserror", + "thiserror 1.0.69", "tracing", "wasm-bindgen", "wasmer-compiler", @@ -14825,7 +14845,7 @@ checksum = "4e2aa507d7ab1d7f6038f60ca107bc4629c5dbf3a0e18427091b7576b0ffbbd9" dependencies = [ "blake3", "hex", - "thiserror", + "thiserror 1.0.69", "wasmer", ] @@ -14850,7 +14870,7 @@ dependencies = [ "self_cell", "shared-buffer", "smallvec", - "thiserror", + "thiserror 1.0.69", "wasmer-types", "wasmer-vm", "wasmparser 0.121.2", @@ -14924,7 +14944,7 @@ dependencies = [ "rkyv", "sha2 0.10.8", "target-lexicon", - "thiserror", + "thiserror 1.0.69", "xxhash-rust", ] @@ -14951,7 +14971,7 @@ dependencies = [ "more-asserts", "region", "scopeguard", - "thiserror", + "thiserror 1.0.69", "wasmer-types", "windows-sys 0.59.0", ] @@ -15184,7 +15204,7 @@ dependencies = [ "log", "object 0.30.4", "target-lexicon", - "thiserror", + "thiserror 1.0.69", "wasmparser 0.102.0", "wasmtime-cranelift-shared", "wasmtime-environ", @@ -15219,7 +15239,7 @@ dependencies = [ "object 0.30.4", "serde", "target-lexicon", - "thiserror", + "thiserror 1.0.69", "wasmparser 0.102.0", "wasmtime-types", ] @@ -15302,7 +15322,7 @@ checksum = "a4f6fffd2a1011887d57f07654dd112791e872e3ff4a2e626aee8059ee17f06f" dependencies = [ "cranelift-entity 0.95.1", "serde", - "thiserror", + "thiserror 1.0.69", "wasmparser 0.102.0", ] @@ -15891,7 +15911,7 @@ dependencies = [ "nom", "oid-registry", "rusticata-macros", - "thiserror", + "thiserror 1.0.69", "time", ] diff --git a/Cargo.toml b/Cargo.toml index 9a0e2d7f..5c20e8ec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -56,7 +56,7 @@ bridging-payment-client = { path = "gear-programs/bridging-payment/client" } vft-manager = { path = "gear-programs/vft-manager" } vft-manager-app = { path = "gear-programs/vft-manager/app" } vft-manager-client = { path = "gear-programs/vft-manager/client" } -gear_proof_storage = { path = "gear-programs/proof-storage" } +gear_proof_storage = { path = "gear-programs/proof-storage", default-features = false } checkpoint_light_client-io = { path = "gear-programs/checkpoint-light-client/io", default-features = false } utils-prometheus = { path = "utils-prometheus" } checkpoint_light_client = { path = "gear-programs/checkpoint-light-client", default-features = false } @@ -152,7 +152,7 @@ serde_json = "1.0" sha2 = "0.10" sled = "0.34.7" static_assertions = "1.1.0" -thiserror = "1.0.61" +thiserror = { version = "2.0.11", default-features = false } tiny-keccak = { version = "2.0.2", features = ["keccak"] } tokio = { version = "1.23.0", features = ["full"] } tree_hash = { git = "https://github.com/gear-tech/tree_hash.git", branch = "gear-v0.6.0", default-features = false } @@ -162,7 +162,6 @@ unroll = "0.1.5" # Gear/Substrate deps gstd = { version = "1.6.2", features = ["nightly"] } gtest = "1.6.2" -gwasm-builder = { version = "1.6.2", package = "gear-wasm-builder" } gmeta = "1.6.2" gear-wasm-builder = { version = "1.6.2", default-features = false } gsdk = "1.6.2" diff --git a/circuits/plonky2_ecdsa/src/curve/curve_msm.rs b/circuits/plonky2_ecdsa/src/curve/curve_msm.rs index 14c65236..3f2be581 100644 --- a/circuits/plonky2_ecdsa/src/curve/curve_msm.rs +++ b/circuits/plonky2_ecdsa/src/curve/curve_msm.rs @@ -41,7 +41,7 @@ pub fn msm_precompute( } fn precompute_single_generator(g: ProjectivePoint, w: usize) -> Vec> { - let digits = (C::ScalarField::BITS + w - 1) / w; + let digits = C::ScalarField::BITS.div_ceil(w); let mut powers: Vec> = Vec::with_capacity(digits); powers.push(g); for i in 1..digits { @@ -69,7 +69,7 @@ pub fn msm_execute( ) -> ProjectivePoint { assert_eq!(precomputation.powers_per_generator.len(), scalars.len()); let w = precomputation.w; - let digits = (C::ScalarField::BITS + w - 1) / w; + let digits = C::ScalarField::BITS.div_ceil(w); let base = 1 << w; // This is a variant of Yao's method, adapted to the multi-scalar setting. Because we use @@ -108,7 +108,7 @@ pub fn msm_execute_parallel( ) -> ProjectivePoint { assert_eq!(precomputation.powers_per_generator.len(), scalars.len()); let w = precomputation.w; - let digits = (C::ScalarField::BITS + w - 1) / w; + let digits = C::ScalarField::BITS.div_ceil(w); let base = 1 << w; // This is a variant of Yao's method, adapted to the multi-scalar setting. Because we use @@ -159,7 +159,7 @@ pub fn msm_execute_parallel( pub(crate) fn to_digits(x: &C::ScalarField, w: usize) -> Vec { let scalar_bits = C::ScalarField::BITS; - let num_digits = (scalar_bits + w - 1) / w; + let num_digits = scalar_bits.div_ceil(w); // Convert x to a bool array. let x_canonical: Vec<_> = x @@ -171,7 +171,7 @@ pub(crate) fn to_digits(x: &C::ScalarField, w: usize) -> Vec { .collect(); let mut x_bits = Vec::with_capacity(scalar_bits); for i in 0..scalar_bits { - x_bits.push((x_canonical[i / 64] >> (i as u64 % 64) & 1) != 0); + x_bits.push(((x_canonical[i / 64] >> (i as u64 % 64)) & 1) != 0); } let mut digits = Vec::with_capacity(num_digits); diff --git a/circuits/plonky2_ecdsa/src/curve/curve_multiplication.rs b/circuits/plonky2_ecdsa/src/curve/curve_multiplication.rs index 8834fb10..c3106066 100644 --- a/circuits/plonky2_ecdsa/src/curve/curve_multiplication.rs +++ b/circuits/plonky2_ecdsa/src/curve/curve_multiplication.rs @@ -10,7 +10,7 @@ const WINDOW_BITS: usize = 4; const BASE: usize = 1 << WINDOW_BITS; fn digits_per_scalar() -> usize { - (C::ScalarField::BITS + WINDOW_BITS - 1) / WINDOW_BITS + C::ScalarField::BITS.div_ceil(WINDOW_BITS) } /// Precomputed state used for scalar x ProjectivePoint multiplications, diff --git a/circuits/plonky2_ecdsa/src/curve/secp256k1.rs b/circuits/plonky2_ecdsa/src/curve/secp256k1.rs index 0b899a71..73efce7c 100644 --- a/circuits/plonky2_ecdsa/src/curve/secp256k1.rs +++ b/circuits/plonky2_ecdsa/src/curve/secp256k1.rs @@ -89,7 +89,7 @@ mod tests { let mut sum = ProjectivePoint::ZERO; for limb in lhs.to_canonical_biguint().to_u64_digits().iter() { for j in 0..64 { - if (limb >> j & 1u64) != 0u64 { + if ((limb >> j) & 1u64) != 0u64 { sum = sum + g; } g = g.double(); diff --git a/circuits/plonky2_ed25519/src/curve/curve_multiplication.rs b/circuits/plonky2_ed25519/src/curve/curve_multiplication.rs index 70e49df6..67004d24 100644 --- a/circuits/plonky2_ed25519/src/curve/curve_multiplication.rs +++ b/circuits/plonky2_ed25519/src/curve/curve_multiplication.rs @@ -9,7 +9,7 @@ const WINDOW_BITS: usize = 4; const BASE: usize = 1 << WINDOW_BITS; fn digits_per_scalar() -> usize { - (C::ScalarField::BITS + WINDOW_BITS - 1) / WINDOW_BITS + C::ScalarField::BITS.div_ceil(WINDOW_BITS) } /// Precomputed state used for scalar x ProjectivePoint multiplications, diff --git a/circuits/plonky2_ed25519/src/curve/ed25519.rs b/circuits/plonky2_ed25519/src/curve/ed25519.rs index d6ed8d44..cfdffff7 100644 --- a/circuits/plonky2_ed25519/src/curve/ed25519.rs +++ b/circuits/plonky2_ed25519/src/curve/ed25519.rs @@ -59,7 +59,7 @@ pub(crate) fn mul_naive( let mut sum = ProjectivePoint::ZERO; for limb in lhs.to_canonical_biguint().to_u64_digits().iter() { for j in 0..64 { - if (limb >> j & 1u64) != 0u64 { + if ((limb >> j) & 1u64) != 0u64 { sum = sum + g; } g = g.double(); diff --git a/ethereum-common/src/base_types/bits.rs b/ethereum-common/src/base_types/bits.rs index 2eb393b7..d4e9a325 100644 --- a/ethereum-common/src/base_types/bits.rs +++ b/ethereum-common/src/base_types/bits.rs @@ -10,7 +10,7 @@ const BITS_PER_BYTE: usize = 8; /// /// `bit_len == 0` requires a single byte. fn bytes_for_bit_len(bit_len: usize) -> usize { - core::cmp::max(1, (bit_len + BITS_PER_BYTE - 1) / BITS_PER_BYTE) + core::cmp::max(1, bit_len.div_ceil(BITS_PER_BYTE)) } type Inner = BitVec; diff --git a/ethereum-common/src/utils.rs b/ethereum-common/src/utils.rs index 5695a3bb..a87ed5c4 100644 --- a/ethereum-common/src/utils.rs +++ b/ethereum-common/src/utils.rs @@ -198,9 +198,7 @@ where match T::tree_hash_type() { TreeHashType::Basic => { - let mut hasher = MerkleHasher::with_leaves( - (N + T::tree_hash_packing_factor() - 1) / T::tree_hash_packing_factor(), - ); + let mut hasher = MerkleHasher::with_leaves(N.div_ceil(T::tree_hash_packing_factor())); for item in vec { hasher @@ -235,7 +233,7 @@ pub fn bitfield_bytes_tree_hash_root(bytes: &[u8]) -> Hash256 { use tree_hash::{MerkleHasher, BYTES_PER_CHUNK}; let byte_size = (N + 7) / 8; - let leaf_count = (byte_size + BYTES_PER_CHUNK - 1) / BYTES_PER_CHUNK; + let leaf_count = byte_size.div_ceil(BYTES_PER_CHUNK); let mut hasher = MerkleHasher::with_leaves(leaf_count); diff --git a/ethereum/client/Cargo.toml b/ethereum/client/Cargo.toml index 4138bede..1f8a9f2a 100644 --- a/ethereum/client/Cargo.toml +++ b/ethereum/client/Cargo.toml @@ -12,7 +12,7 @@ primitive-types.workspace = true reqwest.workspace = true binary-merkle-tree.workspace = true ahash.workspace = true -thiserror.workspace = true +thiserror = { workspace = true, features = ["std"] } keccak-hash.workspace = true sp-core = { workspace = true, features = ["std"] } alloy.workspace = true diff --git a/gear-programs/bridging-payment/app/src/services/mod.rs b/gear-programs/bridging-payment/app/src/services/mod.rs index 505a6dfd..5d0d7904 100644 --- a/gear-programs/bridging-payment/app/src/services/mod.rs +++ b/gear-programs/bridging-payment/app/src/services/mod.rs @@ -95,35 +95,23 @@ where } fn state(&self) -> &State { - unsafe { - STATE - .as_ref() - .expect("BridgingPayment::seed() should be called") - } + #[allow(clippy::deref_addrof)] + unsafe { (*&raw const STATE).as_ref() }.expect("BridgingPayment::seed() should be called") } fn state_mut(&mut self) -> &mut State { - unsafe { - STATE - .as_mut() - .expect("BridgingPayment::seed() should be called") - } + #[allow(clippy::deref_addrof)] + unsafe { (*&raw mut STATE).as_mut() }.expect("BridgingPayment::seed() should be called") } fn config(&self) -> &Config { - unsafe { - CONFIG - .as_ref() - .expect("BridgingPayment::seed() should be called") - } + #[allow(clippy::deref_addrof)] + unsafe { (*&raw const CONFIG).as_ref() }.expect("BridgingPayment::seed() should be called") } fn config_mut(&mut self) -> &mut Config { - unsafe { - CONFIG - .as_mut() - .expect("BridgingPayment::seed() should be called") - } + #[allow(clippy::deref_addrof)] + unsafe { (*&raw mut CONFIG).as_mut() }.expect("BridgingPayment::seed() should be called") } } diff --git a/gear-programs/bridging-payment/app/tests/gclient.rs b/gear-programs/bridging-payment/app/tests/gclient.rs index 079d94b5..26d5c846 100644 --- a/gear-programs/bridging-payment/app/tests/gclient.rs +++ b/gear-programs/bridging-payment/app/tests/gclient.rs @@ -1,3 +1,7 @@ +// Clippy warns about some imports below so disable the check. +// Remove the directive once the clippy happy. +#![allow(clippy::literal_string_with_formatting_args)] + use anyhow::anyhow; use bridging_payment::WASM_BINARY as WASM_BRIDGING_PAYMENT; use bridging_payment_client::traits::*; diff --git a/gear-programs/proof-storage/Cargo.toml b/gear-programs/proof-storage/Cargo.toml index ade9cf18..b8c55e85 100644 --- a/gear-programs/proof-storage/Cargo.toml +++ b/gear-programs/proof-storage/Cargo.toml @@ -12,10 +12,6 @@ thiserror.workspace = true [build-dependencies] gear-wasm-builder.workspace = true -[lib] -crate-type = ["rlib"] -name = "gear_proof_storage" - [features] -std = [] +std = ["thiserror/std", "parity-scale-codec/std", "scale-info/std"] default = ["std"] diff --git a/gear-programs/proof-storage/src/lib.rs b/gear-programs/proof-storage/src/lib.rs index e28633ef..becdcc34 100644 --- a/gear-programs/proof-storage/src/lib.rs +++ b/gear-programs/proof-storage/src/lib.rs @@ -15,15 +15,11 @@ pub use code::WASM_BINARY_OPT as WASM_BINARY; #[cfg(not(feature = "std"))] mod wasm; -#[cfg_attr(feature = "std", derive(thiserror::Error))] -#[derive(Debug, Decode, Encode, TypeInfo)] +#[derive(Debug, Decode, Encode, TypeInfo, thiserror::Error)] pub enum Error { - #[cfg_attr(feature = "std", error("Authority set id is not sequential"))] + #[error("Authority set id is not sequential")] AuthoritySetIdNotSequential, - #[cfg_attr( - feature = "std", - error("Two or more proofs submitted at the same block") - )] + #[error("Two or more proofs submitted at the same block")] ManyProofsSubmittedInSameBlock, } diff --git a/gear-programs/vft-manager/app/src/services/mod.rs b/gear-programs/vft-manager/app/src/services/mod.rs index 41c61996..051575c6 100644 --- a/gear-programs/vft-manager/app/src/services/mod.rs +++ b/gear-programs/vft-manager/app/src/services/mod.rs @@ -395,20 +395,19 @@ where /// Get a reference to the global [State]. fn state(&self) -> &State { - unsafe { STATE.as_ref().expect("VftManager::seed() should be called") } + #[allow(clippy::deref_addrof)] + unsafe { (*&raw const STATE).as_ref() }.expect("VftManager::seed() should be called") } /// Get a mutable reference to the global [State]. fn state_mut(&mut self) -> &mut State { - unsafe { STATE.as_mut().expect("VftManager::seed() should be called") } + #[allow(clippy::deref_addrof)] + unsafe { (*&raw mut STATE).as_mut() }.expect("VftManager::seed() should be called") } /// Get a reference to the global [Config]. fn config(&self) -> &Config { - unsafe { - CONFIG - .as_ref() - .expect("VftManager::seed() should be called") - } + #[allow(clippy::deref_addrof)] + unsafe { (*&raw const CONFIG).as_ref() }.expect("VftManager::seed() should be called") } } diff --git a/gear-programs/vft-manager/app/src/services/request_bridging/msg_tracker.rs b/gear-programs/vft-manager/app/src/services/request_bridging/msg_tracker.rs index c344789a..6722707f 100644 --- a/gear-programs/vft-manager/app/src/services/request_bridging/msg_tracker.rs +++ b/gear-programs/vft-manager/app/src/services/request_bridging/msg_tracker.rs @@ -63,24 +63,13 @@ pub fn init() { /// Fetch state of this message tracker. pub fn msg_tracker_state() -> Vec<(MessageId, MessageInfo)> { - unsafe { - MSG_TRACKER - .as_mut() - .expect("VftManager::seed() should be called") - } - .message_info - .clone() - .into_iter() - .collect() + msg_tracker_mut().message_info.clone().into_iter().collect() } /// Get mutable reference to a global message tracker. pub fn msg_tracker_mut() -> &'static mut MessageTracker { - unsafe { - MSG_TRACKER - .as_mut() - .expect("VftManager::seed() should be called") - } + #[allow(clippy::deref_addrof)] + unsafe { (*&raw mut MSG_TRACKER).as_mut() }.expect("VftManager::seed() should be called") } impl MessageTracker { diff --git a/gear-programs/vft-manager/app/src/services/submit_receipt/mod.rs b/gear-programs/vft-manager/app/src/services/submit_receipt/mod.rs index fd845b8e..0597e45b 100644 --- a/gear-programs/vft-manager/app/src/services/submit_receipt/mod.rs +++ b/gear-programs/vft-manager/app/src/services/submit_receipt/mod.rs @@ -21,11 +21,8 @@ const TX_HISTORY_DEPTH: usize = 500_000; /// Get mutable reference to a transactions storage. fn transactions_mut() -> &'static mut BTreeSet<(u64, u64)> { - unsafe { - TRANSACTIONS - .as_mut() - .expect("Program should be constructed") - } + #[allow(clippy::deref_addrof)] + unsafe { (*&raw mut TRANSACTIONS).as_mut() }.expect("Program should be constructed") } /// Initialize state that's used by this VFT Manager method. diff --git a/gear-programs/vft-manager/app/src/services/submit_receipt/msg_tracker.rs b/gear-programs/vft-manager/app/src/services/submit_receipt/msg_tracker.rs index 07eb6550..4ad7ae42 100644 --- a/gear-programs/vft-manager/app/src/services/submit_receipt/msg_tracker.rs +++ b/gear-programs/vft-manager/app/src/services/submit_receipt/msg_tracker.rs @@ -51,24 +51,13 @@ pub fn init() { /// Fetch state of this message tracker. pub fn msg_tracker_state() -> Vec<(MessageId, MessageInfo)> { - unsafe { - MSG_TRACKER - .as_mut() - .expect("VftManager::seed() should be called") - } - .message_info - .clone() - .into_iter() - .collect() + msg_tracker_mut().message_info.clone().into_iter().collect() } /// Get mutable reference to a global message tracker. pub fn msg_tracker_mut() -> &'static mut MessageTracker { - unsafe { - MSG_TRACKER - .as_mut() - .expect("VftManager::seed() should be called") - } + #[allow(clippy::deref_addrof)] + unsafe { (*&raw mut MSG_TRACKER).as_mut() }.expect("VftManager::seed() should be called") } impl MessageTracker { @@ -94,9 +83,4 @@ impl MessageTracker { pub fn get_message_info(&self, msg_id: &MessageId) -> Option<&MessageInfo> { self.message_info.get(msg_id) } - - /// Stop tracking message state. It will return current state of the target message. - pub fn remove_message_info(&mut self, msg_id: &MessageId) -> Option { - self.message_info.remove(msg_id) - } } diff --git a/gear-programs/vft-service/src/lib.rs b/gear-programs/vft-service/src/lib.rs index 738436bb..5b4ef08d 100644 --- a/gear-programs/vft-service/src/lib.rs +++ b/gear-programs/vft-service/src/lib.rs @@ -19,18 +19,21 @@ pub struct Storage { impl Storage { pub fn get_mut() -> &'static mut Self { - unsafe { STORAGE.as_mut().expect("Storage is not initialized") } + #[allow(clippy::deref_addrof)] + unsafe { (*&raw mut STORAGE).as_mut() }.expect("Storage is not initialized") } + pub fn get() -> &'static Self { - unsafe { STORAGE.as_ref().expect("Storage is not initialized") } + #[allow(clippy::deref_addrof)] + unsafe { (*&raw const STORAGE).as_ref() }.expect("Storage is not initialized") } + pub fn balances() -> &'static mut HashMap { - let storage = unsafe { STORAGE.as_mut().expect("Storage is not initialized") }; - &mut storage.balances + &mut Self::get_mut().balances } + pub fn total_supply() -> &'static mut U256 { - let storage = unsafe { STORAGE.as_mut().expect("Storage is not initialized") }; - &mut storage.total_supply + &mut Self::get_mut().total_supply } } diff --git a/prover/src/common/poseidon_bn128/config.rs b/prover/src/common/poseidon_bn128/config.rs index 52c68064..bc768883 100644 --- a/prover/src/common/poseidon_bn128/config.rs +++ b/prover/src/common/poseidon_bn128/config.rs @@ -88,7 +88,7 @@ impl<'de, F: RichField> Deserialize<'de> for PoseidonBN128HashOut { { struct PoseidonBN128HashOutVisitor; - impl<'a> serde::de::Visitor<'a> for PoseidonBN128HashOutVisitor { + impl serde::de::Visitor<'_> for PoseidonBN128HashOutVisitor { type Value = String; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/relayer/Cargo.toml b/relayer/Cargo.toml index 3ed0f030..93add785 100644 --- a/relayer/Cargo.toml +++ b/relayer/Cargo.toml @@ -6,7 +6,7 @@ edition.workspace = true [dependencies] bridging-payment-client.workspace = true ethereum-client.workspace = true -gear_proof_storage.workspace = true +gear_proof_storage = { workspace = true, features = ["std"] } gear-rpc-client.workspace = true prover.workspace = true @@ -47,7 +47,7 @@ sails-rs = { workspace = true, features = ["gclient"] } serde.workspace = true serde_json.workspace = true sled.workspace = true -thiserror.workspace = true +thiserror = { workspace = true, features = ["std"] } tokio.workspace = true utils-prometheus.workspace = true diff --git a/relayer/src/ethereum_checkpoints/tests/mod.rs b/relayer/src/ethereum_checkpoints/tests/mod.rs index 224d5deb..443d0e57 100644 --- a/relayer/src/ethereum_checkpoints/tests/mod.rs +++ b/relayer/src/ethereum_checkpoints/tests/mod.rs @@ -216,7 +216,7 @@ async fn replay_back_and_updating() -> Result<()> { let headers: Vec = serde_json::from_slice(&headers[..]).unwrap(); // start to replay back - let size_batch = 40 * SLOTS_PER_EPOCH as usize; + let size_batch = 30 * SLOTS_PER_EPOCH as usize; let payload = Handle::ReplayBackStart { sync_update: utils::sync_update_from_finality( decode_signature(&finality_update.sync_aggregate), diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 0000bc6f..431f66cf 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,5 @@ [toolchain] -channel = "nightly-2024-07-30" +channel = "nightly-2025-01-09" +components = [ "rust-src" ] targets = ["wasm32-unknown-unknown"] profile = "default"