From 6212604ff28892c0c24269457bc4d889129a5b4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Fran=C3=A7a?= Date: Thu, 26 Sep 2024 18:36:21 +0100 Subject: [PATCH] Fixed toolbox --- zk_toolbox/Cargo.lock | 165 ++++++------------ .../zk_inception/src/utils/consensus.rs | 4 +- 2 files changed, 57 insertions(+), 112 deletions(-) diff --git a/zk_toolbox/Cargo.lock b/zk_toolbox/Cargo.lock index 29603709452..134511fc75b 100644 --- a/zk_toolbox/Cargo.lock +++ b/zk_toolbox/Cargo.lock @@ -643,7 +643,7 @@ dependencies = [ "hmac", "once_cell", "pbkdf2 0.12.2", - "rand 0.8.5", + "rand", "sha2", "thiserror", ] @@ -722,7 +722,7 @@ dependencies = [ "clap", "common", "ethers", - "rand 0.8.5", + "rand", "serde", "serde_json", "serde_yaml", @@ -871,7 +871,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" dependencies = [ "generic-array", - "rand_core 0.6.4", + "rand_core", "subtle", "zeroize", ] @@ -883,7 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core 0.6.4", + "rand_core", "subtle", "zeroize", ] @@ -1179,7 +1179,7 @@ checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ "curve25519-dalek", "ed25519", - "rand_core 0.6.4", + "rand_core", "serde", "sha2", "subtle", @@ -1209,7 +1209,7 @@ dependencies = [ "generic-array", "group 0.12.1", "pkcs8 0.9.0", - "rand_core 0.6.4", + "rand_core", "sec1 0.3.0", "subtle", "zeroize", @@ -1228,7 +1228,7 @@ dependencies = [ "generic-array", "group 0.13.0", "pkcs8 0.10.2", - "rand_core 0.6.4", + "rand_core", "sec1 0.7.3", "subtle", "zeroize", @@ -1278,7 +1278,7 @@ dependencies = [ "hex", "k256 0.13.3", "log", - "rand 0.8.5", + "rand", "rlp", "serde", "sha3", @@ -1333,7 +1333,7 @@ dependencies = [ "hex", "hmac", "pbkdf2 0.11.0", - "rand 0.8.5", + "rand", "scrypt", "serde", "serde_json", @@ -1496,7 +1496,7 @@ dependencies = [ "num_enum 0.7.2", "once_cell", "open-fastrlp", - "rand 0.8.5", + "rand", "rlp", "serde", "serde_json", @@ -1601,7 +1601,7 @@ dependencies = [ "elliptic-curve 0.13.8", "eth-keystore", "ethers-core", - "rand 0.8.5", + "rand", "sha2", "thiserror", "tracing", @@ -1672,7 +1672,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" dependencies = [ - "rand_core 0.6.4", + "rand_core", "subtle", ] @@ -1682,22 +1682,10 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "rand_core 0.6.4", + "rand_core", "subtle", ] -[[package]] -name = "ff_ce" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b538e4231443a5b9c507caee3356f016d832cf7393d2d90f03ea3180d4e3fbc" -dependencies = [ - "byteorder", - "hex", - "rand 0.4.6", - "serde", -] - [[package]] name = "fiat-crypto" version = "0.2.9" @@ -1723,7 +1711,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ "byteorder", - "rand 0.8.5", + "rand", "rustc-hex", "static_assertions", ] @@ -1795,12 +1783,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "fuchsia-cprng" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" - [[package]] name = "funty" version = "2.0.0" @@ -1996,7 +1978,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" dependencies = [ "ff 0.12.1", - "rand_core 0.6.4", + "rand_core", "subtle", ] @@ -2007,7 +1989,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff 0.13.0", - "rand_core 0.6.4", + "rand_core", "subtle", ] @@ -2837,7 +2819,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ffa00dec017b5b1a8b7cf5e2c008bfda1aa7e0697ac1508b491fdf2622fb4d8" dependencies = [ - "rand 0.8.5", + "rand", ] [[package]] @@ -2920,7 +2902,7 @@ dependencies = [ "num-integer", "num-iter", "num-traits", - "rand 0.8.5", + "rand", "smallvec", "zeroize", ] @@ -3216,7 +3198,7 @@ dependencies = [ "once_cell", "opentelemetry", "percent-encoding", - "rand 0.8.5", + "rand", "serde_json", "thiserror", "tokio", @@ -3317,7 +3299,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" dependencies = [ "base64ct", - "rand_core 0.6.4", + "rand_core", "subtle", ] @@ -3416,7 +3398,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" dependencies = [ "phf_shared 0.11.2", - "rand 0.8.5", + "rand", ] [[package]] @@ -3627,7 +3609,7 @@ dependencies = [ "bitflags 2.6.0", "lazy_static", "num-traits", - "rand 0.8.5", + "rand", "rand_chacha", "rand_xorshift", "regex-syntax 0.8.4", @@ -3777,19 +3759,6 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" -[[package]] -name = "rand" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" -dependencies = [ - "fuchsia-cprng", - "libc", - "rand_core 0.3.1", - "rdrand", - "winapi", -] - [[package]] name = "rand" version = "0.8.5" @@ -3798,7 +3767,7 @@ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha", - "rand_core 0.6.4", + "rand_core", ] [[package]] @@ -3808,24 +3777,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_core" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -dependencies = [ - "rand_core 0.4.2", + "rand_core", ] -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - [[package]] name = "rand_core" version = "0.6.4" @@ -3841,7 +3795,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" dependencies = [ - "rand_core 0.6.4", + "rand_core", ] [[package]] @@ -3864,15 +3818,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "rdrand" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -dependencies = [ - "rand_core 0.3.1", -] - [[package]] name = "redox_syscall" version = "0.4.1" @@ -4129,7 +4074,7 @@ dependencies = [ "num-traits", "pkcs1", "pkcs8 0.10.2", - "rand_core 0.6.4", + "rand_core", "signature 2.2.0", "spki 0.7.3", "subtle", @@ -4483,7 +4428,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "901f761681f97db3db836ef9e094acdd8756c40215326c194201941947164ef1" dependencies = [ "once_cell", - "rand 0.8.5", + "rand", "sentry-types", "serde", "serde_json", @@ -4530,7 +4475,7 @@ checksum = "da956cca56e0101998c8688bc65ce1a96f00673a0e58e663664023d4c7911e82" dependencies = [ "debugid", "hex", - "rand 0.8.5", + "rand", "serde", "serde_json", "thiserror", @@ -4721,7 +4666,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" dependencies = [ "digest", - "rand_core 0.6.4", + "rand_core", ] [[package]] @@ -4731,7 +4676,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest", - "rand_core 0.6.4", + "rand_core", ] [[package]] @@ -4975,7 +4920,7 @@ dependencies = [ "memchr", "once_cell", "percent-encoding", - "rand 0.8.5", + "rand", "rsa", "serde", "sha1", @@ -5014,7 +4959,7 @@ dependencies = [ "md-5", "memchr", "once_cell", - "rand 0.8.5", + "rand", "serde", "serde_json", "sha2", @@ -5541,7 +5486,7 @@ dependencies = [ "indexmap 1.9.3", "pin-project", "pin-project-lite", - "rand 0.8.5", + "rand", "slab", "tokio", "tokio-util", @@ -5684,7 +5629,7 @@ dependencies = [ "http 0.2.12", "httparse", "log", - "rand 0.8.5", + "rand", "rustls 0.21.12", "sha1", "thiserror", @@ -6498,14 +6443,14 @@ dependencies = [ [[package]] name = "zksync_concurrency" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1c8cf6c689ab5922b52d81b775cd2d9cffbfc8fb8da65985e11b06546dfb3bf" +checksum = "6361e42dd8243eb87f6d66b7637aed65c6a409b6b28a8faf51764bbb11ea7d73" dependencies = [ "anyhow", "once_cell", "pin-project", - "rand 0.8.5", + "rand", "sha3", "thiserror", "time", @@ -6520,7 +6465,7 @@ name = "zksync_config" version = "0.1.0" dependencies = [ "anyhow", - "rand 0.8.5", + "rand", "secrecy", "serde", "url", @@ -6532,21 +6477,19 @@ dependencies = [ [[package]] name = "zksync_consensus_crypto" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7baced4e811015038322dad10239f2d631d9e339e8d6b7b6e6b146bee30f41" +checksum = "4194a7281dde7b9876b8b4e17f57bc0b816f7d80b8a23aeefdbd2c2e49a69780" dependencies = [ "anyhow", "blst", "ed25519-dalek", "elliptic-curve 0.13.8", - "ff_ce", "hex", "k256 0.13.3", "num-bigint", "num-traits", - "rand 0.4.6", - "rand 0.8.5", + "rand", "sha3", "thiserror", "tracing", @@ -6555,16 +6498,16 @@ dependencies = [ [[package]] name = "zksync_consensus_roles" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aab4ddf62f6001903c5fe9f65afb1bdc42464928c9d1c6ce52e4d7e9944f5dc" +checksum = "d25bf5e8254d7295673ee97603dca960e624e68a9ac3e6de4cb50cc01733b20c" dependencies = [ "anyhow", "bit-vec", "hex", "num-bigint", "prost 0.12.6", - "rand 0.8.5", + "rand", "serde", "thiserror", "tracing", @@ -6577,12 +6520,12 @@ dependencies = [ [[package]] name = "zksync_consensus_utils" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29e69dffc0fbc7c096548c997f5ca157a490b34b3d49fd524fa3d51840f7fb22" +checksum = "095f601b6a8a5985960906f6102aafcc42e80a7fbd9dece62d8c192976b0ddf7" dependencies = [ "anyhow", - "rand 0.8.5", + "rand", "thiserror", "zksync_concurrency", ] @@ -6607,7 +6550,7 @@ dependencies = [ "anyhow", "blake2", "hex", - "rand 0.8.5", + "rand", "secp256k1", "serde", "serde_json", @@ -6628,9 +6571,9 @@ dependencies = [ [[package]] name = "zksync_protobuf" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df5467dfe2f845ca1fd6ceec623bbd32187589793d3c4023dcd2f5172369d198" +checksum = "748049cdfb8f7d7e610972e7ee5883d0ac0db9a5482a0352c1ffc1b344e88ca5" dependencies = [ "anyhow", "bit-vec", @@ -6638,7 +6581,7 @@ dependencies = [ "prost 0.12.6", "prost-reflect", "quick-protobuf", - "rand 0.8.5", + "rand", "serde", "serde_json", "serde_yaml", @@ -6649,9 +6592,9 @@ dependencies = [ [[package]] name = "zksync_protobuf_build" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d35280660b11be2a4ebdf531184eb729acebfdc3368d27176ec104f8bf9c5f" +checksum = "61fe8c3545b3c346a7e6b7462260056f4c1964e60d2df1a84926a22ff27cb40a" dependencies = [ "anyhow", "heck", @@ -6671,7 +6614,7 @@ dependencies = [ "anyhow", "hex", "prost 0.12.6", - "rand 0.8.5", + "rand", "secrecy", "serde_json", "serde_yaml", diff --git a/zk_toolbox/crates/zk_inception/src/utils/consensus.rs b/zk_toolbox/crates/zk_inception/src/utils/consensus.rs index 0b24bbe5cdc..3c05943e3c2 100644 --- a/zk_toolbox/crates/zk_inception/src/utils/consensus.rs +++ b/zk_toolbox/crates/zk_inception/src/utils/consensus.rs @@ -1,6 +1,6 @@ use std::{ collections::{BTreeMap, BTreeSet}, - net::SocketAddr, + net::{IpAddr, Ipv4Addr, SocketAddr}, }; use config::{ChainConfig, PortsConfig}; @@ -41,10 +41,12 @@ pub fn get_consensus_config( let public_addr = SocketAddr::new(CONSENSUS_PUBLIC_ADDRESS_HOST, ports.consensus_port); let server_addr = SocketAddr::new(CONSENSUS_SERVER_ADDRESS_HOST, ports.consensus_port); + let debug_page_addr = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 5000); Ok(ConsensusConfig { server_addr, public_addr: Host(public_addr.encode()), + debug_page_addr, genesis_spec, max_payload_size: MAX_PAYLOAD_SIZE, gossip_dynamic_inbound_limit: GOSSIP_DYNAMIC_INBOUND_LIMIT,