From c879592a483e74695a6edb8ab2321a54e3f8dc8f Mon Sep 17 00:00:00 2001 From: Danil Date: Thu, 27 Jun 2024 16:31:42 +0200 Subject: [PATCH 01/16] Use config from the main repo in zk_toolbox Signed-off-by: Danil --- core/lib/protobuf_config/src/lib.rs | 22 +- zk_toolbox/Cargo.lock | 2036 +++++++++++++++++++++-- zk_toolbox/Cargo.toml | 5 + zk_toolbox/crates/config/Cargo.toml | 4 + zk_toolbox/crates/config/src/chain.rs | 7 +- zk_toolbox/crates/config/src/general.rs | 190 +-- zk_toolbox/crates/config/src/lib.rs | 1 + zk_toolbox/crates/config/src/traits.rs | 33 +- 8 files changed, 2028 insertions(+), 270 deletions(-) diff --git a/core/lib/protobuf_config/src/lib.rs b/core/lib/protobuf_config/src/lib.rs index 14e4f5455f5f..f7eb19f0d60c 100644 --- a/core/lib/protobuf_config/src/lib.rs +++ b/core/lib/protobuf_config/src/lib.rs @@ -35,9 +35,10 @@ mod utils; mod vm_runner; mod wallets; -use std::str::FromStr; +use std::{path::PathBuf, str::FromStr}; -use zksync_protobuf::ProtoRepr; +use anyhow::Context; +use zksync_protobuf::{serde::serialize_proto, ProtoRepr}; use zksync_types::{H160, H256}; fn parse_h256(bytes: &str) -> anyhow::Result { @@ -51,3 +52,20 @@ fn parse_h160(bytes: &str) -> anyhow::Result { pub fn read_optional_repr(field: &Option

) -> anyhow::Result> { field.as_ref().map(|x| x.read()).transpose() } + +pub fn decode_yaml_repr( + path: &PathBuf, + deny_unknown_fields: bool, +) -> anyhow::Result { + let yaml = std::fs::read_to_string(path).with_context(|| path.display().to_string())?; + let d = serde_yaml::Deserializer::from_str(&yaml); + let this: T = zksync_protobuf::serde::deserialize_proto_with_options(d, deny_unknown_fields)?; + this.read() +} + +pub fn encode_yaml_repr(value: &T::Type) -> anyhow::Result> { + let mut buffer = vec![]; + let mut s = serde_yaml::Serializer::new(&mut buffer); + serialize_proto(&T::build(value), &mut s)?; + Ok(buffer) +} diff --git a/zk_toolbox/Cargo.lock b/zk_toolbox/Cargo.lock index 8af87cf021a0..6e8e7cc200ec 100644 --- a/zk_toolbox/Cargo.lock +++ b/zk_toolbox/Cargo.lock @@ -66,6 +66,21 @@ version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "anstream" version = "0.6.12" @@ -183,6 +198,51 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "axum" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" +dependencies = [ + "async-trait", + "axum-core", + "bitflags 1.3.2", + "bytes", + "futures-util", + "http", + "http-body", + "hyper", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "sync_wrapper", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http", + "http-body", + "mime", + "rustversion", + "tower-layer", + "tower-service", +] + [[package]] name = "backtrace" version = "0.3.69" @@ -198,6 +258,12 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "base16ct" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" + [[package]] name = "base16ct" version = "0.2.0" @@ -216,6 +282,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "base64ct" version = "1.6.0" @@ -228,6 +300,23 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" +[[package]] +name = "beef" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" + +[[package]] +name = "bigdecimal" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6773ddc0eafc0e509fb60e48dff7f450f8e674a0686ae8605e8d9901bd5eefa" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + [[package]] name = "bit-set" version = "0.5.3" @@ -270,6 +359,23 @@ dependencies = [ "wyz", ] +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest", +] + +[[package]] +name = "blake2" +version = "0.10.6" +source = "git+https://github.com/RustCrypto/hashes.git?rev=1f727ce37ff40fa0cce84eb8543a45bdd3ca4a4e#1f727ce37ff40fa0cce84eb8543a45bdd3ca4a4e" +dependencies = [ + "digest", +] + [[package]] name = "block-buffer" version = "0.10.4" @@ -285,7 +391,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" dependencies = [ - "sha2", + "sha2 0.10.8", "tinyvec", ] @@ -390,7 +496,13 @@ version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", "num-traits", + "serde", + "wasm-bindgen", + "windows-targets 0.52.3", ] [[package]] @@ -422,7 +534,7 @@ dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim", + "strsim 0.11.0", "terminal_size", ] @@ -432,7 +544,7 @@ version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "syn 2.0.51", @@ -467,9 +579,9 @@ dependencies = [ "coins-core", "digest", "hmac", - "k256", + "k256 0.13.1", "serde", - "sha2", + "sha2 0.10.8", "thiserror", ] @@ -485,7 +597,7 @@ dependencies = [ "once_cell", "pbkdf2 0.12.2", "rand", - "sha2", + "sha2 0.10.8", "thiserror", ] @@ -504,8 +616,8 @@ dependencies = [ "ripemd", "serde", "serde_derive", - "sha2", - "sha3", + "sha2 0.10.8", + "sha3 0.10.8", "thiserror", ] @@ -537,6 +649,12 @@ dependencies = [ "xshell", ] +[[package]] +name = "compile-fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bed69047ed42e52c7e38d6421eeb8ceefb4f2a2b52eed59137f7bad7908f6800" + [[package]] name = "config" version = "0.1.0" @@ -555,6 +673,9 @@ dependencies = [ "types", "url", "xshell", + "zksync_config", + "zksync_protobuf", + "zksync_protobuf_config", ] [[package]] @@ -644,6 +765,15 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "crossbeam-channel" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-deque" version = "0.8.5" @@ -684,6 +814,18 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "crypto-bigint" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + [[package]] name = "crypto-bigint" version = "0.5.5" @@ -715,12 +857,67 @@ dependencies = [ "cipher", ] +[[package]] +name = "darling" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.10.0", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +dependencies = [ + "darling_core", + "quote", + "syn 1.0.109", +] + [[package]] name = "data-encoding" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +[[package]] +name = "debugid" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" +dependencies = [ + "serde", + "uuid 1.8.0", +] + +[[package]] +name = "der" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" +dependencies = [ + "const-oid", + "zeroize", +] + [[package]] name = "der" version = "0.7.8" @@ -752,6 +949,27 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive_more" +version = "1.0.0-beta.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7abbfc297053be59290e3152f8cbcd52c8642e0728b69ee187d991d4c1af08d" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0-beta.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bba3e9872d7c58ce7ef0fcf1844fcc3e23ef2a58377b50df35dd98e42a5726e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.51", + "unicode-xid", +] + [[package]] name = "deunicode" version = "1.6.0" @@ -824,24 +1042,42 @@ version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" +[[package]] +name = "dtoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" + [[package]] name = "dunce" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" +[[package]] +name = "ecdsa" +version = "0.14.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" +dependencies = [ + "der 0.6.1", + "elliptic-curve 0.12.3", + "rfc6979 0.3.1", + "signature 1.6.4", +] + [[package]] name = "ecdsa" version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ - "der", + "der 0.7.8", "digest", - "elliptic-curve", - "rfc6979", - "signature", - "spki", + "elliptic-curve 0.13.8", + "rfc6979 0.4.0", + "signature 2.2.0", + "spki 0.7.3", ] [[package]] @@ -853,25 +1089,54 @@ dependencies = [ "serde", ] +[[package]] +name = "elliptic-curve" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" +dependencies = [ + "base16ct 0.1.1", + "crypto-bigint 0.4.9", + "der 0.6.1", + "digest", + "ff 0.12.1", + "generic-array", + "group 0.12.1", + "pkcs8 0.9.0", + "rand_core", + "sec1 0.3.0", + "subtle", + "zeroize", +] + [[package]] name = "elliptic-curve" version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ - "base16ct", - "crypto-bigint", + "base16ct 0.2.0", + "crypto-bigint 0.5.5", "digest", - "ff", + "ff 0.13.0", "generic-array", - "group", - "pkcs8", + "group 0.13.0", + "pkcs8 0.10.2", "rand_core", - "sec1", + "sec1 0.7.3", "subtle", "zeroize", ] +[[package]] +name = "elsa" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98e71ae4df57d214182a2e5cb90230c0192c6ddfcaa05c36453d46a54713e10" +dependencies = [ + "stable_deref_trait", +] + [[package]] name = "ena" version = "0.14.2" @@ -905,15 +1170,24 @@ dependencies = [ "base64 0.21.7", "bytes", "hex", - "k256", + "k256 0.13.1", "log", "rand", "rlp", "serde", - "sha3", + "sha3 0.10.8", "zeroize", ] +[[package]] +name = "envy" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f47e0157f2cb54f5ae1bd371b30a2ae4311e1c028f575cd4e81de7353215965" +dependencies = [ + "serde", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -957,8 +1231,8 @@ dependencies = [ "scrypt", "serde", "serde_json", - "sha2", - "sha3", + "sha2 0.10.8", + "sha3 0.10.8", "thiserror", "uuid 0.8.2", ] @@ -975,7 +1249,7 @@ dependencies = [ "regex", "serde", "serde_json", - "sha3", + "sha3 0.10.8", "thiserror", "uint", ] @@ -1109,11 +1383,11 @@ dependencies = [ "cargo_metadata", "chrono", "const-hex", - "elliptic-curve", + "elliptic-curve 0.13.8", "ethabi", "generic-array", - "k256", - "num_enum", + "k256 0.13.1", + "num_enum 0.7.2", "once_cell", "open-fastrlp", "rand", @@ -1218,11 +1492,11 @@ dependencies = [ "coins-bip32", "coins-bip39", "const-hex", - "elliptic-curve", + "elliptic-curve 0.13.8", "eth-keystore", "ethers-core", "rand", - "sha2", + "sha2 0.10.8", "thiserror", "tracing", ] @@ -1281,6 +1555,16 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +[[package]] +name = "ff" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "ff" version = "0.13.0" @@ -1291,6 +1575,18 @@ dependencies = [ "subtle", ] +[[package]] +name = "findshlibs" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40b9e59cd0f7e0806cca4be089683ecb6434e602038df21fe6bf6711b2f07f64" +dependencies = [ + "cc", + "lazy_static", + "libc", + "winapi", +] + [[package]] name = "finl_unicode" version = "1.2.0" @@ -1342,6 +1638,21 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -1542,13 +1853,24 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "group" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" +dependencies = [ + "ff 0.12.1", + "rand_core", + "subtle", +] + [[package]] name = "group" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "ff", + "ff 0.13.0", "rand_core", "subtle", ] @@ -1565,13 +1887,19 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap", + "indexmap 2.2.3", "slab", "tokio", "tokio-util", "tracing", ] +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + [[package]] name = "hashbrown" version = "0.14.3" @@ -1597,7 +1925,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown", + "hashbrown 0.14.3", ] [[package]] @@ -1609,6 +1937,12 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" version = "0.3.8" @@ -1648,6 +1982,17 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "hostname" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" +dependencies = [ + "libc", + "match_cfg", + "winapi", +] + [[package]] name = "http" version = "0.2.11" @@ -1737,18 +2082,72 @@ dependencies = [ ] [[package]] -name = "idna" -version = "0.5.0" +name = "hyper-timeout" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "hyper", + "pin-project-lite", + "tokio", + "tokio-io-timeout", ] [[package]] -name = "impl-codec" -version = "0.6.0" +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "impl-codec" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" dependencies = [ @@ -1790,6 +2189,16 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", +] + [[package]] name = "indexmap" version = "2.2.3" @@ -1797,7 +2206,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.14.3", ] [[package]] @@ -1904,6 +2313,18 @@ dependencies = [ "simple_asn1", ] +[[package]] +name = "k256" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" +dependencies = [ + "cfg-if", + "ecdsa 0.14.8", + "elliptic-curve 0.12.3", + "sha2 0.10.8", +] + [[package]] name = "k256" version = "0.13.1" @@ -1911,11 +2332,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" dependencies = [ "cfg-if", - "ecdsa", - "elliptic-curve", + "ecdsa 0.16.9", + "elliptic-curve 0.13.8", "once_cell", - "sha2", - "signature", + "sha2 0.10.8", + "signature 2.2.0", ] [[package]] @@ -1998,6 +2419,26 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "linkme" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccb76662d78edc9f9bf56360d6919bdacc8b7761227727e5082f128eeb90bbf5" +dependencies = [ + "linkme-impl", +] + +[[package]] +name = "linkme-impl" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dccda732e04fa3baf2e17cf835bfe2601c7c2edafd64417c627dabae3a8cda" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.51", +] + [[package]] name = "linux-raw-sys" version = "0.4.13" @@ -2020,6 +2461,59 @@ version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +[[package]] +name = "logos" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c000ca4d908ff18ac99b93a062cb8958d331c3220719c52e77cb19cc6ac5d2c1" +dependencies = [ + "logos-derive", +] + +[[package]] +name = "logos-codegen" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc487311295e0002e452025d6b580b77bb17286de87b57138f3b5db711cded68" +dependencies = [ + "beef", + "fnv", + "proc-macro2", + "quote", + "regex-syntax 0.6.29", + "syn 2.0.51", +] + +[[package]] +name = "logos-derive" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbfc0d229f1f42d790440136d941afd806bc9e949e2bcb8faa813b0f00d1267e" +dependencies = [ + "logos-codegen", +] + +[[package]] +name = "match_cfg" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + [[package]] name = "md-5" version = "0.10.6" @@ -2036,6 +2530,29 @@ version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +[[package]] +name = "miette" +version = "5.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59bb584eaeeab6bd0226ccf3509a69d7936d148cf3d036ad350abe35e8c6856e" +dependencies = [ + "miette-derive", + "once_cell", + "thiserror", + "unicode-width", +] + +[[package]] +name = "miette-derive" +version = "5.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.51", +] + [[package]] name = "mime" version = "0.3.17" @@ -2068,6 +2585,12 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "multimap" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" + [[package]] name = "nanoid" version = "0.4.0" @@ -2077,6 +2600,23 @@ dependencies = [ "rand", ] +[[package]] +name = "native-tls" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + [[package]] name = "new_debug_unreachable" version = "1.0.4" @@ -2093,15 +2633,39 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + [[package]] name = "num-bigint" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" dependencies = [ - "autocfg", "num-integer", "num-traits", + "serde", ] [[package]] @@ -2121,6 +2685,16 @@ dependencies = [ "zeroize", ] +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", + "serde", +] + [[package]] name = "num-conv" version = "0.1.0" @@ -2138,20 +2712,32 @@ dependencies = [ [[package]] name = "num-iter" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d869c01cc0c455284163fd0092f1f93835385ccab5a98a0dcc497b2f8bf055a9" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" dependencies = [ "autocfg", "num-integer", "num-traits", ] +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", + "serde", +] + [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", "libm", @@ -2167,13 +2753,34 @@ dependencies = [ "libc", ] +[[package]] +name = "num_enum" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" +dependencies = [ + "num_enum_derive 0.6.1", +] + [[package]] name = "num_enum" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" dependencies = [ - "num_enum_derive", + "num_enum_derive 0.7.2", +] + +[[package]] +name = "num_enum_derive" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 2.0.51", ] [[package]] @@ -2235,10 +2842,176 @@ dependencies = [ ] [[package]] -name = "option-ext" -version = "0.2.0" +name = "openssl" +version = "0.10.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +dependencies = [ + "bitflags 2.4.2", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.51", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "opentelemetry" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9591d937bc0e6d2feb6f71a559540ab300ea49955229c347a517a28d27784c54" +dependencies = [ + "opentelemetry_api", + "opentelemetry_sdk", +] + +[[package]] +name = "opentelemetry-http" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7594ec0e11d8e33faf03530a4c49af7064ebba81c1480e01be67d90b356508b" +dependencies = [ + "async-trait", + "bytes", + "http", + "opentelemetry_api", + "reqwest", +] + +[[package]] +name = "opentelemetry-otlp" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e5e5a5c4135864099f3faafbe939eb4d7f9b80ebf68a8448da961b32a7c1275" +dependencies = [ + "async-trait", + "futures-core", + "http", + "opentelemetry-http", + "opentelemetry-proto", + "opentelemetry-semantic-conventions", + "opentelemetry_api", + "opentelemetry_sdk", + "prost 0.11.9", + "reqwest", + "thiserror", + "tokio", + "tonic", +] + +[[package]] +name = "opentelemetry-proto" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e3f814aa9f8c905d0ee4bde026afd3b2577a97c10e1699912e3e44f0c4cbeb" +dependencies = [ + "opentelemetry_api", + "opentelemetry_sdk", + "prost 0.11.9", + "tonic", +] + +[[package]] +name = "opentelemetry-semantic-conventions" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73c9f9340ad135068800e7f1b24e9e09ed9e7143f5bf8518ded3d3ec69789269" +dependencies = [ + "opentelemetry", +] + +[[package]] +name = "opentelemetry_api" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a81f725323db1b1206ca3da8bb19874bbd3f57c3bcd59471bfb04525b265b9b" +dependencies = [ + "futures-channel", + "futures-util", + "indexmap 1.9.3", + "js-sys", + "once_cell", + "pin-project-lite", + "thiserror", + "urlencoding", +] + +[[package]] +name = "opentelemetry_sdk" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa8e705a0612d48139799fcbaba0d4a90f06277153e43dd2bdc16c6f0edd8026" +dependencies = [ + "async-trait", + "crossbeam-channel", + "futures-channel", + "futures-executor", + "futures-util", + "once_cell", + "opentelemetry_api", + "ordered-float 3.9.2", + "percent-encoding", + "rand", + "regex", + "serde_json", + "thiserror", + "tokio", + "tokio-stream", +] + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "ordered-float" +version = "2.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c" +dependencies = [ + "num-traits", +] + +[[package]] +name = "ordered-float" +version = "3.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +checksum = "f1e1c390732d15f1d48471625cd92d154e66db2c56645e29a9cd26f4699f72dc" +dependencies = [ + "num-traits", +] [[package]] name = "os_info" @@ -2251,6 +3024,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + [[package]] name = "parity-scale-codec" version = "3.6.9" @@ -2350,7 +3129,7 @@ dependencies = [ "digest", "hmac", "password-hash", - "sha2", + "sha2 0.10.8", ] [[package]] @@ -2394,7 +3173,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap", + "indexmap 2.2.3", ] [[package]] @@ -2496,9 +3275,19 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" dependencies = [ - "der", - "pkcs8", - "spki", + "der 0.7.8", + "pkcs8 0.10.2", + "spki 0.7.3", +] + +[[package]] +name = "pkcs8" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +dependencies = [ + "der 0.6.1", + "spki 0.6.0", ] [[package]] @@ -2507,8 +3296,8 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der", - "spki", + "der 0.7.8", + "spki 0.7.3", ] [[package]] @@ -2602,6 +3391,29 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "prometheus-client" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ca959da22a332509f2a73ae9e5f23f9dcfc31fd3a54d71f159495bd5909baa" +dependencies = [ + "dtoa", + "itoa", + "parking_lot", + "prometheus-client-derive-encode", +] + +[[package]] +name = "prometheus-client-derive-encode" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.51", +] + [[package]] name = "proptest" version = "1.4.0" @@ -2618,6 +3430,134 @@ dependencies = [ "unarray", ] +[[package]] +name = "prost" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" +dependencies = [ + "bytes", + "prost-derive 0.11.9", +] + +[[package]] +name = "prost" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" +dependencies = [ + "bytes", + "prost-derive 0.12.6", +] + +[[package]] +name = "prost-build" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" +dependencies = [ + "bytes", + "heck 0.4.1", + "itertools 0.12.1", + "log", + "multimap", + "once_cell", + "petgraph", + "prettyplease", + "prost 0.12.6", + "prost-types", + "regex", + "syn 2.0.51", + "tempfile", +] + +[[package]] +name = "prost-derive" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" +dependencies = [ + "anyhow", + "itertools 0.10.5", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "prost-derive" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" +dependencies = [ + "anyhow", + "itertools 0.12.1", + "proc-macro2", + "quote", + "syn 2.0.51", +] + +[[package]] +name = "prost-reflect" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "057237efdb71cf4b3f9396302a3d6599a92fa94063ba537b66130980ea9909f3" +dependencies = [ + "base64 0.21.7", + "logos", + "miette", + "once_cell", + "prost 0.12.6", + "prost-types", + "serde", + "serde-value", +] + +[[package]] +name = "prost-types" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" +dependencies = [ + "prost 0.12.6", +] + +[[package]] +name = "protox" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00bb76c5f6221de491fe2c8f39b106330bbd9762c6511119c07940e10eb9ff11" +dependencies = [ + "bytes", + "miette", + "prost 0.12.6", + "prost-reflect", + "prost-types", + "protox-parse", + "thiserror", +] + +[[package]] +name = "protox-parse" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b4581f441c58863525a3e6bec7b8de98188cf75239a56c725a3e7288450a33f" +dependencies = [ + "logos", + "miette", + "prost-types", + "thiserror", +] + +[[package]] +name = "quick-protobuf" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d6da84cc204722a989e01ba2f6e1e276e190f22263d0cb6ce8526fcdb0d2e1f" +dependencies = [ + "byteorder", +] + [[package]] name = "quote" version = "1.0.35" @@ -2720,10 +3660,19 @@ checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", - "regex-automata", + "regex-automata 0.4.5", "regex-syntax 0.8.2", ] +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + [[package]] name = "regex-automata" version = "0.4.5" @@ -2735,6 +3684,12 @@ dependencies = [ "regex-syntax 0.8.2", ] +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + [[package]] name = "regex-syntax" version = "0.7.5" @@ -2763,10 +3718,12 @@ dependencies = [ "http-body", "hyper", "hyper-rustls", + "hyper-tls", "ipnet", "js-sys", "log", "mime", + "native-tls", "once_cell", "percent-encoding", "pin-project-lite", @@ -2778,6 +3735,7 @@ dependencies = [ "sync_wrapper", "system-configuration", "tokio", + "tokio-native-tls", "tokio-rustls", "tower-service", "url", @@ -2788,6 +3746,17 @@ dependencies = [ "winreg", ] +[[package]] +name = "rfc6979" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" +dependencies = [ + "crypto-bigint 0.4.9", + "hmac", + "zeroize", +] + [[package]] name = "rfc6979" version = "0.4.0" @@ -2871,10 +3840,10 @@ dependencies = [ "num-integer", "num-traits", "pkcs1", - "pkcs8", + "pkcs8 0.10.2", "rand_core", - "signature", - "spki", + "signature 2.2.0", + "spki 0.7.3", "subtle", "zeroize", ] @@ -2981,7 +3950,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f7d66a1128282b7ef025a8ead62a4a9fcf017382ec53b8ffbf4d7bf77bd3c60" dependencies = [ "cfg-if", - "derive_more", + "derive_more 0.99.17", "parity-scale-codec", "scale-info-derive", ] @@ -2990,76 +3959,257 @@ dependencies = [ name = "scale-info-derive" version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" +checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "schannel" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "scrypt" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f9e24d2b632954ded8ab2ef9fea0a0c769ea56ea98bddbafbad22caeeadf45d" +dependencies = [ + "hmac", + "pbkdf2 0.11.0", + "salsa20", + "sha2 0.10.8", +] + +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring 0.17.8", + "untrusted 0.9.0", +] + +[[package]] +name = "sec1" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +dependencies = [ + "base16ct 0.1.1", + "der 0.6.1", + "generic-array", + "pkcs8 0.9.0", + "subtle", + "zeroize", +] + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct 0.2.0", + "der 0.7.8", + "generic-array", + "pkcs8 0.10.2", + "subtle", + "zeroize", +] + +[[package]] +name = "secp256k1" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f" +dependencies = [ + "secp256k1-sys", +] + +[[package]] +name = "secp256k1-sys" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70a129b9e9efbfb223753b9163c4ab3b13cff7fd9c7f010fbac25ab4099fa07e" +dependencies = [ + "cc", +] + +[[package]] +name = "secrecy" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" +dependencies = [ + "zeroize", +] + +[[package]] +name = "security-framework" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +dependencies = [ + "serde", +] + +[[package]] +name = "send_wrapper" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" + +[[package]] +name = "send_wrapper" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" + +[[package]] +name = "sentry" +version = "0.31.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce4b57f1b521f674df7a1d200be8ff5d74e3712020ee25b553146657b5377d5" dependencies = [ - "proc-macro-crate 1.3.1", - "proc-macro2", - "quote", - "syn 1.0.109", + "httpdate", + "native-tls", + "reqwest", + "sentry-backtrace", + "sentry-contexts", + "sentry-core", + "sentry-debug-images", + "sentry-panic", + "sentry-tracing", + "tokio", + "ureq", ] [[package]] -name = "scopeguard" -version = "1.2.0" +name = "sentry-backtrace" +version = "0.31.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +checksum = "58cc8d4e04a73de8f718dc703943666d03f25d3e9e4d0fb271ca0b8c76dfa00e" +dependencies = [ + "backtrace", + "once_cell", + "regex", + "sentry-core", +] [[package]] -name = "scrypt" -version = "0.10.0" +name = "sentry-contexts" +version = "0.31.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f9e24d2b632954ded8ab2ef9fea0a0c769ea56ea98bddbafbad22caeeadf45d" +checksum = "6436c1bad22cdeb02179ea8ef116ffc217797c028927def303bc593d9320c0d1" dependencies = [ - "hmac", - "pbkdf2 0.11.0", - "salsa20", - "sha2", + "hostname", + "libc", + "os_info", + "rustc_version", + "sentry-core", + "uname", ] [[package]] -name = "sct" -version = "0.7.1" +name = "sentry-core" +version = "0.31.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +checksum = "901f761681f97db3db836ef9e094acdd8756c40215326c194201941947164ef1" dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", + "once_cell", + "rand", + "sentry-types", + "serde", + "serde_json", ] [[package]] -name = "sec1" -version = "0.7.3" +name = "sentry-debug-images" +version = "0.31.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +checksum = "afdb263e73d22f39946f6022ed455b7561b22ff5553aca9be3c6a047fa39c328" dependencies = [ - "base16ct", - "der", - "generic-array", - "pkcs8", - "subtle", - "zeroize", + "findshlibs", + "once_cell", + "sentry-core", ] [[package]] -name = "semver" -version = "1.0.22" +name = "sentry-panic" +version = "0.31.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "74fbf1c163f8b6a9d05912e1b272afa27c652e8b47ea60cb9a57ad5e481eea99" dependencies = [ - "serde", + "sentry-backtrace", + "sentry-core", ] [[package]] -name = "send_wrapper" -version = "0.4.0" +name = "sentry-tracing" +version = "0.31.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" +checksum = "82eabcab0a047040befd44599a1da73d3adb228ff53b5ed9795ae04535577704" +dependencies = [ + "sentry-backtrace", + "sentry-core", + "tracing-core", + "tracing-subscriber", +] [[package]] -name = "send_wrapper" -version = "0.6.0" +name = "sentry-types" +version = "0.31.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" +checksum = "da956cca56e0101998c8688bc65ce1a96f00673a0e58e663664023d4c7911e82" +dependencies = [ + "debugid", + "hex", + "rand", + "serde", + "serde_json", + "thiserror", + "time", + "url", + "uuid 1.8.0", +] [[package]] name = "serde" @@ -3070,6 +4220,16 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde-value" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" +dependencies = [ + "ordered-float 2.10.1", + "serde", +] + [[package]] name = "serde_derive" version = "1.0.197" @@ -3113,13 +4273,35 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_with" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff" +dependencies = [ + "serde", + "serde_with_macros", +] + +[[package]] +name = "serde_with_macros" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "serde_yaml" version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap", + "indexmap 2.2.3", "itoa", "ryu", "serde", @@ -3137,6 +4319,16 @@ dependencies = [ "digest", ] +[[package]] +name = "sha2" +version = "0.10.6" +source = "git+https://github.com/RustCrypto/hashes.git?rev=1731ced4a116d61ba9dc6ee6d0f38fb8102e357a#1731ced4a116d61ba9dc6ee6d0f38fb8102e357a" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "sha2" version = "0.10.8" @@ -3148,6 +4340,15 @@ dependencies = [ "digest", ] +[[package]] +name = "sha3" +version = "0.10.6" +source = "git+https://github.com/RustCrypto/hashes.git?rev=7a187e934c1f6c68e4b4e5cf37541b7a0d64d303#7a187e934c1f6c68e4b4e5cf37541b7a0d64d303" +dependencies = [ + "digest", + "keccak", +] + [[package]] name = "sha3" version = "0.10.8" @@ -3158,6 +4359,15 @@ dependencies = [ "keccak", ] +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + [[package]] name = "signal-hook-registry" version = "1.4.1" @@ -3167,6 +4377,16 @@ dependencies = [ "libc", ] +[[package]] +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" +dependencies = [ + "digest", + "rand_core", +] + [[package]] name = "signature" version = "2.2.0" @@ -3265,6 +4485,16 @@ dependencies = [ "lock_api", ] +[[package]] +name = "spki" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +dependencies = [ + "base64ct", + "der 0.6.1", +] + [[package]] name = "spki" version = "0.7.3" @@ -3272,7 +4502,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", - "der", + "der 0.7.8", ] [[package]] @@ -3320,7 +4550,7 @@ dependencies = [ "futures-util", "hashlink", "hex", - "indexmap", + "indexmap 2.2.3", "log", "memchr", "once_cell", @@ -3328,7 +4558,7 @@ dependencies = [ "percent-encoding", "serde", "serde_json", - "sha2", + "sha2 0.10.8", "smallvec", "sqlformat", "thiserror", @@ -3359,14 +4589,14 @@ checksum = "5833ef53aaa16d860e92123292f1f6a3d53c34ba8b1969f152ef1a7bb803f3c8" dependencies = [ "dotenvy", "either", - "heck", + "heck 0.4.1", "hex", "once_cell", "proc-macro2", "quote", "serde", "serde_json", - "sha2", + "sha2 0.10.8", "sqlx-core", "sqlx-mysql", "sqlx-postgres", @@ -3410,7 +4640,7 @@ dependencies = [ "rsa", "serde", "sha1", - "sha2", + "sha2 0.10.8", "smallvec", "sqlx-core", "stringprep", @@ -3448,7 +4678,7 @@ dependencies = [ "rand", "serde", "serde_json", - "sha2", + "sha2 0.10.8", "smallvec", "sqlx-core", "stringprep", @@ -3480,6 +4710,12 @@ dependencies = [ "urlencoding", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "static_assertions" version = "1.1.0" @@ -3510,12 +4746,27 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + [[package]] name = "strsim" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +dependencies = [ + "strum_macros 0.24.3", +] + [[package]] name = "strum" version = "0.25.0" @@ -3531,13 +4782,26 @@ version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "rustversion", + "syn 1.0.109", +] + [[package]] name = "strum_macros" version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "rustversion", @@ -3550,7 +4814,7 @@ version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "rustversion", @@ -3577,7 +4841,7 @@ dependencies = [ "semver", "serde", "serde_json", - "sha2", + "sha2 0.10.8", "thiserror", "url", "zip", @@ -3702,6 +4966,16 @@ dependencies = [ "syn 2.0.51", ] +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + [[package]] name = "time" version = "0.3.34" @@ -3776,6 +5050,16 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "tokio-io-timeout" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" +dependencies = [ + "pin-project-lite", + "tokio", +] + [[package]] name = "tokio-macros" version = "2.2.0" @@ -3787,6 +5071,16 @@ dependencies = [ "syn 2.0.51", ] +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + [[package]] name = "tokio-rustls" version = "0.24.1" @@ -3864,7 +5158,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap", + "indexmap 2.2.3", "toml_datetime", "winnow 0.5.40", ] @@ -3875,7 +5169,7 @@ version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" dependencies = [ - "indexmap", + "indexmap 2.2.3", "toml_datetime", "winnow 0.5.40", ] @@ -3886,7 +5180,7 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ - "indexmap", + "indexmap 2.2.3", "toml_datetime", "winnow 0.5.40", ] @@ -3897,13 +5191,67 @@ version = "0.22.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e40bb779c5187258fd7aad0eb68cb8706a0a81fa712fbea808ab43c4b8374c4" dependencies = [ - "indexmap", + "indexmap 2.2.3", "serde", "serde_spanned", "toml_datetime", "winnow 0.6.2", ] +[[package]] +name = "tonic" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a" +dependencies = [ + "async-trait", + "axum", + "base64 0.21.7", + "bytes", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-timeout", + "percent-encoding", + "pin-project", + "prost 0.11.9", + "tokio", + "tokio-stream", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "indexmap 1.9.3", + "pin-project", + "pin-project-lite", + "rand", + "slab", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + [[package]] name = "tower-service" version = "0.3.2" @@ -3934,22 +5282,93 @@ dependencies = [ ] [[package]] -name = "tracing-core" -version = "0.1.32" +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + +[[package]] +name = "tracing-log" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-opentelemetry" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75327c6b667828ddc28f5e3f169036cb793c3f588d83bf0f262a7f062ffed3c8" +dependencies = [ + "once_cell", + "opentelemetry", + "opentelemetry_sdk", + "smallvec", + "tracing", + "tracing-core", + "tracing-log 0.1.4", + "tracing-subscriber", +] + +[[package]] +name = "tracing-serde" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" dependencies = [ - "once_cell", + "serde", + "tracing-core", ] [[package]] -name = "tracing-futures" -version = "0.2.5" +name = "tracing-subscriber" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ - "pin-project", + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "serde", + "serde_json", + "sharded-slab", + "smallvec", + "thread_local", + "time", "tracing", + "tracing-core", + "tracing-log 0.2.0", + "tracing-serde", ] [[package]] @@ -4008,6 +5427,15 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "uname" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b72f89f0ca32e4db1c04e2a72f5345d59796d4866a1ee0609084569f73683dc8" +dependencies = [ + "libc", +] + [[package]] name = "unarray" version = "0.1.4" @@ -4083,6 +5511,19 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" +[[package]] +name = "ureq" +version = "2.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d11a831e3c0b56e438a28308e7c810799e3c118417f342d30ecec080105395cd" +dependencies = [ + "base64 0.22.1", + "log", + "native-tls", + "once_cell", + "url", +] + [[package]] name = "url" version = "2.5.0" @@ -4130,8 +5571,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" dependencies = [ "getrandom", + "serde", ] +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + [[package]] name = "vcpkg" version = "0.2.15" @@ -4144,6 +5592,41 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "vise" +version = "0.1.0" +source = "git+https://github.com/matter-labs/vise.git?rev=a5bb80c9ce7168663114ee30e794d6dc32159ee4#a5bb80c9ce7168663114ee30e794d6dc32159ee4" +dependencies = [ + "compile-fmt", + "elsa", + "linkme", + "once_cell", + "prometheus-client", + "vise-macros", +] + +[[package]] +name = "vise-exporter" +version = "0.1.0" +source = "git+https://github.com/matter-labs/vise.git?rev=a5bb80c9ce7168663114ee30e794d6dc32159ee4#a5bb80c9ce7168663114ee30e794d6dc32159ee4" +dependencies = [ + "hyper", + "once_cell", + "tokio", + "tracing", + "vise", +] + +[[package]] +name = "vise-macros" +version = "0.1.0" +source = "git+https://github.com/matter-labs/vise.git?rev=a5bb80c9ce7168663114ee30e794d6dc32159ee4#a5bb80c9ce7168663114ee30e794d6dc32159ee4" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.51", +] + [[package]] name = "walkdir" version = "2.4.0" @@ -4298,6 +5781,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.3", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -4567,6 +6059,33 @@ dependencies = [ "zstd", ] +[[package]] +name = "zk_evm" +version = "1.3.3" +source = "git+https://github.com/matter-labs/era-zk_evm.git?tag=v1.3.3-rc2#fbee20f5bac7d6ca3e22ae69b2077c510a07de4e" +dependencies = [ + "anyhow", + "lazy_static", + "num", + "serde", + "serde_json", + "static_assertions", + "zk_evm_abstractions", + "zkevm_opcode_defs", +] + +[[package]] +name = "zk_evm_abstractions" +version = "0.1.0" +source = "git+https://github.com/matter-labs/era-zk_evm_abstractions.git#32dd320953841aa78579d9da08abbc70bcaed175" +dependencies = [ + "anyhow", + "num_enum 0.6.1", + "serde", + "static_assertions", + "zkevm_opcode_defs", +] + [[package]] name = "zk_inception" version = "0.1.0" @@ -4611,6 +6130,265 @@ dependencies = [ "xshell", ] +[[package]] +name = "zkevm_opcode_defs" +version = "1.3.2" +source = "git+https://github.com/matter-labs/era-zkevm_opcode_defs.git?branch=v1.3.2#dffacadeccdfdbff4bc124d44c595c4a6eae5013" +dependencies = [ + "bitflags 2.4.2", + "blake2 0.10.6 (git+https://github.com/RustCrypto/hashes.git?rev=1f727ce37ff40fa0cce84eb8543a45bdd3ca4a4e)", + "ethereum-types", + "k256 0.11.6", + "lazy_static", + "sha2 0.10.6", + "sha3 0.10.6", +] + +[[package]] +name = "zksync_basic_types" +version = "0.1.0" +dependencies = [ + "anyhow", + "chrono", + "ethabi", + "hex", + "num_enum 0.7.2", + "serde", + "serde_json", + "serde_with", + "strum 0.24.1", + "thiserror", + "tiny-keccak", + "url", +] + +[[package]] +name = "zksync_concurrency" +version = "0.1.0" +source = "git+https://github.com/matter-labs/era-consensus.git?rev=3e6f101ee4124308c4c974caaa259d524549b0c6#3e6f101ee4124308c4c974caaa259d524549b0c6" +dependencies = [ + "anyhow", + "once_cell", + "pin-project", + "rand", + "sha3 0.10.8", + "thiserror", + "time", + "tokio", + "tracing", + "tracing-subscriber", + "vise", +] + +[[package]] +name = "zksync_config" +version = "0.1.0" +dependencies = [ + "anyhow", + "rand", + "secrecy", + "serde", + "zksync_basic_types", + "zksync_consensus_utils", + "zksync_crypto_primitives", +] + +[[package]] +name = "zksync_consensus_utils" +version = "0.1.0" +source = "git+https://github.com/matter-labs/era-consensus.git?rev=3e6f101ee4124308c4c974caaa259d524549b0c6#3e6f101ee4124308c4c974caaa259d524549b0c6" +dependencies = [ + "rand", + "thiserror", + "zksync_concurrency", +] + +[[package]] +name = "zksync_contracts" +version = "0.1.0" +dependencies = [ + "envy", + "ethabi", + "hex", + "once_cell", + "serde", + "serde_json", + "zksync_utils", +] + +[[package]] +name = "zksync_crypto" +version = "0.1.0" +dependencies = [ + "blake2 0.10.6 (registry+https://github.com/rust-lang/crates.io-index)", + "hex", + "once_cell", + "serde", + "sha2 0.10.8", + "thiserror", + "zksync_basic_types", +] + +[[package]] +name = "zksync_crypto_primitives" +version = "0.1.0" +dependencies = [ + "anyhow", + "hex", + "rand", + "secp256k1", + "serde", + "serde_json", + "thiserror", + "zksync_basic_types", + "zksync_utils", +] + +[[package]] +name = "zksync_mini_merkle_tree" +version = "0.1.0" +dependencies = [ + "once_cell", + "zksync_basic_types", + "zksync_crypto", +] + +[[package]] +name = "zksync_protobuf" +version = "0.1.0" +source = "git+https://github.com/matter-labs/era-consensus.git?rev=3e6f101ee4124308c4c974caaa259d524549b0c6#3e6f101ee4124308c4c974caaa259d524549b0c6" +dependencies = [ + "anyhow", + "bit-vec", + "once_cell", + "prost 0.12.6", + "prost-reflect", + "quick-protobuf", + "rand", + "serde", + "serde_json", + "serde_yaml", + "zksync_concurrency", + "zksync_consensus_utils", + "zksync_protobuf_build", +] + +[[package]] +name = "zksync_protobuf_build" +version = "0.1.0" +source = "git+https://github.com/matter-labs/era-consensus.git?rev=3e6f101ee4124308c4c974caaa259d524549b0c6#3e6f101ee4124308c4c974caaa259d524549b0c6" +dependencies = [ + "anyhow", + "heck 0.5.0", + "prettyplease", + "proc-macro2", + "prost-build", + "prost-reflect", + "protox", + "quote", + "syn 2.0.51", +] + +[[package]] +name = "zksync_protobuf_config" +version = "0.1.0" +dependencies = [ + "anyhow", + "hex", + "prost 0.12.6", + "rand", + "secrecy", + "serde_json", + "serde_yaml", + "zksync_basic_types", + "zksync_config", + "zksync_protobuf", + "zksync_protobuf_build", + "zksync_types", +] + +[[package]] +name = "zksync_system_constants" +version = "0.1.0" +dependencies = [ + "once_cell", + "zksync_basic_types", + "zksync_utils", +] + +[[package]] +name = "zksync_types" +version = "0.1.0" +dependencies = [ + "anyhow", + "blake2 0.10.6 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono", + "derive_more 1.0.0-beta.6", + "hex", + "itertools 0.10.5", + "num", + "num_enum 0.7.2", + "once_cell", + "prost 0.12.6", + "rlp", + "secp256k1", + "serde", + "serde_json", + "strum 0.24.1", + "thiserror", + "zksync_basic_types", + "zksync_config", + "zksync_contracts", + "zksync_crypto_primitives", + "zksync_mini_merkle_tree", + "zksync_protobuf", + "zksync_protobuf_build", + "zksync_system_constants", + "zksync_utils", +] + +[[package]] +name = "zksync_utils" +version = "0.1.0" +dependencies = [ + "anyhow", + "bigdecimal", + "futures", + "hex", + "itertools 0.10.5", + "num", + "once_cell", + "reqwest", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", + "zk_evm", + "zksync_basic_types", + "zksync_vlog", +] + +[[package]] +name = "zksync_vlog" +version = "0.1.0" +dependencies = [ + "anyhow", + "chrono", + "opentelemetry", + "opentelemetry-otlp", + "opentelemetry-semantic-conventions", + "sentry", + "serde", + "serde_json", + "tokio", + "tracing", + "tracing-opentelemetry", + "tracing-subscriber", + "vise", + "vise-exporter", +] + [[package]] name = "zstd" version = "0.11.2+zstd.1.5.2" diff --git a/zk_toolbox/Cargo.toml b/zk_toolbox/Cargo.toml index 42ea31c033d3..0f93f8630c66 100644 --- a/zk_toolbox/Cargo.toml +++ b/zk_toolbox/Cargo.toml @@ -26,6 +26,11 @@ common = { path = "crates/common" } config = { path = "crates/config" } types = { path = "crates/types" } +# ZkSync deps +zksync_config = { path = "../core/lib/config" } +zksync_protobuf_config = { path = "../core/lib/protobuf_config" } +zksync_protobuf = { version = "0.1.0", git = "https://github.com/matter-labs/era-consensus.git", rev = "3e6f101ee4124308c4c974caaa259d524549b0c6" } + # External dependencies anyhow = "1.0.82" clap = { version = "4.4", features = ["derive", "wrap_help"] } diff --git a/zk_toolbox/crates/config/Cargo.toml b/zk_toolbox/crates/config/Cargo.toml index a1fb10760b45..d441c1578a04 100644 --- a/zk_toolbox/crates/config/Cargo.toml +++ b/zk_toolbox/crates/config/Cargo.toml @@ -25,3 +25,7 @@ thiserror.workspace = true types.workspace = true url.workspace = true xshell.workspace = true + +zksync_protobuf_config.workspace = true +zksync_protobuf.workspace = true +zksync_config.workspace = true diff --git a/zk_toolbox/crates/config/src/chain.rs b/zk_toolbox/crates/config/src/chain.rs index f00bee175c0d..4a33bae987e8 100644 --- a/zk_toolbox/crates/config/src/chain.rs +++ b/zk_toolbox/crates/config/src/chain.rs @@ -8,6 +8,7 @@ use types::{ BaseToken, ChainId, L1BatchCommitDataGeneratorMode, L1Network, ProverMode, WalletCreation, }; use xshell::Shell; +use zksync_protobuf_config::decode_yaml_repr; use crate::{ consts::{ @@ -75,7 +76,11 @@ impl ChainConfig { } pub fn get_general_config(&self) -> anyhow::Result { - GeneralConfig::read(self.get_shell(), self.configs.join(GENERAL_FILE)) + decode_yaml_repr::( + &self.configs.join(GENERAL_FILE), + false, + ) + // GeneralConfig::read(self.get_shell(), self.configs.join(GENERAL_FILE)) } pub fn get_wallets_config(&self) -> anyhow::Result { diff --git a/zk_toolbox/crates/config/src/general.rs b/zk_toolbox/crates/config/src/general.rs index e1f3655d2200..2ecfb9018e94 100644 --- a/zk_toolbox/crates/config/src/general.rs +++ b/zk_toolbox/crates/config/src/general.rs @@ -1,7 +1,9 @@ use std::path::PathBuf; +use anyhow::Context; use serde::{Deserialize, Serialize}; use url::Url; +pub use zksync_config::configs::GeneralConfig; use crate::{consts::GENERAL_FILE, traits::FileConfigWithDefaultName}; @@ -10,48 +12,61 @@ pub struct RocksDbs { pub merkle_tree: PathBuf, } -#[derive(Debug, Deserialize, Serialize, Clone)] -pub struct GeneralConfig { - pub db: RocksDBConfig, - pub eth: EthConfig, - pub api: ApiConfig, - #[serde(flatten)] - pub other: serde_json::Value, +// #[derive(Debug, Deserialize, Serialize, Clone)] +// pub struct GeneralConfig { +// pub db: RocksDBConfig, +// pub eth: EthConfig, +// pub api: ApiConfig, +// #[serde(flatten)] +// pub other: serde_json::Value, +// } + +// impl GeneralConfig { +pub fn set_rocks_db_config(config: &mut GeneralConfig, rocks_dbs: RocksDbs) -> anyhow::Result<()> { + config + .db_config + .as_mut() + .context("Db config")? + .state_keeper_db_path = rocks_dbs.state_keeper.to_str().unwrap().to_string(); + config + .db_config + .as_mut() + .context("Db config")? + .merkle_tree + .path = rocks_dbs.merkle_tree.to_str().unwrap().to_string(); + Ok(()) } -impl GeneralConfig { - pub fn set_rocks_db_config(&mut self, rocks_dbs: RocksDbs) -> anyhow::Result<()> { - self.db.state_keeper_db_path = rocks_dbs.state_keeper; - self.db.merkle_tree.path = rocks_dbs.merkle_tree; - Ok(()) - } - - pub fn ports_config(&self) -> PortsConfig { - PortsConfig { - web3_json_rpc_http_port: self.api.web3_json_rpc.http_port, - web3_json_rpc_ws_port: self.api.web3_json_rpc.ws_port, - healthcheck_port: self.api.healthcheck.port, - merkle_tree_port: self.api.merkle_tree.port, - prometheus_listener_port: self.api.prometheus.listener_port, - } - } - - pub fn update_ports(&mut self, ports_config: &PortsConfig) -> anyhow::Result<()> { - self.api.web3_json_rpc.http_port = ports_config.web3_json_rpc_http_port; - update_port_in_url( - &mut self.api.web3_json_rpc.http_url, - ports_config.web3_json_rpc_http_port, - )?; - self.api.web3_json_rpc.ws_port = ports_config.web3_json_rpc_ws_port; - update_port_in_url( - &mut self.api.web3_json_rpc.ws_url, - ports_config.web3_json_rpc_ws_port, - )?; - self.api.healthcheck.port = ports_config.healthcheck_port; - self.api.merkle_tree.port = ports_config.merkle_tree_port; - self.api.prometheus.listener_port = ports_config.prometheus_listener_port; - Ok(()) - } +pub fn ports_config(config: &GeneralConfig) -> Option { + let api = config.api_config.as_ref()?; + Some(PortsConfig { + web3_json_rpc_http_port: api.web3_json_rpc.http_port, + web3_json_rpc_ws_port: api.web3_json_rpc.ws_port, + healthcheck_port: api.healthcheck.port, + merkle_tree_port: api.merkle_tree.port, + prometheus_listener_port: api.prometheus.listener_port, + }) +} + +pub fn update_ports(config: &mut GeneralConfig, ports_config: &PortsConfig) -> anyhow::Result<()> { + let api = config + .api_config + .as_mut() + .context("Api config is not presented")?; + api.web3_json_rpc.http_port = ports_config.web3_json_rpc_http_port; + update_port_in_url( + &mut api.web3_json_rpc.http_url, + ports_config.web3_json_rpc_http_port, + )?; + api.web3_json_rpc.ws_port = ports_config.web3_json_rpc_ws_port; + update_port_in_url( + &mut api.web3_json_rpc.ws_url, + ports_config.web3_json_rpc_ws_port, + )?; + api.healthcheck.port = ports_config.healthcheck_port; + api.merkle_tree.port = ports_config.merkle_tree_port; + api.prometheus.listener_port = ports_config.prometheus_listener_port; + Ok(()) } fn update_port_in_url(http_url: &mut String, port: u16) -> anyhow::Result<()> { @@ -67,101 +82,6 @@ impl FileConfigWithDefaultName for GeneralConfig { const FILE_NAME: &'static str = GENERAL_FILE; } -#[derive(Debug, Deserialize, Serialize, Clone)] -pub struct RocksDBConfig { - pub state_keeper_db_path: PathBuf, - pub merkle_tree: MerkleTreeDB, - #[serde(flatten)] - pub other: serde_json::Value, -} - -#[derive(Debug, Deserialize, Serialize, Clone)] -pub struct MerkleTreeDB { - pub path: PathBuf, - #[serde(flatten)] - pub other: serde_json::Value, -} - -#[derive(Debug, Deserialize, Serialize, Clone)] -pub struct EthConfig { - pub sender: EthSender, - #[serde(flatten)] - pub other: serde_json::Value, -} - -#[derive(Debug, Deserialize, Serialize, Clone)] -pub struct EthSender { - pub proof_sending_mode: String, - pub pubdata_sending_mode: String, - #[serde(flatten)] - pub other: serde_json::Value, -} - -#[derive(Debug, Deserialize, Serialize, Clone)] -pub struct ApiConfig { - /// Configuration options for the Web3 JSON RPC servers. - pub web3_json_rpc: Web3JsonRpcConfig, - /// Configuration options for the Prometheus exporter. - pub prometheus: PrometheusConfig, - /// Configuration options for the Health check. - pub healthcheck: HealthCheckConfig, - /// Configuration options for Merkle tree API. - pub merkle_tree: MerkleTreeApiConfig, - #[serde(flatten)] - pub other: serde_json::Value, -} - -#[derive(Debug, Deserialize, Serialize, Clone)] -pub struct Web3JsonRpcConfig { - /// Port to which the HTTP RPC server is listening. - pub http_port: u16, - /// URL to access HTTP RPC server. - pub http_url: String, - /// Port to which the WebSocket RPC server is listening. - pub ws_port: u16, - /// URL to access WebSocket RPC server. - pub ws_url: String, - /// Max possible limit of entities to be requested once. - pub req_entities_limit: Option, - #[serde(flatten)] - pub other: serde_json::Value, -} - -#[derive(Debug, Deserialize, Serialize, Clone)] -pub struct PrometheusConfig { - /// Port to which the Prometheus exporter server is listening. - pub listener_port: u16, - /// URL of the push gateway. - pub pushgateway_url: String, - /// Push interval in ms. - pub push_interval_ms: Option, - #[serde(flatten)] - pub other: serde_json::Value, -} - -#[derive(Debug, Deserialize, Serialize, Clone)] -pub struct HealthCheckConfig { - /// Port to which the REST server is listening. - pub port: u16, - /// Time limit in milliseconds to mark a health check as slow and log the corresponding warning. - /// If not specified, the default value in the health check crate will be used. - pub slow_time_limit_ms: Option, - /// Time limit in milliseconds to abort a health check and return "not ready" status for the corresponding component. - /// If not specified, the default value in the health check crate will be used. - pub hard_time_limit_ms: Option, - #[serde(flatten)] - pub other: serde_json::Value, -} - -/// Configuration for the Merkle tree API. -#[derive(Debug, Deserialize, Serialize, Clone)] -pub struct MerkleTreeApiConfig { - /// Port to bind the Merkle tree API server to. - pub port: u16, - #[serde(flatten)] - pub other: serde_json::Value, -} - pub struct PortsConfig { pub web3_json_rpc_http_port: u16, pub web3_json_rpc_ws_port: u16, diff --git a/zk_toolbox/crates/config/src/lib.rs b/zk_toolbox/crates/config/src/lib.rs index a80a2b6fe5de..47d4040eb6bf 100644 --- a/zk_toolbox/crates/config/src/lib.rs +++ b/zk_toolbox/crates/config/src/lib.rs @@ -9,6 +9,7 @@ pub use manipulations::*; pub use secrets::*; pub use wallet_creation::*; pub use wallets::*; +pub use zksync_protobuf_config::{decode_yaml_repr, encode_yaml_repr}; mod chain; mod consts; diff --git a/zk_toolbox/crates/config/src/traits.rs b/zk_toolbox/crates/config/src/traits.rs index 79ae3a187a8b..6d4857333be0 100644 --- a/zk_toolbox/crates/config/src/traits.rs +++ b/zk_toolbox/crates/config/src/traits.rs @@ -6,6 +6,7 @@ use common::files::{ }; use serde::{de::DeserializeOwned, Serialize}; use xshell::Shell; +use zksync_protobuf::repr::ProtoRepr; pub trait FileConfig {} @@ -19,13 +20,13 @@ pub trait FileConfigWithDefaultName { impl FileConfig for T where T: FileConfigWithDefaultName {} -impl ReadConfig for T where T: FileConfig + Clone + DeserializeOwned {} +// impl ReadConfig for T where T: FileConfig + Clone {} impl SaveConfig for T where T: FileConfig + Serialize {} impl SaveConfigWithComment for T where T: FileConfig + Serialize {} -impl ReadConfigWithBasePath for T where T: FileConfigWithDefaultName + Clone + DeserializeOwned {} +impl ReadConfigWithBasePath for T where T: FileConfigWithDefaultName + DeserializeOwned + Clone {} impl SaveConfigWithBasePath for T where T: FileConfigWithDefaultName + Serialize {} @@ -33,7 +34,14 @@ impl SaveConfigWithCommentAndBasePath for T where T: FileConfigWithDefaultNam /// Reads a config file from a given path, correctly parsing file extension. /// Supported file extensions are: `yaml`, `yml`, `toml`, `json`. -pub trait ReadConfig: DeserializeOwned + Clone { +pub trait ReadConfig: Clone { + fn read(shell: &Shell, path: impl AsRef) -> anyhow::Result; +} + +impl ReadConfig for T +where + T: DeserializeOwned + Clone + FileConfig, +{ fn read(shell: &Shell, path: impl AsRef) -> anyhow::Result { let error_context = || format!("Failed to parse config file {:?}.", path.as_ref()); @@ -49,6 +57,25 @@ pub trait ReadConfig: DeserializeOwned + Clone { } } +// impl ReadConfig for T +// where +// T: ProtoRepr + Clone + FileConfig, +// { +// fn read(shell: &Shell, path: impl AsRef) -> anyhow::Result { +// let error_context = || format!("Failed to parse config file {:?}.", path.as_ref()); +// +// match path.as_ref().extension().and_then(|ext| ext.to_str()) { +// Some("yaml") | Some("yml") => read_yaml_file(shell, &path).with_context(error_context), +// Some("toml") => read_toml_file(shell, &path).with_context(error_context), +// Some("json") => read_json_file(shell, &path).with_context(error_context), +// _ => bail!(format!( +// "Unsupported file extension for config file {:?}.", +// path.as_ref() +// )), +// } +// } +// } + /// Reads a config file from a base path, correctly parsing file extension. /// Supported file extensions are: `yaml`, `yml`, `toml`, `json`. pub trait ReadConfigWithBasePath: ReadConfig + FileConfigWithDefaultName { From 309eb295a33e472cf1b40007f10fda1ebb2adc2b Mon Sep 17 00:00:00 2001 From: Danil Date: Tue, 23 Jul 2024 12:28:58 +0200 Subject: [PATCH 02/16] Use some file configs Signed-off-by: Danil --- zk_toolbox/Cargo.lock | 1419 ++++++++++------- zk_toolbox/Cargo.toml | 4 +- zk_toolbox/crates/config/src/chain.rs | 12 +- zk_toolbox/crates/config/src/general.rs | 29 +- zk_toolbox/crates/config/src/traits.rs | 28 +- .../src/commands/chain/genesis.rs | 11 +- .../commands/external_node/prepare_configs.rs | 19 +- .../zk_inception/src/commands/prover/init.rs | 4 +- 8 files changed, 884 insertions(+), 642 deletions(-) diff --git a/zk_toolbox/Cargo.lock b/zk_toolbox/Cargo.lock index 6e8e7cc200ec..77525872b0eb 100644 --- a/zk_toolbox/Cargo.lock +++ b/zk_toolbox/Cargo.lock @@ -14,9 +14,9 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ "gimli", ] @@ -53,9 +53,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -83,47 +83,48 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.12" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b09b5178381e0874812a9b157f7fe84982617e48f71f4e3235482775e5b540" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -131,9 +132,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.82" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "arrayvec" @@ -152,13 +153,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.77" +version = "0.1.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.72", ] [[package]] @@ -181,6 +182,12 @@ dependencies = [ "num-traits", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "auto_impl" version = "1.2.0" @@ -189,14 +196,14 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.72", ] [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "axum" @@ -209,9 +216,9 @@ dependencies = [ "bitflags 1.3.2", "bytes", "futures-util", - "http", - "http-body", - "hyper", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.30", "itoa", "matchit", "memchr", @@ -220,7 +227,7 @@ dependencies = [ "pin-project-lite", "rustversion", "serde", - "sync_wrapper", + "sync_wrapper 0.1.2", "tower", "tower-layer", "tower-service", @@ -235,8 +242,8 @@ dependencies = [ "async-trait", "bytes", "futures-util", - "http", - "http-body", + "http 0.2.12", + "http-body 0.4.6", "mime", "rustversion", "tower-layer", @@ -245,9 +252,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", @@ -340,9 +347,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" dependencies = [ "serde", ] @@ -368,14 +375,6 @@ dependencies = [ "digest", ] -[[package]] -name = "blake2" -version = "0.10.6" -source = "git+https://github.com/RustCrypto/hashes.git?rev=1f727ce37ff40fa0cce84eb8543a45bdd3ca4a4e#1f727ce37ff40fa0cce84eb8543a45bdd3ca4a4e" -dependencies = [ - "digest", -] - [[package]] name = "block-buffer" version = "0.10.4" @@ -387,19 +386,19 @@ dependencies = [ [[package]] name = "bs58" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" dependencies = [ - "sha2 0.10.8", + "sha2", "tinyvec", ] [[package]] name = "bumpalo" -version = "3.15.3" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea184aa71bb362a1157c896979544cc23974e08fd265f29ea96b59f0b4a555b" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byte-slice-cast" @@ -415,9 +414,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" dependencies = [ "serde", ] @@ -445,18 +444,18 @@ dependencies = [ [[package]] name = "camino" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239" dependencies = [ "serde", ] [[package]] name = "cargo-platform" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "694c8807f2ae16faecc43dc17d74b3eb042482789fd0eb64b39a2e04e087053f" +checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" dependencies = [ "serde", ] @@ -477,10 +476,11 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.88" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02f341c093d19155a6e41631ce5971aac4e9a868262212153124c15fa22d1cdc" +checksum = "2aba8f4e9906c7ce3c73463f62a7f0c65183ada1a2d47e397cc8810827f9694f" dependencies = [ + "jobserver", "libc", ] @@ -492,9 +492,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.34" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", @@ -502,7 +502,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.52.3", + "windows-targets 0.52.6", ] [[package]] @@ -517,9 +517,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.1" +version = "4.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da" +checksum = "64acc1846d54c1fe936a78dc189c34e28d3f5afc348403f28ecf53660b9b8462" dependencies = [ "clap_builder", "clap_derive", @@ -527,34 +527,34 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.1" +version = "4.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3e7391dad68afb0c2ede1bf619f579a3dc9c2ec67f089baa397123a2f3d1eb" +checksum = "6fb8393d67ba2e7bfaf28a23458e4e2b543cc73a99595511eb207fdb8aede942" dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.11.0", + "strsim 0.11.1", "terminal_size", ] [[package]] name = "clap_derive" -version = "4.5.0" +version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" +checksum = "2bac35c6dafb060fd4d275d9a4ffae97917c13a6327903a8be2153cd964f7085" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.72", ] [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" [[package]] name = "cliclack" @@ -579,9 +579,9 @@ dependencies = [ "coins-core", "digest", "hmac", - "k256 0.13.1", + "k256 0.13.3", "serde", - "sha2 0.10.8", + "sha2", "thiserror", ] @@ -597,7 +597,7 @@ dependencies = [ "once_cell", "pbkdf2 0.12.2", "rand", - "sha2 0.10.8", + "sha2", "thiserror", ] @@ -616,16 +616,16 @@ dependencies = [ "ripemd", "serde", "serde_derive", - "sha2 0.10.8", - "sha3 0.10.8", + "sha2", + "sha3", "thiserror", ] [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" [[package]] name = "common" @@ -642,7 +642,8 @@ dependencies = [ "serde_json", "serde_yaml", "sqlx", - "strum_macros 0.26.2", + "strum_macros 0.26.4", + "thiserror", "tokio", "toml", "url", @@ -667,8 +668,8 @@ dependencies = [ "rand", "serde", "serde_json", - "strum 0.26.2", - "strum_macros 0.26.2", + "strum 0.26.3", + "strum_macros 0.26.4", "thiserror", "types", "url", @@ -693,9 +694,9 @@ dependencies = [ [[package]] name = "const-hex" -version = "1.11.3" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ba00838774b4ab0233e355d26710fbfc8327a05c017f6dc4873f876d1f79f78" +checksum = "94fb8a24a26d37e1ffd45343323dc9fe6654ceea44c12f2fcb3d7ac29e610bc6" dependencies = [ "cfg-if", "cpufeatures", @@ -758,9 +759,9 @@ checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] name = "crc32fast" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] @@ -804,9 +805,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crunchy" @@ -894,9 +895,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "debugid" @@ -905,7 +906,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" dependencies = [ "serde", - "uuid 1.8.0", + "uuid 1.10.0", ] [[package]] @@ -920,9 +921,9 @@ dependencies = [ [[package]] name = "der" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "pem-rfc7468", @@ -940,13 +941,13 @@ dependencies = [ [[package]] name = "derive_more" -version = "0.99.17" +version = "0.99.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.72", ] [[package]] @@ -966,7 +967,7 @@ checksum = "2bba3e9872d7c58ce7ef0fcf1844fcc3e23ef2a58377b50df35dd98e42a5726e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.72", "unicode-xid", ] @@ -976,12 +977,6 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "339544cc9e2c4dc3fc7149fd630c5f22263a4fdf18a98afd0075784968b5cf00" -[[package]] -name = "diff" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" - [[package]] name = "digest" version = "0.10.7" @@ -1072,7 +1067,7 @@ version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ - "der 0.7.8", + "der 0.7.9", "digest", "elliptic-curve 0.13.8", "rfc6979 0.4.0", @@ -1082,9 +1077,9 @@ dependencies = [ [[package]] name = "either" -version = "1.10.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" dependencies = [ "serde", ] @@ -1139,9 +1134,9 @@ dependencies = [ [[package]] name = "ena" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c533630cf40e9caa44bd91aadc88a75d75a4c3a12b4cfde353cbed41daa1e1f1" +checksum = "3d248bdd43ce613d87415282f69b9bb99d947d290b10962dd6c56233312c2ad5" dependencies = [ "log", ] @@ -1154,28 +1149,28 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] [[package]] name = "enr" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe81b5c06ecfdbc71dd845216f225f53b62a10cb8a16c946836a3467f701d05b" +checksum = "2a3d8dc56e02f954cac8eb489772c552c473346fc34f67412bb6244fd647f7e4" dependencies = [ "base64 0.21.7", "bytes", "hex", - "k256 0.13.1", + "k256 0.13.3", "log", "rand", "rlp", "serde", - "sha3 0.10.8", + "sha3", "zeroize", ] @@ -1196,9 +1191,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -1231,8 +1226,8 @@ dependencies = [ "scrypt", "serde", "serde_json", - "sha2 0.10.8", - "sha3 0.10.8", + "sha2", + "sha3", "thiserror", "uuid 0.8.2", ] @@ -1249,7 +1244,7 @@ dependencies = [ "regex", "serde", "serde_json", - "sha3 0.10.8", + "sha3", "thiserror", "uint", ] @@ -1287,9 +1282,9 @@ dependencies = [ [[package]] name = "ethers" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c7cd562832e2ff584fa844cd2f6e5d4f35bbe11b28c7c9b8df957b2e1d0c701" +checksum = "816841ea989f0c69e459af1cf23a6b0033b19a55424a1ea3a30099becdb8dec0" dependencies = [ "ethers-addressbook", "ethers-contract", @@ -1303,9 +1298,9 @@ dependencies = [ [[package]] name = "ethers-addressbook" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35dc9a249c066d17e8947ff52a4116406163cf92c7f0763cb8c001760b26403f" +checksum = "5495afd16b4faa556c3bba1f21b98b4983e53c1755022377051a975c3b021759" dependencies = [ "ethers-core", "once_cell", @@ -1315,9 +1310,9 @@ dependencies = [ [[package]] name = "ethers-contract" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43304317c7f776876e47f2f637859f6d0701c1ec7930a150f169d5fbe7d76f5a" +checksum = "6fceafa3578c836eeb874af87abacfb041f92b4da0a78a5edd042564b8ecdaaa" dependencies = [ "const-hex", "ethers-contract-abigen", @@ -1334,9 +1329,9 @@ dependencies = [ [[package]] name = "ethers-contract-abigen" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9f96502317bf34f6d71a3e3d270defaa9485d754d789e15a8e04a84161c95eb" +checksum = "04ba01fbc2331a38c429eb95d4a570166781f14290ef9fdb144278a90b5a739b" dependencies = [ "Inflector", "const-hex", @@ -1348,19 +1343,19 @@ dependencies = [ "proc-macro2", "quote", "regex", - "reqwest", + "reqwest 0.11.27", "serde", "serde_json", - "syn 2.0.51", + "syn 2.0.72", "toml", "walkdir", ] [[package]] name = "ethers-contract-derive" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "452ff6b0a64507ce8d67ffd48b1da3b42f03680dcf5382244e9c93822cbbf5de" +checksum = "87689dcabc0051cde10caaade298f9e9093d65f6125c14575db3fd8c669a168f" dependencies = [ "Inflector", "const-hex", @@ -1369,14 +1364,14 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.51", + "syn 2.0.72", ] [[package]] name = "ethers-core" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aab3cef6cc1c9fd7f787043c81ad3052eff2b96a3878ef1526aa446311bdbfc9" +checksum = "82d80cc6ad30b14a48ab786523af33b37f28a8623fc06afd55324816ef18fb1f" dependencies = [ "arrayvec", "bytes", @@ -1386,7 +1381,7 @@ dependencies = [ "elliptic-curve 0.13.8", "ethabi", "generic-array", - "k256 0.13.1", + "k256 0.13.3", "num_enum 0.7.2", "once_cell", "open-fastrlp", @@ -1394,8 +1389,8 @@ dependencies = [ "rlp", "serde", "serde_json", - "strum 0.25.0", - "syn 2.0.51", + "strum 0.26.3", + "syn 2.0.72", "tempfile", "thiserror", "tiny-keccak", @@ -1404,13 +1399,13 @@ dependencies = [ [[package]] name = "ethers-etherscan" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d45b981f5fa769e1d0343ebc2a44cfa88c9bc312eb681b676318b40cef6fb1" +checksum = "e79e5973c26d4baf0ce55520bd732314328cabe53193286671b47144145b9649" dependencies = [ "chrono", "ethers-core", - "reqwest", + "reqwest 0.11.27", "semver", "serde", "serde_json", @@ -1420,9 +1415,9 @@ dependencies = [ [[package]] name = "ethers-middleware" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "145211f34342487ef83a597c1e69f0d3e01512217a7c72cc8a25931854c7dca0" +checksum = "48f9fdf09aec667c099909d91908d5eaf9be1bd0e2500ba4172c1d28bfaa43de" dependencies = [ "async-trait", "auto_impl", @@ -1435,7 +1430,7 @@ dependencies = [ "futures-locks", "futures-util", "instant", - "reqwest", + "reqwest 0.11.27", "serde", "serde_json", "thiserror", @@ -1447,9 +1442,9 @@ dependencies = [ [[package]] name = "ethers-providers" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb6b15393996e3b8a78ef1332d6483c11d839042c17be58decc92fa8b1c3508a" +checksum = "6434c9a33891f1effc9c75472e12666db2fa5a0fec4b29af6221680a6fe83ab2" dependencies = [ "async-trait", "auto_impl", @@ -1462,12 +1457,12 @@ dependencies = [ "futures-timer", "futures-util", "hashers", - "http", + "http 0.2.12", "instant", "jsonwebtoken", "once_cell", "pin-project", - "reqwest", + "reqwest 0.11.27", "serde", "serde_json", "thiserror", @@ -1484,9 +1479,9 @@ dependencies = [ [[package]] name = "ethers-signers" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3b125a103b56aef008af5d5fb48191984aa326b50bfd2557d231dc499833de3" +checksum = "228875491c782ad851773b652dd8ecac62cda8571d3bc32a5853644dd26766c2" dependencies = [ "async-trait", "coins-bip32", @@ -1496,16 +1491,16 @@ dependencies = [ "eth-keystore", "ethers-core", "rand", - "sha2 0.10.8", + "sha2", "thiserror", "tracing", ] [[package]] name = "ethers-solc" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d21df08582e0a43005018a858cc9b465c5fff9cf4056651be64f844e57d1f55f" +checksum = "66244a771d9163282646dbeffe0e6eca4dda4146b6498644e678ac6089b11edd" dependencies = [ "cfg-if", "const-hex", @@ -1551,9 +1546,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "ff" @@ -1587,12 +1582,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "finl_unicode" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" - [[package]] name = "fixed-hash" version = "0.8.0" @@ -1613,9 +1602,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ "crc32fast", "miniz_oxide", @@ -1755,7 +1744,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.72", ] [[package]] @@ -1820,9 +1809,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -1831,9 +1820,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "glob" @@ -1886,8 +1875,27 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http", - "indexmap 2.2.3", + "http 0.2.12", + "indexmap 2.2.6", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "h2" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http 1.1.0", + "indexmap 2.2.6", "slab", "tokio", "tokio-util", @@ -1902,9 +1910,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", "allocator-api2", @@ -1925,7 +1933,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -1945,9 +1953,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "379dada1584ad501b383485dd706b8afb7a70fcbc7f4da7d780638a5a6124a60" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hex" @@ -1995,9 +2003,20 @@ dependencies = [ [[package]] name = "http" -version = "0.2.11" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", "fnv", @@ -2011,15 +2030,38 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", - "http", + "http 0.2.12", + "pin-project-lite", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http 1.1.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", "pin-project-lite", ] [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "httpdate" @@ -2040,22 +2082,22 @@ dependencies = [ "serde", "serde_derive", "toml", - "uuid 1.8.0", + "uuid 1.10.0", ] [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" dependencies = [ "bytes", "futures-channel", "futures-core", "futures-util", - "h2", - "http", - "http-body", + "h2 0.3.26", + "http 0.2.12", + "http-body 0.4.6", "httparse", "httpdate", "itoa", @@ -2067,6 +2109,26 @@ dependencies = [ "want", ] +[[package]] +name = "hyper" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "h2 0.4.5", + "http 1.1.0", + "http-body 1.0.1", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + [[package]] name = "hyper-rustls" version = "0.24.2" @@ -2074,11 +2136,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", - "http", - "hyper", - "rustls", + "http 0.2.12", + "hyper 0.14.30", + "rustls 0.21.12", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +dependencies = [ + "futures-util", + "http 1.1.0", + "hyper 1.4.1", + "hyper-util", + "rustls 0.23.11", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.26.0", + "tower-service", ] [[package]] @@ -2087,7 +2166,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" dependencies = [ - "hyper", + "hyper 0.14.30", "pin-project-lite", "tokio", "tokio-io-timeout", @@ -2100,10 +2179,46 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper", + "hyper 0.14.30", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper 1.4.1", + "hyper-util", "native-tls", "tokio", "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "hyper 1.4.1", + "pin-project-lite", + "socket2", + "tokio", + "tower", + "tower-service", + "tracing", ] [[package]] @@ -2201,12 +2316,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.3" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -2233,9 +2348,9 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", ] @@ -2247,15 +2362,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] -name = "is-terminal" -version = "0.4.12" +name = "is_terminal_polyfill" +version = "1.70.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.52.0", -] +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" [[package]] name = "itertools" @@ -2286,15 +2396,24 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "jobserver" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" +dependencies = [ + "libc", +] [[package]] name = "js-sys" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -2322,20 +2441,20 @@ dependencies = [ "cfg-if", "ecdsa 0.14.8", "elliptic-curve 0.12.3", - "sha2 0.10.8", + "sha2", ] [[package]] name = "k256" -version = "0.13.1" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ "cfg-if", "ecdsa 0.16.9", "elliptic-curve 0.13.8", "once_cell", - "sha2 0.10.8", + "sha2", "signature 2.2.0", ] @@ -2350,46 +2469,48 @@ dependencies = [ [[package]] name = "lalrpop" -version = "0.20.0" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da4081d44f4611b66c6dd725e6de3169f9f63905421e8626fcb86b6a898998b8" +checksum = "55cb077ad656299f160924eb2912aa147d7339ea7d69e1b5517326fdcec3c1ca" dependencies = [ "ascii-canvas", "bit-set", - "diff", "ena", - "is-terminal", - "itertools 0.10.5", + "itertools 0.11.0", "lalrpop-util", "petgraph", "regex", - "regex-syntax 0.7.5", + "regex-syntax 0.8.4", "string_cache", "term", "tiny-keccak", "unicode-xid", + "walkdir", ] [[package]] name = "lalrpop-util" -version = "0.20.0" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f35c735096c0293d313e8f2a641627472b83d01b937177fe76e5e2708d31e0d" +checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" +dependencies = [ + "regex-automata 0.4.7", +] [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" dependencies = [ - "spin 0.5.2", + "spin 0.9.8", ] [[package]] name = "libc" -version = "0.2.153" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libm" @@ -2399,13 +2520,12 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libredox" -version = "0.0.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "libc", - "redox_syscall", ] [[package]] @@ -2436,20 +2556,20 @@ checksum = "f8dccda732e04fa3baf2e17cf835bfe2601c7c2edafd64417c627dabae3a8cda" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.72", ] [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -2457,9 +2577,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "logos" @@ -2481,7 +2601,7 @@ dependencies = [ "proc-macro2", "quote", "regex-syntax 0.6.29", - "syn 2.0.51", + "syn 2.0.72", ] [[package]] @@ -2526,9 +2646,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "miette" @@ -2550,7 +2670,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.72", ] [[package]] @@ -2567,9 +2687,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] @@ -2619,9 +2739,9 @@ dependencies = [ [[package]] name = "new_debug_unreachable" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" [[package]] name = "nom" @@ -2659,9 +2779,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ "num-integer", "num-traits", @@ -2780,7 +2900,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.72", ] [[package]] @@ -2792,7 +2912,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.72", ] [[package]] @@ -2803,9 +2923,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "object" -version = "0.32.2" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" dependencies = [ "memchr", ] @@ -2843,11 +2963,11 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.64" +version = "0.10.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "cfg-if", "foreign-types", "libc", @@ -2864,7 +2984,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.72", ] [[package]] @@ -2875,9 +2995,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.102" +version = "0.9.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" +checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" dependencies = [ "cc", "libc", @@ -2903,9 +3023,9 @@ checksum = "c7594ec0e11d8e33faf03530a4c49af7064ebba81c1480e01be67d90b356508b" dependencies = [ "async-trait", "bytes", - "http", + "http 0.2.12", "opentelemetry_api", - "reqwest", + "reqwest 0.11.27", ] [[package]] @@ -2916,14 +3036,14 @@ checksum = "7e5e5a5c4135864099f3faafbe939eb4d7f9b80ebf68a8448da961b32a7c1275" dependencies = [ "async-trait", "futures-core", - "http", + "http 0.2.12", "opentelemetry-http", "opentelemetry-proto", "opentelemetry-semantic-conventions", "opentelemetry_api", "opentelemetry_sdk", "prost 0.11.9", - "reqwest", + "reqwest 0.11.27", "thiserror", "tokio", "tonic", @@ -3032,9 +3152,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "parity-scale-codec" -version = "3.6.9" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" +checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" dependencies = [ "arrayvec", "bitvec", @@ -3046,11 +3166,11 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.9" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" +checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" dependencies = [ - "proc-macro-crate 2.0.0", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", "syn 1.0.109", @@ -3058,9 +3178,9 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -3068,15 +3188,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.5.3", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] @@ -3092,9 +3212,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "path-absolutize" @@ -3129,7 +3249,7 @@ dependencies = [ "digest", "hmac", "password-hash", - "sha2 0.10.8", + "sha2", ] [[package]] @@ -3168,12 +3288,12 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "petgraph" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.2.3", + "indexmap 2.2.6", ] [[package]] @@ -3216,7 +3336,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.72", ] [[package]] @@ -3239,29 +3359,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.72", ] [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -3275,7 +3395,7 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" dependencies = [ - "der 0.7.8", + "der 0.7.9", "pkcs8 0.10.2", "spki 0.7.3", ] @@ -3296,7 +3416,7 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der 0.7.8", + "der 0.7.9", "spki 0.7.3", ] @@ -3308,9 +3428,9 @@ checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "portable-atomic" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" +checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265" [[package]] name = "powerfmt" @@ -3332,12 +3452,12 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "prettyplease" -version = "0.2.16" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" +checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ "proc-macro2", - "syn 2.0.51", + "syn 2.0.72", ] [[package]] @@ -3364,15 +3484,6 @@ dependencies = [ "toml_edit 0.19.15", ] -[[package]] -name = "proc-macro-crate" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" -dependencies = [ - "toml_edit 0.20.7", -] - [[package]] name = "proc-macro-crate" version = "3.1.0" @@ -3384,18 +3495,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "prometheus-client" -version = "0.22.2" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ca959da22a332509f2a73ae9e5f23f9dcfc31fd3a54d71f159495bd5909baa" +checksum = "504ee9ff529add891127c4827eb481bd69dc0ebc72e9a682e187db4caa60c3ca" dependencies = [ "dtoa", "itoa", @@ -3411,22 +3522,22 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.72", ] [[package]] name = "proptest" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" +checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "lazy_static", "num-traits", "rand", "rand_chacha", "rand_xorshift", - "regex-syntax 0.8.2", + "regex-syntax 0.8.4", "unarray", ] @@ -3457,7 +3568,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" dependencies = [ "bytes", - "heck 0.4.1", + "heck 0.5.0", "itertools 0.12.1", "log", "multimap", @@ -3467,7 +3578,7 @@ dependencies = [ "prost 0.12.6", "prost-types", "regex", - "syn 2.0.51", + "syn 2.0.72", "tempfile", ] @@ -3494,7 +3605,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.72", ] [[package]] @@ -3560,9 +3671,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -3614,9 +3725,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.8.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", @@ -3641,11 +3752,20 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_syscall" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +dependencies = [ + "bitflags 2.6.0", +] + [[package]] name = "redox_users" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ "getrandom", "libredox", @@ -3654,14 +3774,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.3" +version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.5", - "regex-syntax 0.8.2", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -3675,13 +3795,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax 0.8.4", ] [[package]] @@ -3692,33 +3812,74 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] -name = "regex-syntax" -version = "0.8.2" +name = "reqwest" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +dependencies = [ + "base64 0.21.7", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2 0.3.26", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.30", + "hyper-rustls 0.24.2", + "hyper-tls 0.5.0", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls 0.21.12", + "rustls-pemfile 1.0.4", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper 0.1.2", + "system-configuration", + "tokio", + "tokio-native-tls", + "tokio-rustls 0.24.1", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots", + "winreg 0.50.0", +] [[package]] name = "reqwest" -version = "0.11.24" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" +checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "bytes", "encoding_rs", + "futures-channel", "futures-core", "futures-util", - "h2", - "http", - "http-body", - "hyper", - "hyper-rustls", - "hyper-tls", + "h2 0.4.5", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.4.1", + "hyper-rustls 0.27.2", + "hyper-tls 0.6.0", + "hyper-util", "ipnet", "js-sys", "log", @@ -3727,23 +3888,20 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls", - "rustls-pemfile", + "rustls-pemfile 2.1.2", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 1.0.1", "system-configuration", "tokio", "tokio-native-tls", - "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots", - "winreg", + "winreg 0.52.0", ] [[package]] @@ -3850,9 +4008,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hex" @@ -3871,11 +4029,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.31" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", @@ -3890,10 +4048,23 @@ checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", "ring 0.17.8", - "rustls-webpki", + "rustls-webpki 0.101.7", "sct", ] +[[package]] +name = "rustls" +version = "0.23.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4828ea528154ae444e5a642dbb7d5623354030dc9822b83fd9bb79683c7399d0" +dependencies = [ + "once_cell", + "rustls-pki-types", + "rustls-webpki 0.102.5", + "subtle", + "zeroize", +] + [[package]] name = "rustls-pemfile" version = "1.0.4" @@ -3903,6 +4074,22 @@ dependencies = [ "base64 0.21.7", ] +[[package]] +name = "rustls-pemfile" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +dependencies = [ + "base64 0.22.1", + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" + [[package]] name = "rustls-webpki" version = "0.101.7" @@ -3913,17 +4100,28 @@ dependencies = [ "untrusted 0.9.0", ] +[[package]] +name = "rustls-webpki" +version = "0.102.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78" +dependencies = [ + "ring 0.17.8", + "rustls-pki-types", + "untrusted 0.9.0", +] + [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "salsa20" @@ -3945,23 +4143,23 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.10.0" +version = "2.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7d66a1128282b7ef025a8ead62a4a9fcf017382ec53b8ffbf4d7bf77bd3c60" +checksum = "eca070c12893629e2cc820a9761bedf6ce1dcddc9852984d1dc734b8bd9bd024" dependencies = [ "cfg-if", - "derive_more 0.99.17", + "derive_more 0.99.18", "parity-scale-codec", "scale-info-derive", ] [[package]] name = "scale-info-derive" -version = "2.10.0" +version = "2.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" +checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", "syn 1.0.109", @@ -3991,7 +4189,7 @@ dependencies = [ "hmac", "pbkdf2 0.11.0", "salsa20", - "sha2 0.10.8", + "sha2", ] [[package]] @@ -4025,7 +4223,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ "base16ct 0.2.0", - "der 0.7.8", + "der 0.7.9", "generic-array", "pkcs8 0.10.2", "subtle", @@ -4061,11 +4259,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.10.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -4074,9 +4272,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" +checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" dependencies = [ "core-foundation-sys", "libc", @@ -4084,9 +4282,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ "serde", ] @@ -4111,7 +4309,7 @@ checksum = "6ce4b57f1b521f674df7a1d200be8ff5d74e3712020ee25b553146657b5377d5" dependencies = [ "httpdate", "native-tls", - "reqwest", + "reqwest 0.11.27", "sentry-backtrace", "sentry-contexts", "sentry-core", @@ -4208,14 +4406,14 @@ dependencies = [ "thiserror", "time", "url", - "uuid 1.8.0", + "uuid 1.10.0", ] [[package]] name = "serde" -version = "1.0.197" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" dependencies = [ "serde_derive", ] @@ -4232,20 +4430,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.72", ] [[package]] name = "serde_json" -version = "1.0.114" +version = "1.0.120" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" +checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" dependencies = [ "itoa", "ryu", @@ -4254,9 +4452,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" dependencies = [ "serde", ] @@ -4301,7 +4499,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.2.3", + "indexmap 2.2.6", "itoa", "ryu", "serde", @@ -4321,8 +4519,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.6" -source = "git+https://github.com/RustCrypto/hashes.git?rev=1731ced4a116d61ba9dc6ee6d0f38fb8102e357a#1731ced4a116d61ba9dc6ee6d0f38fb8102e357a" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -4330,10 +4529,10 @@ dependencies = [ ] [[package]] -name = "sha2" -version = "0.10.8" +name = "sha2_ce" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +checksum = "eca2daa77078f4ddff27e75c4bf59e4c2697525f56dbb3c842d34a5d1f2b04a2" dependencies = [ "cfg-if", "cpufeatures", @@ -4342,18 +4541,19 @@ dependencies = [ [[package]] name = "sha3" -version = "0.10.6" -source = "git+https://github.com/RustCrypto/hashes.git?rev=7a187e934c1f6c68e4b4e5cf37541b7a0d64d303#7a187e934c1f6c68e4b4e5cf37541b7a0d64d303" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" dependencies = [ "digest", "keccak", ] [[package]] -name = "sha3" -version = "0.10.8" +name = "sha3_ce" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +checksum = "34c9a08202c50378d8a07a5f458193a5f542d2828ac6640263dbc0c2533ea25e" dependencies = [ "digest", "keccak", @@ -4370,9 +4570,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -4436,9 +4636,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "smawk" @@ -4448,9 +4648,9 @@ checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", "windows-sys 0.52.0", @@ -4502,16 +4702,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", - "der 0.7.8", + "der 0.7.9", ] [[package]] name = "sqlformat" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce81b7bd7c4493975347ef60d8c7e8b742d4694f4c49f93e0a12ea263938176c" +checksum = "f895e3734318cc55f1fe66258926c9b910c124d47520339efecbb6c59cec7c1f" dependencies = [ - "itertools 0.12.1", "nom", "unicode_categories", ] @@ -4550,7 +4749,7 @@ dependencies = [ "futures-util", "hashlink", "hex", - "indexmap 2.2.3", + "indexmap 2.2.6", "log", "memchr", "once_cell", @@ -4558,7 +4757,7 @@ dependencies = [ "percent-encoding", "serde", "serde_json", - "sha2 0.10.8", + "sha2", "smallvec", "sqlformat", "thiserror", @@ -4596,7 +4795,7 @@ dependencies = [ "quote", "serde", "serde_json", - "sha2 0.10.8", + "sha2", "sqlx-core", "sqlx-mysql", "sqlx-postgres", @@ -4615,7 +4814,7 @@ checksum = "1ed31390216d20e538e447a7a9b959e06ed9fc51c37b514b46eb758016ecd418" dependencies = [ "atoi", "base64 0.21.7", - "bitflags 2.4.2", + "bitflags 2.6.0", "byteorder", "bytes", "crc", @@ -4640,7 +4839,7 @@ dependencies = [ "rsa", "serde", "sha1", - "sha2 0.10.8", + "sha2", "smallvec", "sqlx-core", "stringprep", @@ -4657,7 +4856,7 @@ checksum = "7c824eb80b894f926f89a0b9da0c7f435d27cdd35b8c655b114e58223918577e" dependencies = [ "atoi", "base64 0.21.7", - "bitflags 2.4.2", + "bitflags 2.6.0", "byteorder", "crc", "dotenvy", @@ -4678,7 +4877,7 @@ dependencies = [ "rand", "serde", "serde_json", - "sha2 0.10.8", + "sha2", "smallvec", "sqlx-core", "stringprep", @@ -4737,13 +4936,13 @@ dependencies = [ [[package]] name = "stringprep" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb41d74e231a107a1b4ee36bd1214b11285b77768d2e3824aedafa988fd36ee6" +checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1" dependencies = [ - "finl_unicode", "unicode-bidi", "unicode-normalization", + "unicode-properties", ] [[package]] @@ -4754,9 +4953,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "strsim" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" @@ -4769,19 +4968,13 @@ dependencies = [ [[package]] name = "strum" -version = "0.25.0" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ - "strum_macros 0.25.3", + "strum_macros 0.26.4", ] -[[package]] -name = "strum" -version = "0.26.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" - [[package]] name = "strum_macros" version = "0.24.3" @@ -4797,35 +4990,22 @@ dependencies = [ [[package]] name = "strum_macros" -version = "0.25.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" -dependencies = [ - "heck 0.4.1", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.51", -] - -[[package]] -name = "strum_macros" -version = "0.26.2" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", "rustversion", - "syn 2.0.51", + "syn 2.0.72", ] [[package]] name = "subtle" -version = "2.4.1" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "svm-rs" @@ -4837,11 +5017,11 @@ dependencies = [ "fs2", "hex", "once_cell", - "reqwest", + "reqwest 0.11.27", "semver", "serde", "serde_json", - "sha2 0.10.8", + "sha2", "thiserror", "url", "zip", @@ -4860,9 +5040,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.51" +version = "2.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ab617d94515e94ae53b8406c628598680aa0c9587474ecbe58188f7b345d66c" +checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" dependencies = [ "proc-macro2", "quote", @@ -4875,6 +5055,12 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "sync_wrapper" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" + [[package]] name = "system-configuration" version = "0.5.1" @@ -4948,22 +5134,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.57" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.57" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.72", ] [[package]] @@ -4978,9 +5164,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.34" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", @@ -4999,9 +5185,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ "num-conv", "time-core", @@ -5018,9 +5204,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -5033,9 +5219,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.37.0" +version = "1.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +checksum = "eb2caba9f80616f438e09748d5acda951967e1ea58508ef53d9c6402485a46df" dependencies = [ "backtrace", "bytes", @@ -5062,13 +5248,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.72", ] [[package]] @@ -5087,7 +5273,18 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls", + "rustls 0.21.12", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +dependencies = [ + "rustls 0.23.11", + "rustls-pki-types", "tokio", ] @@ -5110,44 +5307,43 @@ checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" dependencies = [ "futures-util", "log", - "rustls", + "rustls 0.21.12", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", "tungstenite", "webpki-roots", ] [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] name = "toml" -version = "0.8.12" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" +checksum = "ac2caab0bf757388c6c0ae23b3293fdb463fee59434529014f85e3263b995c28" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.9", + "toml_edit 0.22.16", ] [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" dependencies = [ "serde", ] @@ -5158,18 +5354,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.2.3", - "toml_datetime", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.20.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" -dependencies = [ - "indexmap 2.2.3", + "indexmap 2.2.6", "toml_datetime", "winnow 0.5.40", ] @@ -5180,22 +5365,22 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ - "indexmap 2.2.3", + "indexmap 2.2.6", "toml_datetime", "winnow 0.5.40", ] [[package]] name = "toml_edit" -version = "0.22.9" +version = "0.22.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e40bb779c5187258fd7aad0eb68cb8706a0a81fa712fbea808ab43c4b8374c4" +checksum = "278f3d518e152219c994ce877758516bca5e118eaed6996192a774fb9fbf0788" dependencies = [ - "indexmap 2.2.3", + "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.2", + "winnow 0.6.14", ] [[package]] @@ -5210,10 +5395,10 @@ dependencies = [ "bytes", "futures-core", "futures-util", - "h2", - "http", - "http-body", - "hyper", + "h2 0.3.26", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.30", "hyper-timeout", "percent-encoding", "pin-project", @@ -5278,7 +5463,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.72", ] [[package]] @@ -5386,11 +5571,11 @@ dependencies = [ "byteorder", "bytes", "data-encoding", - "http", + "http 0.2.12", "httparse", "log", "rand", - "rustls", + "rustls 0.21.12", "sha1", "thiserror", "url", @@ -5410,8 +5595,8 @@ dependencies = [ "clap", "ethers", "serde", - "strum 0.26.2", - "strum_macros 0.26.2", + "strum 0.26.3", + "strum_macros 0.26.4", "thiserror", ] @@ -5469,6 +5654,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-properties" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4259d9d4425d9f0661581b804cb85fe66a4c631cadd8f490d1c13a35d5d9291" + [[package]] name = "unicode-segmentation" version = "1.11.0" @@ -5477,9 +5668,9 @@ checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "unicode-xid" @@ -5513,9 +5704,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "ureq" -version = "2.9.7" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d11a831e3c0b56e438a28308e7c810799e3c118417f342d30ecec080105395cd" +checksum = "72139d247e5f97a3eff96229a7ae85ead5328a39efe76f8bf5a06313d505b6ea" dependencies = [ "base64 0.22.1", "log", @@ -5526,9 +5717,9 @@ dependencies = [ [[package]] name = "url" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", @@ -5550,9 +5741,9 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" @@ -5566,9 +5757,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" dependencies = [ "getrandom", "serde", @@ -5595,7 +5786,8 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "vise" version = "0.1.0" -source = "git+https://github.com/matter-labs/vise.git?rev=a5bb80c9ce7168663114ee30e794d6dc32159ee4#a5bb80c9ce7168663114ee30e794d6dc32159ee4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "229baafe01d5177b63c6ee1def80d8e39a2365e64caf69ddb05a57594b15647c" dependencies = [ "compile-fmt", "elsa", @@ -5608,9 +5800,10 @@ dependencies = [ [[package]] name = "vise-exporter" version = "0.1.0" -source = "git+https://github.com/matter-labs/vise.git?rev=a5bb80c9ce7168663114ee30e794d6dc32159ee4#a5bb80c9ce7168663114ee30e794d6dc32159ee4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23981b18d697026f5430249ab01ba739ef2edc463e400042394331cb2bb63494" dependencies = [ - "hyper", + "hyper 0.14.30", "once_cell", "tokio", "tracing", @@ -5620,18 +5813,19 @@ dependencies = [ [[package]] name = "vise-macros" version = "0.1.0" -source = "git+https://github.com/matter-labs/vise.git?rev=a5bb80c9ce7168663114ee30e794d6dc32159ee4#a5bb80c9ce7168663114ee30e794d6dc32159ee4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bb19c33cd5f04dcf4e767635e058a998edbc2b7fca32ade0a4a1cea0f8e9b34" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.72", ] [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -5660,9 +5854,9 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -5670,24 +5864,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.72", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.41" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -5697,9 +5891,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -5707,28 +5901,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.72", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "web-sys" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -5746,7 +5940,7 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a44ab49fad634e88f55bf8f9bb3abd2f27d7204172a112c7c9987e01c1c94ea9" dependencies = [ - "redox_syscall", + "redox_syscall 0.4.1", "wasite", ] @@ -5768,11 +5962,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -5787,7 +5981,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.3", + "windows-targets 0.52.6", ] [[package]] @@ -5805,7 +5999,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.3", + "windows-targets 0.52.6", ] [[package]] @@ -5825,17 +6019,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d380ba1dc7187569a8a9e91ed34b8ccfc33123bbacb8c0aed2d1ad7f3ef2dc5f" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.3", - "windows_aarch64_msvc 0.52.3", - "windows_i686_gnu 0.52.3", - "windows_i686_msvc 0.52.3", - "windows_x86_64_gnu 0.52.3", - "windows_x86_64_gnullvm 0.52.3", - "windows_x86_64_msvc 0.52.3", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -5846,9 +6041,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68e5dcfb9413f53afd9c8f86e56a7b4d86d9a2fa26090ea2dc9e40fba56c6ec6" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -5858,9 +6053,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dab469ebbc45798319e69eebf92308e541ce46760b49b18c6b3fe5e8965b30f" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -5870,9 +6065,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a4e9b6a7cac734a8b4138a4e1044eac3404d8326b6c0f939276560687a033fb" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -5882,9 +6083,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b0ec9c422ca95ff34a78755cfa6ad4a51371da2a5ace67500cf7ca5f232c58" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -5894,9 +6095,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704131571ba93e89d7cd43482277d6632589b18ecf4468f591fbae0a8b101614" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -5906,9 +6107,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42079295511643151e98d61c38c0acc444e52dd42ab456f7ccfd5152e8ecf21c" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -5918,9 +6119,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0770833d60a970638e989b3fa9fd2bb1aaadcf88963d1659fd7d9990196ed2d6" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" @@ -5933,9 +6134,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.2" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a4191c47f15cc3ec71fcb4913cb83d58def65dd3787610213c649283b5ce178" +checksum = "374ec40a2d767a3c1b4972d9475ecd557356637be906f2cb3f7fe17a6eb5e22f" dependencies = [ "memchr", ] @@ -5950,6 +6151,16 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "winreg" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + [[package]] name = "ws_stream_wasm" version = "0.7.4" @@ -6001,29 +6212,29 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.72", ] [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" dependencies = [ "zeroize_derive", ] @@ -6036,7 +6247,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.72", ] [[package]] @@ -6061,8 +6272,9 @@ dependencies = [ [[package]] name = "zk_evm" -version = "1.3.3" -source = "git+https://github.com/matter-labs/era-zk_evm.git?tag=v1.3.3-rc2#fbee20f5bac7d6ca3e22ae69b2077c510a07de4e" +version = "0.133.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9af08e9284686a1b0c89ec4931eb915ac0729367f1247abd06164874fe738106" dependencies = [ "anyhow", "lazy_static", @@ -6076,8 +6288,9 @@ dependencies = [ [[package]] name = "zk_evm_abstractions" -version = "0.1.0" -source = "git+https://github.com/matter-labs/era-zk_evm_abstractions.git#32dd320953841aa78579d9da08abbc70bcaed175" +version = "0.140.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be696258861eba4e6625a5665084b2266720bb67f4ba69819469700ac5c6a401" dependencies = [ "anyhow", "num_enum 0.6.1", @@ -6099,18 +6312,20 @@ dependencies = [ "ethers", "human-panic", "lazy_static", + "path-absolutize", "serde", "serde_json", "serde_yaml", "slugify-rs", - "strum 0.26.2", - "strum_macros 0.26.2", + "strum 0.26.3", + "strum_macros 0.26.4", "thiserror", "tokio", "toml", "types", "url", "xshell", + "zksync_config", ] [[package]] @@ -6123,8 +6338,8 @@ dependencies = [ "config", "human-panic", "serde", - "strum 0.26.2", - "strum_macros 0.26.2", + "strum 0.26.3", + "strum_macros 0.26.4", "tokio", "url", "xshell", @@ -6132,16 +6347,17 @@ dependencies = [ [[package]] name = "zkevm_opcode_defs" -version = "1.3.2" -source = "git+https://github.com/matter-labs/era-zkevm_opcode_defs.git?branch=v1.3.2#dffacadeccdfdbff4bc124d44c595c4a6eae5013" +version = "0.132.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0769f7b27d8fb06e715da3290c575cac5d04d10a557faef180e847afce50ac4" dependencies = [ - "bitflags 2.4.2", - "blake2 0.10.6 (git+https://github.com/RustCrypto/hashes.git?rev=1f727ce37ff40fa0cce84eb8543a45bdd3ca4a4e)", + "bitflags 2.6.0", + "blake2", "ethereum-types", "k256 0.11.6", "lazy_static", - "sha2 0.10.6", - "sha3 0.10.6", + "sha2_ce", + "sha3_ce", ] [[package]] @@ -6164,14 +6380,15 @@ dependencies = [ [[package]] name = "zksync_concurrency" -version = "0.1.0" -source = "git+https://github.com/matter-labs/era-consensus.git?rev=3e6f101ee4124308c4c974caaa259d524549b0c6#3e6f101ee4124308c4c974caaa259d524549b0c6" +version = "0.1.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1af85d9a31c534a29877c88474cf5f1c46ad25f7c48efff61ea40f4aa83c5459" dependencies = [ "anyhow", "once_cell", "pin-project", "rand", - "sha3 0.10.8", + "sha3", "thiserror", "time", "tokio", @@ -6188,16 +6405,20 @@ dependencies = [ "rand", "secrecy", "serde", + "url", "zksync_basic_types", + "zksync_concurrency", "zksync_consensus_utils", "zksync_crypto_primitives", ] [[package]] name = "zksync_consensus_utils" -version = "0.1.0" -source = "git+https://github.com/matter-labs/era-consensus.git?rev=3e6f101ee4124308c4c974caaa259d524549b0c6#3e6f101ee4124308c4c974caaa259d524549b0c6" +version = "0.1.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "587de103f745d0b88b49a9fb98cb002c4b7ce6ad042e17845091dce67b8aa984" dependencies = [ + "anyhow", "rand", "thiserror", "zksync_concurrency", @@ -6220,11 +6441,11 @@ dependencies = [ name = "zksync_crypto" version = "0.1.0" dependencies = [ - "blake2 0.10.6 (registry+https://github.com/rust-lang/crates.io-index)", + "blake2", "hex", "once_cell", "serde", - "sha2 0.10.8", + "sha2", "thiserror", "zksync_basic_types", ] @@ -6255,8 +6476,9 @@ dependencies = [ [[package]] name = "zksync_protobuf" -version = "0.1.0" -source = "git+https://github.com/matter-labs/era-consensus.git?rev=3e6f101ee4124308c4c974caaa259d524549b0c6#3e6f101ee4124308c4c974caaa259d524549b0c6" +version = "0.1.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d86baa84d8bbbbeea269c0f99aca88364e4fd2a08e6ae7051ff87317132b4ef9" dependencies = [ "anyhow", "bit-vec", @@ -6275,8 +6497,9 @@ dependencies = [ [[package]] name = "zksync_protobuf_build" -version = "0.1.0" -source = "git+https://github.com/matter-labs/era-consensus.git?rev=3e6f101ee4124308c4c974caaa259d524549b0c6#3e6f101ee4124308c4c974caaa259d524549b0c6" +version = "0.1.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f221ce83f4622c3d8732d09f4461d116d7b10f1cc9d1d1cd014c1fa836c168e6" dependencies = [ "anyhow", "heck 0.5.0", @@ -6286,7 +6509,7 @@ dependencies = [ "prost-reflect", "protox", "quote", - "syn 2.0.51", + "syn 2.0.72", ] [[package]] @@ -6321,7 +6544,8 @@ name = "zksync_types" version = "0.1.0" dependencies = [ "anyhow", - "blake2 0.10.6 (registry+https://github.com/rust-lang/crates.io-index)", + "bigdecimal", + "blake2", "chrono", "derive_more 1.0.0-beta.6", "hex", @@ -6336,6 +6560,7 @@ dependencies = [ "serde_json", "strum 0.24.1", "thiserror", + "tracing", "zksync_basic_types", "zksync_config", "zksync_contracts", @@ -6358,7 +6583,7 @@ dependencies = [ "itertools 0.10.5", "num", "once_cell", - "reqwest", + "reqwest 0.12.5", "serde", "serde_json", "thiserror", @@ -6410,9 +6635,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.9+zstd.1.5.5" +version = "2.0.12+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" +checksum = "0a4e40c320c3cb459d9a9ff6de98cff88f4751ee9275d140e2be94a2b74e4c13" dependencies = [ "cc", "pkg-config", diff --git a/zk_toolbox/Cargo.toml b/zk_toolbox/Cargo.toml index 51875abba0f5..32fde939a796 100644 --- a/zk_toolbox/Cargo.toml +++ b/zk_toolbox/Cargo.toml @@ -25,13 +25,11 @@ keywords = ["zk", "cryptography", "blockchain", "ZKStack", "ZKsync"] common = { path = "crates/common" } config = { path = "crates/config" } types = { path = "crates/types" } -zksync_config = { path = "../core/lib/config" } -zksync_protobuf_config = { path = "../core/lib/protobuf_config" } # ZkSync deps zksync_config = { path = "../core/lib/config" } zksync_protobuf_config = { path = "../core/lib/protobuf_config" } -zksync_protobuf = { version = "0.1.0", git = "https://github.com/matter-labs/era-consensus.git", rev = "3e6f101ee4124308c4c974caaa259d524549b0c6" } +zksync_protobuf = "=0.1.0-rc.2" # External dependencies anyhow = "1.0.82" diff --git a/zk_toolbox/crates/config/src/chain.rs b/zk_toolbox/crates/config/src/chain.rs index 65caa0deaac0..fe790090808c 100644 --- a/zk_toolbox/crates/config/src/chain.rs +++ b/zk_toolbox/crates/config/src/chain.rs @@ -112,17 +112,7 @@ impl ChainConfig { self.configs.join(SECRETS_FILE) } - pub fn get_zksync_general_config(&self) -> anyhow::Result { - decode_yaml_repr::( - &self.configs.join(GENERAL_FILE), - false, - ) - } - - pub fn save_zksync_general_config( - &self, - general_config: &ZkSyncGeneralConfig, - ) -> anyhow::Result<()> { + pub fn save_general_config(&self, general_config: &ZkSyncGeneralConfig) -> anyhow::Result<()> { let path = self.configs.join(GENERAL_FILE); let bytes = encode_yaml_repr::( general_config, diff --git a/zk_toolbox/crates/config/src/general.rs b/zk_toolbox/crates/config/src/general.rs index 3708b7257265..c612cf26c82b 100644 --- a/zk_toolbox/crates/config/src/general.rs +++ b/zk_toolbox/crates/config/src/general.rs @@ -1,27 +1,22 @@ -use std::path::PathBuf; +use std::ops::Deref; +use std::path::{Path, PathBuf}; use anyhow::Context; -use serde::{Deserialize, Serialize}; use url::Url; +use xshell::Shell; pub use zksync_config::configs::GeneralConfig; +use zksync_protobuf_config::encode_yaml_repr; -use crate::{consts::GENERAL_FILE, traits::FileConfigWithDefaultName}; +use crate::{ + consts::GENERAL_FILE, + traits::{FileConfigWithDefaultName, SaveConfig}, +}; pub struct RocksDbs { pub state_keeper: PathBuf, pub merkle_tree: PathBuf, } -// #[derive(Debug, Deserialize, Serialize, Clone)] -// pub struct GeneralConfig { -// pub db: RocksDBConfig, -// pub eth: EthConfig, -// pub api: ApiConfig, -// #[serde(flatten)] -// pub other: serde_json::Value, -// } - -// impl GeneralConfig { pub fn set_rocks_db_config(config: &mut GeneralConfig, rocks_dbs: RocksDbs) -> anyhow::Result<()> { config .db_config @@ -101,3 +96,11 @@ impl PortsConfig { } } } + +impl SaveConfig for GeneralConfig { + fn save(&self, shell: &Shell, path: impl AsRef) -> anyhow::Result<()> { + let bytes = + encode_yaml_repr::(&self)?; + Ok(shell.write_file(path, bytes)?) + } +} diff --git a/zk_toolbox/crates/config/src/traits.rs b/zk_toolbox/crates/config/src/traits.rs index 6d4857333be0..1e266872df82 100644 --- a/zk_toolbox/crates/config/src/traits.rs +++ b/zk_toolbox/crates/config/src/traits.rs @@ -6,7 +6,6 @@ use common::files::{ }; use serde::{de::DeserializeOwned, Serialize}; use xshell::Shell; -use zksync_protobuf::repr::ProtoRepr; pub trait FileConfig {} @@ -22,13 +21,15 @@ impl FileConfig for T where T: FileConfigWithDefaultName {} // impl ReadConfig for T where T: FileConfig + Clone {} -impl SaveConfig for T where T: FileConfig + Serialize {} - -impl SaveConfigWithComment for T where T: FileConfig + Serialize {} +impl SaveConfig for T { + fn save(&self, shell: &Shell, path: impl AsRef) -> anyhow::Result<()> { + save_with_comment(shell, path, &self, "") + } +} impl ReadConfigWithBasePath for T where T: FileConfigWithDefaultName + DeserializeOwned + Clone {} -impl SaveConfigWithBasePath for T where T: FileConfigWithDefaultName + Serialize {} +impl SaveConfigWithBasePath for T where T: FileConfigWithDefaultName + Serialize + Sized {} impl SaveConfigWithCommentAndBasePath for T where T: FileConfigWithDefaultName + Serialize {} @@ -86,10 +87,8 @@ pub trait ReadConfigWithBasePath: ReadConfig + FileConfigWithDefaultName { /// Saves a config file to a given path, correctly parsing file extension. /// Supported file extensions are: `yaml`, `yml`, `toml`, `json`. -pub trait SaveConfig: Serialize + Sized { - fn save(&self, shell: &Shell, path: impl AsRef) -> anyhow::Result<()> { - save_with_comment(shell, path, self, "") - } +pub trait SaveConfig { + fn save(&self, shell: &Shell, path: impl AsRef) -> anyhow::Result<()>; } /// Saves a config file from a base path, correctly parsing file extension. @@ -106,7 +105,16 @@ pub trait SaveConfigWithBasePath: SaveConfig + FileConfigWithDefaultName { /// Saves a config file to a given path, correctly parsing file extension. /// Supported file extensions are: `yaml`, `yml`, `toml`. -pub trait SaveConfigWithComment: Serialize + Sized { +pub trait SaveConfigWithComment: Sized { + fn save_with_comment( + &self, + shell: &Shell, + path: impl AsRef, + comment: &str, + ) -> anyhow::Result<()>; +} + +impl SaveConfigWithComment for T { fn save_with_comment( &self, shell: &Shell, diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/genesis.rs b/zk_toolbox/crates/zk_inception/src/commands/chain/genesis.rs index b42a1138229d..ca93da031c0b 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/chain/genesis.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/chain/genesis.rs @@ -9,12 +9,14 @@ use common::{ spinner::Spinner, }; use config::{ + set_rocks_db_config, traits::{FileConfigWithDefaultName, SaveConfigWithBasePath}, ChainConfig, ContractsConfig, EcosystemConfig, GeneralConfig, GenesisConfig, SecretsConfig, WalletsConfig, }; use types::ProverMode; use xshell::Shell; +use zksync_config::configs::eth_sender::ProofSendingMode; use super::args::genesis::GenesisArgsFinal; use crate::{ @@ -55,9 +57,14 @@ pub async fn genesis( let rocks_db = recreate_rocksdb_dirs(shell, &config.rocks_db_path, RocksDBDirOption::Main) .context(MSG_RECREATE_ROCKS_DB_ERRROR)?; let mut general = config.get_general_config()?; - general.set_rocks_db_config(rocks_db)?; + set_rocks_db_config(&mut general, rocks_db)?; if config.prover_version != ProverMode::NoProofs { - general.eth.sender.proof_sending_mode = "ONLY_REAL_PROOFS".to_string(); + general + .eth + .context("eth")? + .sender + .context("sender")? + .proof_sending_mode = ProofSendingMode::OnlyRealProofs; } general.save_with_base_path(shell, &config.configs)?; diff --git a/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs b/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs index 09e9d1b460c4..16d14515d7b2 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs @@ -3,8 +3,8 @@ use std::path::Path; use anyhow::Context; use common::{config::global_config, logger}; use config::{ - external_node::ENConfig, traits::SaveConfigWithBasePath, ChainConfig, DatabaseSecrets, - EcosystemConfig, L1Secret, SecretsConfig, + external_node::ENConfig, ports_config, traits::SaveConfigWithBasePath, update_ports, + ChainConfig, DatabaseSecrets, EcosystemConfig, L1Secret, SecretsConfig, }; use xshell::Shell; @@ -51,11 +51,22 @@ fn prepare_configs( l1_batch_commit_data_generator_mode: genesis .l1_batch_commit_data_generator_mode .unwrap_or_default(), - main_node_url: general.api.web3_json_rpc.http_url.clone(), + main_node_url: general + .api_config + .context("api_config")? + .web3_json_rpc + .http_url + .clone(), main_node_rate_limit_rps: None, }; let mut general_en = general.clone(); - general_en.update_ports(&general.ports_config().next_empty_ports_config())?; + + update_ports( + &mut general_en, + &ports_config(&general) + .context("da")? + .next_empty_ports_config(), + )?; let secrets = SecretsConfig { database: DatabaseSecrets { server_url: args.db.full_url(), diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/init.rs b/zk_toolbox/crates/zk_inception/src/commands/prover/init.rs index 31785338bf3e..54b53b8576db 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/prover/init.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/prover/init.rs @@ -29,7 +29,7 @@ pub(crate) async fn run(args: ProverInitArgs, shell: &Shell) -> anyhow::Result<( .load_chain(Some(ecosystem_config.default_chain.clone())) .context(MSG_CHAIN_NOT_FOUND_ERR)?; let mut general_config = chain_config - .get_zksync_general_config() + .get_general_config() .context(MSG_GENERAL_CONFIG_NOT_FOUND_ERR)?; let setup_key_path = get_default_setup_key_path(&ecosystem_config)?; @@ -67,7 +67,7 @@ pub(crate) async fn run(args: ProverInitArgs, shell: &Shell) -> anyhow::Result<( proof_compressor_config.universal_setup_path = args.setup_key_config.setup_key_path; general_config.proof_compressor_config = Some(proof_compressor_config); - chain_config.save_zksync_general_config(&general_config)?; + chain_config.save_general_config(&general_config)?; init_bellman_cuda(shell, args.bellman_cuda_config).await?; From b8fb813ef5f9828c5a982ed48ffa5030a0da1a79 Mon Sep 17 00:00:00 2001 From: Danil Date: Tue, 23 Jul 2024 13:35:01 +0200 Subject: [PATCH 03/16] Migrate general to the main repo Signed-off-by: Danil --- zk_toolbox/crates/config/src/chain.rs | 3 +++ zk_toolbox/crates/config/src/contracts.rs | 2 ++ zk_toolbox/crates/config/src/ecosystem.rs | 3 +++ zk_toolbox/crates/config/src/external_node.rs | 3 +++ .../forge_interface/deploy_ecosystem/input.rs | 4 ++++ .../forge_interface/deploy_ecosystem/output.rs | 2 ++ zk_toolbox/crates/config/src/general.rs | 1 - zk_toolbox/crates/config/src/genesis.rs | 3 +++ zk_toolbox/crates/config/src/secrets.rs | 3 +++ zk_toolbox/crates/config/src/traits.rs | 16 ++++++++++------ zk_toolbox/crates/config/src/wallets.rs | 2 ++ .../zk_inception/src/commands/chain/genesis.rs | 10 +++++----- .../commands/external_node/prepare_configs.rs | 9 +++++---- 13 files changed, 45 insertions(+), 16 deletions(-) diff --git a/zk_toolbox/crates/config/src/chain.rs b/zk_toolbox/crates/config/src/chain.rs index fe790090808c..e6a7740f6380 100644 --- a/zk_toolbox/crates/config/src/chain.rs +++ b/zk_toolbox/crates/config/src/chain.rs @@ -20,6 +20,7 @@ use crate::{ traits::{FileConfigWithDefaultName, ReadConfig, SaveConfig, SaveConfigWithBasePath}, ContractsConfig, GeneralConfig, GenesisConfig, SecretsConfig, WalletsConfig, }; +use crate::traits::FileConfig; /// Chain configuration file. This file is created in the chain /// directory before network initialization. @@ -154,3 +155,5 @@ impl ChainConfig { impl FileConfigWithDefaultName for ChainConfigInternal { const FILE_NAME: &'static str = CONFIG_NAME; } + +impl FileConfig for ChainConfigInternal {} diff --git a/zk_toolbox/crates/config/src/contracts.rs b/zk_toolbox/crates/config/src/contracts.rs index a4c00a10a455..03706d83cd10 100644 --- a/zk_toolbox/crates/config/src/contracts.rs +++ b/zk_toolbox/crates/config/src/contracts.rs @@ -89,6 +89,8 @@ impl FileConfigWithDefaultName for ContractsConfig { const FILE_NAME: &'static str = CONTRACTS_FILE; } +impl FileConfig for ContractsConfig {} + #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Default)] pub struct EcosystemContracts { pub bridgehub_proxy_addr: Address, diff --git a/zk_toolbox/crates/config/src/ecosystem.rs b/zk_toolbox/crates/config/src/ecosystem.rs index 60ca22e9a9b0..45dfc3eeab59 100644 --- a/zk_toolbox/crates/config/src/ecosystem.rs +++ b/zk_toolbox/crates/config/src/ecosystem.rs @@ -6,6 +6,7 @@ use thiserror::Error; use types::{ChainId, L1Network, ProverMode, WalletCreation}; use xshell::Shell; +use crate::traits::FileConfig; use crate::{ consts::{ CONFIGS_PATH, CONFIG_NAME, CONTRACTS_FILE, ECOSYSTEM_PATH, ERA_CHAIN_ID, @@ -95,6 +96,8 @@ impl FileConfigWithDefaultName for EcosystemConfig { const FILE_NAME: &'static str = CONFIG_NAME; } +impl FileConfig for EcosystemConfig {} + impl EcosystemConfig { fn get_shell(&self) -> &Shell { self.shell.get().expect("Must be initialized") diff --git a/zk_toolbox/crates/config/src/external_node.rs b/zk_toolbox/crates/config/src/external_node.rs index 87acb15e4d8c..720af9fdbfbe 100644 --- a/zk_toolbox/crates/config/src/external_node.rs +++ b/zk_toolbox/crates/config/src/external_node.rs @@ -4,6 +4,7 @@ use serde::{Deserialize, Serialize}; use types::{ChainId, L1BatchCommitDataGeneratorMode}; use crate::{consts::EN_CONFIG_FILE, traits::FileConfigWithDefaultName}; +use crate::traits::FileConfig; #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] pub struct ENConfig { @@ -21,3 +22,5 @@ pub struct ENConfig { impl FileConfigWithDefaultName for ENConfig { const FILE_NAME: &'static str = EN_CONFIG_FILE; } + +impl FileConfig for ENConfig {} diff --git a/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/input.rs b/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/input.rs index e0ad2ac70cdc..8a367d522f4e 100644 --- a/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/input.rs +++ b/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/input.rs @@ -61,6 +61,8 @@ impl FileConfigWithDefaultName for InitialDeploymentConfig { const FILE_NAME: &'static str = INITIAL_DEPLOYMENT_FILE; } +impl FileConfig for InitialDeploymentConfig {} + #[derive(Debug, Deserialize, Serialize, Clone)] pub struct Erc20DeploymentConfig { pub tokens: Vec, @@ -70,6 +72,8 @@ impl FileConfigWithDefaultName for Erc20DeploymentConfig { const FILE_NAME: &'static str = INITIAL_DEPLOYMENT_FILE; } +impl FileConfig for Erc20DeploymentConfig {} + impl Default for Erc20DeploymentConfig { fn default() -> Self { Self { diff --git a/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/output.rs b/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/output.rs index 874414ccc1a4..9af7541ee1c1 100644 --- a/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/output.rs +++ b/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/output.rs @@ -96,3 +96,5 @@ pub struct DeployErc20Output { impl FileConfigWithDefaultName for DeployErc20Output { const FILE_NAME: &'static str = ERC20_CONFIGS_FILE; } + +impl FileConfig for DeployErc20Output {} diff --git a/zk_toolbox/crates/config/src/general.rs b/zk_toolbox/crates/config/src/general.rs index c612cf26c82b..5b32e4d65b5a 100644 --- a/zk_toolbox/crates/config/src/general.rs +++ b/zk_toolbox/crates/config/src/general.rs @@ -1,4 +1,3 @@ -use std::ops::Deref; use std::path::{Path, PathBuf}; use anyhow::Context; diff --git a/zk_toolbox/crates/config/src/genesis.rs b/zk_toolbox/crates/config/src/genesis.rs index e666931870a8..22eedb92e07f 100644 --- a/zk_toolbox/crates/config/src/genesis.rs +++ b/zk_toolbox/crates/config/src/genesis.rs @@ -2,6 +2,7 @@ use ethers::types::{Address, H256}; use serde::{Deserialize, Serialize}; use types::{ChainId, L1BatchCommitDataGeneratorMode, ProtocolSemanticVersion}; +use crate::traits::FileConfig; use crate::{consts::GENESIS_FILE, traits::FileConfigWithDefaultName, ChainConfig}; #[derive(Debug, Deserialize, Serialize, Clone)] @@ -32,3 +33,5 @@ impl GenesisConfig { impl FileConfigWithDefaultName for GenesisConfig { const FILE_NAME: &'static str = GENESIS_FILE; } + +impl FileConfig for GenesisConfig {} diff --git a/zk_toolbox/crates/config/src/secrets.rs b/zk_toolbox/crates/config/src/secrets.rs index 98a9be6ffe61..b373e1a58ef4 100644 --- a/zk_toolbox/crates/config/src/secrets.rs +++ b/zk_toolbox/crates/config/src/secrets.rs @@ -2,6 +2,7 @@ use common::db::DatabaseConfig; use serde::{Deserialize, Serialize}; use url::Url; +use crate::traits::FileConfig; use crate::{consts::SECRETS_FILE, traits::FileConfigWithDefaultName}; #[derive(Debug, Clone, Serialize, Deserialize)] @@ -46,3 +47,5 @@ impl SecretsConfig { impl FileConfigWithDefaultName for SecretsConfig { const FILE_NAME: &'static str = SECRETS_FILE; } + +impl FileConfig for SecretsConfig {} diff --git a/zk_toolbox/crates/config/src/traits.rs b/zk_toolbox/crates/config/src/traits.rs index 1e266872df82..8c4f0f776030 100644 --- a/zk_toolbox/crates/config/src/traits.rs +++ b/zk_toolbox/crates/config/src/traits.rs @@ -17,8 +17,6 @@ pub trait FileConfigWithDefaultName { } } -impl FileConfig for T where T: FileConfigWithDefaultName {} - // impl ReadConfig for T where T: FileConfig + Clone {} impl SaveConfig for T { @@ -27,11 +25,17 @@ impl SaveConfig for T { } } -impl ReadConfigWithBasePath for T where T: FileConfigWithDefaultName + DeserializeOwned + Clone {} +impl ReadConfigWithBasePath for T +where + T: FileConfigWithDefaultName + DeserializeOwned + Clone + FileConfig, +{} -impl SaveConfigWithBasePath for T where T: FileConfigWithDefaultName + Serialize + Sized {} +impl SaveConfigWithBasePath for T where T: FileConfigWithDefaultName + SaveConfig {} -impl SaveConfigWithCommentAndBasePath for T where T: FileConfigWithDefaultName + Serialize {} +impl SaveConfigWithCommentAndBasePath for T +where + T: FileConfigWithDefaultName + Serialize + FileConfig, +{} /// Reads a config file from a given path, correctly parsing file extension. /// Supported file extensions are: `yaml`, `yml`, `toml`, `json`. @@ -139,7 +143,7 @@ impl SaveConfigWithComment for T { /// Saves a config file from a base path, correctly parsing file extension. /// Supported file extensions are: `yaml`, `yml`, `toml`. pub trait SaveConfigWithCommentAndBasePath: - SaveConfigWithComment + FileConfigWithDefaultName +SaveConfigWithComment + FileConfigWithDefaultName + FileConfig { fn save_with_comment_and_base_path( &self, diff --git a/zk_toolbox/crates/config/src/wallets.rs b/zk_toolbox/crates/config/src/wallets.rs index 91958195c232..cfa4741f5824 100644 --- a/zk_toolbox/crates/config/src/wallets.rs +++ b/zk_toolbox/crates/config/src/wallets.rs @@ -61,3 +61,5 @@ pub(crate) struct EthMnemonicConfig { } impl FileConfig for EthMnemonicConfig {} + +impl FileConfig for WalletsConfig {} diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/genesis.rs b/zk_toolbox/crates/zk_inception/src/commands/chain/genesis.rs index ca93da031c0b..53ced5c08694 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/chain/genesis.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/chain/genesis.rs @@ -60,9 +60,9 @@ pub async fn genesis( set_rocks_db_config(&mut general, rocks_db)?; if config.prover_version != ProverMode::NoProofs { general - .eth + .eth.as_mut() .context("eth")? - .sender + .sender.as_mut() .context("sender")? .proof_sending_mode = ProofSendingMode::OnlyRealProofs; } @@ -90,7 +90,7 @@ pub async fn genesis( config.link_to_code.clone(), args.dont_drop, ) - .await?; + .await?; spinner.finish(); let spinner = Spinner::new(MSG_STARTING_GENESIS_SPINNER); @@ -123,7 +123,7 @@ async fn initialize_databases( path_to_server_migration, &server_db_config.full_url(), ) - .await?; + .await?; if global_config().verbose { logger::debug(MSG_INITIALIZING_PROVER_DATABASE) @@ -140,7 +140,7 @@ async fn initialize_databases( path_to_prover_migration, &prover_db_config.full_url(), ) - .await?; + .await?; Ok(()) } diff --git a/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs b/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs index 16d14515d7b2..7cedf7e7f7ba 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs @@ -3,8 +3,8 @@ use std::path::Path; use anyhow::Context; use common::{config::global_config, logger}; use config::{ - external_node::ENConfig, ports_config, traits::SaveConfigWithBasePath, update_ports, - ChainConfig, DatabaseSecrets, EcosystemConfig, L1Secret, SecretsConfig, + external_node::ENConfig, ports_config, set_rocks_db_config, traits::SaveConfigWithBasePath, + update_ports, ChainConfig, DatabaseSecrets, EcosystemConfig, L1Secret, SecretsConfig, }; use xshell::Shell; @@ -44,7 +44,7 @@ fn prepare_configs( args: PrepareConfigFinal, ) -> anyhow::Result<()> { let genesis = config.get_genesis_config()?; - let general = config.get_general_config()?; + let mut general = config.get_general_config()?; let en_config = ENConfig { l2_chain_id: genesis.l2_chain_id, l1_chain_id: genesis.l1_chain_id, @@ -53,6 +53,7 @@ fn prepare_configs( .unwrap_or_default(), main_node_url: general .api_config + .as_ref() .context("api_config")? .web3_json_rpc .http_url @@ -81,7 +82,7 @@ fn prepare_configs( }; secrets.save_with_base_path(shell, en_configs_path)?; let dirs = recreate_rocksdb_dirs(shell, &config.rocks_db_path, RocksDBDirOption::ExternalNode)?; - general_en.set_rocks_db_config(dirs)?; + set_rocks_db_config(&mut general, dirs)?; general_en.save_with_base_path(shell, en_configs_path)?; en_config.save_with_base_path(shell, en_configs_path)?; From 374b26188d3bb286d043fc63aca7d3d94de99b73 Mon Sep 17 00:00:00 2001 From: Danil Date: Tue, 23 Jul 2024 15:28:27 +0200 Subject: [PATCH 04/16] Add genesis file support Signed-off-by: Danil --- Cargo.lock | 12 ++-- Cargo.toml | 2 +- core/lib/basic_types/src/commitment.rs | 3 +- core/lib/config/src/configs/general.rs | 2 +- prover/Cargo.toml | 2 +- zk_toolbox/Cargo.lock | 46 ++++------------ zk_toolbox/Cargo.toml | 6 +- zk_toolbox/crates/common/Cargo.toml | 4 +- zk_toolbox/crates/common/src/ethereum.rs | 4 +- zk_toolbox/crates/common/src/forge.rs | 2 +- zk_toolbox/crates/config/Cargo.toml | 2 +- zk_toolbox/crates/config/src/chain.rs | 21 +++---- zk_toolbox/crates/config/src/ecosystem.rs | 3 +- zk_toolbox/crates/config/src/external_node.rs | 10 ++-- .../forge_interface/deploy_ecosystem/input.rs | 14 ++--- .../forge_interface/register_chain/input.rs | 7 ++- zk_toolbox/crates/config/src/general.rs | 11 +++- zk_toolbox/crates/config/src/genesis.rs | 55 +++++++++---------- zk_toolbox/crates/config/src/secrets.rs | 6 +- zk_toolbox/crates/config/src/traits.rs | 37 +++---------- zk_toolbox/crates/types/Cargo.toml | 2 +- .../l1_batch_commit_data_generator_mode.rs | 21 ------- zk_toolbox/crates/types/src/l1_network.rs | 6 +- zk_toolbox/crates/types/src/lib.rs | 3 +- zk_toolbox/crates/types/src/prover_mode.rs | 13 +---- .../crates/types/src/wallet_creation.rs | 4 +- zk_toolbox/crates/zk_inception/Cargo.toml | 1 - .../src/commands/chain/args/create.rs | 49 +++++++++++------ .../src/commands/chain/genesis.rs | 12 ++-- .../zk_inception/src/commands/chain/init.rs | 4 +- .../src/commands/ecosystem/args/create.rs | 7 ++- .../commands/external_node/prepare_configs.rs | 9 ++- .../src/commands/prover/args/init.rs | 5 +- .../src/commands/prover/args/run.rs | 6 +- zk_toolbox/crates/zk_supervisor/Cargo.toml | 1 - .../commands/database/args/new_migration.rs | 3 +- 36 files changed, 169 insertions(+), 226 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aa88c84975ad..4c3648e50389 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6401,24 +6401,24 @@ dependencies = [ [[package]] name = "strum" -version = "0.24.1" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ "strum_macros", ] [[package]] name = "strum_macros" -version = "0.24.3" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2 1.0.69", "quote 1.0.33", "rustversion", - "syn 1.0.109", + "syn 2.0.38", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index f36af0a33c3e..1d722daf3aac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -164,7 +164,7 @@ sha3 = "0.10.8" sqlx = "0.7.3" static_assertions = "1.1" structopt = "0.3.20" -strum = "0.24" +strum = "0.26" tempfile = "3.0.2" test-casing = "0.1.2" test-log = "0.2.15" diff --git a/core/lib/basic_types/src/commitment.rs b/core/lib/basic_types/src/commitment.rs index 873dff2313a2..eca339f40f42 100644 --- a/core/lib/basic_types/src/commitment.rs +++ b/core/lib/basic_types/src/commitment.rs @@ -1,4 +1,5 @@ use serde::{Deserialize, Serialize}; +use strum::{Display, EnumIter}; use crate::{ ethabi, @@ -6,7 +7,7 @@ use crate::{ U256, }; -#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Serialize, Deserialize)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Serialize, Deserialize, EnumIter, Display)] pub enum L1BatchCommitmentMode { #[default] Rollup, diff --git a/core/lib/config/src/configs/general.rs b/core/lib/config/src/configs/general.rs index e80538b2a4b9..78e94e8c2af7 100644 --- a/core/lib/config/src/configs/general.rs +++ b/core/lib/config/src/configs/general.rs @@ -17,7 +17,7 @@ use crate::{ SnapshotsCreatorConfig, }; -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct GeneralConfig { pub postgres_config: Option, pub api_config: Option, diff --git a/prover/Cargo.toml b/prover/Cargo.toml index 4e6d7791f056..7863718cb080 100644 --- a/prover/Cargo.toml +++ b/prover/Cargo.toml @@ -58,7 +58,7 @@ serde_json = "1.0" sha3 = "0.10.8" sqlx = { version = "0.7.3", default-features = false } structopt = "0.3.26" -strum = { version = "0.24" } +strum = { version = "0.26" } tempfile = "3" tokio = "1" toml_edit = "0.14.4" diff --git a/zk_toolbox/Cargo.lock b/zk_toolbox/Cargo.lock index 77525872b0eb..84989dd6713c 100644 --- a/zk_toolbox/Cargo.lock +++ b/zk_toolbox/Cargo.lock @@ -642,7 +642,7 @@ dependencies = [ "serde_json", "serde_yaml", "sqlx", - "strum_macros 0.26.4", + "strum", "thiserror", "tokio", "toml", @@ -668,12 +668,12 @@ dependencies = [ "rand", "serde", "serde_json", - "strum 0.26.3", - "strum_macros 0.26.4", + "strum", "thiserror", "types", "url", "xshell", + "zksync_basic_types", "zksync_config", "zksync_protobuf", "zksync_protobuf_config", @@ -1389,7 +1389,7 @@ dependencies = [ "rlp", "serde", "serde_json", - "strum 0.26.3", + "strum", "syn 2.0.72", "tempfile", "thiserror", @@ -4957,35 +4957,13 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" -[[package]] -name = "strum" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" -dependencies = [ - "strum_macros 0.24.3", -] - [[package]] name = "strum" version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ - "strum_macros 0.26.4", -] - -[[package]] -name = "strum_macros" -version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" -dependencies = [ - "heck 0.4.1", - "proc-macro2", - "quote", - "rustversion", - "syn 1.0.109", + "strum_macros", ] [[package]] @@ -5595,9 +5573,9 @@ dependencies = [ "clap", "ethers", "serde", - "strum 0.26.3", - "strum_macros 0.26.4", + "strum", "thiserror", + "zksync_basic_types", ] [[package]] @@ -6317,8 +6295,7 @@ dependencies = [ "serde_json", "serde_yaml", "slugify-rs", - "strum 0.26.3", - "strum_macros 0.26.4", + "strum", "thiserror", "tokio", "toml", @@ -6338,8 +6315,7 @@ dependencies = [ "config", "human-panic", "serde", - "strum 0.26.3", - "strum_macros 0.26.4", + "strum", "tokio", "url", "xshell", @@ -6372,7 +6348,7 @@ dependencies = [ "serde", "serde_json", "serde_with", - "strum 0.24.1", + "strum", "thiserror", "tiny-keccak", "url", @@ -6558,7 +6534,7 @@ dependencies = [ "secp256k1", "serde", "serde_json", - "strum 0.24.1", + "strum", "thiserror", "tracing", "zksync_basic_types", diff --git a/zk_toolbox/Cargo.toml b/zk_toolbox/Cargo.toml index 32fde939a796..1871bb6aee64 100644 --- a/zk_toolbox/Cargo.toml +++ b/zk_toolbox/Cargo.toml @@ -29,11 +29,12 @@ types = { path = "crates/types" } # ZkSync deps zksync_config = { path = "../core/lib/config" } zksync_protobuf_config = { path = "../core/lib/protobuf_config" } +zksync_basic_types = { path = "../core/lib/basic_types" } zksync_protobuf = "=0.1.0-rc.2" # External dependencies anyhow = "1.0.82" -clap = { version = "4.4", features = ["derive", "wrap_help"] } +clap = { version = "4.4", features = ["derive", "wrap_help", "string"] } slugify-rs = "0.0.3" cliclack = "0.2.5" console = "0.15.8" @@ -48,8 +49,7 @@ serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" serde_yaml = "0.9" sqlx = { version = "0.7.4", features = ["runtime-tokio", "migrate", "postgres"] } -strum = { version = "0.26.2", features = ["derive"] } -strum_macros = "0.26.2" +strum = { version = "0.26", features = ["derive"] } thiserror = "1.0.57" tokio = { version = "1.37", features = ["full"] } toml = "0.8.12" diff --git a/zk_toolbox/crates/common/Cargo.toml b/zk_toolbox/crates/common/Cargo.toml index 6b362905160f..3d9d406f6234 100644 --- a/zk_toolbox/crates/common/Cargo.toml +++ b/zk_toolbox/crates/common/Cargo.toml @@ -22,9 +22,9 @@ serde.workspace = true serde_json.workspace = true serde_yaml.workspace = true sqlx.workspace = true -strum_macros.workspace = true tokio.workspace = true toml.workspace = true url.workspace = true xshell.workspace = true -thiserror = "1.0.57" +thiserror.workspace = true +strum.workspace = true diff --git a/zk_toolbox/crates/common/src/ethereum.rs b/zk_toolbox/crates/common/src/ethereum.rs index 451bc311145f..c035d588370d 100644 --- a/zk_toolbox/crates/common/src/ethereum.rs +++ b/zk_toolbox/crates/common/src/ethereum.rs @@ -13,7 +13,7 @@ use crate::wallets::Wallet; pub fn create_ethers_client( private_key: H256, l1_rpc: String, - chain_id: Option, + chain_id: Option, ) -> anyhow::Result, ethers::prelude::Wallet>> { let mut wallet = LocalWallet::from_bytes(private_key.as_bytes())?; if let Some(chain_id) = chain_id { @@ -27,7 +27,7 @@ pub async fn distribute_eth( main_wallet: Wallet, addresses: Vec

, l1_rpc: String, - chain_id: u32, + chain_id: u64, amount: u128, ) -> anyhow::Result<()> { let client = create_ethers_client(main_wallet.private_key.unwrap(), l1_rpc, Some(chain_id))?; diff --git a/zk_toolbox/crates/common/src/forge.rs b/zk_toolbox/crates/common/src/forge.rs index de91c0e72500..a6381bc0c846 100644 --- a/zk_toolbox/crates/common/src/forge.rs +++ b/zk_toolbox/crates/common/src/forge.rs @@ -12,7 +12,7 @@ use ethers::{ utils::{hex, hex::ToHex}, }; use serde::{Deserialize, Serialize}; -use strum_macros::Display; +use strum::Display; use xshell::{cmd, Shell}; use crate::{ diff --git a/zk_toolbox/crates/config/Cargo.toml b/zk_toolbox/crates/config/Cargo.toml index d441c1578a04..60e0ba28bd7f 100644 --- a/zk_toolbox/crates/config/Cargo.toml +++ b/zk_toolbox/crates/config/Cargo.toml @@ -20,7 +20,6 @@ rand.workspace = true serde.workspace = true serde_json.workspace = true strum.workspace = true -strum_macros.workspace = true thiserror.workspace = true types.workspace = true url.workspace = true @@ -29,3 +28,4 @@ xshell.workspace = true zksync_protobuf_config.workspace = true zksync_protobuf.workspace = true zksync_config.workspace = true +zksync_basic_types.workspace = true diff --git a/zk_toolbox/crates/config/src/chain.rs b/zk_toolbox/crates/config/src/chain.rs index e6a7740f6380..02b72385d2a4 100644 --- a/zk_toolbox/crates/config/src/chain.rs +++ b/zk_toolbox/crates/config/src/chain.rs @@ -4,12 +4,10 @@ use std::{ }; use serde::{Deserialize, Serialize, Serializer}; -use types::{ - BaseToken, ChainId, L1BatchCommitDataGeneratorMode, L1Network, ProverMode, WalletCreation, -}; +use types::{BaseToken, ChainId, L1BatchCommitmentMode, L1Network, ProverMode, WalletCreation}; use xshell::Shell; use zksync_config::configs::GeneralConfig as ZkSyncGeneralConfig; -use zksync_protobuf_config::{decode_yaml_repr, encode_yaml_repr}; +use zksync_protobuf_config::encode_yaml_repr; use crate::{ consts::{ @@ -17,10 +15,11 @@ use crate::{ SECRETS_FILE, WALLETS_FILE, }, create_localhost_wallets, - traits::{FileConfigWithDefaultName, ReadConfig, SaveConfig, SaveConfigWithBasePath}, + traits::{ + FileConfig, FileConfigWithDefaultName, ReadConfig, SaveConfig, SaveConfigWithBasePath, + }, ContractsConfig, GeneralConfig, GenesisConfig, SecretsConfig, WalletsConfig, }; -use crate::traits::FileConfig; /// Chain configuration file. This file is created in the chain /// directory before network initialization. @@ -35,7 +34,7 @@ pub struct ChainConfigInternal { pub configs: PathBuf, pub rocks_db_path: PathBuf, pub external_node_config_path: Option, - pub l1_batch_commit_data_generator_mode: L1BatchCommitDataGeneratorMode, + pub l1_batch_commit_data_generator_mode: L1BatchCommitmentMode, pub base_token: BaseToken, pub wallet_creation: WalletCreation, } @@ -53,7 +52,7 @@ pub struct ChainConfig { pub rocks_db_path: PathBuf, pub configs: PathBuf, pub external_node_config_path: Option, - pub l1_batch_commit_data_generator_mode: L1BatchCommitDataGeneratorMode, + pub l1_batch_commit_data_generator_mode: L1BatchCommitmentMode, pub base_token: BaseToken, pub wallet_creation: WalletCreation, pub shell: OnceCell, @@ -78,11 +77,7 @@ impl ChainConfig { } pub fn get_general_config(&self) -> anyhow::Result { - decode_yaml_repr::( - &self.configs.join(GENERAL_FILE), - false, - ) - // GeneralConfig::read(self.get_shell(), self.configs.join(GENERAL_FILE)) + GeneralConfig::read(self.get_shell(), self.configs.join(GENERAL_FILE)) } pub fn get_wallets_config(&self) -> anyhow::Result { diff --git a/zk_toolbox/crates/config/src/ecosystem.rs b/zk_toolbox/crates/config/src/ecosystem.rs index 45dfc3eeab59..91d37d13f892 100644 --- a/zk_toolbox/crates/config/src/ecosystem.rs +++ b/zk_toolbox/crates/config/src/ecosystem.rs @@ -6,7 +6,6 @@ use thiserror::Error; use types::{ChainId, L1Network, ProverMode, WalletCreation}; use xshell::Shell; -use crate::traits::FileConfig; use crate::{ consts::{ CONFIGS_PATH, CONFIG_NAME, CONTRACTS_FILE, ECOSYSTEM_PATH, ERA_CHAIN_ID, @@ -15,7 +14,7 @@ use crate::{ }, create_localhost_wallets, forge_interface::deploy_ecosystem::input::{Erc20DeploymentConfig, InitialDeploymentConfig}, - traits::{FileConfigWithDefaultName, ReadConfig, SaveConfig}, + traits::{FileConfig, FileConfigWithDefaultName, ReadConfig, SaveConfig}, ChainConfig, ChainConfigInternal, ContractsConfig, WalletsConfig, }; diff --git a/zk_toolbox/crates/config/src/external_node.rs b/zk_toolbox/crates/config/src/external_node.rs index 720af9fdbfbe..cdeb4d0275bb 100644 --- a/zk_toolbox/crates/config/src/external_node.rs +++ b/zk_toolbox/crates/config/src/external_node.rs @@ -1,17 +1,19 @@ use std::num::NonZeroUsize; use serde::{Deserialize, Serialize}; -use types::{ChainId, L1BatchCommitDataGeneratorMode}; +use types::{ChainId, L1BatchCommitmentMode}; -use crate::{consts::EN_CONFIG_FILE, traits::FileConfigWithDefaultName}; -use crate::traits::FileConfig; +use crate::{ + consts::EN_CONFIG_FILE, + traits::{FileConfig, FileConfigWithDefaultName}, +}; #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] pub struct ENConfig { // Genesis pub l2_chain_id: ChainId, pub l1_chain_id: u32, - pub l1_batch_commit_data_generator_mode: L1BatchCommitDataGeneratorMode, + pub l1_batch_commit_data_generator_mode: L1BatchCommitmentMode, // Main node configuration pub main_node_url: String, diff --git a/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/input.rs b/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/input.rs index 8a367d522f4e..0ddca5d90cfb 100644 --- a/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/input.rs +++ b/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/input.rs @@ -151,16 +151,16 @@ impl DeployL1Config { .diamond_init_max_pubdata_per_batch, diamond_init_minimal_l2_gas_price: initial_deployment_config .diamond_init_minimal_l2_gas_price, - bootloader_hash: genesis_config.bootloader_hash, - default_aa_hash: genesis_config.default_aa_hash, + bootloader_hash: genesis_config.bootloader_hash.unwrap(), + default_aa_hash: genesis_config.default_aa_hash.unwrap(), diamond_init_priority_tx_max_pubdata: initial_deployment_config .diamond_init_priority_tx_max_pubdata, diamond_init_pubdata_pricing_mode: initial_deployment_config .diamond_init_pubdata_pricing_mode, - genesis_batch_commitment: genesis_config.genesis_batch_commitment, - genesis_rollup_leaf_index: genesis_config.genesis_rollup_leaf_index, - genesis_root: genesis_config.genesis_root, - latest_protocol_version: genesis_config.genesis_protocol_semantic_version.pack(), + genesis_batch_commitment: genesis_config.genesis_commitment.unwrap(), + genesis_rollup_leaf_index: genesis_config.rollup_last_leaf_index.unwrap(), + genesis_root: genesis_config.genesis_root_hash.unwrap(), + latest_protocol_version: genesis_config.protocol_version.unwrap().pack(), recursion_circuits_set_vks_hash: H256::zero(), recursion_leaf_level_vk_hash: H256::zero(), recursion_node_level_vk_hash: H256::zero(), @@ -185,7 +185,7 @@ pub struct ContractsDeployL1Config { pub create2_factory_addr: Option
, pub validator_timelock_execution_delay: u64, pub genesis_root: H256, - pub genesis_rollup_leaf_index: u32, + pub genesis_rollup_leaf_index: u64, pub genesis_batch_commitment: H256, pub latest_protocol_version: U256, pub recursion_node_level_vk_hash: H256, diff --git a/zk_toolbox/crates/config/src/forge_interface/register_chain/input.rs b/zk_toolbox/crates/config/src/forge_interface/register_chain/input.rs index 3849aa341e2b..d6832b161533 100644 --- a/zk_toolbox/crates/config/src/forge_interface/register_chain/input.rs +++ b/zk_toolbox/crates/config/src/forge_interface/register_chain/input.rs @@ -1,7 +1,7 @@ use ethers::types::Address; use rand::Rng; use serde::{Deserialize, Serialize}; -use types::{ChainId, L1BatchCommitDataGeneratorMode}; +use types::{ChainId, L1BatchCommitmentMode}; use crate::{traits::FileConfig, ChainConfig, ContractsConfig}; @@ -14,6 +14,7 @@ struct Bridgehub { struct StateTransition { state_transition_proxy_addr: Address, } + #[derive(Debug, Deserialize, Serialize, Clone)] struct DeployedAddresses { state_transition: StateTransition, @@ -70,7 +71,7 @@ impl RegisterChainL1Config { validator_timelock_addr: contracts.ecosystem_contracts.validator_timelock_addr, }, chain: ChainL1Config { - chain_chain_id: genesis_config.l2_chain_id, + chain_chain_id: ChainId(genesis_config.l2_chain_id.as_u64() as u32), base_token_gas_price_multiplier_nominator: chain_config.base_token.nominator, base_token_gas_price_multiplier_denominator: chain_config.base_token.denominator, base_token_addr: chain_config.base_token.address, @@ -80,7 +81,7 @@ impl RegisterChainL1Config { // TODO verify bridgehub_create_new_chain_salt: rand::thread_rng().gen_range(0..=i64::MAX) as u64, validium_mode: chain_config.l1_batch_commit_data_generator_mode - == L1BatchCommitDataGeneratorMode::Validium, + == L1BatchCommitmentMode::Validium, validator_sender_operator_commit_eth: wallets_config.operator.address, validator_sender_operator_blobs_eth: wallets_config.blob_operator.address, }, diff --git a/zk_toolbox/crates/config/src/general.rs b/zk_toolbox/crates/config/src/general.rs index 5b32e4d65b5a..23ba82067833 100644 --- a/zk_toolbox/crates/config/src/general.rs +++ b/zk_toolbox/crates/config/src/general.rs @@ -4,11 +4,11 @@ use anyhow::Context; use url::Url; use xshell::Shell; pub use zksync_config::configs::GeneralConfig; -use zksync_protobuf_config::encode_yaml_repr; +use zksync_protobuf_config::{decode_yaml_repr, encode_yaml_repr}; use crate::{ consts::GENERAL_FILE, - traits::{FileConfigWithDefaultName, SaveConfig}, + traits::{FileConfigWithDefaultName, ReadConfig, SaveConfig}, }; pub struct RocksDbs { @@ -103,3 +103,10 @@ impl SaveConfig for GeneralConfig { Ok(shell.write_file(path, bytes)?) } } + +impl ReadConfig for GeneralConfig { + fn read(shell: &Shell, path: impl AsRef) -> anyhow::Result { + let path = shell.current_dir().join(path); + decode_yaml_repr::(&path, false) + } +} diff --git a/zk_toolbox/crates/config/src/genesis.rs b/zk_toolbox/crates/config/src/genesis.rs index 22eedb92e07f..9bc990c8f67d 100644 --- a/zk_toolbox/crates/config/src/genesis.rs +++ b/zk_toolbox/crates/config/src/genesis.rs @@ -1,37 +1,36 @@ -use ethers::types::{Address, H256}; -use serde::{Deserialize, Serialize}; -use types::{ChainId, L1BatchCommitDataGeneratorMode, ProtocolSemanticVersion}; +use std::path::Path; -use crate::traits::FileConfig; -use crate::{consts::GENESIS_FILE, traits::FileConfigWithDefaultName, ChainConfig}; +use xshell::Shell; +use zksync_basic_types::{L1ChainId, L2ChainId}; +pub use zksync_config::GenesisConfig; +use zksync_protobuf_config::{decode_yaml_repr, encode_yaml_repr}; -#[derive(Debug, Deserialize, Serialize, Clone)] -pub struct GenesisConfig { - pub l2_chain_id: ChainId, - pub l1_chain_id: u32, - pub l1_batch_commit_data_generator_mode: Option, - pub bootloader_hash: H256, - pub default_aa_hash: H256, - pub fee_account: Address, - pub genesis_batch_commitment: H256, - pub genesis_rollup_leaf_index: u32, - pub genesis_root: H256, - pub genesis_protocol_version: u64, - pub genesis_protocol_semantic_version: ProtocolSemanticVersion, - #[serde(flatten)] - pub other: serde_json::Value, -} +use crate::{ + consts::GENESIS_FILE, + traits::{FileConfigWithDefaultName, ReadConfig, SaveConfig}, + ChainConfig, +}; -impl GenesisConfig { - pub fn update_from_chain_config(&mut self, config: &ChainConfig) { - self.l2_chain_id = config.chain_id; - self.l1_chain_id = config.l1_network.chain_id(); - self.l1_batch_commit_data_generator_mode = Some(config.l1_batch_commit_data_generator_mode); - } +pub fn update_from_chain_config(genesis: &mut GenesisConfig, config: &ChainConfig) { + genesis.l2_chain_id = L2ChainId::from(config.chain_id.0); + genesis.l1_chain_id = L1ChainId(config.l1_network.chain_id()); + genesis.l1_batch_commit_data_generator_mode = config.l1_batch_commit_data_generator_mode; } impl FileConfigWithDefaultName for GenesisConfig { const FILE_NAME: &'static str = GENESIS_FILE; } -impl FileConfig for GenesisConfig {} +impl SaveConfig for GenesisConfig { + fn save(&self, shell: &Shell, path: impl AsRef) -> anyhow::Result<()> { + let bytes = encode_yaml_repr::(&self)?; + Ok(shell.write_file(path, bytes)?) + } +} + +impl ReadConfig for GenesisConfig { + fn read(shell: &Shell, path: impl AsRef) -> anyhow::Result { + let path = shell.current_dir().join(path); + decode_yaml_repr::(&path, false) + } +} diff --git a/zk_toolbox/crates/config/src/secrets.rs b/zk_toolbox/crates/config/src/secrets.rs index b373e1a58ef4..b9345ac75089 100644 --- a/zk_toolbox/crates/config/src/secrets.rs +++ b/zk_toolbox/crates/config/src/secrets.rs @@ -2,8 +2,10 @@ use common::db::DatabaseConfig; use serde::{Deserialize, Serialize}; use url::Url; -use crate::traits::FileConfig; -use crate::{consts::SECRETS_FILE, traits::FileConfigWithDefaultName}; +use crate::{ + consts::SECRETS_FILE, + traits::{FileConfig, FileConfigWithDefaultName}, +}; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct DatabaseSecrets { diff --git a/zk_toolbox/crates/config/src/traits.rs b/zk_toolbox/crates/config/src/traits.rs index 8c4f0f776030..6055c2f789ee 100644 --- a/zk_toolbox/crates/config/src/traits.rs +++ b/zk_toolbox/crates/config/src/traits.rs @@ -25,17 +25,17 @@ impl SaveConfig for T { } } -impl ReadConfigWithBasePath for T -where - T: FileConfigWithDefaultName + DeserializeOwned + Clone + FileConfig, -{} +impl ReadConfigWithBasePath for T where + T: FileConfigWithDefaultName + DeserializeOwned + Clone + ReadConfig +{ +} impl SaveConfigWithBasePath for T where T: FileConfigWithDefaultName + SaveConfig {} -impl SaveConfigWithCommentAndBasePath for T -where - T: FileConfigWithDefaultName + Serialize + FileConfig, -{} +impl SaveConfigWithCommentAndBasePath for T where + T: FileConfigWithDefaultName + Serialize + SaveConfig +{ +} /// Reads a config file from a given path, correctly parsing file extension. /// Supported file extensions are: `yaml`, `yml`, `toml`, `json`. @@ -62,25 +62,6 @@ where } } -// impl ReadConfig for T -// where -// T: ProtoRepr + Clone + FileConfig, -// { -// fn read(shell: &Shell, path: impl AsRef) -> anyhow::Result { -// let error_context = || format!("Failed to parse config file {:?}.", path.as_ref()); -// -// match path.as_ref().extension().and_then(|ext| ext.to_str()) { -// Some("yaml") | Some("yml") => read_yaml_file(shell, &path).with_context(error_context), -// Some("toml") => read_toml_file(shell, &path).with_context(error_context), -// Some("json") => read_json_file(shell, &path).with_context(error_context), -// _ => bail!(format!( -// "Unsupported file extension for config file {:?}.", -// path.as_ref() -// )), -// } -// } -// } - /// Reads a config file from a base path, correctly parsing file extension. /// Supported file extensions are: `yaml`, `yml`, `toml`, `json`. pub trait ReadConfigWithBasePath: ReadConfig + FileConfigWithDefaultName { @@ -143,7 +124,7 @@ impl SaveConfigWithComment for T { /// Saves a config file from a base path, correctly parsing file extension. /// Supported file extensions are: `yaml`, `yml`, `toml`. pub trait SaveConfigWithCommentAndBasePath: -SaveConfigWithComment + FileConfigWithDefaultName + FileConfig + SaveConfigWithComment + FileConfigWithDefaultName + SaveConfig { fn save_with_comment_and_base_path( &self, diff --git a/zk_toolbox/crates/types/Cargo.toml b/zk_toolbox/crates/types/Cargo.toml index efd8f84d7088..3c7b50622abb 100644 --- a/zk_toolbox/crates/types/Cargo.toml +++ b/zk_toolbox/crates/types/Cargo.toml @@ -15,5 +15,5 @@ clap.workspace = true ethers.workspace = true serde.workspace = true strum.workspace = true -strum_macros.workspace = true thiserror.workspace = true +zksync_basic_types.workspace = true \ No newline at end of file diff --git a/zk_toolbox/crates/types/src/l1_batch_commit_data_generator_mode.rs b/zk_toolbox/crates/types/src/l1_batch_commit_data_generator_mode.rs index cdb8f5919c2d..8b137891791f 100644 --- a/zk_toolbox/crates/types/src/l1_batch_commit_data_generator_mode.rs +++ b/zk_toolbox/crates/types/src/l1_batch_commit_data_generator_mode.rs @@ -1,22 +1 @@ -use clap::ValueEnum; -use serde::{Deserialize, Serialize}; -use strum_macros::EnumIter; -#[derive( - Debug, - Serialize, - Deserialize, - Clone, - Copy, - ValueEnum, - EnumIter, - strum_macros::Display, - Default, - PartialEq, - Eq, -)] -pub enum L1BatchCommitDataGeneratorMode { - #[default] - Rollup, - Validium, -} diff --git a/zk_toolbox/crates/types/src/l1_network.rs b/zk_toolbox/crates/types/src/l1_network.rs index f7367673f6c8..822235611a33 100644 --- a/zk_toolbox/crates/types/src/l1_network.rs +++ b/zk_toolbox/crates/types/src/l1_network.rs @@ -1,6 +1,6 @@ use clap::ValueEnum; use serde::{Deserialize, Serialize}; -use strum_macros::EnumIter; +use strum::EnumIter; #[derive( Copy, @@ -15,7 +15,7 @@ use strum_macros::EnumIter; Deserialize, ValueEnum, EnumIter, - strum_macros::Display, + strum::Display, )] pub enum L1Network { #[default] @@ -26,7 +26,7 @@ pub enum L1Network { impl L1Network { #[must_use] - pub fn chain_id(&self) -> u32 { + pub fn chain_id(&self) -> u64 { match self { L1Network::Localhost => 9, L1Network::Sepolia => 11_155_111, diff --git a/zk_toolbox/crates/types/src/lib.rs b/zk_toolbox/crates/types/src/lib.rs index c405013990cf..7079888c2326 100644 --- a/zk_toolbox/crates/types/src/lib.rs +++ b/zk_toolbox/crates/types/src/lib.rs @@ -1,6 +1,5 @@ mod base_token; mod chain_id; -mod l1_batch_commit_data_generator_mode; mod l1_network; mod protocol_version; mod prover_mode; @@ -8,8 +7,8 @@ mod wallet_creation; pub use base_token::*; pub use chain_id::*; -pub use l1_batch_commit_data_generator_mode::*; pub use l1_network::*; pub use protocol_version::ProtocolSemanticVersion; pub use prover_mode::*; pub use wallet_creation::*; +pub use zksync_basic_types::commitment::L1BatchCommitmentMode; diff --git a/zk_toolbox/crates/types/src/prover_mode.rs b/zk_toolbox/crates/types/src/prover_mode.rs index d9b4fb965e8c..29f144c78143 100644 --- a/zk_toolbox/crates/types/src/prover_mode.rs +++ b/zk_toolbox/crates/types/src/prover_mode.rs @@ -1,18 +1,9 @@ use clap::ValueEnum; use serde::{Deserialize, Serialize}; -use strum_macros::EnumIter; +use strum::EnumIter; #[derive( - Debug, - Serialize, - Deserialize, - Clone, - Copy, - ValueEnum, - EnumIter, - strum_macros::Display, - PartialEq, - Eq, + Debug, Serialize, Deserialize, Clone, Copy, ValueEnum, EnumIter, strum::Display, PartialEq, Eq, )] pub enum ProverMode { NoProofs, diff --git a/zk_toolbox/crates/types/src/wallet_creation.rs b/zk_toolbox/crates/types/src/wallet_creation.rs index 43cb5e969b93..8457d109e43b 100644 --- a/zk_toolbox/crates/types/src/wallet_creation.rs +++ b/zk_toolbox/crates/types/src/wallet_creation.rs @@ -1,6 +1,6 @@ use clap::ValueEnum; use serde::{Deserialize, Serialize}; -use strum_macros::EnumIter; +use strum::EnumIter; #[derive( Clone, @@ -15,7 +15,7 @@ use strum_macros::EnumIter; Deserialize, ValueEnum, EnumIter, - strum_macros::Display, + strum::Display, )] pub enum WalletCreation { /// Load wallets from localhost mnemonic, they are funded for localhost env diff --git a/zk_toolbox/crates/zk_inception/Cargo.toml b/zk_toolbox/crates/zk_inception/Cargo.toml index 3a4ebf0f622c..a11a357dbab1 100644 --- a/zk_toolbox/crates/zk_inception/Cargo.toml +++ b/zk_toolbox/crates/zk_inception/Cargo.toml @@ -27,7 +27,6 @@ ethers.workspace = true common.workspace = true tokio.workspace = true types.workspace = true -strum_macros.workspace = true strum.workspace = true toml.workspace = true url.workspace = true diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/args/create.rs b/zk_toolbox/crates/zk_inception/src/commands/chain/args/create.rs index 97a3de69c738..b45b153cd336 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/chain/args/create.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/chain/args/create.rs @@ -1,12 +1,11 @@ use std::{path::PathBuf, str::FromStr}; -use clap::Parser; +use clap::{Parser, ValueEnum}; use common::{Prompt, PromptConfirm, PromptSelect}; use serde::{Deserialize, Serialize}; use slugify_rs::slugify; -use strum::IntoEnumIterator; -use strum_macros::{Display, EnumIter}; -use types::{BaseToken, L1BatchCommitDataGeneratorMode, L1Network, ProverMode, WalletCreation}; +use strum::{Display, EnumIter, IntoEnumIterator}; +use types::{BaseToken, L1BatchCommitmentMode, L1Network, ProverMode, WalletCreation}; use crate::{ defaults::L2_CHAIN_ID, @@ -23,28 +22,44 @@ use crate::{ }, }; +// We need to duplicate it for using enum inside the arguments +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, EnumIter, Display, ValueEnum)] +enum L1BatchCommitmentModeInternal { + Rollup, + Validium, +} + +impl Into for L1BatchCommitmentModeInternal { + fn into(self) -> L1BatchCommitmentMode { + match self { + L1BatchCommitmentModeInternal::Rollup => L1BatchCommitmentMode::Rollup, + L1BatchCommitmentModeInternal::Validium => L1BatchCommitmentMode::Validium, + } + } +} + #[derive(Debug, Serialize, Deserialize, Parser)] pub struct ChainCreateArgs { #[arg(long)] - pub chain_name: Option, + chain_name: Option, #[arg(value_parser = clap::value_parser ! (u32).range(1..))] - pub chain_id: Option, + chain_id: Option, #[clap(long, help = MSG_PROVER_MODE_HELP, value_enum)] - pub prover_mode: Option, + prover_mode: Option, #[clap(long, help = MSG_WALLET_CREATION_HELP, value_enum)] - pub wallet_creation: Option, + wallet_creation: Option, #[clap(long, help = MSG_WALLET_PATH_HELP)] - pub wallet_path: Option, + wallet_path: Option, #[clap(long, help = MSG_L1_COMMIT_DATA_GENERATOR_MODE_HELP)] - pub l1_batch_commit_data_generator_mode: Option, + l1_batch_commit_data_generator_mode: Option, #[clap(long, help = MSG_BASE_TOKEN_ADDRESS_HELP)] - pub base_token_address: Option, + base_token_address: Option, #[clap(long, help = MSG_BASE_TOKEN_PRICE_NOMINATOR_HELP)] - pub base_token_price_nominator: Option, + base_token_price_nominator: Option, #[clap(long, help = MSG_BASE_TOKEN_PRICE_DENOMINATOR_HELP)] - pub base_token_price_denominator: Option, + base_token_price_denominator: Option, #[clap(long, help = MSG_SET_AS_DEFAULT_HELP, default_missing_value = "true", num_args = 0..=1)] - pub set_as_default: Option, + pub(crate) set_as_default: Option, } impl ChainCreateArgs { @@ -81,7 +96,7 @@ impl ChainCreateArgs { let l1_batch_commit_data_generator_mode = PromptSelect::new( MSG_L1_BATCH_COMMIT_DATA_GENERATOR_MODE_PROMPT, - L1BatchCommitDataGeneratorMode::iter(), + L1BatchCommitmentModeInternal::iter(), ) .ask(); @@ -139,7 +154,7 @@ impl ChainCreateArgs { chain_id, prover_version, wallet_creation, - l1_batch_commit_data_generator_mode, + l1_batch_commit_data_generator_mode: l1_batch_commit_data_generator_mode.into(), wallet_path, base_token, set_as_default, @@ -153,7 +168,7 @@ pub struct ChainCreateArgsFinal { pub chain_id: u32, pub prover_version: ProverMode, pub wallet_creation: WalletCreation, - pub l1_batch_commit_data_generator_mode: L1BatchCommitDataGeneratorMode, + pub l1_batch_commit_data_generator_mode: L1BatchCommitmentMode, pub wallet_path: Option, pub base_token: BaseToken, pub set_as_default: bool, diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/genesis.rs b/zk_toolbox/crates/zk_inception/src/commands/chain/genesis.rs index 53ced5c08694..00e1e102a050 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/chain/genesis.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/chain/genesis.rs @@ -60,9 +60,11 @@ pub async fn genesis( set_rocks_db_config(&mut general, rocks_db)?; if config.prover_version != ProverMode::NoProofs { general - .eth.as_mut() + .eth + .as_mut() .context("eth")? - .sender.as_mut() + .sender + .as_mut() .context("sender")? .proof_sending_mode = ProofSendingMode::OnlyRealProofs; } @@ -90,7 +92,7 @@ pub async fn genesis( config.link_to_code.clone(), args.dont_drop, ) - .await?; + .await?; spinner.finish(); let spinner = Spinner::new(MSG_STARTING_GENESIS_SPINNER); @@ -123,7 +125,7 @@ async fn initialize_databases( path_to_server_migration, &server_db_config.full_url(), ) - .await?; + .await?; if global_config().verbose { logger::debug(MSG_INITIALIZING_PROVER_DATABASE) @@ -140,7 +142,7 @@ async fn initialize_databases( path_to_prover_migration, &prover_db_config.full_url(), ) - .await?; + .await?; Ok(()) } diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/init.rs b/zk_toolbox/crates/zk_inception/src/commands/chain/init.rs index 640f4a492869..c88e28162791 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/chain/init.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/chain/init.rs @@ -12,7 +12,7 @@ use config::{ script_params::REGISTER_CHAIN_SCRIPT_PARAMS, }, traits::{ReadConfig, SaveConfig, SaveConfigWithBasePath}, - ChainConfig, ContractsConfig, EcosystemConfig, + update_from_chain_config, ChainConfig, ContractsConfig, EcosystemConfig, }; use xshell::Shell; @@ -59,7 +59,7 @@ pub async fn init( copy_configs(shell, &ecosystem_config.link_to_code, &chain_config.configs)?; let mut genesis_config = chain_config.get_genesis_config()?; - genesis_config.update_from_chain_config(chain_config); + update_from_chain_config(&mut genesis_config, chain_config); genesis_config.save_with_base_path(shell, &chain_config.configs)?; // Copy ecosystem contracts diff --git a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/args/create.rs b/zk_toolbox/crates/zk_inception/src/commands/ecosystem/args/create.rs index f005a98f6b64..74929801f40c 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/args/create.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/ecosystem/args/create.rs @@ -4,8 +4,7 @@ use clap::Parser; use common::{Prompt, PromptConfirm, PromptSelect}; use serde::{Deserialize, Serialize}; use slugify_rs::slugify; -use strum::IntoEnumIterator; -use strum_macros::EnumIter; +use strum::{EnumIter, IntoEnumIterator}; use types::{L1Network, WalletCreation}; use crate::{ @@ -29,7 +28,9 @@ pub struct EcosystemCreateArgs { #[clap(flatten)] #[serde(flatten)] pub chain: ChainCreateArgs, - #[clap(long, help = MSG_START_CONTAINERS_HELP, default_missing_value = "true", num_args = 0..=1)] + #[clap( + long, help = MSG_START_CONTAINERS_HELP, default_missing_value = "true", num_args = 0..=1 + )] pub start_containers: Option, } diff --git a/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs b/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs index 7cedf7e7f7ba..104760326bb2 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs @@ -6,6 +6,7 @@ use config::{ external_node::ENConfig, ports_config, set_rocks_db_config, traits::SaveConfigWithBasePath, update_ports, ChainConfig, DatabaseSecrets, EcosystemConfig, L1Secret, SecretsConfig, }; +use types::ChainId; use xshell::Shell; use crate::{ @@ -46,11 +47,9 @@ fn prepare_configs( let genesis = config.get_genesis_config()?; let mut general = config.get_general_config()?; let en_config = ENConfig { - l2_chain_id: genesis.l2_chain_id, - l1_chain_id: genesis.l1_chain_id, - l1_batch_commit_data_generator_mode: genesis - .l1_batch_commit_data_generator_mode - .unwrap_or_default(), + l2_chain_id: ChainId(genesis.l2_chain_id.as_u64() as u32), + l1_chain_id: genesis.l1_chain_id.0 as u32, + l1_batch_commit_data_generator_mode: genesis.l1_batch_commit_data_generator_mode, main_node_url: general .api_config .as_ref() diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/args/init.rs b/zk_toolbox/crates/zk_inception/src/commands/prover/args/init.rs index c398b1852c61..4943c596a1d6 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/prover/args/init.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/prover/args/init.rs @@ -1,8 +1,7 @@ use clap::{Parser, ValueEnum}; use common::{logger, Prompt, PromptConfirm, PromptSelect}; use serde::{Deserialize, Serialize}; -use strum::IntoEnumIterator; -use strum_macros::EnumIter; +use strum::{EnumIter, IntoEnumIterator}; use xshell::Shell; use super::init_bellman_cuda::InitBellmanCudaArgs; @@ -55,7 +54,7 @@ pub struct ProverInitArgs { pub setup_key_config: SetupKeyConfigTmp, } -#[derive(Debug, Clone, ValueEnum, EnumIter, strum_macros::Display, PartialEq, Eq)] +#[derive(Debug, Clone, ValueEnum, EnumIter, strum::Display, PartialEq, Eq)] #[allow(clippy::upper_case_acronyms)] enum ProofStoreConfig { Local, diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/args/run.rs b/zk_toolbox/crates/zk_inception/src/commands/prover/args/run.rs index 678c548cea64..4b485099cc80 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/prover/args/run.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/prover/args/run.rs @@ -13,7 +13,7 @@ pub struct ProverRunArgs { } #[derive( - Debug, Clone, ValueEnum, strum::EnumString, EnumIter, PartialEq, Eq, Copy, strum_macros::Display, + Debug, Clone, ValueEnum, strum::EnumString, EnumIter, PartialEq, Eq, Copy, strum::Display, )] pub enum ProverComponent { #[strum(to_string = "Gateway")] @@ -34,9 +34,7 @@ pub struct WitnessGeneratorArgs { pub round: Option, } -#[derive( - Debug, Clone, ValueEnum, strum::EnumString, EnumIter, PartialEq, Eq, strum_macros::Display, -)] +#[derive(Debug, Clone, ValueEnum, strum::EnumString, EnumIter, PartialEq, Eq, strum::Display)] pub enum WitnessGeneratorRound { #[strum(to_string = "All rounds")] AllRounds, diff --git a/zk_toolbox/crates/zk_supervisor/Cargo.toml b/zk_toolbox/crates/zk_supervisor/Cargo.toml index d8f5d7862a04..54d9a819a7b9 100644 --- a/zk_toolbox/crates/zk_supervisor/Cargo.toml +++ b/zk_toolbox/crates/zk_supervisor/Cargo.toml @@ -17,7 +17,6 @@ common.workspace = true config.workspace = true human-panic.workspace = true strum.workspace = true -strum_macros.workspace = true tokio.workspace = true url.workspace = true xshell.workspace = true diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/database/args/new_migration.rs b/zk_toolbox/crates/zk_supervisor/src/commands/database/args/new_migration.rs index ef053ca50c77..64b7a507abea 100644 --- a/zk_toolbox/crates/zk_supervisor/src/commands/database/args/new_migration.rs +++ b/zk_toolbox/crates/zk_supervisor/src/commands/database/args/new_migration.rs @@ -1,7 +1,6 @@ use clap::{Parser, ValueEnum}; use common::{Prompt, PromptSelect}; -use strum::IntoEnumIterator; -use strum_macros::{Display, EnumIter}; +use strum::{Display, EnumIter, IntoEnumIterator}; use crate::messages::{ MSG_DATABASE_NEW_MIGRATION_DATABASE_HELP, MSG_DATABASE_NEW_MIGRATION_DB_PROMPT, From 37dd10d6b8f853270a508597188dd1ef848477e9 Mon Sep 17 00:00:00 2001 From: Danil Date: Tue, 23 Jul 2024 19:32:44 +0200 Subject: [PATCH 05/16] Add secrets Signed-off-by: Danil --- zk_toolbox/Cargo.lock | 1 + zk_toolbox/crates/common/src/db.rs | 2 +- zk_toolbox/crates/config/src/secrets.rs | 75 ++++++++++--------- zk_toolbox/crates/config/src/traits.rs | 16 ++-- zk_toolbox/crates/zk_inception/Cargo.toml | 1 + .../src/commands/chain/deploy_paymaster.rs | 2 +- .../src/commands/chain/genesis.rs | 4 +- .../zk_inception/src/commands/chain/init.rs | 3 +- .../src/commands/chain/initialize_bridges.rs | 2 +- .../src/commands/external_node/init.rs | 11 ++- .../commands/external_node/prepare_configs.rs | 31 +++++--- .../src/commands/database/drop.rs | 2 +- zk_toolbox/crates/zk_supervisor/src/dals.rs | 15 +++- 13 files changed, 101 insertions(+), 64 deletions(-) diff --git a/zk_toolbox/Cargo.lock b/zk_toolbox/Cargo.lock index 84989dd6713c..6b77aa6ff3b0 100644 --- a/zk_toolbox/Cargo.lock +++ b/zk_toolbox/Cargo.lock @@ -6302,6 +6302,7 @@ dependencies = [ "types", "url", "xshell", + "zksync_basic_types", "zksync_config", ] diff --git a/zk_toolbox/crates/common/src/db.rs b/zk_toolbox/crates/common/src/db.rs index c0a681bc74c0..eda5471170dd 100644 --- a/zk_toolbox/crates/common/src/db.rs +++ b/zk_toolbox/crates/common/src/db.rs @@ -27,7 +27,7 @@ impl DatabaseConfig { } /// Create a new `Db` instance from a URL. - pub fn from_url(url: Url) -> anyhow::Result { + pub fn from_url(url: &Url) -> anyhow::Result { let name = url .path_segments() .ok_or(anyhow!("Failed to parse database name from URL"))? diff --git a/zk_toolbox/crates/config/src/secrets.rs b/zk_toolbox/crates/config/src/secrets.rs index b9345ac75089..f15473707e87 100644 --- a/zk_toolbox/crates/config/src/secrets.rs +++ b/zk_toolbox/crates/config/src/secrets.rs @@ -1,53 +1,54 @@ +use std::{path::Path, str::FromStr}; + +use anyhow::Context; use common::db::DatabaseConfig; -use serde::{Deserialize, Serialize}; -use url::Url; +use xshell::Shell; +use zksync_basic_types::url::SensitiveUrl; +pub use zksync_config::configs::Secrets as SecretsConfig; +use zksync_protobuf_config::{decode_yaml_repr, encode_yaml_repr}; use crate::{ consts::SECRETS_FILE, - traits::{FileConfig, FileConfigWithDefaultName}, + traits::{FileConfigWithDefaultName, ReadConfig, SaveConfig}, }; -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct DatabaseSecrets { - pub server_url: Url, - #[serde(skip_serializing_if = "Option::is_none")] - pub prover_url: Option, - #[serde(flatten)] - pub other: serde_json::Value, +pub fn set_databases( + secrets: &mut SecretsConfig, + server_db_config: &DatabaseConfig, + prover_db_config: &DatabaseConfig, +) -> anyhow::Result<()> { + let database = secrets + .database + .as_mut() + .context("Databases must be presented")?; + database.server_url = Some(SensitiveUrl::from(server_db_config.full_url())); + database.prover_url = Some(SensitiveUrl::from(prover_db_config.full_url())); + Ok(()) } -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct L1Secret { - pub l1_rpc_url: String, - #[serde(flatten)] - pub other: serde_json::Value, +pub fn set_l1_rpc_url(secrets: &mut SecretsConfig, l1_rpc_url: String) -> anyhow::Result<()> { + secrets + .l1 + .as_mut() + .context("L1 Secrets must be presented")? + .l1_rpc_url = SensitiveUrl::from_str(&l1_rpc_url)?; + Ok(()) } -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct SecretsConfig { - pub database: DatabaseSecrets, - pub l1: L1Secret, - #[serde(flatten)] - pub other: serde_json::Value, +impl FileConfigWithDefaultName for SecretsConfig { + const FILE_NAME: &'static str = SECRETS_FILE; } -impl SecretsConfig { - pub fn set_databases( - &mut self, - server_db_config: &DatabaseConfig, - prover_db_config: &DatabaseConfig, - ) { - self.database.server_url = server_db_config.full_url(); - self.database.prover_url = Some(prover_db_config.full_url()); - } - - pub fn set_l1_rpc_url(&mut self, l1_rpc_url: String) { - self.l1.l1_rpc_url = l1_rpc_url; +impl SaveConfig for SecretsConfig { + fn save(&self, shell: &Shell, path: impl AsRef) -> anyhow::Result<()> { + let bytes = encode_yaml_repr::(&self)?; + Ok(shell.write_file(path, bytes)?) } } -impl FileConfigWithDefaultName for SecretsConfig { - const FILE_NAME: &'static str = SECRETS_FILE; +impl ReadConfig for SecretsConfig { + fn read(shell: &Shell, path: impl AsRef) -> anyhow::Result { + let path = shell.current_dir().join(path); + decode_yaml_repr::(&path, false) + } } - -impl FileConfig for SecretsConfig {} diff --git a/zk_toolbox/crates/config/src/traits.rs b/zk_toolbox/crates/config/src/traits.rs index 6055c2f789ee..b34b2551c56b 100644 --- a/zk_toolbox/crates/config/src/traits.rs +++ b/zk_toolbox/crates/config/src/traits.rs @@ -25,9 +25,13 @@ impl SaveConfig for T { } } -impl ReadConfigWithBasePath for T where - T: FileConfigWithDefaultName + DeserializeOwned + Clone + ReadConfig +impl ReadConfigWithBasePath for T +where + T: FileConfigWithDefaultName + Clone + ReadConfig, { + fn read_with_base_path(shell: &Shell, base_path: impl AsRef) -> anyhow::Result { + ::read(shell, base_path.as_ref().join(Self::FILE_NAME)) + } } impl SaveConfigWithBasePath for T where T: FileConfigWithDefaultName + SaveConfig {} @@ -39,7 +43,7 @@ impl SaveConfigWithCommentAndBasePath for T where /// Reads a config file from a given path, correctly parsing file extension. /// Supported file extensions are: `yaml`, `yml`, `toml`, `json`. -pub trait ReadConfig: Clone { +pub trait ReadConfig: Sized { fn read(shell: &Shell, path: impl AsRef) -> anyhow::Result; } @@ -64,10 +68,8 @@ where /// Reads a config file from a base path, correctly parsing file extension. /// Supported file extensions are: `yaml`, `yml`, `toml`, `json`. -pub trait ReadConfigWithBasePath: ReadConfig + FileConfigWithDefaultName { - fn read_with_base_path(shell: &Shell, base_path: impl AsRef) -> anyhow::Result { - ::read(shell, base_path.as_ref().join(Self::FILE_NAME)) - } +pub trait ReadConfigWithBasePath: ReadConfig + FileConfigWithDefaultName + Clone { + fn read_with_base_path(shell: &Shell, base_path: impl AsRef) -> anyhow::Result; } /// Saves a config file to a given path, correctly parsing file extension. diff --git a/zk_toolbox/crates/zk_inception/Cargo.toml b/zk_toolbox/crates/zk_inception/Cargo.toml index a11a357dbab1..c81d246b0eb9 100644 --- a/zk_toolbox/crates/zk_inception/Cargo.toml +++ b/zk_toolbox/crates/zk_inception/Cargo.toml @@ -33,3 +33,4 @@ url.workspace = true thiserror.workspace = true zksync_config.workspace = true slugify-rs.workspace = true +zksync_basic_types.workspace = true \ No newline at end of file diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/deploy_paymaster.rs b/zk_toolbox/crates/zk_inception/src/commands/chain/deploy_paymaster.rs index 4f82a92c2edc..5b37bacccce1 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/chain/deploy_paymaster.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/chain/deploy_paymaster.rs @@ -47,7 +47,7 @@ pub async fn deploy_paymaster( let mut forge = Forge::new(&foundry_contracts_path) .script(&DEPLOY_PAYMASTER_SCRIPT_PARAMS.script(), forge_args.clone()) .with_ffi() - .with_rpc_url(secrets.l1.l1_rpc_url.clone()) + .with_rpc_url(secrets.l1.unwrap().l1_rpc_url.expose_str().to_string()) .with_broadcast(); forge = fill_forge_private_key( diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/genesis.rs b/zk_toolbox/crates/zk_inception/src/commands/chain/genesis.rs index 00e1e102a050..3cd5440ba83d 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/chain/genesis.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/chain/genesis.rs @@ -9,7 +9,7 @@ use common::{ spinner::Spinner, }; use config::{ - set_rocks_db_config, + set_databases, set_rocks_db_config, traits::{FileConfigWithDefaultName, SaveConfigWithBasePath}, ChainConfig, ContractsConfig, EcosystemConfig, GeneralConfig, GenesisConfig, SecretsConfig, WalletsConfig, @@ -71,7 +71,7 @@ pub async fn genesis( general.save_with_base_path(shell, &config.configs)?; let mut secrets = config.get_secrets_config()?; - secrets.set_databases(&args.server_db, &args.prover_db); + set_databases(&mut secrets, &args.server_db, &args.prover_db)?; secrets.save_with_base_path(shell, &config.configs)?; logger::note( diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/init.rs b/zk_toolbox/crates/zk_inception/src/commands/chain/init.rs index c88e28162791..bf44b5d5c999 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/chain/init.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/chain/init.rs @@ -11,6 +11,7 @@ use config::{ register_chain::{input::RegisterChainL1Config, output::RegisterChainOutput}, script_params::REGISTER_CHAIN_SCRIPT_PARAMS, }, + set_l1_rpc_url, traits::{ReadConfig, SaveConfig, SaveConfigWithBasePath}, update_from_chain_config, ChainConfig, ContractsConfig, EcosystemConfig, }; @@ -74,7 +75,7 @@ pub async fn init( ) .await?; let mut secrets = chain_config.get_secrets_config()?; - secrets.set_l1_rpc_url(init_args.l1_rpc_url.clone()); + set_l1_rpc_url(&mut secrets, init_args.l1_rpc_url.clone())?; secrets.save_with_base_path(shell, &chain_config.configs)?; let spinner = Spinner::new(MSG_REGISTERING_CHAIN_SPINNER); diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/initialize_bridges.rs b/zk_toolbox/crates/zk_inception/src/commands/chain/initialize_bridges.rs index e81971eba7cb..91e87b45f1aa 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/chain/initialize_bridges.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/chain/initialize_bridges.rs @@ -67,7 +67,7 @@ pub async fn initialize_bridges( forge_args.clone(), ) .with_ffi() - .with_rpc_url(secrets.l1.l1_rpc_url.clone()) + .with_rpc_url(secrets.l1.unwrap().l1_rpc_url.expose_str().to_string()) .with_broadcast(); forge = fill_forge_private_key( diff --git a/zk_toolbox/crates/zk_inception/src/commands/external_node/init.rs b/zk_toolbox/crates/zk_inception/src/commands/external_node/init.rs index c6101e88739c..1f7ce9f24c40 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/external_node/init.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/external_node/init.rs @@ -36,7 +36,16 @@ pub async fn init(shell: &Shell, chain_config: &ChainConfig) -> anyhow::Result<( .clone() .context(MSG_EXTERNAL_NODE_CONFIG_NOT_INITIALIZED)?, )?; - let db_config = DatabaseConfig::from_url(secrets.database.server_url)?; + let db_config = DatabaseConfig::from_url( + secrets + .database + .as_ref() + .context("")? + .server_url + .as_ref() + .context("")? + .expose_url(), + )?; drop_db_if_exists(&db_config) .await .context(MSG_FAILED_TO_DROP_SERVER_DATABASE_ERR)?; diff --git a/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs b/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs index 104760326bb2..80e0ce76fdc6 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs @@ -1,13 +1,15 @@ -use std::path::Path; +use std::{path::Path, str::FromStr}; use anyhow::Context; use common::{config::global_config, logger}; use config::{ external_node::ENConfig, ports_config, set_rocks_db_config, traits::SaveConfigWithBasePath, - update_ports, ChainConfig, DatabaseSecrets, EcosystemConfig, L1Secret, SecretsConfig, + update_ports, ChainConfig, EcosystemConfig, SecretsConfig, }; use types::ChainId; use xshell::Shell; +use zksync_basic_types::url::SensitiveUrl; +use zksync_config::configs::{DatabaseSecrets, L1Secrets}; use crate::{ commands::external_node::args::prepare_configs::{PrepareConfigArgs, PrepareConfigFinal}, @@ -68,16 +70,23 @@ fn prepare_configs( .next_empty_ports_config(), )?; let secrets = SecretsConfig { - database: DatabaseSecrets { - server_url: args.db.full_url(), + // database: DatabaseSecrets { + // server_url: args.db.full_url(), + // prover_url: None, + // other: Default::default(), + // }, + // l1: L1Secrets { + // l1_rpc_url: args.l1_rpc_url.clone(), + // }, + consensus: None, + database: Some(DatabaseSecrets { + server_url: Some(args.db.full_url().into()), prover_url: None, - other: Default::default(), - }, - l1: L1Secret { - l1_rpc_url: args.l1_rpc_url.clone(), - other: Default::default(), - }, - other: Default::default(), + server_replica_url: None, + }), + l1: Some(L1Secrets { + l1_rpc_url: SensitiveUrl::from_str(&args.l1_rpc_url).context("l1_rpc_url")?, + }), }; secrets.save_with_base_path(shell, en_configs_path)?; let dirs = recreate_rocksdb_dirs(shell, &config.rocks_db_path, RocksDBDirOption::ExternalNode)?; diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/database/drop.rs b/zk_toolbox/crates/zk_supervisor/src/commands/database/drop.rs index fb6996b40ee3..075f21d3b1a3 100644 --- a/zk_toolbox/crates/zk_supervisor/src/commands/database/drop.rs +++ b/zk_toolbox/crates/zk_supervisor/src/commands/database/drop.rs @@ -35,7 +35,7 @@ pub async fn run(shell: &Shell, args: DatabaseCommonArgs) -> anyhow::Result<()> pub async fn drop_database(dal: Dal) -> anyhow::Result<()> { let spinner = Spinner::new(&msg_database_loading(MSG_DATABASE_DROP_GERUND, &dal.path)); - let db = DatabaseConfig::from_url(dal.url)?; + let db = DatabaseConfig::from_url(&dal.url)?; drop_db_if_exists(&db).await?; spinner.finish(); Ok(()) diff --git a/zk_toolbox/crates/zk_supervisor/src/dals.rs b/zk_toolbox/crates/zk_supervisor/src/dals.rs index ae8815c96899..5dddf9b3d1f3 100644 --- a/zk_toolbox/crates/zk_supervisor/src/dals.rs +++ b/zk_toolbox/crates/zk_supervisor/src/dals.rs @@ -48,8 +48,12 @@ pub fn get_prover_dal(shell: &Shell) -> anyhow::Result { path: PROVER_DAL_PATH.to_string(), url: secrets .database + .as_ref() + .context(MSG_PROVER_URL_MUST_BE_PRESENTED)? .prover_url + .as_ref() .context(MSG_PROVER_URL_MUST_BE_PRESENTED)? + .expose_url() .clone(), }) } @@ -59,7 +63,16 @@ pub fn get_core_dal(shell: &Shell) -> anyhow::Result { Ok(Dal { path: CORE_DAL_PATH.to_string(), - url: secrets.database.server_url.clone(), + url: secrets + .database + .as_ref() + .context("DATABASE not found")? + .server_url + .as_ref() + .context("DATABASE not found")? + .clone() + .expose_url() + .clone(), }) } From 66a4681fef8fc67e1a3d3622cecb6a3f7e997927 Mon Sep 17 00:00:00 2001 From: Danil Date: Tue, 23 Jul 2024 20:14:22 +0200 Subject: [PATCH 06/16] Rename FileConfig Signed-off-by: Danil --- zk_toolbox/crates/config/src/chain.rs | 29 +++++++------------ zk_toolbox/crates/config/src/contracts.rs | 6 ++-- zk_toolbox/crates/config/src/ecosystem.rs | 6 ++-- zk_toolbox/crates/config/src/external_node.rs | 4 +-- .../forge_interface/accept_ownership/mod.rs | 4 +-- .../forge_interface/deploy_ecosystem/input.rs | 10 +++---- .../deploy_ecosystem/output.rs | 6 ++-- .../initialize_bridges/input.rs | 4 +-- .../initialize_bridges/output.rs | 4 +-- .../src/forge_interface/paymaster/mod.rs | 7 +++-- .../forge_interface/register_chain/input.rs | 4 +-- .../forge_interface/register_chain/output.rs | 4 +-- zk_toolbox/crates/config/src/traits.rs | 7 +++-- zk_toolbox/crates/config/src/wallets.rs | 6 ++-- zk_toolbox/crates/types/Cargo.toml | 2 +- zk_toolbox/crates/zk_inception/Cargo.toml | 2 +- 16 files changed, 49 insertions(+), 56 deletions(-) diff --git a/zk_toolbox/crates/config/src/chain.rs b/zk_toolbox/crates/config/src/chain.rs index 02b72385d2a4..470037f2b129 100644 --- a/zk_toolbox/crates/config/src/chain.rs +++ b/zk_toolbox/crates/config/src/chain.rs @@ -6,17 +6,13 @@ use std::{ use serde::{Deserialize, Serialize, Serializer}; use types::{BaseToken, ChainId, L1BatchCommitmentMode, L1Network, ProverMode, WalletCreation}; use xshell::Shell; -use zksync_config::configs::GeneralConfig as ZkSyncGeneralConfig; -use zksync_protobuf_config::encode_yaml_repr; use crate::{ - consts::{ - CONFIG_NAME, CONTRACTS_FILE, GENERAL_FILE, GENESIS_FILE, L1_CONTRACTS_FOUNDRY, - SECRETS_FILE, WALLETS_FILE, - }, + consts::{CONFIG_NAME, GENERAL_FILE, L1_CONTRACTS_FOUNDRY, SECRETS_FILE, WALLETS_FILE}, create_localhost_wallets, traits::{ - FileConfig, FileConfigWithDefaultName, ReadConfig, SaveConfig, SaveConfigWithBasePath, + FileConfigWithDefaultName, ReadConfig, ReadConfigWithBasePath, SaveConfig, + SaveConfigWithBasePath, ZkToolboxConfig, }, ContractsConfig, GeneralConfig, GenesisConfig, SecretsConfig, WalletsConfig, }; @@ -73,11 +69,11 @@ impl ChainConfig { } pub fn get_genesis_config(&self) -> anyhow::Result { - GenesisConfig::read(self.get_shell(), self.configs.join(GENESIS_FILE)) + GenesisConfig::read_with_base_path(self.get_shell(), &self.configs) } pub fn get_general_config(&self) -> anyhow::Result { - GeneralConfig::read(self.get_shell(), self.configs.join(GENERAL_FILE)) + GeneralConfig::read_with_base_path(self.get_shell(), &self.configs) } pub fn get_wallets_config(&self) -> anyhow::Result { @@ -93,11 +89,11 @@ impl ChainConfig { anyhow::bail!("Wallets configs has not been found"); } pub fn get_contracts_config(&self) -> anyhow::Result { - ContractsConfig::read(self.get_shell(), self.configs.join(CONTRACTS_FILE)) + ContractsConfig::read_with_base_path(self.get_shell(), &self.configs) } pub fn get_secrets_config(&self) -> anyhow::Result { - SecretsConfig::read(self.get_shell(), self.configs.join(SECRETS_FILE)) + SecretsConfig::read_with_base_path(self.get_shell(), &self.configs) } pub fn path_to_general_config(&self) -> PathBuf { @@ -108,13 +104,8 @@ impl ChainConfig { self.configs.join(SECRETS_FILE) } - pub fn save_general_config(&self, general_config: &ZkSyncGeneralConfig) -> anyhow::Result<()> { - let path = self.configs.join(GENERAL_FILE); - let bytes = encode_yaml_repr::( - general_config, - )?; - self.get_shell().write_file(path, bytes)?; - Ok(()) + pub fn save_general_config(&self, general_config: &GeneralConfig) -> anyhow::Result<()> { + general_config.save_with_base_path(self.get_shell(), &self.configs) } pub fn path_to_foundry(&self) -> PathBuf { @@ -151,4 +142,4 @@ impl FileConfigWithDefaultName for ChainConfigInternal { const FILE_NAME: &'static str = CONFIG_NAME; } -impl FileConfig for ChainConfigInternal {} +impl ZkToolboxConfig for ChainConfigInternal {} diff --git a/zk_toolbox/crates/config/src/contracts.rs b/zk_toolbox/crates/config/src/contracts.rs index 03706d83cd10..0a0b3c22ab5b 100644 --- a/zk_toolbox/crates/config/src/contracts.rs +++ b/zk_toolbox/crates/config/src/contracts.rs @@ -8,7 +8,7 @@ use crate::{ initialize_bridges::output::InitializeBridgeOutput, register_chain::output::RegisterChainOutput, }, - traits::{FileConfig, FileConfigWithDefaultName}, + traits::{FileConfigWithDefaultName, ZkToolboxConfig}, }; #[derive(Debug, Deserialize, Serialize, Clone, Default)] @@ -89,7 +89,7 @@ impl FileConfigWithDefaultName for ContractsConfig { const FILE_NAME: &'static str = CONTRACTS_FILE; } -impl FileConfig for ContractsConfig {} +impl ZkToolboxConfig for ContractsConfig {} #[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Default)] pub struct EcosystemContracts { @@ -100,7 +100,7 @@ pub struct EcosystemContracts { pub diamond_cut_data: String, } -impl FileConfig for EcosystemContracts {} +impl ZkToolboxConfig for EcosystemContracts {} #[derive(Debug, Serialize, Deserialize, Clone, Default)] pub struct BridgesContracts { diff --git a/zk_toolbox/crates/config/src/ecosystem.rs b/zk_toolbox/crates/config/src/ecosystem.rs index 578a5909ebdf..c4c64cc14183 100644 --- a/zk_toolbox/crates/config/src/ecosystem.rs +++ b/zk_toolbox/crates/config/src/ecosystem.rs @@ -17,7 +17,7 @@ use crate::{ }, create_localhost_wallets, forge_interface::deploy_ecosystem::input::{Erc20DeploymentConfig, InitialDeploymentConfig}, - traits::{FileConfig, FileConfigWithDefaultName, ReadConfig, SaveConfig}, + traits::{FileConfigWithDefaultName, ReadConfig, SaveConfig, ZkToolboxConfig}, ChainConfig, ChainConfigInternal, ContractsConfig, WalletsConfig, }; @@ -90,9 +90,9 @@ impl FileConfigWithDefaultName for EcosystemConfig { const FILE_NAME: &'static str = CONFIG_NAME; } -impl FileConfig for EcosystemConfigInternal {} +impl ZkToolboxConfig for EcosystemConfigInternal {} -impl FileConfig for EcosystemConfig {} +impl ZkToolboxConfig for EcosystemConfig {} impl EcosystemConfig { fn get_shell(&self) -> &Shell { diff --git a/zk_toolbox/crates/config/src/external_node.rs b/zk_toolbox/crates/config/src/external_node.rs index cdeb4d0275bb..d75d5ad206ff 100644 --- a/zk_toolbox/crates/config/src/external_node.rs +++ b/zk_toolbox/crates/config/src/external_node.rs @@ -5,7 +5,7 @@ use types::{ChainId, L1BatchCommitmentMode}; use crate::{ consts::EN_CONFIG_FILE, - traits::{FileConfig, FileConfigWithDefaultName}, + traits::{FileConfigWithDefaultName, ZkToolboxConfig}, }; #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] @@ -25,4 +25,4 @@ impl FileConfigWithDefaultName for ENConfig { const FILE_NAME: &'static str = EN_CONFIG_FILE; } -impl FileConfig for ENConfig {} +impl ZkToolboxConfig for ENConfig {} diff --git a/zk_toolbox/crates/config/src/forge_interface/accept_ownership/mod.rs b/zk_toolbox/crates/config/src/forge_interface/accept_ownership/mod.rs index 58b5aa1f9d49..636cffc49f89 100644 --- a/zk_toolbox/crates/config/src/forge_interface/accept_ownership/mod.rs +++ b/zk_toolbox/crates/config/src/forge_interface/accept_ownership/mod.rs @@ -1,9 +1,9 @@ use ethers::types::Address; use serde::{Deserialize, Serialize}; -use crate::traits::FileConfig; +use crate::traits::ZkToolboxConfig; -impl FileConfig for AcceptOwnershipInput {} +impl ZkToolboxConfig for AcceptOwnershipInput {} #[derive(Debug, Deserialize, Serialize, Clone)] pub struct AcceptOwnershipInput { diff --git a/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/input.rs b/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/input.rs index 0ddca5d90cfb..91e6459fd780 100644 --- a/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/input.rs +++ b/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/input.rs @@ -10,7 +10,7 @@ use types::ChainId; use crate::{ consts::INITIAL_DEPLOYMENT_FILE, - traits::{FileConfig, FileConfigWithDefaultName}, + traits::{FileConfigWithDefaultName, ZkToolboxConfig}, ContractsConfig, GenesisConfig, WalletsConfig, }; @@ -61,7 +61,7 @@ impl FileConfigWithDefaultName for InitialDeploymentConfig { const FILE_NAME: &'static str = INITIAL_DEPLOYMENT_FILE; } -impl FileConfig for InitialDeploymentConfig {} +impl ZkToolboxConfig for InitialDeploymentConfig {} #[derive(Debug, Deserialize, Serialize, Clone)] pub struct Erc20DeploymentConfig { @@ -72,7 +72,7 @@ impl FileConfigWithDefaultName for Erc20DeploymentConfig { const FILE_NAME: &'static str = INITIAL_DEPLOYMENT_FILE; } -impl FileConfig for Erc20DeploymentConfig {} +impl ZkToolboxConfig for Erc20DeploymentConfig {} impl Default for Erc20DeploymentConfig { fn default() -> Self { @@ -122,7 +122,7 @@ pub struct DeployL1Config { pub tokens: TokensDeployL1Config, } -impl FileConfig for DeployL1Config {} +impl ZkToolboxConfig for DeployL1Config {} impl DeployL1Config { pub fn new( @@ -216,7 +216,7 @@ pub struct DeployErc20Config { pub additional_addresses_for_minting: Vec
, } -impl FileConfig for DeployErc20Config {} +impl ZkToolboxConfig for DeployErc20Config {} impl DeployErc20Config { pub fn new( diff --git a/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/output.rs b/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/output.rs index 9af7541ee1c1..77f212114916 100644 --- a/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/output.rs +++ b/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/output.rs @@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize}; use crate::{ consts::ERC20_CONFIGS_FILE, - traits::{FileConfig, FileConfigWithDefaultName}, + traits::{FileConfigWithDefaultName, ZkToolboxConfig}, }; #[derive(Debug, Deserialize, Serialize, Clone)] @@ -21,7 +21,7 @@ pub struct DeployL1Output { pub deployed_addresses: DeployL1DeployedAddressesOutput, } -impl FileConfig for DeployL1Output {} +impl ZkToolboxConfig for DeployL1Output {} #[derive(Debug, Deserialize, Serialize, Clone)] pub struct DeployL1ContractsConfigOutput { @@ -97,4 +97,4 @@ impl FileConfigWithDefaultName for DeployErc20Output { const FILE_NAME: &'static str = ERC20_CONFIGS_FILE; } -impl FileConfig for DeployErc20Output {} +impl ZkToolboxConfig for DeployErc20Output {} diff --git a/zk_toolbox/crates/config/src/forge_interface/initialize_bridges/input.rs b/zk_toolbox/crates/config/src/forge_interface/initialize_bridges/input.rs index e884c0a3a39e..7341eb1ad7fd 100644 --- a/zk_toolbox/crates/config/src/forge_interface/initialize_bridges/input.rs +++ b/zk_toolbox/crates/config/src/forge_interface/initialize_bridges/input.rs @@ -2,9 +2,9 @@ use ethers::types::Address; use serde::{Deserialize, Serialize}; use types::ChainId; -use crate::{traits::FileConfig, ChainConfig}; +use crate::{traits::ZkToolboxConfig, ChainConfig}; -impl FileConfig for InitializeBridgeInput {} +impl ZkToolboxConfig for InitializeBridgeInput {} #[derive(Debug, Clone, Serialize, Deserialize)] pub struct InitializeBridgeInput { diff --git a/zk_toolbox/crates/config/src/forge_interface/initialize_bridges/output.rs b/zk_toolbox/crates/config/src/forge_interface/initialize_bridges/output.rs index d03474a6a089..8da3707ed706 100644 --- a/zk_toolbox/crates/config/src/forge_interface/initialize_bridges/output.rs +++ b/zk_toolbox/crates/config/src/forge_interface/initialize_bridges/output.rs @@ -1,9 +1,9 @@ use ethers::types::Address; use serde::{Deserialize, Serialize}; -use crate::traits::FileConfig; +use crate::traits::ZkToolboxConfig; -impl FileConfig for InitializeBridgeOutput {} +impl ZkToolboxConfig for InitializeBridgeOutput {} #[derive(Debug, Clone, Serialize, Deserialize)] pub struct InitializeBridgeOutput { diff --git a/zk_toolbox/crates/config/src/forge_interface/paymaster/mod.rs b/zk_toolbox/crates/config/src/forge_interface/paymaster/mod.rs index e634f1eb3dab..fc43dd522103 100644 --- a/zk_toolbox/crates/config/src/forge_interface/paymaster/mod.rs +++ b/zk_toolbox/crates/config/src/forge_interface/paymaster/mod.rs @@ -2,7 +2,7 @@ use ethers::types::Address; use serde::{Deserialize, Serialize}; use types::ChainId; -use crate::{traits::FileConfig, ChainConfig}; +use crate::{traits::ZkToolboxConfig, ChainConfig}; #[derive(Debug, Serialize, Deserialize, Clone)] pub struct DeployPaymasterInput { @@ -21,11 +21,12 @@ impl DeployPaymasterInput { }) } } -impl FileConfig for DeployPaymasterInput {} + +impl ZkToolboxConfig for DeployPaymasterInput {} #[derive(Debug, Serialize, Deserialize, Clone)] pub struct DeployPaymasterOutput { pub paymaster: Address, } -impl FileConfig for DeployPaymasterOutput {} +impl ZkToolboxConfig for DeployPaymasterOutput {} diff --git a/zk_toolbox/crates/config/src/forge_interface/register_chain/input.rs b/zk_toolbox/crates/config/src/forge_interface/register_chain/input.rs index d6832b161533..6428e56625ce 100644 --- a/zk_toolbox/crates/config/src/forge_interface/register_chain/input.rs +++ b/zk_toolbox/crates/config/src/forge_interface/register_chain/input.rs @@ -3,7 +3,7 @@ use rand::Rng; use serde::{Deserialize, Serialize}; use types::{ChainId, L1BatchCommitmentMode}; -use crate::{traits::FileConfig, ChainConfig, ContractsConfig}; +use crate::{traits::ZkToolboxConfig, ChainConfig, ContractsConfig}; #[derive(Debug, Deserialize, Serialize, Clone)] struct Bridgehub { @@ -49,7 +49,7 @@ pub struct ChainL1Config { pub governance_min_delay: u64, } -impl FileConfig for RegisterChainL1Config {} +impl ZkToolboxConfig for RegisterChainL1Config {} impl RegisterChainL1Config { pub fn new(chain_config: &ChainConfig, contracts: &ContractsConfig) -> anyhow::Result { diff --git a/zk_toolbox/crates/config/src/forge_interface/register_chain/output.rs b/zk_toolbox/crates/config/src/forge_interface/register_chain/output.rs index 2f39b76c3933..f9521b16328f 100644 --- a/zk_toolbox/crates/config/src/forge_interface/register_chain/output.rs +++ b/zk_toolbox/crates/config/src/forge_interface/register_chain/output.rs @@ -1,7 +1,7 @@ use ethers::types::Address; use serde::{Deserialize, Serialize}; -use crate::traits::FileConfig; +use crate::traits::ZkToolboxConfig; #[derive(Debug, Deserialize, Serialize, Clone)] pub struct RegisterChainOutput { @@ -10,4 +10,4 @@ pub struct RegisterChainOutput { pub chain_admin_addr: Address, } -impl FileConfig for RegisterChainOutput {} +impl ZkToolboxConfig for RegisterChainOutput {} diff --git a/zk_toolbox/crates/config/src/traits.rs b/zk_toolbox/crates/config/src/traits.rs index a2ea52c17788..96522110fe6e 100644 --- a/zk_toolbox/crates/config/src/traits.rs +++ b/zk_toolbox/crates/config/src/traits.rs @@ -7,7 +7,8 @@ use common::files::{ use serde::{de::DeserializeOwned, Serialize}; use xshell::Shell; -pub trait FileConfig {} +// Configs that we use only inside zk toolbox, we don't have protobuf implementation for them. +pub trait ZkToolboxConfig {} pub trait FileConfigWithDefaultName { const FILE_NAME: &'static str; @@ -17,7 +18,7 @@ pub trait FileConfigWithDefaultName { } } -impl SaveConfig for T { +impl SaveConfig for T { fn save(&self, shell: &Shell, path: impl AsRef) -> anyhow::Result<()> { save_with_comment(shell, path, &self, "") } @@ -47,7 +48,7 @@ pub trait ReadConfig: Sized { impl ReadConfig for T where - T: DeserializeOwned + Clone + FileConfig, + T: DeserializeOwned + Clone + ZkToolboxConfig, { fn read(shell: &Shell, path: impl AsRef) -> anyhow::Result { let error_context = || format!("Failed to parse config file {:?}.", path.as_ref()); diff --git a/zk_toolbox/crates/config/src/wallets.rs b/zk_toolbox/crates/config/src/wallets.rs index cfa4741f5824..460c4e3574a3 100644 --- a/zk_toolbox/crates/config/src/wallets.rs +++ b/zk_toolbox/crates/config/src/wallets.rs @@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize}; use crate::{ consts::WALLETS_FILE, - traits::{FileConfig, FileConfigWithDefaultName}, + traits::{FileConfigWithDefaultName, ZkToolboxConfig}, }; #[derive(Debug, Clone, Serialize, Deserialize)] @@ -60,6 +60,6 @@ pub(crate) struct EthMnemonicConfig { pub(crate) base_path: String, } -impl FileConfig for EthMnemonicConfig {} +impl ZkToolboxConfig for EthMnemonicConfig {} -impl FileConfig for WalletsConfig {} +impl ZkToolboxConfig for WalletsConfig {} diff --git a/zk_toolbox/crates/types/Cargo.toml b/zk_toolbox/crates/types/Cargo.toml index 3c7b50622abb..7dc96cab768d 100644 --- a/zk_toolbox/crates/types/Cargo.toml +++ b/zk_toolbox/crates/types/Cargo.toml @@ -16,4 +16,4 @@ ethers.workspace = true serde.workspace = true strum.workspace = true thiserror.workspace = true -zksync_basic_types.workspace = true \ No newline at end of file +zksync_basic_types.workspace = true diff --git a/zk_toolbox/crates/zk_inception/Cargo.toml b/zk_toolbox/crates/zk_inception/Cargo.toml index 3c9be5e8eaa1..2626611376fe 100644 --- a/zk_toolbox/crates/zk_inception/Cargo.toml +++ b/zk_toolbox/crates/zk_inception/Cargo.toml @@ -32,4 +32,4 @@ url.workspace = true thiserror.workspace = true zksync_config.workspace = true slugify-rs.workspace = true -zksync_basic_types.workspace = true \ No newline at end of file +zksync_basic_types.workspace = true From 973e802e17b3166c09a32ddd407ac593356d0102 Mon Sep 17 00:00:00 2001 From: Danil Date: Wed, 24 Jul 2024 11:52:21 +0200 Subject: [PATCH 07/16] fixes Signed-off-by: Danil --- prover/Cargo.lock | 12 ++++++------ zk_toolbox/crates/config/src/general.rs | 2 +- zk_toolbox/crates/config/src/genesis.rs | 2 +- zk_toolbox/crates/config/src/secrets.rs | 2 +- zk_toolbox/crates/config/src/traits.rs | 2 +- .../zk_inception/src/commands/chain/args/create.rs | 6 +++--- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/prover/Cargo.lock b/prover/Cargo.lock index 376b464babe1..4587251f7be8 100644 --- a/prover/Cargo.lock +++ b/prover/Cargo.lock @@ -6066,24 +6066,24 @@ dependencies = [ [[package]] name = "strum" -version = "0.24.1" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ "strum_macros", ] [[package]] name = "strum_macros" -version = "0.24.3" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2 1.0.85", "quote 1.0.36", "rustversion", - "syn 1.0.109", + "syn 2.0.66", ] [[package]] diff --git a/zk_toolbox/crates/config/src/general.rs b/zk_toolbox/crates/config/src/general.rs index 23ba82067833..9db7c4ec0b2a 100644 --- a/zk_toolbox/crates/config/src/general.rs +++ b/zk_toolbox/crates/config/src/general.rs @@ -99,7 +99,7 @@ impl PortsConfig { impl SaveConfig for GeneralConfig { fn save(&self, shell: &Shell, path: impl AsRef) -> anyhow::Result<()> { let bytes = - encode_yaml_repr::(&self)?; + encode_yaml_repr::(self)?; Ok(shell.write_file(path, bytes)?) } } diff --git a/zk_toolbox/crates/config/src/genesis.rs b/zk_toolbox/crates/config/src/genesis.rs index 9bc990c8f67d..3ba9f6e1d837 100644 --- a/zk_toolbox/crates/config/src/genesis.rs +++ b/zk_toolbox/crates/config/src/genesis.rs @@ -23,7 +23,7 @@ impl FileConfigWithDefaultName for GenesisConfig { impl SaveConfig for GenesisConfig { fn save(&self, shell: &Shell, path: impl AsRef) -> anyhow::Result<()> { - let bytes = encode_yaml_repr::(&self)?; + let bytes = encode_yaml_repr::(self)?; Ok(shell.write_file(path, bytes)?) } } diff --git a/zk_toolbox/crates/config/src/secrets.rs b/zk_toolbox/crates/config/src/secrets.rs index f15473707e87..5bcad19ad339 100644 --- a/zk_toolbox/crates/config/src/secrets.rs +++ b/zk_toolbox/crates/config/src/secrets.rs @@ -41,7 +41,7 @@ impl FileConfigWithDefaultName for SecretsConfig { impl SaveConfig for SecretsConfig { fn save(&self, shell: &Shell, path: impl AsRef) -> anyhow::Result<()> { - let bytes = encode_yaml_repr::(&self)?; + let bytes = encode_yaml_repr::(self)?; Ok(shell.write_file(path, bytes)?) } } diff --git a/zk_toolbox/crates/config/src/traits.rs b/zk_toolbox/crates/config/src/traits.rs index 96522110fe6e..37237fc97db2 100644 --- a/zk_toolbox/crates/config/src/traits.rs +++ b/zk_toolbox/crates/config/src/traits.rs @@ -20,7 +20,7 @@ pub trait FileConfigWithDefaultName { impl SaveConfig for T { fn save(&self, shell: &Shell, path: impl AsRef) -> anyhow::Result<()> { - save_with_comment(shell, path, &self, "") + save_with_comment(shell, path, self, "") } } diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/args/create.rs b/zk_toolbox/crates/zk_inception/src/commands/chain/args/create.rs index b45b153cd336..63f3a3736cd7 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/chain/args/create.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/chain/args/create.rs @@ -29,9 +29,9 @@ enum L1BatchCommitmentModeInternal { Validium, } -impl Into for L1BatchCommitmentModeInternal { - fn into(self) -> L1BatchCommitmentMode { - match self { +impl From for L1BatchCommitmentMode { + fn from(val: L1BatchCommitmentModeInternal) -> Self { + match val { L1BatchCommitmentModeInternal::Rollup => L1BatchCommitmentMode::Rollup, L1BatchCommitmentModeInternal::Validium => L1BatchCommitmentMode::Validium, } From c976ebcda57100fd838d729ccf06c13e5d888bc5 Mon Sep 17 00:00:00 2001 From: Danil Date: Wed, 24 Jul 2024 14:32:31 +0200 Subject: [PATCH 08/16] Fix secrets config Signed-off-by: Danil --- core/lib/config/src/configs/secrets.rs | 8 +++++--- core/lib/protobuf_config/src/secrets.rs | 5 +---- .../src/commands/external_node/prepare_configs.rs | 8 -------- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/core/lib/config/src/configs/secrets.rs b/core/lib/config/src/configs/secrets.rs index 02bb52e00718..71197f5d9306 100644 --- a/core/lib/config/src/configs/secrets.rs +++ b/core/lib/config/src/configs/secrets.rs @@ -30,9 +30,11 @@ impl DatabaseSecrets { /// Returns a copy of the replica database URL as a `Result` to simplify error propagation. pub fn replica_url(&self) -> anyhow::Result { - self.server_replica_url - .clone() - .context("Replica DB URL is absent") + if let Some(replica_url) = &self.server_replica_url { + Ok(replica_url.clone()) + } else { + self.master_url() + } } /// Returns a copy of the prover database URL as a `Result` to simplify error propagation. diff --git a/core/lib/protobuf_config/src/secrets.rs b/core/lib/protobuf_config/src/secrets.rs index 43f537a5fbfa..3047c0093bb0 100644 --- a/core/lib/protobuf_config/src/secrets.rs +++ b/core/lib/protobuf_config/src/secrets.rs @@ -41,15 +41,12 @@ impl ProtoRepr for proto::DatabaseSecrets { .map(str::parse::) .transpose() .context("master_url")?; - let mut server_replica_url = self + let server_replica_url = self .server_replica_url .as_deref() .map(str::parse::) .transpose() .context("replica_url")?; - if server_replica_url.is_none() { - server_replica_url.clone_from(&server_url) - } let prover_url = self .prover_url .as_deref() diff --git a/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs b/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs index 80e0ce76fdc6..13dc6a43439c 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs @@ -70,14 +70,6 @@ fn prepare_configs( .next_empty_ports_config(), )?; let secrets = SecretsConfig { - // database: DatabaseSecrets { - // server_url: args.db.full_url(), - // prover_url: None, - // other: Default::default(), - // }, - // l1: L1Secrets { - // l1_rpc_url: args.l1_rpc_url.clone(), - // }, consensus: None, database: Some(DatabaseSecrets { server_url: Some(args.db.full_url().into()), From 8af00e3d6417c3f0a06d08dc35c9eafd0a2baf7e Mon Sep 17 00:00:00 2001 From: Danil Date: Wed, 24 Jul 2024 15:45:21 +0200 Subject: [PATCH 09/16] fix protobuf encoding Signed-off-by: Danil --- core/lib/protobuf_config/src/lib.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/core/lib/protobuf_config/src/lib.rs b/core/lib/protobuf_config/src/lib.rs index 839f3e3cf8ca..e019e631619b 100644 --- a/core/lib/protobuf_config/src/lib.rs +++ b/core/lib/protobuf_config/src/lib.rs @@ -40,7 +40,10 @@ mod wallets; use std::{path::PathBuf, str::FromStr}; use anyhow::Context; -use zksync_protobuf::{serde::serialize_proto, ProtoRepr}; +use zksync_protobuf::{ + build::{prost_reflect, prost_reflect::ReflectMessage, serde}, + ProtoRepr, +}; use zksync_types::{H160, H256}; fn parse_h256(bytes: &str) -> anyhow::Result { @@ -71,3 +74,11 @@ pub fn encode_yaml_repr(value: &T::Type) -> anyhow::Result serialize_proto(&T::build(value), &mut s)?; Ok(buffer) } + +fn serialize_proto( + x: &T, + s: S, +) -> Result { + let opts = prost_reflect::SerializeOptions::new().use_proto_field_name(true); + x.transcode_to_dynamic().serialize_with_options(s, &opts) +} From 137c64495bd7bea210a1ba4455419ed7619a5742 Mon Sep 17 00:00:00 2001 From: Danil Date: Wed, 24 Jul 2024 16:04:10 +0200 Subject: [PATCH 10/16] Migrate en config Signed-off-by: Danil --- zk_toolbox/crates/config/src/chain.rs | 7 +- zk_toolbox/crates/config/src/consts.rs | 4 +- zk_toolbox/crates/config/src/ecosystem.rs | 11 +-- zk_toolbox/crates/config/src/external_node.rs | 36 ++++---- .../forge_interface/deploy_ecosystem/input.rs | 6 +- .../initialize_bridges/input.rs | 8 +- .../src/forge_interface/paymaster/mod.rs | 4 +- .../forge_interface/register_chain/input.rs | 7 +- zk_toolbox/crates/config/src/genesis.rs | 4 +- zk_toolbox/crates/types/src/chain_id.rs | 18 ---- .../l1_batch_commit_data_generator_mode.rs | 1 - zk_toolbox/crates/types/src/lib.rs | 8 +- .../crates/types/src/protocol_version.rs | 87 ------------------- zk_toolbox/crates/types/src/prover_mode.rs | 1 - .../zk_inception/src/commands/chain/create.rs | 4 +- .../commands/external_node/prepare_configs.rs | 20 ++--- 16 files changed, 59 insertions(+), 167 deletions(-) delete mode 100644 zk_toolbox/crates/types/src/chain_id.rs delete mode 100644 zk_toolbox/crates/types/src/l1_batch_commit_data_generator_mode.rs delete mode 100644 zk_toolbox/crates/types/src/protocol_version.rs diff --git a/zk_toolbox/crates/config/src/chain.rs b/zk_toolbox/crates/config/src/chain.rs index 470037f2b129..e8b6df00644d 100644 --- a/zk_toolbox/crates/config/src/chain.rs +++ b/zk_toolbox/crates/config/src/chain.rs @@ -4,8 +4,9 @@ use std::{ }; use serde::{Deserialize, Serialize, Serializer}; -use types::{BaseToken, ChainId, L1BatchCommitmentMode, L1Network, ProverMode, WalletCreation}; +use types::{BaseToken, L1BatchCommitmentMode, L1Network, ProverMode, WalletCreation}; use xshell::Shell; +use zksync_basic_types::L2ChainId; use crate::{ consts::{CONFIG_NAME, GENERAL_FILE, L1_CONTRACTS_FOUNDRY, SECRETS_FILE, WALLETS_FILE}, @@ -25,7 +26,7 @@ pub struct ChainConfigInternal { // needs for local setups only pub id: u32, pub name: String, - pub chain_id: ChainId, + pub chain_id: L2ChainId, pub prover_version: ProverMode, pub configs: PathBuf, pub rocks_db_path: PathBuf, @@ -41,7 +42,7 @@ pub struct ChainConfigInternal { pub struct ChainConfig { pub id: u32, pub name: String, - pub chain_id: ChainId, + pub chain_id: L2ChainId, pub prover_version: ProverMode, pub l1_network: L1Network, pub link_to_code: PathBuf, diff --git a/zk_toolbox/crates/config/src/consts.rs b/zk_toolbox/crates/config/src/consts.rs index a00274fb35f3..fecb6e78c9a5 100644 --- a/zk_toolbox/crates/config/src/consts.rs +++ b/zk_toolbox/crates/config/src/consts.rs @@ -1,5 +1,3 @@ -use types::ChainId; - /// Name of the main configuration file pub(crate) const CONFIG_NAME: &str = "ZkStack.yaml"; /// Name of the wallets file @@ -35,7 +33,7 @@ pub(crate) const ECOSYSTEM_PATH: &str = "etc/ecosystem"; /// Path to l1 contracts foundry folder inside zksync-era pub(crate) const L1_CONTRACTS_FOUNDRY: &str = "contracts/l1-contracts"; -pub(crate) const ERA_CHAIN_ID: ChainId = ChainId(270); +pub(crate) const ERA_CHAIN_ID: u32 = 270; pub(crate) const TEST_CONFIG_PATH: &str = "etc/test_config/constant/eth.json"; pub(crate) const BASE_PATH: &str = "m/44'/60'/0'"; diff --git a/zk_toolbox/crates/config/src/ecosystem.rs b/zk_toolbox/crates/config/src/ecosystem.rs index c4c64cc14183..76d8a0c45b22 100644 --- a/zk_toolbox/crates/config/src/ecosystem.rs +++ b/zk_toolbox/crates/config/src/ecosystem.rs @@ -6,8 +6,9 @@ use std::{ use common::logger; use serde::{Deserialize, Serialize, Serializer}; use thiserror::Error; -use types::{ChainId, L1Network, ProverMode, WalletCreation}; +use types::{L1Network, ProverMode, WalletCreation}; use xshell::Shell; +use zksync_basic_types::L2ChainId; use crate::{ consts::{ @@ -32,7 +33,7 @@ struct EcosystemConfigInternal { pub chains: PathBuf, pub config: PathBuf, pub default_chain: String, - pub era_chain_id: ChainId, + pub era_chain_id: L2ChainId, pub prover_version: ProverMode, pub wallet_creation: WalletCreation, } @@ -48,7 +49,7 @@ pub struct EcosystemConfig { pub chains: PathBuf, pub config: PathBuf, pub default_chain: String, - pub era_chain_id: ChainId, + pub era_chain_id: L2ChainId, pub prover_version: ProverMode, pub wallet_creation: WalletCreation, pub shell: OnceCell, @@ -249,8 +250,8 @@ pub enum EcosystemConfigFromFileError { InvalidConfig { source: anyhow::Error }, } -pub fn get_default_era_chain_id() -> ChainId { - ERA_CHAIN_ID +pub fn get_default_era_chain_id() -> L2ChainId { + L2ChainId::from(ERA_CHAIN_ID) } // Find file in all parents repository and return necessary path or an empty error if nothing has been found diff --git a/zk_toolbox/crates/config/src/external_node.rs b/zk_toolbox/crates/config/src/external_node.rs index d75d5ad206ff..a07ff5dc1400 100644 --- a/zk_toolbox/crates/config/src/external_node.rs +++ b/zk_toolbox/crates/config/src/external_node.rs @@ -1,28 +1,28 @@ -use std::num::NonZeroUsize; +use std::path::Path; -use serde::{Deserialize, Serialize}; -use types::{ChainId, L1BatchCommitmentMode}; +use xshell::Shell; +pub use zksync_config::configs::en_config::ENConfig; +use zksync_protobuf_config::{decode_yaml_repr, encode_yaml_repr}; use crate::{ consts::EN_CONFIG_FILE, - traits::{FileConfigWithDefaultName, ZkToolboxConfig}, + traits::{FileConfigWithDefaultName, ReadConfig, SaveConfig}, }; -#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] -pub struct ENConfig { - // Genesis - pub l2_chain_id: ChainId, - pub l1_chain_id: u32, - pub l1_batch_commit_data_generator_mode: L1BatchCommitmentMode, - - // Main node configuration - pub main_node_url: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub main_node_rate_limit_rps: Option, -} - impl FileConfigWithDefaultName for ENConfig { const FILE_NAME: &'static str = EN_CONFIG_FILE; } -impl ZkToolboxConfig for ENConfig {} +impl SaveConfig for ENConfig { + fn save(&self, shell: &Shell, path: impl AsRef) -> anyhow::Result<()> { + let bytes = encode_yaml_repr::(self)?; + Ok(shell.write_file(path, bytes)?) + } +} + +impl ReadConfig for ENConfig { + fn read(shell: &Shell, path: impl AsRef) -> anyhow::Result { + let path = shell.current_dir().join(path); + decode_yaml_repr::(&path, false) + } +} diff --git a/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/input.rs b/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/input.rs index 91e6459fd780..dd80b009a71e 100644 --- a/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/input.rs +++ b/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/input.rs @@ -6,7 +6,7 @@ use ethers::{ }; use rand::Rng; use serde::{Deserialize, Serialize}; -use types::ChainId; +use zksync_basic_types::L2ChainId; use crate::{ consts::INITIAL_DEPLOYMENT_FILE, @@ -115,7 +115,7 @@ pub struct Erc20DeploymentTokensConfig { #[derive(Debug, Deserialize, Serialize, Clone)] pub struct DeployL1Config { - pub era_chain_id: ChainId, + pub era_chain_id: L2ChainId, pub owner_address: Address, pub testnet_verifier: bool, pub contracts: ContractsDeployL1Config, @@ -129,7 +129,7 @@ impl DeployL1Config { genesis_config: &GenesisConfig, wallets_config: &WalletsConfig, initial_deployment_config: &InitialDeploymentConfig, - era_chain_id: ChainId, + era_chain_id: L2ChainId, testnet_verifier: bool, ) -> Self { Self { diff --git a/zk_toolbox/crates/config/src/forge_interface/initialize_bridges/input.rs b/zk_toolbox/crates/config/src/forge_interface/initialize_bridges/input.rs index 7341eb1ad7fd..d06e36185607 100644 --- a/zk_toolbox/crates/config/src/forge_interface/initialize_bridges/input.rs +++ b/zk_toolbox/crates/config/src/forge_interface/initialize_bridges/input.rs @@ -1,6 +1,6 @@ use ethers::types::Address; use serde::{Deserialize, Serialize}; -use types::ChainId; +use zksync_basic_types::L2ChainId; use crate::{traits::ZkToolboxConfig, ChainConfig}; @@ -8,8 +8,8 @@ impl ZkToolboxConfig for InitializeBridgeInput {} #[derive(Debug, Clone, Serialize, Deserialize)] pub struct InitializeBridgeInput { - pub era_chain_id: ChainId, - pub chain_id: ChainId, + pub era_chain_id: L2ChainId, + pub chain_id: L2ChainId, pub l1_shared_bridge: Address, pub bridgehub: Address, pub governance: Address, @@ -17,7 +17,7 @@ pub struct InitializeBridgeInput { } impl InitializeBridgeInput { - pub fn new(chain_config: &ChainConfig, era_chain_id: ChainId) -> anyhow::Result { + pub fn new(chain_config: &ChainConfig, era_chain_id: L2ChainId) -> anyhow::Result { let contracts = chain_config.get_contracts_config()?; let wallets = chain_config.get_wallets_config()?; Ok(Self { diff --git a/zk_toolbox/crates/config/src/forge_interface/paymaster/mod.rs b/zk_toolbox/crates/config/src/forge_interface/paymaster/mod.rs index fc43dd522103..9631fe743180 100644 --- a/zk_toolbox/crates/config/src/forge_interface/paymaster/mod.rs +++ b/zk_toolbox/crates/config/src/forge_interface/paymaster/mod.rs @@ -1,12 +1,12 @@ use ethers::types::Address; use serde::{Deserialize, Serialize}; -use types::ChainId; +use zksync_basic_types::L2ChainId; use crate::{traits::ZkToolboxConfig, ChainConfig}; #[derive(Debug, Serialize, Deserialize, Clone)] pub struct DeployPaymasterInput { - pub chain_id: ChainId, + pub chain_id: L2ChainId, pub l1_shared_bridge: Address, pub bridgehub: Address, } diff --git a/zk_toolbox/crates/config/src/forge_interface/register_chain/input.rs b/zk_toolbox/crates/config/src/forge_interface/register_chain/input.rs index 6428e56625ce..29494ba5d8f5 100644 --- a/zk_toolbox/crates/config/src/forge_interface/register_chain/input.rs +++ b/zk_toolbox/crates/config/src/forge_interface/register_chain/input.rs @@ -1,7 +1,8 @@ use ethers::types::Address; use rand::Rng; use serde::{Deserialize, Serialize}; -use types::{ChainId, L1BatchCommitmentMode}; +use types::L1BatchCommitmentMode; +use zksync_basic_types::L2ChainId; use crate::{traits::ZkToolboxConfig, ChainConfig, ContractsConfig}; @@ -37,7 +38,7 @@ pub struct RegisterChainL1Config { #[derive(Debug, Deserialize, Serialize, Clone)] pub struct ChainL1Config { - pub chain_chain_id: ChainId, + pub chain_chain_id: L2ChainId, pub base_token_addr: Address, pub bridgehub_create_new_chain_salt: u64, pub validium_mode: bool, @@ -71,7 +72,7 @@ impl RegisterChainL1Config { validator_timelock_addr: contracts.ecosystem_contracts.validator_timelock_addr, }, chain: ChainL1Config { - chain_chain_id: ChainId(genesis_config.l2_chain_id.as_u64() as u32), + chain_chain_id: genesis_config.l2_chain_id, base_token_gas_price_multiplier_nominator: chain_config.base_token.nominator, base_token_gas_price_multiplier_denominator: chain_config.base_token.denominator, base_token_addr: chain_config.base_token.address, diff --git a/zk_toolbox/crates/config/src/genesis.rs b/zk_toolbox/crates/config/src/genesis.rs index 3ba9f6e1d837..1df1da85fe1f 100644 --- a/zk_toolbox/crates/config/src/genesis.rs +++ b/zk_toolbox/crates/config/src/genesis.rs @@ -1,7 +1,7 @@ use std::path::Path; use xshell::Shell; -use zksync_basic_types::{L1ChainId, L2ChainId}; +use zksync_basic_types::L1ChainId; pub use zksync_config::GenesisConfig; use zksync_protobuf_config::{decode_yaml_repr, encode_yaml_repr}; @@ -12,7 +12,7 @@ use crate::{ }; pub fn update_from_chain_config(genesis: &mut GenesisConfig, config: &ChainConfig) { - genesis.l2_chain_id = L2ChainId::from(config.chain_id.0); + genesis.l2_chain_id = config.chain_id; genesis.l1_chain_id = L1ChainId(config.l1_network.chain_id()); genesis.l1_batch_commit_data_generator_mode = config.l1_batch_commit_data_generator_mode; } diff --git a/zk_toolbox/crates/types/src/chain_id.rs b/zk_toolbox/crates/types/src/chain_id.rs deleted file mode 100644 index 258175d3fde5..000000000000 --- a/zk_toolbox/crates/types/src/chain_id.rs +++ /dev/null @@ -1,18 +0,0 @@ -use std::fmt::Display; - -use serde::{Deserialize, Serialize}; - -#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)] -pub struct ChainId(pub u32); - -impl Display for ChainId { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{}", self.0) - } -} - -impl From for ChainId { - fn from(value: u32) -> Self { - Self(value) - } -} diff --git a/zk_toolbox/crates/types/src/l1_batch_commit_data_generator_mode.rs b/zk_toolbox/crates/types/src/l1_batch_commit_data_generator_mode.rs deleted file mode 100644 index 8b137891791f..000000000000 --- a/zk_toolbox/crates/types/src/l1_batch_commit_data_generator_mode.rs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/zk_toolbox/crates/types/src/lib.rs b/zk_toolbox/crates/types/src/lib.rs index 7079888c2326..4cc7f160a45b 100644 --- a/zk_toolbox/crates/types/src/lib.rs +++ b/zk_toolbox/crates/types/src/lib.rs @@ -1,14 +1,12 @@ mod base_token; -mod chain_id; mod l1_network; -mod protocol_version; mod prover_mode; mod wallet_creation; pub use base_token::*; -pub use chain_id::*; pub use l1_network::*; -pub use protocol_version::ProtocolSemanticVersion; pub use prover_mode::*; pub use wallet_creation::*; -pub use zksync_basic_types::commitment::L1BatchCommitmentMode; +pub use zksync_basic_types::{ + commitment::L1BatchCommitmentMode, protocol_version::ProtocolSemanticVersion, +}; diff --git a/zk_toolbox/crates/types/src/protocol_version.rs b/zk_toolbox/crates/types/src/protocol_version.rs deleted file mode 100644 index 5b619c883a3e..000000000000 --- a/zk_toolbox/crates/types/src/protocol_version.rs +++ /dev/null @@ -1,87 +0,0 @@ -use std::{fmt, num::ParseIntError, str::FromStr}; - -use ethers::prelude::U256; -use serde::{de::Error, Deserialize, Deserializer, Serialize, Serializer}; - -pub const PACKED_SEMVER_MINOR_OFFSET: u32 = 32; - -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)] -pub struct ProtocolSemanticVersion { - pub minor: u16, - pub patch: u16, -} - -impl ProtocolSemanticVersion { - const MAJOR_VERSION: u8 = 0; - - pub fn new(minor: u16, patch: u16) -> Self { - Self { minor, patch } - } - - pub fn pack(&self) -> U256 { - (U256::from(self.minor) << U256::from(PACKED_SEMVER_MINOR_OFFSET)) | U256::from(self.patch) - } -} - -impl fmt::Display for ProtocolSemanticVersion { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "{}.{}.{}", Self::MAJOR_VERSION, self.minor, self.patch) - } -} - -#[derive(Debug, thiserror::Error)] -pub enum ParseProtocolSemanticVersionError { - #[error("invalid format")] - InvalidFormat, - #[error("non zero major version")] - NonZeroMajorVersion, - #[error("{0}")] - ParseIntError(ParseIntError), -} - -impl FromStr for ProtocolSemanticVersion { - type Err = ParseProtocolSemanticVersionError; - - fn from_str(s: &str) -> Result { - let parts: Vec<&str> = s.split('.').collect(); - if parts.len() != 3 { - return Err(ParseProtocolSemanticVersionError::InvalidFormat); - } - - let major = parts[0] - .parse::() - .map_err(ParseProtocolSemanticVersionError::ParseIntError)?; - if major != 0 { - return Err(ParseProtocolSemanticVersionError::NonZeroMajorVersion); - } - - let minor = parts[1] - .parse::() - .map_err(ParseProtocolSemanticVersionError::ParseIntError)?; - - let patch = parts[2] - .parse::() - .map_err(ParseProtocolSemanticVersionError::ParseIntError)?; - - Ok(ProtocolSemanticVersion { minor, patch }) - } -} - -impl<'de> Deserialize<'de> for ProtocolSemanticVersion { - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - ProtocolSemanticVersion::from_str(&s).map_err(D::Error::custom) - } -} - -impl Serialize for ProtocolSemanticVersion { - fn serialize(&self, serializer: S) -> Result - where - S: Serializer, - { - serializer.serialize_str(&self.to_string()) - } -} diff --git a/zk_toolbox/crates/types/src/prover_mode.rs b/zk_toolbox/crates/types/src/prover_mode.rs index 29f144c78143..b6667402ba26 100644 --- a/zk_toolbox/crates/types/src/prover_mode.rs +++ b/zk_toolbox/crates/types/src/prover_mode.rs @@ -8,5 +8,4 @@ use strum::EnumIter; pub enum ProverMode { NoProofs, Gpu, - Cpu, } diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/create.rs b/zk_toolbox/crates/zk_inception/src/commands/chain/create.rs index dc8f408db3b3..70f4442cca62 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/chain/create.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/chain/create.rs @@ -5,8 +5,8 @@ use config::{ create_local_configs_dir, create_wallets, traits::SaveConfigWithBasePath, ChainConfig, EcosystemConfig, }; -use types::ChainId; use xshell::Shell; +use zksync_basic_types::L2ChainId; use crate::{ commands::chain::args::create::{ChainCreateArgs, ChainCreateArgsFinal}, @@ -62,7 +62,7 @@ pub(crate) fn create_chain_inner( let chain_config = ChainConfig { id: chain_id, name: default_chain_name.clone(), - chain_id: ChainId::from(args.chain_id), + chain_id: L2ChainId::from(args.chain_id), prover_version: args.prover_version, l1_network: ecosystem_config.l1_network, link_to_code: ecosystem_config.link_to_code.clone(), diff --git a/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs b/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs index 13dc6a43439c..ff6a802bee1a 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs @@ -6,7 +6,6 @@ use config::{ external_node::ENConfig, ports_config, set_rocks_db_config, traits::SaveConfigWithBasePath, update_ports, ChainConfig, EcosystemConfig, SecretsConfig, }; -use types::ChainId; use xshell::Shell; use zksync_basic_types::url::SensitiveUrl; use zksync_config::configs::{DatabaseSecrets, L1Secrets}; @@ -49,16 +48,17 @@ fn prepare_configs( let genesis = config.get_genesis_config()?; let mut general = config.get_general_config()?; let en_config = ENConfig { - l2_chain_id: ChainId(genesis.l2_chain_id.as_u64() as u32), - l1_chain_id: genesis.l1_chain_id.0 as u32, + l2_chain_id: genesis.l2_chain_id, + l1_chain_id: genesis.l1_chain_id, l1_batch_commit_data_generator_mode: genesis.l1_batch_commit_data_generator_mode, - main_node_url: general - .api_config - .as_ref() - .context("api_config")? - .web3_json_rpc - .http_url - .clone(), + main_node_url: SensitiveUrl::from_str( + &general + .api_config + .as_ref() + .context("api_config")? + .web3_json_rpc + .http_url, + )?, main_node_rate_limit_rps: None, }; let mut general_en = general.clone(); From 2b4856e8f60084e8ea0d879e61d3ea17a8eab4c9 Mon Sep 17 00:00:00 2001 From: Danil Date: Wed, 24 Jul 2024 16:16:11 +0200 Subject: [PATCH 11/16] Fix data messages Signed-off-by: Danil --- .../src/commands/chain/deploy_paymaster.rs | 10 +++++++++- .../src/commands/chain/initialize_bridges.rs | 5 +++-- .../src/commands/external_node/init.rs | 7 +++---- zk_toolbox/crates/zk_inception/src/messages.rs | 2 ++ zk_toolbox/crates/zk_supervisor/src/dals.rs | 15 +++++---------- zk_toolbox/crates/zk_supervisor/src/messages.rs | 5 ++--- 6 files changed, 24 insertions(+), 20 deletions(-) diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/deploy_paymaster.rs b/zk_toolbox/crates/zk_inception/src/commands/chain/deploy_paymaster.rs index 5b37bacccce1..f83abe0f549f 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/chain/deploy_paymaster.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/chain/deploy_paymaster.rs @@ -14,6 +14,7 @@ use config::{ }; use xshell::Shell; +use crate::messages::MSG_L1_SECRETS_MUST_BE_PRESENTED; use crate::{ messages::{MSG_CHAIN_NOT_INITIALIZED, MSG_DEPLOYING_PAYMASTER}, utils::forge::{check_the_balance, fill_forge_private_key}, @@ -47,7 +48,14 @@ pub async fn deploy_paymaster( let mut forge = Forge::new(&foundry_contracts_path) .script(&DEPLOY_PAYMASTER_SCRIPT_PARAMS.script(), forge_args.clone()) .with_ffi() - .with_rpc_url(secrets.l1.unwrap().l1_rpc_url.expose_str().to_string()) + .with_rpc_url( + secrets + .l1 + .context(MSG_L1_SECRETS_MUST_BE_PRESENTED)? + .l1_rpc_url + .expose_str() + .to_string(), + ) .with_broadcast(); forge = fill_forge_private_key( diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/initialize_bridges.rs b/zk_toolbox/crates/zk_inception/src/commands/chain/initialize_bridges.rs index 91e87b45f1aa..44666b734522 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/chain/initialize_bridges.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/chain/initialize_bridges.rs @@ -21,6 +21,7 @@ use crate::{ messages::{MSG_CHAIN_NOT_INITIALIZED, MSG_INITIALIZING_BRIDGES_SPINNER}, utils::forge::{check_the_balance, fill_forge_private_key}, }; +use crate::messages::MSG_L1_SECRETS_MUST_BE_PRESENTED; pub async fn run(args: ForgeScriptArgs, shell: &Shell) -> anyhow::Result<()> { let chain_name = global_config().chain_name.clone(); @@ -38,7 +39,7 @@ pub async fn run(args: ForgeScriptArgs, shell: &Shell) -> anyhow::Result<()> { &mut contracts, args, ) - .await?; + .await?; contracts.save_with_base_path(shell, &chain_config.configs)?; spinner.finish(); @@ -67,7 +68,7 @@ pub async fn initialize_bridges( forge_args.clone(), ) .with_ffi() - .with_rpc_url(secrets.l1.unwrap().l1_rpc_url.expose_str().to_string()) + .with_rpc_url(secrets.l1.context(MSG_L1_SECRETS_MUST_BE_PRESENTED)?.l1_rpc_url.expose_str().to_string()) .with_broadcast(); forge = fill_forge_private_key( diff --git a/zk_toolbox/crates/zk_inception/src/commands/external_node/init.rs b/zk_toolbox/crates/zk_inception/src/commands/external_node/init.rs index 1f7ce9f24c40..0d5ba068c679 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/external_node/init.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/external_node/init.rs @@ -7,6 +7,7 @@ use common::{ use config::{traits::ReadConfigWithBasePath, ChainConfig, EcosystemConfig, SecretsConfig}; use xshell::Shell; +use crate::messages::MSG_DATABASE_MUST_BE_PRESENTED; use crate::{ consts::SERVER_MIGRATIONS, messages::{ @@ -40,10 +41,8 @@ pub async fn init(shell: &Shell, chain_config: &ChainConfig) -> anyhow::Result<( secrets .database .as_ref() - .context("")? - .server_url - .as_ref() - .context("")? + .context(MSG_DATABASE_MUST_BE_PRESENTED)? + .master_url()? .expose_url(), )?; drop_db_if_exists(&db_config) diff --git a/zk_toolbox/crates/zk_inception/src/messages.rs b/zk_toolbox/crates/zk_inception/src/messages.rs index af40b48e5795..0d7926718a93 100644 --- a/zk_toolbox/crates/zk_inception/src/messages.rs +++ b/zk_toolbox/crates/zk_inception/src/messages.rs @@ -122,6 +122,8 @@ pub(super) const MSG_CREATING_CHAIN_CONFIGURATIONS_SPINNER: &str = "Creating chain configurations..."; /// Chain genesis related messages +pub(super) const MSG_L1_SECRETS_MUST_BE_PRESENTED: &str = "L1 secret must be presented"; +pub(super) const MSG_DATABASE_MUST_BE_PRESENTED: &str = "Database secret must be presented"; pub(super) const MSG_SERVER_DB_URL_HELP: &str = "Server database url without database name"; pub(super) const MSG_SERVER_DB_NAME_HELP: &str = "Server database name"; pub(super) const MSG_PROVER_DB_URL_HELP: &str = "Prover database url without database name"; diff --git a/zk_toolbox/crates/zk_supervisor/src/dals.rs b/zk_toolbox/crates/zk_supervisor/src/dals.rs index 150b2a5f0918..2d2af41500b4 100644 --- a/zk_toolbox/crates/zk_supervisor/src/dals.rs +++ b/zk_toolbox/crates/zk_supervisor/src/dals.rs @@ -4,7 +4,7 @@ use config::{EcosystemConfig, SecretsConfig}; use url::Url; use xshell::Shell; -use crate::messages::{MSG_CHAIN_NOT_FOUND_ERR, MSG_PROVER_URL_MUST_BE_PRESENTED}; +use crate::messages::{MSG_CHAIN_NOT_FOUND_ERR, MSG_DATABASE_MUST_BE_PRESENTED}; const CORE_DAL_PATH: &str = "core/lib/dal"; const PROVER_DAL_PATH: &str = "prover/crates/lib/prover_dal"; @@ -49,10 +49,8 @@ pub fn get_prover_dal(shell: &Shell) -> anyhow::Result { url: secrets .database .as_ref() - .context(MSG_PROVER_URL_MUST_BE_PRESENTED)? - .prover_url - .as_ref() - .context(MSG_PROVER_URL_MUST_BE_PRESENTED)? + .context(MSG_DATABASE_MUST_BE_PRESENTED)? + .prover_url()? .expose_url() .clone(), }) @@ -66,11 +64,8 @@ pub fn get_core_dal(shell: &Shell) -> anyhow::Result { url: secrets .database .as_ref() - .context("DATABASE not found")? - .server_url - .as_ref() - .context("DATABASE not found")? - .clone() + .context(MSG_DATABASE_MUST_BE_PRESENTED)? + .master_url()? .expose_url() .clone(), }) diff --git a/zk_toolbox/crates/zk_supervisor/src/messages.rs b/zk_toolbox/crates/zk_supervisor/src/messages.rs index 863f1c4b1aef..ecbe604a7ba3 100644 --- a/zk_toolbox/crates/zk_supervisor/src/messages.rs +++ b/zk_toolbox/crates/zk_supervisor/src/messages.rs @@ -37,9 +37,7 @@ pub(super) const MSG_DATABASE_RESET_GERUND: &str = "Resetting"; pub(super) const MSG_DATABASE_RESET_PAST: &str = "reset"; pub(super) const MSG_DATABASE_SETUP_GERUND: &str = "Setting up"; pub(super) const MSG_DATABASE_SETUP_PAST: &str = "set up"; - -pub(super) const MSG_PROVER_URL_MUST_BE_PRESENTED: &str = "Prover url must be presented"; - +pub(super) const MSG_DATABASE_MUST_BE_PRESENTED: &str = "Database config must be presented"; pub(super) const MSG_DATABASE_COMMON_PROVER_HELP: &str = "Prover database"; pub(super) const MSG_DATABASE_COMMON_CORE_HELP: &str = "Core database"; pub(super) const MSG_DATABASE_NEW_MIGRATION_DATABASE_HELP: &str = @@ -96,6 +94,7 @@ pub(super) const MSG_REVERT_TEST_ENABLE_CONSENSUS_HELP: &str = "Enable consensus pub(super) const MSG_REVERT_TEST_INSTALLING_DEPENDENCIES: &str = "Building and installing dependencies. This process may take a lot of time..."; pub(super) const MSG_REVERT_TEST_RUN_INFO: &str = "Running revert and restart test"; + pub(super) fn msg_revert_tests_run(external_node: bool) -> String { let base = "Running integration tests"; if external_node { From 2108f5451d7fbfdc39042272cb3f7819dc3ab855 Mon Sep 17 00:00:00 2001 From: Danil Date: Wed, 24 Jul 2024 16:17:13 +0200 Subject: [PATCH 12/16] Fix data messages Signed-off-by: Danil --- .../src/commands/chain/deploy_paymaster.rs | 5 +++-- .../src/commands/chain/initialize_bridges.rs | 17 +++++++++++++---- .../src/commands/external_node/init.rs | 6 +++--- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/deploy_paymaster.rs b/zk_toolbox/crates/zk_inception/src/commands/chain/deploy_paymaster.rs index f83abe0f549f..81ac457cd884 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/chain/deploy_paymaster.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/chain/deploy_paymaster.rs @@ -14,9 +14,10 @@ use config::{ }; use xshell::Shell; -use crate::messages::MSG_L1_SECRETS_MUST_BE_PRESENTED; use crate::{ - messages::{MSG_CHAIN_NOT_INITIALIZED, MSG_DEPLOYING_PAYMASTER}, + messages::{ + MSG_CHAIN_NOT_INITIALIZED, MSG_DEPLOYING_PAYMASTER, MSG_L1_SECRETS_MUST_BE_PRESENTED, + }, utils::forge::{check_the_balance, fill_forge_private_key}, }; diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/initialize_bridges.rs b/zk_toolbox/crates/zk_inception/src/commands/chain/initialize_bridges.rs index 44666b734522..b60daa9dbd61 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/chain/initialize_bridges.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/chain/initialize_bridges.rs @@ -18,10 +18,12 @@ use config::{ use xshell::{cmd, Shell}; use crate::{ - messages::{MSG_CHAIN_NOT_INITIALIZED, MSG_INITIALIZING_BRIDGES_SPINNER}, + messages::{ + MSG_CHAIN_NOT_INITIALIZED, MSG_INITIALIZING_BRIDGES_SPINNER, + MSG_L1_SECRETS_MUST_BE_PRESENTED, + }, utils::forge::{check_the_balance, fill_forge_private_key}, }; -use crate::messages::MSG_L1_SECRETS_MUST_BE_PRESENTED; pub async fn run(args: ForgeScriptArgs, shell: &Shell) -> anyhow::Result<()> { let chain_name = global_config().chain_name.clone(); @@ -39,7 +41,7 @@ pub async fn run(args: ForgeScriptArgs, shell: &Shell) -> anyhow::Result<()> { &mut contracts, args, ) - .await?; + .await?; contracts.save_with_base_path(shell, &chain_config.configs)?; spinner.finish(); @@ -68,7 +70,14 @@ pub async fn initialize_bridges( forge_args.clone(), ) .with_ffi() - .with_rpc_url(secrets.l1.context(MSG_L1_SECRETS_MUST_BE_PRESENTED)?.l1_rpc_url.expose_str().to_string()) + .with_rpc_url( + secrets + .l1 + .context(MSG_L1_SECRETS_MUST_BE_PRESENTED)? + .l1_rpc_url + .expose_str() + .to_string(), + ) .with_broadcast(); forge = fill_forge_private_key( diff --git a/zk_toolbox/crates/zk_inception/src/commands/external_node/init.rs b/zk_toolbox/crates/zk_inception/src/commands/external_node/init.rs index 0d5ba068c679..28c3e80aaab0 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/external_node/init.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/external_node/init.rs @@ -7,12 +7,12 @@ use common::{ use config::{traits::ReadConfigWithBasePath, ChainConfig, EcosystemConfig, SecretsConfig}; use xshell::Shell; -use crate::messages::MSG_DATABASE_MUST_BE_PRESENTED; use crate::{ consts::SERVER_MIGRATIONS, messages::{ - MSG_CHAIN_NOT_INITIALIZED, MSG_EXTERNAL_NODE_CONFIG_NOT_INITIALIZED, - MSG_FAILED_TO_DROP_SERVER_DATABASE_ERR, MSG_INITIALIZING_DATABASES_SPINNER, + MSG_CHAIN_NOT_INITIALIZED, MSG_DATABASE_MUST_BE_PRESENTED, + MSG_EXTERNAL_NODE_CONFIG_NOT_INITIALIZED, MSG_FAILED_TO_DROP_SERVER_DATABASE_ERR, + MSG_INITIALIZING_DATABASES_SPINNER, }, utils::rocks_db::{recreate_rocksdb_dirs, RocksDBDirOption}, }; From beb77711c3a6104ceb74cadb2e2f00aadedbdcbc Mon Sep 17 00:00:00 2001 From: Danil Date: Wed, 24 Jul 2024 16:17:13 +0200 Subject: [PATCH 13/16] Fix data messages Signed-off-by: Danil --- .../config/src/forge_interface/deploy_ecosystem/input.rs | 1 + zk_toolbox/crates/config/src/general.rs | 4 ++-- zk_toolbox/crates/config/src/traits.rs | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/input.rs b/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/input.rs index dd80b009a71e..0dc117ae8cda 100644 --- a/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/input.rs +++ b/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/input.rs @@ -157,6 +157,7 @@ impl DeployL1Config { .diamond_init_priority_tx_max_pubdata, diamond_init_pubdata_pricing_mode: initial_deployment_config .diamond_init_pubdata_pricing_mode, + // These values are not optional in genesis config with file based configuration genesis_batch_commitment: genesis_config.genesis_commitment.unwrap(), genesis_rollup_leaf_index: genesis_config.rollup_last_leaf_index.unwrap(), genesis_root: genesis_config.genesis_root_hash.unwrap(), diff --git a/zk_toolbox/crates/config/src/general.rs b/zk_toolbox/crates/config/src/general.rs index 9db7c4ec0b2a..091d18936616 100644 --- a/zk_toolbox/crates/config/src/general.rs +++ b/zk_toolbox/crates/config/src/general.rs @@ -20,12 +20,12 @@ pub fn set_rocks_db_config(config: &mut GeneralConfig, rocks_dbs: RocksDbs) -> a config .db_config .as_mut() - .context("Db config")? + .context("DB config is not presented")? .state_keeper_db_path = rocks_dbs.state_keeper.to_str().unwrap().to_string(); config .db_config .as_mut() - .context("Db config")? + .context("DB config is not presented")? .merkle_tree .path = rocks_dbs.merkle_tree.to_str().unwrap().to_string(); Ok(()) diff --git a/zk_toolbox/crates/config/src/traits.rs b/zk_toolbox/crates/config/src/traits.rs index 37237fc97db2..1f00b39b040a 100644 --- a/zk_toolbox/crates/config/src/traits.rs +++ b/zk_toolbox/crates/config/src/traits.rs @@ -125,7 +125,7 @@ impl SaveConfigWithComment for T { /// Saves a config file from a base path, correctly parsing file extension. /// Supported file extensions are: `yaml`, `yml`, `toml`. pub trait SaveConfigWithCommentAndBasePath: - SaveConfigWithComment + FileConfigWithDefaultName + SaveConfig + SaveConfigWithComment + FileConfigWithDefaultName { fn save_with_comment_and_base_path( &self, From 0aee72c2b65db8d5eae9bd454927b882789246aa Mon Sep 17 00:00:00 2001 From: Danil Date: Wed, 24 Jul 2024 17:29:42 +0200 Subject: [PATCH 14/16] Add piping only during resume process Signed-off-by: Danil --- zk_toolbox/crates/common/src/cmd.rs | 18 +++++++++++++++--- zk_toolbox/crates/common/src/forge.rs | 16 ++++++++++++---- .../commands/external_node/prepare_configs.rs | 5 ++--- 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/zk_toolbox/crates/common/src/cmd.rs b/zk_toolbox/crates/common/src/cmd.rs index ca0f285882a3..7bf0147b69c0 100644 --- a/zk_toolbox/crates/common/src/cmd.rs +++ b/zk_toolbox/crates/common/src/cmd.rs @@ -19,6 +19,8 @@ use crate::{ pub struct Cmd<'a> { inner: xshell::Cmd<'a>, force_run: bool, + // For resume functionality we must pipe the output, otherwise it only shows less information + piped_std_err: bool, } #[derive(thiserror::Error, Debug)] @@ -72,6 +74,7 @@ impl<'a> Cmd<'a> { Self { inner: cmd, force_run: false, + piped_std_err: false, } } @@ -81,6 +84,11 @@ impl<'a> Cmd<'a> { self } + pub fn with_piped_std_err(mut self) -> Self { + self.piped_std_err = true; + self + } + /// Set env variables for the command. pub fn env, V: AsRef>(mut self, key: K, value: V) -> Self { self.inner = self.inner.env(key, value); @@ -93,7 +101,7 @@ impl<'a> Cmd<'a> { let output = if global_config().verbose || self.force_run { logger::debug(format!("Running: {}", self.inner)); logger::new_empty_line(); - let output = run_low_level_process_command(self.inner.into())?; + let output = run_low_level_process_command(self.inner.into(), self.piped_std_err)?; if let Ok(data) = String::from_utf8(output.stderr.clone()) { if !data.is_empty() { logger::info(data) @@ -152,9 +160,13 @@ fn check_output_status(command_text: &str, output: &std::process::Output) -> Cmd Ok(()) } -fn run_low_level_process_command(mut command: Command) -> io::Result { +fn run_low_level_process_command(mut command: Command, piped_std_err: bool) -> io::Result { command.stdout(Stdio::inherit()); - command.stderr(Stdio::piped()); + if piped_std_err { + command.stderr(Stdio::piped()); + } else { + command.stderr(Stdio::inherit()); + } let child = command.spawn()?; child.wait_with_output() } diff --git a/zk_toolbox/crates/common/src/forge.rs b/zk_toolbox/crates/common/src/forge.rs index a6381bc0c846..f00921a0bf20 100644 --- a/zk_toolbox/crates/common/src/forge.rs +++ b/zk_toolbox/crates/common/src/forge.rs @@ -62,16 +62,24 @@ impl ForgeScript { if self.args.resume { let mut args = args_no_resume.clone(); args.push(ForgeScriptArg::Resume.to_string()); - let res = Cmd::new(cmd!(shell, "forge script {script_path} --legacy {args...}")).run(); + let res = Cmd::new(cmd!(shell, "forge script {script_path} --legacy {args...}")) + .with_piped_std_err() + .run(); if !res.resume_not_successful_because_has_not_began() { return Ok(res?); } } - let res = Cmd::new(cmd!( + let mut cmd = Cmd::new(cmd!( shell, "forge script {script_path} --legacy {args_no_resume...}" - )) - .run(); + )); + + if self.args.resume { + cmd = cmd.with_piped_std_err(); + } + + let res = cmd.run(); + // We won't catch this error if resume is not set. if res.proposal_error() { return Ok(()); } diff --git a/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs b/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs index ff6a802bee1a..b799a68aeb8f 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/external_node/prepare_configs.rs @@ -46,7 +46,7 @@ fn prepare_configs( args: PrepareConfigFinal, ) -> anyhow::Result<()> { let genesis = config.get_genesis_config()?; - let mut general = config.get_general_config()?; + let general = config.get_general_config()?; let en_config = ENConfig { l2_chain_id: genesis.l2_chain_id, l1_chain_id: genesis.l1_chain_id, @@ -82,8 +82,7 @@ fn prepare_configs( }; secrets.save_with_base_path(shell, en_configs_path)?; let dirs = recreate_rocksdb_dirs(shell, &config.rocks_db_path, RocksDBDirOption::ExternalNode)?; - set_rocks_db_config(&mut general, dirs)?; - + set_rocks_db_config(&mut general_en, dirs)?; general_en.save_with_base_path(shell, en_configs_path)?; en_config.save_with_base_path(shell, en_configs_path)?; From a136ffb50c976ce849ec93175d5362aba4108ee7 Mon Sep 17 00:00:00 2001 From: Danil Date: Thu, 25 Jul 2024 10:56:28 +0200 Subject: [PATCH 15/16] Do not stringify 64 fields Signed-off-by: Danil --- core/lib/protobuf_config/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/lib/protobuf_config/src/lib.rs b/core/lib/protobuf_config/src/lib.rs index e019e631619b..e910b5760d31 100644 --- a/core/lib/protobuf_config/src/lib.rs +++ b/core/lib/protobuf_config/src/lib.rs @@ -79,6 +79,8 @@ fn serialize_proto( x: &T, s: S, ) -> Result { - let opts = prost_reflect::SerializeOptions::new().use_proto_field_name(true); + let opts = prost_reflect::SerializeOptions::new() + .use_proto_field_name(true) + .stringify_64_bit_integers(false); x.transcode_to_dynamic().serialize_with_options(s, &opts) } From 525ef78fa2fe5dabb485c6e7b809d994c78906a8 Mon Sep 17 00:00:00 2001 From: Danil Date: Thu, 25 Jul 2024 19:55:33 +0200 Subject: [PATCH 16/16] Update zksync_protobuf Signed-off-by: Danil --- zk_toolbox/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zk_toolbox/Cargo.toml b/zk_toolbox/Cargo.toml index 1aea7930a9d2..0c5e2188c66a 100644 --- a/zk_toolbox/Cargo.toml +++ b/zk_toolbox/Cargo.toml @@ -30,7 +30,7 @@ types = { path = "crates/types" } zksync_config = { path = "../core/lib/config" } zksync_protobuf_config = { path = "../core/lib/protobuf_config" } zksync_basic_types = { path = "../core/lib/basic_types" } -zksync_protobuf = "=0.1.0-rc.2" +zksync_protobuf = "=0.1.0-rc.4" # External dependencies anyhow = "1.0.82"