diff --git a/Cargo.lock b/Cargo.lock index 7d9a07fc..f73a2e95 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -40,9 +40,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.7.7" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ "getrandom", "once_cell", @@ -63,9 +63,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" dependencies = [ "memchr", ] @@ -413,13 +413,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.74" +version = "0.1.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.37", ] [[package]] @@ -540,9 +540,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.5" +version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" [[package]] name = "base64ct" @@ -588,9 +588,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" [[package]] name = "bitvec" @@ -670,9 +670,9 @@ dependencies = [ [[package]] name = "byteorder" -version = "1.5.0" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" @@ -715,9 +715,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.4" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12024c4645c97566567129c204f65d5815a8c9aecf30fcbe682b2fe034996d36" +checksum = "2cfa25e60aea747ec7e1124f238816749faa93759c6ff5b31f1ccdda137f4479" dependencies = [ "serde", ] @@ -730,7 +730,7 @@ checksum = "e7daec1a2a2129eeba1644b220b4647ec537b0b5d4bfd6876fcc5a540056b592" dependencies = [ "camino", "cargo-platform", - "semver 1.0.20", + "semver 1.0.19", "serde", "serde_json", "thiserror", @@ -790,9 +790,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.7" +version = "4.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac495e00dcec98c83465d5ad66c5c4fabd652fd6686e7c6269b117e729a6f17b" +checksum = "d04704f56c2cde07f43e8e2c154b43f216dc5c92fc98ada720177362f953b956" dependencies = [ "clap_builder", "clap_derive", @@ -800,9 +800,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.7" +version = "4.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c77ed9a32a62e6ca27175d00d29d05ca32e396ea1eb5fb01d8256b669cec7663" +checksum = "0e231faeaca65ebd1ea3c737966bf858971cd38c3849107aa3ea7de90a804e45" dependencies = [ "anstream", "anstyle", @@ -812,21 +812,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.4.7" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.37", ] [[package]] name = "clap_lex" -version = "0.6.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" +checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" [[package]] name = "coins-bip32" @@ -866,7 +866,7 @@ version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5286a0843c21f8367f7be734f89df9b822e0321d8bcce8d6e735aadff7d74979" dependencies = [ - "base64 0.21.5", + "base64 0.21.4", "bech32", "bs58", "digest 0.10.7", @@ -962,9 +962,9 @@ dependencies = [ [[package]] name = "const-hex" -version = "1.9.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c37be52ef5e3b394db27a2341010685ad5103c72ac15ce2e9420a7e8f93f342c" +checksum = "aa72a10d0e914cad6bcad4e7409e68d230c1c2db67896e19a37f758b1fcbdab5" dependencies = [ "cfg-if", "cpufeatures", @@ -1015,9 +1015,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.11" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" dependencies = [ "libc", ] @@ -1199,9 +1199,9 @@ dependencies = [ [[package]] name = "csv" -version = "1.3.0" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac574ff4d437a7b5ad237ef331c17ccca63c46479e5b5453eb8e10bb99a759fe" +checksum = "626ae34994d3d8d668f4269922248239db4ae42d538b14c398b74a52208e8086" dependencies = [ "csv-core", "itoa", @@ -1211,9 +1211,9 @@ dependencies = [ [[package]] name = "csv-core" -version = "0.1.11" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5efa2b3d7902f4b634a20cae3c9c4e6209dc4779feb6863329607560143efa70" +checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" dependencies = [ "memchr", ] @@ -1247,7 +1247,7 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.37", ] [[package]] @@ -1258,7 +1258,7 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core", "quote", - "syn 2.0.38", + "syn 2.0.37", ] [[package]] @@ -1279,12 +1279,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.9" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" -dependencies = [ - "powerfmt", -] +checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" [[package]] name = "derivative" @@ -1405,9 +1402,9 @@ checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "elliptic-curve" -version = "0.13.6" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97ca172ae9dc9f9b779a6e3a65d308f2af74e5b8c921299075bdb4a0370e914" +checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" dependencies = [ "base16ct", "crypto-bigint", @@ -1446,7 +1443,7 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe81b5c06ecfdbc71dd845216f225f53b62a10cb8a16c946836a3467f701d05b" dependencies = [ - "base64 0.21.5", + "base64 0.21.4", "bytes", "hex", "k256", @@ -1492,9 +1489,9 @@ dependencies = [ [[package]] name = "enumset" -version = "1.1.3" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "226c0da7462c13fb57e5cc9e0dc8f0635e7d27f276a3a7fd30054647f669007d" +checksum = "e875f1719c16de097dee81ed675e2d9bb63096823ed3f0ca827b7dea3028bbbb" dependencies = [ "enumset_derive", ] @@ -1508,7 +1505,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.37", ] [[package]] @@ -1519,14 +1516,25 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.5" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" +checksum = "add4f07d43996f76ef320709726a556a9d4f965d9410d8d0271132d2f8293480" dependencies = [ + "errno-dragonfly", "libc", "windows-sys 0.48.0", ] +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "eth-keystore" version = "0.5.0" @@ -1663,7 +1671,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "syn 2.0.38", + "syn 2.0.37", "toml 0.7.8", "walkdir", ] @@ -1681,7 +1689,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.38", + "syn 2.0.37", ] [[package]] @@ -1707,7 +1715,7 @@ dependencies = [ "serde", "serde_json", "strum", - "syn 2.0.38", + "syn 2.0.37", "tempfile", "thiserror", "tiny-keccak", @@ -1717,7 +1725,7 @@ dependencies = [ [[package]] name = "ethers-core" version = "2.0.10" -source = "git+https://github.com/gakonst/ethers-rs#17c008e915f22686bfdc769e7140e8c50e6b8a61" +source = "git+https://github.com/gakonst/ethers-rs#70e5f022b1bd94c26dbc85d57b5342e5e23ba8c2" dependencies = [ "arrayvec", "bytes", @@ -1748,7 +1756,7 @@ checksum = "0e53451ea4a8128fbce33966da71132cf9e1040dcfd2a2084fd7733ada7b2045" dependencies = [ "ethers-core 2.0.10 (registry+https://github.com/rust-lang/crates.io-index)", "reqwest", - "semver 1.0.20", + "semver 1.0.19", "serde", "serde_json", "thiserror", @@ -1790,7 +1798,7 @@ checksum = "6838fa110e57d572336178b7c79e94ff88ef976306852d8cb87d9e5b1fc7c0b5" dependencies = [ "async-trait", "auto_impl", - "base64 0.21.5", + "base64 0.21.4", "bytes", "const-hex", "enr", @@ -1859,7 +1867,7 @@ dependencies = [ "path-slash", "rayon", "regex", - "semver 1.0.20", + "semver 1.0.19", "serde", "serde_json", "solang-parser", @@ -1935,9 +1943,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" dependencies = [ "crc32fast", "miniz_oxide", @@ -1991,9 +1999,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.29" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" dependencies = [ "futures-channel", "futures-core", @@ -2006,9 +2014,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.29" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" dependencies = [ "futures-core", "futures-sink", @@ -2016,15 +2024,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.29" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" [[package]] name = "futures-executor" -version = "0.3.29" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" dependencies = [ "futures-core", "futures-task", @@ -2033,9 +2041,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.29" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" [[package]] name = "futures-locks" @@ -2049,26 +2057,26 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.29" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.37", ] [[package]] name = "futures-sink" -version = "0.3.29" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" [[package]] name = "futures-task" -version = "0.3.29" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" [[package]] name = "futures-timer" @@ -2082,9 +2090,9 @@ dependencies = [ [[package]] name = "futures-util" -version = "0.3.29" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ "futures-channel", "futures-core", @@ -2206,7 +2214,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" dependencies = [ - "ahash 0.7.7", + "ahash 0.7.6", ] [[package]] @@ -2215,14 +2223,14 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash 0.7.7", + "ahash 0.7.6", ] [[package]] name = "hashbrown" -version = "0.14.2" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" [[package]] name = "hashers" @@ -2335,7 +2343,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.10", + "socket2 0.4.9", "tokio", "tower-service", "tracing", @@ -2344,9 +2352,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.24.2" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" dependencies = [ "futures-util", "http", @@ -2379,7 +2387,7 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" name = "identity-sequencer" version = "0.1.0" dependencies = [ - "clap 4.4.7", + "clap 4.4.6", "ethers", "eyre", "futures", @@ -2388,7 +2396,7 @@ dependencies = [ "serde", "state_bridge", "tokio", - "toml 0.8.5", + "toml 0.8.6", "tracing", "tree_availability", ] @@ -2465,7 +2473,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" dependencies = [ "equivalent", - "hashbrown 0.14.2", + "hashbrown 0.14.1", ] [[package]] @@ -2488,9 +2496,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.9.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" [[package]] name = "is-terminal" @@ -2529,9 +2537,9 @@ checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "jobserver" -version = "0.1.27" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" dependencies = [ "libc", ] @@ -2551,9 +2559,9 @@ version = "8.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" dependencies = [ - "base64 0.21.5", + "base64 0.21.4", "pem", - "ring 0.16.20", + "ring", "serde", "serde_json", "simple_asn1", @@ -2597,7 +2605,7 @@ dependencies = [ "lalrpop-util", "petgraph", "regex", - "regex-syntax 0.7.5", + "regex-syntax", "string_cache", "term", "tiny-keccak", @@ -2624,9 +2632,9 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" -version = "0.2.149" +version = "0.2.148" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" +checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" [[package]] name = "libloading" @@ -2640,21 +2648,21 @@ dependencies = [ [[package]] name = "libm" -version = "0.2.8" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" [[package]] name = "linux-raw-sys" -version = "0.4.10" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" +checksum = "3852614a3bd9ca9804678ba6be5e3b8ce76dfc902cae004e3e0c44051b6e88db" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" dependencies = [ "autocfg", "scopeguard", @@ -2782,7 +2790,7 @@ checksum = "ddece26afd34c31585c74a4db0630c376df271c285d682d1e55012197830b6df" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.37", ] [[package]] @@ -2802,9 +2810,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.9" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", "wasi", @@ -2941,9 +2949,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ "autocfg", "libm", @@ -2977,7 +2985,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.37", ] [[package]] @@ -3050,7 +3058,7 @@ version = "0.10.57" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.0", "cfg-if", "foreign-types", "libc", @@ -3067,7 +3075,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.37", ] [[package]] @@ -3144,13 +3152,13 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", + "redox_syscall 0.3.5", "smallvec", "windows-targets 0.48.5", ] @@ -3217,9 +3225,9 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" -version = "2.7.5" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae9cee2a55a544be8b89dc6848072af97a20f2422603c10865be2a42b580fff5" +checksum = "c022f1e7b65d6a24c0dbbd5fb344c66881bc01f3e5ae74a1c8100f2f985d98a4" dependencies = [ "memchr", "thiserror", @@ -3276,7 +3284,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.37", ] [[package]] @@ -3314,7 +3322,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.37", ] [[package]] @@ -3379,12 +3387,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b559898e0b4931ed2d3b959ab0c2da4d99cc644c4b0b1a35b4d344027f474023" -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - [[package]] name = "ppv-lite86" version = "0.2.17" @@ -3404,14 +3406,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" dependencies = [ "proc-macro2", - "syn 2.0.38", + "syn 2.0.37", ] [[package]] name = "primitive-types" -version = "0.12.2" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" +checksum = "9f3486ccba82358b11a77516035647c34ba167dfa53312630de83b12bd4f3d66" dependencies = [ "fixed-hash", "impl-codec", @@ -3457,9 +3459,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -3470,13 +3472,13 @@ version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c003ac8c77cb07bb74f5f198bce836a689bcd5a42574612bf14d17bfd08c20e" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.0", "lazy_static", "num-traits", "rand", "rand_chacha", "rand_xorshift", - "regex-syntax 0.7.5", + "regex-syntax", "unarray", ] @@ -3585,9 +3587,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.4.1" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ "bitflags 1.3.2", ] @@ -3616,25 +3618,25 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.2" +version = "1.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "ebee201405406dbf528b8b672104ae6d6d63e6d118cb10e4d51abbc7b58044ff" dependencies = [ "aho-corasick", "memchr", "regex-automata", - "regex-syntax 0.8.2", + "regex-syntax", ] [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax", ] [[package]] @@ -3643,12 +3645,6 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" -[[package]] -name = "regex-syntax" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" - [[package]] name = "region" version = "3.0.0" @@ -3676,7 +3672,7 @@ version = "0.11.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" dependencies = [ - "base64 0.21.5", + "base64 0.21.4", "bytes", "encoding_rs", "futures-core", @@ -3732,26 +3728,12 @@ dependencies = [ "cc", "libc", "once_cell", - "spin 0.5.2", - "untrusted 0.7.1", + "spin", + "untrusted", "web-sys", "winapi", ] -[[package]] -name = "ring" -version = "0.17.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" -dependencies = [ - "cc", - "getrandom", - "libc", - "spin 0.9.8", - "untrusted 0.9.0", - "windows-sys 0.48.0", -] - [[package]] name = "ripemd" version = "0.1.3" @@ -3775,7 +3757,7 @@ dependencies = [ "rkyv_derive", "seahash", "tinyvec", - "uuid 1.5.0", + "uuid 1.4.1", ] [[package]] @@ -3873,16 +3855,16 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.20", + "semver 1.0.19", ] [[package]] name = "rustix" -version = "0.38.21" +version = "0.38.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" +checksum = "d2f9da0cbd88f9f09e7814e388301c8414c51c62aa6ce1e4b5c551d49d96e531" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.0", "errno", "libc", "linux-raw-sys", @@ -3891,12 +3873,12 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.8" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "446e14c5cda4f3f30fe71863c34ec70f5ac79d6087097ad0bb433e1be5edf04c" +checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" dependencies = [ "log", - "ring 0.17.5", + "ring", "rustls-webpki", "sct", ] @@ -3907,17 +3889,17 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64 0.21.5", + "base64 0.21.4", ] [[package]] name = "rustls-webpki" -version = "0.101.7" +version = "0.101.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" dependencies = [ - "ring 0.17.5", - "untrusted 0.9.0", + "ring", + "untrusted", ] [[package]] @@ -3952,9 +3934,9 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.10.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7d66a1128282b7ef025a8ead62a4a9fcf017382ec53b8ffbf4d7bf77bd3c60" +checksum = "35c0a159d0c45c12b20c5a844feb1fe4bea86e28f17b92a5f0c42193634d3782" dependencies = [ "cfg-if", "derive_more", @@ -3964,9 +3946,9 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.10.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" +checksum = "912e55f6d20e0e80d63733872b40e1227c0bce1e1ab81ba67d696339bfd7fd29" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -4003,12 +3985,12 @@ dependencies = [ [[package]] name = "sct" -version = "0.7.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" dependencies = [ - "ring 0.17.5", - "untrusted 0.9.0", + "ring", + "untrusted", ] [[package]] @@ -4057,7 +4039,7 @@ dependencies = [ [[package]] name = "semaphore" version = "0.1.0" -source = "git+https://github.com/worldcoin/semaphore-rs?branch=main#62a3b3b47217fcf6edf38e6a0ddc6d161366fd6f" +source = "git+https://github.com/worldcoin/semaphore-rs?branch=main#404c2a59b41e60b83a83e7546bd9b3cda7e9a2a7" dependencies = [ "ark-bn254", "ark-circom", @@ -4092,18 +4074,18 @@ dependencies = [ [[package]] name = "semaphore-depth-config" version = "0.1.0" -source = "git+https://github.com/worldcoin/semaphore-rs?branch=main#62a3b3b47217fcf6edf38e6a0ddc6d161366fd6f" +source = "git+https://github.com/worldcoin/semaphore-rs?branch=main#404c2a59b41e60b83a83e7546bd9b3cda7e9a2a7" [[package]] name = "semaphore-depth-macros" version = "0.1.0" -source = "git+https://github.com/worldcoin/semaphore-rs?branch=main#62a3b3b47217fcf6edf38e6a0ddc6d161366fd6f" +source = "git+https://github.com/worldcoin/semaphore-rs?branch=main#404c2a59b41e60b83a83e7546bd9b3cda7e9a2a7" dependencies = [ "itertools 0.10.5", "proc-macro2", "quote", "semaphore-depth-config", - "syn 2.0.38", + "syn 2.0.37", ] [[package]] @@ -4117,9 +4099,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.20" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" dependencies = [ "serde", ] @@ -4151,9 +4133,9 @@ version = "0.1.0" [[package]] name = "serde" -version = "1.0.190" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91d3c334ca1ee894a2c6f6ad698fe8c435b76d504b13d436f0685d648d6d96f7" +checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" dependencies = [ "serde_derive", ] @@ -4179,13 +4161,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.190" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c5609f394e5c2bd7fc51efda478004ea80ef42fee983d5c67a65e34f32c0e3" +checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.37", ] [[package]] @@ -4264,9 +4246,9 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.7" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +checksum = "c1b21f559e07218024e7e9f90f96f601825397de0e25420135f7f952453fed0b" dependencies = [ "lazy_static", ] @@ -4340,9 +4322,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.4.10" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" dependencies = [ "libc", "winapi", @@ -4350,9 +4332,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" dependencies = [ "libc", "windows-sys 0.48.0", @@ -4378,12 +4360,6 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - [[package]] name = "spki" version = "0.7.2" @@ -4455,15 +4431,15 @@ dependencies = [ [[package]] name = "strum_macros" -version = "0.25.3" +version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" +checksum = "ad8d03b598d3d0fff69bf533ee3ef19b8eeb342729596df84bcc7e1f96ec4059" dependencies = [ "heck", "proc-macro2", "quote", "rustversion", - "syn 2.0.38", + "syn 2.0.37", ] [[package]] @@ -4483,7 +4459,7 @@ dependencies = [ "hex", "once_cell", "reqwest", - "semver 1.0.20", + "semver 1.0.19", "serde", "serde_json", "sha2", @@ -4505,9 +4481,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.38" +version = "2.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" dependencies = [ "proc-macro2", "quote", @@ -4569,19 +4545,19 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.12.12" +version = "0.12.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" +checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" [[package]] name = "tempfile" -version = "3.8.1" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" dependencies = [ "cfg-if", "fastrand", - "redox_syscall 0.4.1", + "redox_syscall 0.3.5", "rustix", "windows-sys 0.48.0", ] @@ -4608,22 +4584,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.37", ] [[package]] @@ -4638,13 +4614,12 @@ dependencies = [ [[package]] name = "time" -version = "0.3.30" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" +checksum = "426f806f4089c493dcac0d24c29c01e2c38baf8e30f1b716ee37e83d200b18fe" dependencies = [ "deranged", "itoa", - "powerfmt", "serde", "time-core", "time-macros", @@ -4713,7 +4688,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.5", + "socket2 0.5.4", "tokio-macros", "windows-sys 0.48.0", ] @@ -4726,7 +4701,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.37", ] [[package]] @@ -4768,9 +4743,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" dependencies = [ "bytes", "futures-core", @@ -4794,14 +4769,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3efaf127c78d5339cc547cce4e4d973bd5e4f56e949a06d091c082ebeef2f800" +checksum = "8ff9e3abce27ee2c9a37f9ad37238c1bdd4e789c84ba37df76aa4d528f5072cc" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.20.5", + "toml_edit 0.20.7", ] [[package]] @@ -4828,9 +4803,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.20.5" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "782bf6c2ddf761c1e7855405e8975472acf76f7f36d0d4328bd3b7a2fae12a85" +checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" dependencies = [ "indexmap 2.0.2", "serde", @@ -4887,7 +4862,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.37", ] [[package]] @@ -5069,12 +5044,6 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" -[[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - [[package]] name = "url" version = "2.4.1" @@ -5110,9 +5079,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.5.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc" +checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" [[package]] name = "valuable" @@ -5178,7 +5147,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.37", "wasm-bindgen-shared", ] @@ -5212,7 +5181,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.37", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5225,9 +5194,9 @@ checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wasm-encoder" -version = "0.35.0" +version = "0.33.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca90ba1b5b0a70d3d49473c5579951f3bddc78d47b59256d2f9d4922b150aca" +checksum = "34180c89672b3e4825c3a8db4b61a674f1447afd5fe2445b2d22c3d8b6ea086c" dependencies = [ "leb128", ] @@ -5471,9 +5440,9 @@ checksum = "718ed7c55c2add6548cca3ddd6383d738cd73b892df400e96b9aa876f0141d7a" [[package]] name = "wast" -version = "66.0.2" +version = "65.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93cb43b0ac6dd156f2c375735ccfd72b012a7c0a6e6d09503499b8d3cb6e6072" +checksum = "a55a88724cf8c2c0ebbf32c8e8f4ac0d6aa7ba6d73a1cfd94b254aa8f894317e" dependencies = [ "leb128", "memchr", @@ -5483,9 +5452,9 @@ dependencies = [ [[package]] name = "wat" -version = "1.0.77" +version = "1.0.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e367582095d2903caeeea9acbb140e1db9c7677001efa4347c3687fd34fe7072" +checksum = "d83e1a8d86d008adc7bafa5cf4332d448699a08fcf2a715a71fbb75e2c5ca188" dependencies = [ "wast", ] @@ -5732,9 +5701,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.17" +version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3b801d0e0a6726477cc207f60162da452f3a95adb368399bef20a946e06f65c" +checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" dependencies = [ "memchr", ] @@ -5800,7 +5769,7 @@ checksum = "772666c41fb6dceaf520b564b962d738a8e1a83b41bd48945f50837aed78bb1d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.37", ] [[package]] @@ -5820,7 +5789,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.37", ] [[package]] @@ -5864,10 +5833,11 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.9+zstd.1.5.5" +version = "2.0.8+zstd.1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" +checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" dependencies = [ "cc", + "libc", "pkg-config", ] diff --git a/bin/state_bridge_service.rs b/bin/state_bridge_service.rs index bce6e690..60b108cc 100644 --- a/bin/state_bridge_service.rs +++ b/bin/state_bridge_service.rs @@ -16,10 +16,8 @@ use state_bridge::root::IWorldIDIdentityManager; use state_bridge::StateBridgeService; use tracing::info; -/// The state bridge service propagates roots according to the specified relaying_period by -/// calling the propagateRoot() method on each specified World ID StateBridge. The state bridge -/// service will also make sure that it doesn't propagate roots that have already been propagated -/// and have finalized on the BridgedWorldID side +// The state bridge service propagates roots from the world tree. Frequency of root propagation is specified +// by the relaying_period. This service will not propagate roots that have already been propagated before. #[derive(Parser, Debug)] #[clap( name = "State Bridge Service", @@ -30,7 +28,7 @@ struct Options { config: PathBuf, } -/// Converts a u64 into a Duration using Duration::from_secs +// Converts a u64 into a Duration using Duration::from_secs mod duration_seconds { use std::time::Duration; @@ -60,29 +58,29 @@ struct BridgeConfig { bridged_rpc_url: String, } -/// The config TOML file defines all the necessary parameters to spawn a state bridge service. -/// rpc_url - HTTP rpc url for an Ethereum node (string) -/// private_key - pk to an address that will call the propagateRoot() method on the StateBridge contract (string) -/// world_id_address - WorldIDIdentityManager contract address (string) -/// bridge_pair_addresses - List of StateBridge and BridgedWorldID contract address pairs (strings) -/// bridged_world_id_addresses - List of BridgedWorldID contract addresses (strings) -/// relaying_period: propagateRoot() call period time in seconds (u64) -/// block_confirmations - Number of block confirmations required for the propagateRoot call on the StateBridge contract (optional number) +// The config TOML file defines all the necessary parameters to spawn a state bridge service. +// rpc_url - HTTP rpc url for an Ethereum node (string) +// private_key - pk to an address that will call the propagateRoot() method on the StateBridge contract (string) +// world_id_address - WorldIDIdentityManager contract address (string) +// bridge_pair_addresses - List of StateBridge and BridgedWorldID contract address pairs (strings) +// bridged_world_id_addresses - List of BridgedWorldID contract addresses (strings) +// relaying_period: propagateRoot() call period time in seconds (u64) +// block_confirmations - Number of block confirmations required for the propagateRoot call on the StateBridge contract (optional number) #[derive(Deserialize, Serialize, Debug, Clone)] struct Config { - /// RPC URL for the HTTP provider (World ID IdentityManager) + // RPC URL for the HTTP provider (World ID IdentityManager) rpc_url: String, - /// Private key to use for the middleware signer + // Private key to use for the middleware signer private_key: String, - /// `WorldIDIdentityManager` contract address + // `WorldIDIdentityManager` contract address world_id_address: H160, - /// List of `StateBridge` and `BridgedWorldID` pair addresses + // List of `StateBridge` and `BridgedWorldID` pair addresses bridge_configs: Vec, - /// `propagateRoot()` call period time in seconds + // `propagateRoot()` call period time in seconds #[serde(with = "duration_seconds")] relaying_period_seconds: Duration, - /// Number of block confirmations required for the `propagateRoot` call on the `StateBridge` - /// contract + // Number of block confirmations required for the `propagateRoot` call on the `StateBridge` + // contract #[serde(default = "default_block_confirmations")] block_confirmations: usize, } diff --git a/bin/tree_availability_service.rs b/bin/tree_availability_service.rs index c1ab4316..7b89a83d 100644 --- a/bin/tree_availability_service.rs +++ b/bin/tree_availability_service.rs @@ -8,7 +8,10 @@ use futures::StreamExt; use tree_availability::TreeAvailabilityService; #[derive(Parser, Debug)] -#[clap(name = "Tree Availability Service", about = "")] +#[clap( + name = "Tree Availability Service", + about = "The tree availability service periodically calls propagateRoot() on a World ID StateBridge contract." +)] struct Opts { #[clap(long, help = "Depth of the World Tree")] tree_depth: usize, diff --git a/crates/state_bridge/src/bridge.rs b/crates/state_bridge/src/bridge.rs index 9e63fcf6..91432ca3 100644 --- a/crates/state_bridge/src/bridge.rs +++ b/crates/state_bridge/src/bridge.rs @@ -29,14 +29,29 @@ abigen!( event_derives(serde::Deserialize, serde::Serialize) ); +/// The `StateBridge` takes care of listening to roots propagated from the `WorldRoot` and +/// propagates them periodically every time `relaying_period` elapses and the root was updated. pub struct StateBridge { + /// Interface for the `StateBridge` contract pub state_bridge: IStateBridge, + /// Interface for the `BridgedWorldID` contract pub bridged_world_id: IBridgedWorldID, + /// Time delay between `propagateRoot()` transactions pub relaying_period: Duration, + /// The number of block confirmations before a `propagateRoot()` transaction is considered finalized pub block_confirmations: usize, } impl StateBridge { + /// Initializes a StateBridge + /// + /// `state_bridge`: `StateBridge` contract interface + /// + /// `bridged_world_id`: `BridgedWorldID` contract interface + /// + /// `relaying_period`: Time in between `propagateRoot()` calls + /// + /// `block_confirmations: The number of blocks before a `propagateRoot()` call is considered finalized pub fn new( state_bridge: IStateBridge, bridged_world_id: IBridgedWorldID, @@ -51,6 +66,19 @@ impl StateBridge { }) } + /// Initializes a StateBridge with address and middleware + /// + /// `bridge_address`: `StateBridge` contract address + /// + /// `canonical_middleware`: middleware for the chain where the `StateBridge` is deployed + /// + /// `bridged_world_id_address`: `BridgedWorldID` contract address + /// + /// `derived_middleware`: middleware for the chain where the `BridgedWorldID` is deployed + /// + /// `relaying_period`: Time in between `propagateRoot()` calls + /// + /// `block_confirmations: The number of block confirmations before a `propagateRoot()` transaction is considered finalized pub fn new_from_parts( bridge_address: H160, canonical_middleware: Arc, @@ -75,6 +103,9 @@ impl StateBridge { }) } + /// Spawns the `StateBridge` which listens to the `WorldRoot` `TreeChanged` events for new roots to propagate. + /// + /// `root_rx`: The root receiver that listens to the `WorldRoot` root sender pub async fn spawn( &self, mut root_rx: tokio::sync::broadcast::Receiver, diff --git a/crates/state_bridge/src/error.rs b/crates/state_bridge/src/error.rs index b0575188..cbc65608 100644 --- a/crates/state_bridge/src/error.rs +++ b/crates/state_bridge/src/error.rs @@ -4,7 +4,6 @@ use thiserror::Error; use crate::root::Hash; -/// Wraps dependency errors and converts them to `StateBridgeError` using `thiserror` #[derive(Error, Debug)] pub enum StateBridgeError where diff --git a/crates/state_bridge/src/lib.rs b/crates/state_bridge/src/lib.rs index c4ba4d50..a724d937 100644 --- a/crates/state_bridge/src/lib.rs +++ b/crates/state_bridge/src/lib.rs @@ -3,73 +3,7 @@ //! ### Description //! //! The state bridge service for the World ID protocol takes care of periodically relaying the latest roots from the World ID Identity Manager onto L2 networks or sidechains that implement native bridge on Ethereum or have an integration with third party messaging protocol. The state bridge service requires a deployment of the [`world-id-state-bridge`](github.com/worldcoin/world-id-state-bridge/) contracts which in turn also have to be connected to a valid [`world-id-contracts`](https://github.com/worldcoin/world-id-contracts/) deployment. -//! -//! ### Usage -//! -//! #### CLI -//! -//! TODO: specify how to run the state bridge service as a command-line utility -//! -//! #### Library -//! In order to launch a `StateBridgeService` as a library you can use the following example from the [`bridge_service.rs`](https://github.com/worldcoin/identity-sequencer/blob/359f0fe3ec62b18d6f569d8ad31967c048401fa1/crates/state_bridge/tests/bridge_service.rs#L37) test file as a guide. -//! ``` -//! use state_bridge::bridge::{IBridgedWorldID, IStateBridge, StateBridge}; -//! use state_bridge::root::IWorldIDIdentityManager; -//! use state_bridge::StateBridgeService; -//! use common::test_utilities::chain_mock::{spawn_mock_chain, MockChain}; -//! // If you deploy your own state bridge and run your own Ethereum RPC -//! // (or use a third party service like Alchemy) -//! // you can instantiate your own variables by providing the right addresses -//! // and a middleware (implements ethers::middleware::Middleware). -//! #[tokio::test] -//! async fn doc_example() -> eyre::Result<()> { -//! let MockChain { -//! mock_state_bridge, -//! mock_bridged_world_id, -//! mock_world_id, -//! middleware, -//! anvil, -//! .. -//! } = spawn_mock_chain().await?; -//! -//! let relaying_period = std::time::Duration::from_secs(5); -//! -//! let world_id = IWorldIDIdentityManager::new( -//! mock_world_id.address(), -//! middleware.clone(), -//! ); -//! -//! mock_state_bridge.propagate_root().send().await?.await?; -//! -//! let state_bridge_address = mock_state_bridge.address(); -//! -//! let bridged_world_id_address = mock_bridged_world_id.address(); -//! -//! let block_confirmations = 6; -//! -//! let mut state_bridge_service = StateBridgeService::new(world_id) -//! .await -//! .expect("couldn't create StateBridgeService"); -//! -//! let state_bridge = -//! IStateBridge::new(state_bridge_address, middleware.clone()); -//! -//! let bridged_world_id = -//! IBridgedWorldID::new(bridged_world_id_address, middleware.clone()); -//! -//! let state_bridge = -//! StateBridge::new(state_bridge, bridged_world_id, relaying_period, block_confirmations) -//! .unwrap(); -//! -//! state_bridge_service.add_state_bridge(state_bridge); -//! -//! state_bridge_service -//! .spawn() -//! .await -//! .expect("failed to spawn a state bridge service"); -//! } -//! ``` -//! + pub mod bridge; pub mod error; pub mod root; @@ -101,15 +35,9 @@ impl StateBridgeService where M: Middleware, { - /// constructor for the `StateBridgeService` - /// - /// ### Arguments + /// Initializes the `StateBridgeService` /// /// `world_tree`:`IWorldID ` - interface to the `WorldIDIdentityManager` - /// - /// ### Output - /// - /// `Result>` pub async fn new( world_tree: IWorldIDIdentityManager, ) -> Result> { @@ -120,16 +48,11 @@ where }) } - /// constructor for the `StateBridgeService` - /// - /// ### Arguments + /// Initializes the `StateBridgeService` /// /// `world_tree_address`:`H160` - interface to the `WorldIDIdentityManager` - /// `middleware`:`Arc\` - Middleware provider /// - /// ### Output - /// - /// `Result>` + /// `middleware`:`Arc` - Middleware provider pub async fn new_from_parts( world_tree_address: H160, middleware: Arc, @@ -145,30 +68,29 @@ where } /// Adds a state bridge to the list of state bridges the service will use - /// to propagate roots on chain to their destination chains - /// - /// ### Args + /// to propagate roots on chain to their destination chains. /// /// `state_bridge`: `StateBridge` - state bridge contract interface with provider /// /// ### Notes + /// /// Needs to be called before the spawn function so that the `StateBridgeService` - /// knows where to propagate roots to + /// knows where to propagate roots to. pub fn add_state_bridge(&mut self, state_bridge: StateBridge) { self.state_bridges.push(state_bridge); } - /// Spawns the `StateBridgeService` + /// Spawns the `StateBridgeService`. pub async fn spawn(&mut self) -> Result<(), StateBridgeError> { // if no state bridge initialized then there is no point in spawning - // the state bridge service as there'd be no receivers for new roots + // the state bridge service as there'd be no receivers for new roots. if self.state_bridges.is_empty() { return Err(StateBridgeError::BridgesNotInitialized); } // We first instantiate the receivers on the state bridges // so that the root sender doesn't yield an error when pushing roots - // through the channel + // through the channel. for bridge in self.state_bridges.iter() { self.handles.push( bridge.spawn(self.canonical_root.root_tx.subscribe()).await, diff --git a/crates/state_bridge/src/root.rs b/crates/state_bridge/src/root.rs index cf684e95..5c16e8d2 100644 --- a/crates/state_bridge/src/root.rs +++ b/crates/state_bridge/src/root.rs @@ -37,13 +37,9 @@ impl WorldTreeRoot where M: Middleware, { - /// `WorldTreeRoot` constructor + /// Initializes `WorldTreeRoot` /// - /// ### Args - /// `world_id_identity_manager`:`IWorldIDIdentityManager\` - `WorldIDIdentityManager` interface - /// - /// ### Output - /// `WorldTreeRoot` Result + /// `world_id_identity_manager`:`IWorldIDIdentityManager` - `WorldIDIdentityManager` interface pub async fn new( world_id_identity_manager: IWorldIDIdentityManager, ) -> Result> { @@ -55,15 +51,13 @@ where }) } - /// `WorldTreeRoot` constructor from address and middleware + /// Initializes `WorldTreeRoot` from address and middleware + /// + /// `world_id_identity_manager`:`IWorldIDIdentityManager` - `WorldIDIdentityManager` interface /// - /// ### Args - /// `world_id_identity_manager`:`IWorldIDIdentityManager\` - `WorldIDIdentityManager` interface /// `world_tree_address`: `H160` - `WorldIDIdentityManager` contract address - /// `middleware`: `Arc\` - Middleware provider (ethers) /// - /// ### Output - /// `WorldTreeRoot` Result + /// `middleware`: `Arc` - Middleware provider (ethers) pub async fn new_from_parts( world_tree_address: H160, middleware: Arc, diff --git a/crates/tree_availability/src/lib.rs b/crates/tree_availability/src/lib.rs index 7bcc49d6..0a7282e9 100644 --- a/crates/tree_availability/src/lib.rs +++ b/crates/tree_availability/src/lib.rs @@ -1,3 +1,12 @@ +//! # Tree Availability Service +//! +//! The tree availability service is able to create an in-memory representation of the World ID +//! merkle tree by syncing the state of the World ID contract `registerIdentities` and `deleteIdentities` +//! function calldata and `TreeChanged` events. Once it syncs the latest state of the state of the tree, it +//! is able to serve inclusion proofs on the `/inclusionProof` endpoint. It also keeps a historical roots list +//! of `tree_history_size` size in order to serve proofs against older tree roots (including the roots of +//! World IDs bridged to other networks). + pub mod error; pub mod server; pub mod world_tree; @@ -14,11 +23,27 @@ use world_tree::{Hash, PoseidonTree, WorldTree}; use crate::server::{inclusion_proof, synced}; +/// Service that keeps the World Tree synced with `WorldIDIdentityManager` and exposes an API endpoint to serve inclusion proofs for a given World ID. pub struct TreeAvailabilityService { + /// In-memory representation of the merkle tree containing all verified World IDs. pub world_tree: Arc>, } impl TreeAvailabilityService { + /// Initializes new instance of `TreeAvailabilityService`, + /// + /// # Arguments + /// + /// * `tree_depth` - Depth of the merkle tree + /// * `dense_prefix_depth`: Depth of the tree that is densely populated. Nodes beyond the `dense_prefix_depth` will be stored through pointer based structures. + /// * `tree_history_size`: Number of historical roots to store in memory. This is used to serve proofs against historical roots. + /// * `world_tree_address`: Address of the `WorldIDIdentityManager` contract onchain + /// * `world_tree_creation_block`: Block number where `WorldIDIdentityManager` was deployed + /// * `middleware`: Provider to interact with Ethereum + /// + /// # Returns + /// + /// New instance of `TreeAvailabilityService`. pub fn new( tree_depth: usize, dense_prefix_depth: usize, @@ -44,6 +69,15 @@ impl TreeAvailabilityService { Self { world_tree } } + /// Spawns an axum server and exposes an API endpoint to serve inclusion proofs for a given World ID. This function also spawns a new task to keep the world tree synced to the chain head. + /// + /// # Arguments + /// + /// * `port` - Port to bind the server to. + /// + /// # Returns + /// + /// Vector of `JoinHandle`s for the spawned tasks. pub async fn serve( self, port: u16, diff --git a/crates/tree_availability/src/server.rs b/crates/tree_availability/src/server.rs index 4a48a6a3..aca2ddc2 100644 --- a/crates/tree_availability/src/server.rs +++ b/crates/tree_availability/src/server.rs @@ -81,7 +81,7 @@ pub async fn inclusion_proof( State(world_tree): State>>, Json(req): Json, ) -> Result<(StatusCode, Json>), TreeError> { - if world_tree.tree_updater.synced.load(Ordering::Relaxed) { + if world_tree.synced.load(Ordering::Relaxed) { let inclusion_proof = world_tree .tree_data .get_inclusion_proof(req.identity_commitment, req.root) @@ -112,7 +112,7 @@ impl SyncResponse { pub async fn synced( State(world_tree): State>>, ) -> (StatusCode, Json) { - if world_tree.tree_updater.synced.load(Ordering::Relaxed) { + if world_tree.synced.load(Ordering::Relaxed) { (StatusCode::OK, SyncResponse::new(true, None).into()) } else { let latest_synced_block = Some( @@ -130,10 +130,12 @@ pub async fn synced( impl TreeError { fn to_status_code(&self) -> StatusCode { - //TODO: update this - StatusCode::BAD_REQUEST + match self { + TreeError::TreeNotSynced => StatusCode::SERVICE_UNAVAILABLE, + } } } + impl IntoResponse for TreeError { fn into_response(self) -> axum::response::Response { let status_code = self.to_status_code(); diff --git a/crates/tree_availability/src/world_tree/block_scanner.rs b/crates/tree_availability/src/world_tree/block_scanner.rs index 47ba2172..48a6b388 100644 --- a/crates/tree_availability/src/world_tree/block_scanner.rs +++ b/crates/tree_availability/src/world_tree/block_scanner.rs @@ -5,9 +5,13 @@ use ethers::types::{ Address, BlockNumber, Filter, FilterBlockOption, Log, Topic, ValueOrArray, }; +/// The `BlockScanner` utility tool enables allows parsing arbitrary onchain events pub struct BlockScanner { + /// The onchain data provider middleware: M, + /// The block from which to start parsing a given event current_block: AtomicU64, + /// The maximum block range to parse window_size: u64, } @@ -15,6 +19,7 @@ impl BlockScanner where M: Middleware, { + /// Initializes a new `BlockScanner` pub const fn new( middleware: M, window_size: u64, @@ -27,6 +32,12 @@ where } } + /// Retrieves events matching the specified address and topics from the last synced block to the latest block. + /// + /// # Arguments + /// + /// * `address` - Optional address to target when fetching logs. + /// * `topics` - Optional topics to target when fetching logs, enabling granular filtering when looking for specific event signatures or topic values. pub async fn next( &self, address: Option>, diff --git a/crates/tree_availability/src/world_tree/mod.rs b/crates/tree_availability/src/world_tree/mod.rs index ead736f3..1d3d9ef6 100644 --- a/crates/tree_availability/src/world_tree/mod.rs +++ b/crates/tree_availability/src/world_tree/mod.rs @@ -3,7 +3,7 @@ pub mod block_scanner; pub mod tree_data; pub mod tree_updater; -use std::sync::atomic::Ordering; +use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; use std::time::Duration; @@ -26,11 +26,28 @@ pub type Hash = ::Hash; /// In our data model the `tree` is the oldest available tree. /// The entires in `tree_history` represent new additions to the tree. pub struct WorldTree { + /// All the leaves of the tree and their corresponding root hash pub tree_data: Arc, + /// The object in charge of syncing the tree from calldata pub tree_updater: Arc>, + /// Boolean to indicate when the tree state is synced wth the chain head upon spawning the `WorldTree`. + pub synced: Arc, } impl WorldTree { + /// Initializes a new instance of `WorldTree`. + /// + /// # Arguments + /// + /// * `tree` - The PoseidonTree used for the merkle tree representation. + /// * `tree_history_size` - The number of historical tree roots to keep in memory. + /// * `address` - The smart contract address of the `WorldIDIdentityManager`. + /// * `creation_block` - The block number at which the contract was deployed. + /// * `middleware` - Provider to interact with Ethereum. + /// + /// # Returns + /// + /// New instance of `WorldTree`. pub fn new( tree: PoseidonTree, tree_history_size: usize, @@ -45,17 +62,25 @@ impl WorldTree { creation_block, middleware, )), + synced: Arc::new(AtomicBool::new(false)), } } + /// Spawns a task that continually syncs the `TreeData` to the state at the chain head. + /// + /// # Returns + /// + /// A `JoinHandle` that resolves to a `Result<(), TreeAvailabilityError>` when the spawned task completes. pub async fn spawn( &self, ) -> JoinHandle>> { let tree_data = self.tree_data.clone(); let tree_updater = self.tree_updater.clone(); + let synced = self.synced.clone(); + tokio::spawn(async move { tree_updater.sync_to_head(&tree_data).await?; - tree_updater.synced.store(true, Ordering::Relaxed); + synced.store(true, Ordering::Relaxed); loop { tree_updater.sync_to_head(&tree_data).await?; diff --git a/crates/tree_availability/src/world_tree/tree_data.rs b/crates/tree_availability/src/world_tree/tree_data.rs index f4542510..1e28987c 100644 --- a/crates/tree_availability/src/world_tree/tree_data.rs +++ b/crates/tree_availability/src/world_tree/tree_data.rs @@ -7,17 +7,25 @@ use tokio::sync::RwLock; use super::{Hash, PoseidonTree}; use crate::server::InclusionProof; +/// Represents the in-memory state of the World Tree, caching historical roots up to `tree_history_size`. pub struct TreeData { + /// A canonical in-memory representation of the World Tree. pub tree: RwLock>, + /// The number of historical tree roots to cache for serving older proofs. pub tree_history_size: usize, - pub tree_history: RwLock>>, //TODO: make a note that the latest is at the front -} -pub struct TreeUpdate { - pub index: usize, - pub value: Hash, + /// Cache of historical tree state, used to serve proofs against older roots. If the cache becomes larger than `tree_history_size`, the oldest roots are removed on a FIFO basis. + pub tree_history: RwLock>>, } impl TreeData { + /// Initializes a new instance of `TreeData`. + /// + /// * `tree` - PoseidonTree representing the World Tree onchain, which will be used to generate inclusion proofs. + /// * `tree_history_size` - Number of previous tree states to retain for serving proofs with historical roots. + /// + /// # Returns + /// + /// A new `TreeData` instance. pub fn new( tree: PoseidonTree, tree_history_size: usize, @@ -29,6 +37,12 @@ impl TreeData { } } + /// Inserts multiple identity commitments starting from a specified index. The tree state before the insert operation is cached to tree history. + /// + /// # Arguments + /// + /// * `start_index` - The leaf index in the tree to begin inserting identity commitments. + /// * `identities` - The array of identity commitments to insert. pub async fn insert_many_at( &self, start_index: usize, @@ -42,6 +56,11 @@ impl TreeData { } } + /// Deletes multiple identity commitments at specified indices. The tree state before the delete operation is cached to tree history. + /// + /// # Arguments + /// + /// * `delete_indices` - The indices of the leaves in the tree to delete. pub async fn delete_many(&self, delete_indices: &[usize]) { self.cache_tree_history().await; @@ -52,6 +71,7 @@ impl TreeData { } } + /// Caches the current tree state to `tree_history` if `tree_history_size` is greater than 0. pub async fn cache_tree_history(&self) { if self.tree_history_size != 0 { let mut tree_history = self.tree_history.write().await; @@ -64,10 +84,12 @@ impl TreeData { } } - /// Fetches the inclusion proof of the provided identity at the given root hash + /// Fetches the inclusion proof for a given identity against a specified root. If no root is specified, the latest root is used. Returns `None` if root or identity is not found. + /// + /// # Arguments /// - /// Returns None if the provided root hash is not in the latest one or is not present in tree history - /// or if the identity is not present in the tree + /// * `identity` - The identity commitment for which to fetch the inclusion proof. + /// * `root` - Optional root hash to serve the inclusion proof against. If `None`, uses the latest root. pub async fn get_inclusion_proof( &self, identity: Hash, @@ -110,6 +132,12 @@ impl TreeData { } } + /// Generates an inclusion proof for a specific identity commitment from a given `PoseidonTree`. + /// + /// # Arguments + /// + /// * `tree` - The Poseidon tree to fetch the inclusion proof against. + /// * `identity` - The identity commitment to generate the inclusion proof for. fn proof( tree: &PoseidonTree, identity: Hash, diff --git a/crates/tree_availability/src/world_tree/tree_updater.rs b/crates/tree_availability/src/world_tree/tree_updater.rs index 3b3cfdad..b7d9d984 100644 --- a/crates/tree_availability/src/world_tree/tree_updater.rs +++ b/crates/tree_availability/src/world_tree/tree_updater.rs @@ -19,20 +19,30 @@ use crate::world_tree::Hash; // TODO: Change to a configurable parameter const SCANNING_WINDOW_SIZE: u64 = 100; +/// Manages the synchronization of the World Tree with it's onchain representation. pub struct TreeUpdater { + /// Contract address of the `WorldIDIdentityManager`. pub address: H160, + /// Latest block that has been synced. pub latest_synced_block: AtomicU64, - pub synced: AtomicBool, + /// Scanner responsible for fetching logs and parsing calldata to decode tree updates. block_scanner: BlockScanner>, + /// Provider to interact with Ethereum. pub middleware: Arc, } impl TreeUpdater { + /// Initializes TreeUpdater + /// + /// `address`: `WorldIDIdentityManager` contract address + /// + /// `creation_block`: The block height of the `WorldIDIdentityManager` contract deployment + /// + /// `middleware`: provider pub fn new(address: H160, creation_block: u64, middleware: Arc) -> Self { Self { address, latest_synced_block: AtomicU64::new(creation_block), - synced: AtomicBool::new(false), block_scanner: BlockScanner::new( middleware.clone(), SCANNING_WINDOW_SIZE, @@ -42,7 +52,11 @@ impl TreeUpdater { } } - // Sync the state of the tree to to the chain head + /// Updates the in-memory tree to reflect the latest state of the onchain tree. + /// + /// # Arguments + /// + /// * `tree_data` - Instance of `TreeData` maintaining the current state of the tree and tree history. pub async fn sync_to_head( &self, tree_data: &TreeData, @@ -92,6 +106,12 @@ impl TreeUpdater { Ok(()) } + /// Updates the in-memory tree based transaction calldata. + /// + /// # Arguments + /// + /// * `tree_data` - Instance of `TreeData` maintaining the current state of the tree and tree history. + /// * `transaction` - Transaction containing the calldata necessary to update the local tree. pub async fn sync_from_transaction( &self, tree_data: &TreeData, @@ -135,6 +155,11 @@ impl TreeUpdater { } } +/// Packs an array of 32-bit indices into a contiguous byte vector. +/// +/// # Arguments +/// +/// * `indices` - The array of indices representing positions of identity commitments in the `WorldTree`. pub fn pack_indices(indices: &[u32]) -> Vec { let mut packed = Vec::with_capacity(indices.len() * 4); @@ -145,6 +170,11 @@ pub fn pack_indices(indices: &[u32]) -> Vec { packed } +/// Unpacks a contiguous byte array into a vector of 32-bit indices. +/// +/// # Arguments +/// +/// * `packed` - The packed byte array containing positions of identity commitments in the `WorldTree`. pub fn unpack_indices(packed: &[u8]) -> Vec { let mut indices = Vec::with_capacity(packed.len() / 4); diff --git a/crates/tree_availability/tests/inclusion_proof.rs b/crates/tree_availability/tests/inclusion_proof.rs index 50b57f34..4b67a7b9 100644 --- a/crates/tree_availability/tests/inclusion_proof.rs +++ b/crates/tree_availability/tests/inclusion_proof.rs @@ -79,11 +79,7 @@ async fn test_inclusion_proof() -> eyre::Result<()> { // Wait for the tree to be synced loop { - if world_tree - .tree_updater - .synced - .load(std::sync::atomic::Ordering::Relaxed) - { + if world_tree.synced.load(std::sync::atomic::Ordering::Relaxed) { break; }