diff --git a/.gitignore b/.gitignore index 2c656632a..7e370ee35 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ perf.data* /bin genesis.ssz /clippy.toml +/.cargo # IntelliJ /*.iml diff --git a/Cargo.lock b/Cargo.lock index bc235ad2f..8ca3e9b68 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -205,9 +205,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.68" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cb2f989d18dd141ab8ae82f64d1a8cdd37e0840f73a406896cf5e99502fab61" +checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800" [[package]] name = "arbitrary" @@ -244,7 +244,7 @@ dependencies = [ "asn1-rs-derive 0.1.0", "asn1-rs-impl", "displaydoc", - "nom 7.1.2", + "nom 7.1.3", "num-traits", "rusticata-macros", "thiserror", @@ -260,7 +260,7 @@ dependencies = [ "asn1-rs-derive 0.4.0", "asn1-rs-impl", "displaydoc", - "nom 7.1.2", + "nom 7.1.3", "num-traits", "rusticata-macros", "thiserror", @@ -325,7 +325,7 @@ dependencies = [ "slab", "socket2", "waker-fn", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -361,9 +361,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.61" +version = "0.1.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "705339e0e4a9690e2908d2b3d049d85682cf19fbd5782494498fbf7003a6a282" +checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2" dependencies = [ "proc-macro2", "quote", @@ -396,9 +396,9 @@ dependencies = [ [[package]] name = "atomic-waker" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a" +checksum = "debc29dde2e69f9e47506b525f639ed42300fc014a3e007832592448fa8e4599" [[package]] name = "attohttpc" @@ -463,7 +463,7 @@ dependencies = [ "http", "http-body", "hyper", - "itoa 1.0.5", + "itoa", "matchit", "memchr", "mime", @@ -529,6 +529,12 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +[[package]] +name = "base64" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" + [[package]] name = "base64ct" version = "1.5.3" @@ -596,6 +602,8 @@ dependencies = [ "serde_json", "slasher", "slog", + "slog-async", + "slog-term", "sloggers", "slot_clock", "smallvec", @@ -812,18 +820,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" -[[package]] -name = "bstr" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" -dependencies = [ - "lazy_static", - "memchr", - "regex-automata", - "serde", -] - [[package]] name = "buf_redux" version = "0.8.4" @@ -847,9 +843,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.11.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" +checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" [[package]] name = "byte-slice-cast" @@ -865,9 +861,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" dependencies = [ "serde", ] @@ -925,9 +921,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.0.78" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" [[package]] name = "ccm" @@ -946,7 +942,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" dependencies = [ - "nom 7.1.2", + "nom 7.1.3", ] [[package]] @@ -1132,9 +1128,9 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7bef69dc86e3c610e4e7aed41035e2a7ed12e72dd7530f61327a6579a4390b" +checksum = "c278839b831783b70278b14df4d45e1beb1aad306c07bb796637de9a0e323e8e" dependencies = [ "crossbeam-utils", ] @@ -1203,18 +1199,18 @@ checksum = "dcb25d077389e53838a8158c8e99174c5a9d902dee4904320db714f3c653ffba" [[package]] name = "crc" -version = "3.0.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53757d12b596c16c78b83458d732a5d1a17ab3f53f2f7412f6fb57cc8a140ab3" +checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" dependencies = [ "crc-catalog", ] [[package]] name = "crc-catalog" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d0165d2900ae6778e36e80bbc4da3b5eefccee9ba939761f9c2882a5d9af3ff" +checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" [[package]] name = "crc32fast" @@ -1364,13 +1360,12 @@ dependencies = [ [[package]] name = "csv" -version = "1.1.6" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1" +checksum = "af91f40b7355f82b0a891f50e70399475945bb0b0da4f1700ce60761c9d3e359" dependencies = [ - "bstr", "csv-core", - "itoa 0.4.8", + "itoa", "ryu", "serde", ] @@ -1404,12 +1399,12 @@ dependencies = [ [[package]] name = "ctrlc" -version = "3.2.4" +version = "3.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1631ca6e3c59112501a9d87fd86f21591ff77acd31331e8a73f8d80a65bbdd71" +checksum = "bbcf33c2a618cbe41ee43ae6e9f2e48368cd9f9db2896f10167d8d762679f639" dependencies = [ - "nix 0.26.1", - "windows-sys", + "nix 0.26.2", + "windows-sys 0.45.0", ] [[package]] @@ -1427,9 +1422,9 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.0.0-pre.5" +version = "4.0.0-rc.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67bc65846be335cb20f4e52d49a437b773a2c1fdb42b19fc84e79e6f6771536f" +checksum = "8da00a7a9a4eb92a0a0f8e75660926d48f0d0f3c537e455c457bcdaa1e16b1ac" dependencies = [ "cfg-if", "fiat-crypto", @@ -1441,9 +1436,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.86" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d1075c37807dcf850c379432f0df05ba52cc30f279c5cfc43cc221ce7f8579" +checksum = "90d59d9acd2a682b4e40605a242f6670eaa58c5957471cbf85e8aa6a0b97a5e8" dependencies = [ "cc", "cxxbridge-flags", @@ -1453,9 +1448,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.86" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5044281f61b27bc598f2f6647d480aed48d2bf52d6eb0b627d84c0361b17aa70" +checksum = "ebfa40bda659dd5c864e65f4c9a2b0aff19bea56b017b9b77c73d3766a453a38" dependencies = [ "cc", "codespan-reporting", @@ -1468,15 +1463,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.86" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61b50bc93ba22c27b0d31128d2d130a0a6b3d267ae27ef7e4fae2167dfe8781c" +checksum = "457ce6757c5c70dc6ecdbda6925b958aae7f959bda7d8fb9bde889e34a09dc03" [[package]] name = "cxxbridge-macro" -version = "1.0.86" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e61fda7e62115119469c7b3591fd913ecca96fb766cfd3f2e2502ab7bc87a5" +checksum = "ebf883b7aacd7b2aeb2a7b338648ee19f57c140d4ee8e52c68979c6b2f7f2263" dependencies = [ "proc-macro2", "quote", @@ -1495,12 +1490,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" +checksum = "c0808e1bd8671fb44a113a14e13497557533369847788fa2ae912b6ebfce9fa8" dependencies = [ - "darling_core 0.14.2", - "darling_macro 0.14.2", + "darling_core 0.14.3", + "darling_macro 0.14.3", ] [[package]] @@ -1519,9 +1514,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" +checksum = "001d80444f28e193f30c2f293455da62dcf9a6b29918a4253152ae2b1de592cb" dependencies = [ "fnv", "ident_case", @@ -1544,11 +1539,11 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" +checksum = "b36230598a2d5de7ec1c6f51f72d8a99a9208daff41de2084d06e3fd3ea56685" dependencies = [ - "darling_core 0.14.2", + "darling_core 0.14.3", "quote", "syn", ] @@ -1666,7 +1661,7 @@ checksum = "fe398ac75057914d7d07307bf67dc7f3f574a26783b4fc7805a20ffa9f506e82" dependencies = [ "asn1-rs 0.3.1", "displaydoc", - "nom 7.1.2", + "nom 7.1.3", "num-bigint", "num-traits", "rusticata-macros", @@ -1680,7 +1675,7 @@ checksum = "42d4bc9b0db0a0df9ae64634ac5bdefb7afcb534e182275ca0beadbe486701c1" dependencies = [ "asn1-rs 0.5.1", "displaydoc", - "nom 7.1.2", + "nom 7.1.3", "num-bigint", "num-traits", "rusticata-macros", @@ -1702,7 +1697,7 @@ name = "derive_arbitrary" version = "1.2.2" source = "git+https://github.com/michaelsproul/arbitrary?rev=a572fd8743012a4f1ada5ee5968b1b3619c427ba#a572fd8743012a4f1ada5ee5968b1b3619c427ba" dependencies = [ - "darling 0.14.2", + "darling 0.14.3", "proc-macro2", "quote", "syn", @@ -1723,7 +1718,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f91d4cfa921f1c05904dc3c57b4a32c38aed3340cce209f3a6fd1478babafc4" dependencies = [ - "darling 0.14.2", + "darling 0.14.3", "proc-macro2", "quote", "syn", @@ -1835,7 +1830,7 @@ dependencies = [ "enr", "fnv", "futures", - "hashlink", + "hashlink 0.7.0", "hex", "hkdf", "lazy_static", @@ -1887,9 +1882,9 @@ dependencies = [ [[package]] name = "ed25519" -version = "1.5.2" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9c280362032ea4203659fc489832d0204ef09f247a0506f170dafcac08c369" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" dependencies = [ "signature", ] @@ -1941,9 +1936,9 @@ dependencies = [ [[package]] name = "either" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" [[package]] name = "elliptic-curve" @@ -1969,9 +1964,9 @@ dependencies = [ [[package]] name = "encoding_rs" -version = "0.8.31" +version = "0.8.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" dependencies = [ "cfg-if", ] @@ -1982,7 +1977,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26fa0a0be8915790626d5759eb51fe47435a8eac92c2f212bd2da9aa7f30ea56" dependencies = [ - "base64", + "base64 0.13.1", "bs58", "bytes", "ed25519-dalek", @@ -2159,7 +2154,7 @@ dependencies = [ name = "eth2_interop_keypairs" version = "0.2.0" dependencies = [ - "base64", + "base64 0.13.1", "bls", "eth2_hashing", "hex", @@ -2439,7 +2434,7 @@ checksum = "a1a9e0597aa6b2fdc810ff58bc95e4eeaa2c219b3e615ed025106ecb027407d8" dependencies = [ "async-trait", "auto_impl", - "base64", + "base64 0.13.1", "ethers-core", "futures-channel", "futures-core", @@ -2570,9 +2565,9 @@ checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" [[package]] name = "fastrand" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" dependencies = [ "instant", ] @@ -2620,7 +2615,8 @@ dependencies = [ [[package]] name = "fixed-hash" version = "0.7.0" -source = "git+https://github.com/paritytech/parity-common?rev=df638ab0885293d21d656dc300d39236b69ce57d#df638ab0885293d21d656dc300d39236b69ce57d" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" dependencies = [ "byteorder", "rand 0.8.5", @@ -2713,12 +2709,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "fs_extra" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394" - [[package]] name = "funty" version = "1.1.0" @@ -2733,9 +2723,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" +checksum = "13e2792b0ff0340399d58445b88fd9770e3489eff258a4cbc1523418f12abf84" dependencies = [ "futures-channel", "futures-core", @@ -2748,9 +2738,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" +checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" dependencies = [ "futures-core", "futures-sink", @@ -2758,15 +2748,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" +checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" [[package]] name = "futures-executor" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" +checksum = "e8de0a35a6ab97ec8869e32a2473f4b1324459e14c29275d14b10cb1fd19b50e" dependencies = [ "futures-core", "futures-task", @@ -2776,9 +2766,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" +checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" [[package]] name = "futures-lite" @@ -2797,9 +2787,9 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" +checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" dependencies = [ "proc-macro2", "quote", @@ -2813,21 +2803,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2411eed028cdf8c8034eaf21f9915f956b6c3abec4d4c7949ee67f0721127bd" dependencies = [ "futures-io", - "rustls 0.20.7", + "rustls 0.20.8", "webpki 0.22.0", ] [[package]] name = "futures-sink" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" +checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" [[package]] name = "futures-task" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" +checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" [[package]] name = "futures-timer" @@ -2837,9 +2827,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" +checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" dependencies = [ "futures-channel", "futures-core", @@ -2941,9 +2931,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.0" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dec7af912d60cdbd3677c1af9352ebae6fb8394d165568a2234df0fa00f87793" +checksum = "221996f774192f0f718773def8201c4ae31f02616a54ccfc2d358bb0e5cefdec" [[package]] name = "git-version" @@ -2999,7 +2989,7 @@ dependencies = [ "indexmap", "slab", "tokio", - "tokio-util 0.7.4", + "tokio-util 0.7.7", "tracing", ] @@ -3060,13 +3050,22 @@ dependencies = [ "hashbrown 0.11.2", ] +[[package]] +name = "hashlink" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69fe1fcf8b4278d860ad0548329f892a3631fb63f82574df68275f34cdbe0ffa" +dependencies = [ + "hashbrown 0.12.3", +] + [[package]] name = "headers" version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3e372db8e5c0d213e0cd0b9be18be2aca3d44cf2fe30a9d46a65581cd454584" dependencies = [ - "base64", + "base64 0.13.1", "bitflags", "bytes", "headers-core", @@ -3087,9 +3086,9 @@ dependencies = [ [[package]] name = "heck" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" @@ -3199,7 +3198,7 @@ checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" dependencies = [ "bytes", "fnv", - "itoa 1.0.5", + "itoa", ] [[package]] @@ -3305,9 +3304,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.23" +version = "0.14.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" +checksum = "5e011372fa0b68db8350aa7a248930ecc7839bf46d8485577d69f117a75f164c" dependencies = [ "bytes", "futures-channel", @@ -3318,7 +3317,7 @@ dependencies = [ "http-body", "httparse", "httpdate", - "itoa 1.0.5", + "itoa", "pin-project-lite 0.2.9", "socket2", "tokio", @@ -3335,7 +3334,7 @@ checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" dependencies = [ "http", "hyper", - "rustls 0.20.7", + "rustls 0.20.8", "tokio", "tokio-rustls 0.23.4", ] @@ -3482,7 +3481,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" dependencies = [ - "parity-scale-codec 3.2.1", + "parity-scale-codec 3.4.0", ] [[package]] @@ -3609,12 +3608,6 @@ dependencies = [ "either", ] -[[package]] -name = "itoa" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" - [[package]] name = "itoa" version = "1.0.5" @@ -3634,12 +3627,11 @@ dependencies = [ [[package]] name = "jemalloc-sys" -version = "0.5.2+5.3.0-patched" +version = "0.5.3+5.3.0-patched" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134163979b6eed9564c98637b710b40979939ba351f59952708234ea11b5f3f8" +checksum = "f9bd5d616ea7ed58b571b2e209a65759664d7fb021a0819d7a790afc67e47ca1" dependencies = [ "cc", - "fs_extra", "libc", ] @@ -3655,9 +3647,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.60" +version = "0.3.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" dependencies = [ "wasm-bindgen", ] @@ -3683,7 +3675,7 @@ version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09f4f04699947111ec1733e71778d763555737579e44b85844cae8e1940a1828" dependencies = [ - "base64", + "base64 0.13.1", "pem", "ring", "serde", @@ -3734,9 +3726,7 @@ dependencies = [ "eth2_serde_utils", "eth2_ssz", "eth2_ssz_derive", - "ethereum-types 0.12.1", "hex", - "rand 0.7.3", "serde", "serde_derive", "tree_hash", @@ -4006,7 +3996,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a173171c71c29bb156f98886c7c4824596de3903dadf01e2e79d2ccdcf38cd9f" dependencies = [ "asynchronous-codec", - "base64", + "base64 0.13.1", "byteorder", "bytes", "fnv", @@ -4157,7 +4147,7 @@ dependencies = [ "parking_lot 0.12.1", "quinn-proto", "rand 0.8.5", - "rustls 0.20.7", + "rustls 0.20.8", "thiserror", "tokio", ] @@ -4222,7 +4212,7 @@ dependencies = [ "libp2p-core 0.38.0", "rcgen 0.10.0", "ring", - "rustls 0.20.7", + "rustls 0.20.8", "thiserror", "webpki 0.22.0", "x509-parser 0.14.0", @@ -4256,7 +4246,7 @@ dependencies = [ "thiserror", "tinytemplate", "tokio", - "tokio-util 0.7.4", + "tokio-util 0.7.7", "webrtc", ] @@ -4300,7 +4290,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95b09eff1b35ed3b33b877ced3a691fc7a481919c7e29c53c906226fcf55e2a1" dependencies = [ "arrayref", - "base64", + "base64 0.13.1", "digest 0.9.0", "hmac-drbg", "libsecp256k1-core", @@ -4343,9 +4333,9 @@ dependencies = [ [[package]] name = "libsqlite3-sys" -version = "0.22.2" +version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290b64917f8b0cb885d9de0f9959fe1f775d7fa12f1da2db9001c1c8ab60f89d" +checksum = "29f835d03d717946d28b1d1ed632eb6f0e24a299388ee623d0c23118d3e8a7fa" dependencies = [ "cc", "pkg-config", @@ -4623,9 +4613,9 @@ dependencies = [ [[package]] name = "matches" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" [[package]] name = "matchit" @@ -4773,14 +4763,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" +checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] @@ -4981,9 +4971,9 @@ dependencies = [ [[package]] name = "netlink-packet-utils" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25af9cf0dc55498b7bd94a1508af7a78706aa0ab715a73c5169273e03c84845e" +checksum = "0ede8a08c71ad5a95cdd0e4e52facd37190977039a4704eb82a283f713747d34" dependencies = [ "anyhow", "byteorder", @@ -5008,9 +4998,9 @@ dependencies = [ [[package]] name = "netlink-sys" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92b654097027250401127914afb37cb1f311df6610a9891ff07a757e94199027" +checksum = "260e21fbb6f3d253a14df90eb0000a6066780a15dd901a7519ce02d77a94985b" dependencies = [ "bytes", "futures", @@ -5091,9 +5081,9 @@ dependencies = [ [[package]] name = "nix" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46a58d1d356c6597d08cde02c2f09d785b09e28711837b1ed667dc652c08a694" +checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" dependencies = [ "bitflags", "cfg-if", @@ -5130,9 +5120,9 @@ checksum = "cf51a729ecf40266a2368ad335a5fdde43471f545a967109cd62146ecf8b66ff" [[package]] name = "nom" -version = "7.1.2" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5507769c4919c998e69e49c839d9dc6e693ede4cc4290d6ad8b41d4f09c548c" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ "memchr", "minimal-lexical", @@ -5238,9 +5228,9 @@ dependencies = [ [[package]] name = "object" -version = "0.30.1" +version = "0.30.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d864c91689fdc196779b98dba0aceac6118594c2df6ee5d943eb6a8df4d107a" +checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" dependencies = [ "memchr", ] @@ -5265,9 +5255,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.17.0" +version = "1.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" [[package]] name = "oneshot_broadcast" @@ -5347,9 +5337,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "111.24.0+1.1.1s" +version = "111.25.0+1.1.1t" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3498f259dab01178c6228c6b00dcef0ed2a2d5e20d648c017861227773ea4abd" +checksum = "3173cd3626c43e3854b1b727422a276e568d9ec5fe8cec197822cf52cfb743d6" dependencies = [ "cc", ] @@ -5446,15 +5436,15 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.2.1" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "366e44391a8af4cfd6002ef6ba072bae071a96aafca98d7d448a34c5dca38b6a" +checksum = "637935964ff85a605d114591d4d2c13c5d1ba2806dae97cea6bf180238a749ac" dependencies = [ "arrayvec", "bitvec 1.0.1", "byte-slice-cast", "impl-trait-for-tuples", - "parity-scale-codec-derive 3.1.3", + "parity-scale-codec-derive 3.1.4", "serde", ] @@ -5472,9 +5462,9 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.1.3" +version = "3.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9299338969a3d2f491d65f140b00ddec470858402f888af98e8642fb5e8965cd" +checksum = "86b26a931f824dd4eca30b3e43bb4f31cd5f0d3a403c5f5ff27106b805bfde7b" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -5506,7 +5496,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.5", + "parking_lot_core 0.9.7", ] [[package]] @@ -5525,15 +5515,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.5" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba" +checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] @@ -5568,11 +5558,11 @@ checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" [[package]] name = "pem" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03c64931a1a212348ec4f3b4362585eca7159d0d09cbdf4a7f74f02173596fd4" +checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" dependencies = [ - "base64", + "base64 0.13.1", ] [[package]] @@ -5592,9 +5582,9 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "pest" -version = "2.5.2" +version = "2.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f6e86fb9e7026527a0d46bc308b841d73170ef8f443e1807f6ef88526a816d4" +checksum = "028accff104c4e513bad663bbcd2ad7cfd5304144404c31ed0a77ac103d00660" dependencies = [ "thiserror", "ucd-trie", @@ -5602,9 +5592,9 @@ dependencies = [ [[package]] name = "petgraph" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143" +checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" dependencies = [ "fixedbitset", "indexmap", @@ -5725,7 +5715,7 @@ dependencies = [ "libc", "log", "wepoll-ffi", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -5847,9 +5837,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.49" +version = "1.0.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5" +checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" dependencies = [ "unicode-ident", ] @@ -5888,7 +5878,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83cd1b99916654a69008fd66b4f9397fbe08e6e51dfe23d4417acf5d3b8cb87c" dependencies = [ "dtoa", - "itoa 1.0.5", + "itoa", "parking_lot 0.12.1", "prometheus-client-derive-text-encode", ] @@ -5906,9 +5896,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.11.5" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c01db6702aa05baa3f57dec92b8eeeeb4cb19e894e73996b32a4093289e54592" +checksum = "21dc42e00223fc37204bd4aa177e69420c604ca4a183209a8f9de30c6d934698" dependencies = [ "bytes", "prost-derive", @@ -5916,9 +5906,9 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.11.5" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb5320c680de74ba083512704acb90fe00f28f79207286a848e730c45dd73ed6" +checksum = "a3f8ad728fb08fe212df3c05169e940fbb6d9d16a877ddde14644a983ba2012e" dependencies = [ "bytes", "heck", @@ -5951,9 +5941,9 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.11.5" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8842bad1a5419bca14eac663ba798f6bc19c413c2fdceb5f3ba3b0932d96720" +checksum = "8bda8c0881ea9f722eb9629376db3d0b903b462477c1aafcb0566610ac28ac5d" dependencies = [ "anyhow", "itertools", @@ -5964,9 +5954,9 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.11.5" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "017f79637768cde62820bc2d4fe0e45daaa027755c323ad077767c6c5f173091" +checksum = "a5e0526209433e96d83d750dd81a99118edbc55739e7e61a46764fd2ad537788" dependencies = [ "bytes", "prost", @@ -6060,7 +6050,7 @@ dependencies = [ "rand 0.8.5", "ring", "rustc-hash", - "rustls 0.20.7", + "rustls 0.20.8", "slab", "thiserror", "tinyvec", @@ -6090,9 +6080,9 @@ dependencies = [ [[package]] name = "r2d2_sqlite" -version = "0.18.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d24607049214c5e42d3df53ac1d8a23c34cc6a5eefe3122acb2c72174719959" +checksum = "b4f5d0337e99cd5cacd91ffc326c6cc9d8078def459df560c4f9bf9ba4a51034" dependencies = [ "r2d2", "rusqlite", @@ -6202,9 +6192,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.10.1" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cac410af5d00ab6884528b4ab69d1e8e146e8d471201800fa1b4524126de6ad3" +checksum = "356a0625f1954f730c0201cdab48611198dc6ce21f4acff55089b5a78e6e835b" dependencies = [ "crossbeam-channel", "crossbeam-deque", @@ -6294,11 +6284,11 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.13" +version = "0.11.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c" +checksum = "21eed90ec8570952d53b772ecf8f206aa1ec9a3d76b2521c56c42973f2d91ee9" dependencies = [ - "base64", + "base64 0.21.0", "bytes", "encoding_rs", "futures-core", @@ -6317,7 +6307,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite 0.2.9", - "rustls 0.20.7", + "rustls 0.20.8", "rustls-pemfile", "serde", "serde_json", @@ -6325,11 +6315,12 @@ dependencies = [ "tokio", "tokio-native-tls", "tokio-rustls 0.23.4", - "tokio-util 0.7.4", + "tokio-util 0.7.7", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", + "wasm-streams", "web-sys", "webpki-roots", "winreg", @@ -6450,16 +6441,15 @@ dependencies = [ [[package]] name = "rusqlite" -version = "0.25.4" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c4b1eaf239b47034fb450ee9cdedd7d0226571689d8823030c4b6c2cb407152" +checksum = "01e213bc3ecb39ac32e81e51ebe31fd888a940515173e3a18a35f8c6e896422a" dependencies = [ "bitflags", "fallible-iterator", "fallible-streaming-iterator", - "hashlink", + "hashlink 0.8.1", "libsqlite3-sys", - "memchr", "smallvec", ] @@ -6514,7 +6504,7 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" dependencies = [ - "nom 7.1.2", + "nom 7.1.3", ] [[package]] @@ -6523,7 +6513,7 @@ version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" dependencies = [ - "base64", + "base64 0.13.1", "log", "ring", "sct 0.6.1", @@ -6532,9 +6522,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.20.7" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "539a2bfe908f471bfa933876bd1eb6a19cf2176d375f82ef7f99530a40e48c2c" +checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" dependencies = [ "log", "ring", @@ -6544,11 +6534,11 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55" +checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" dependencies = [ - "base64", + "base64 0.21.0", ] [[package]] @@ -6610,7 +6600,7 @@ checksum = "001cf62ece89779fd16105b5f515ad0e5cedcd5440d3dd806bb067978e7c3608" dependencies = [ "cfg-if", "derive_more", - "parity-scale-codec 3.2.1", + "parity-scale-codec 3.4.0", "scale-info-derive", ] @@ -6632,7 +6622,7 @@ version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" dependencies = [ - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -6740,9 +6730,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.7.0" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" +checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" dependencies = [ "bitflags", "core-foundation", @@ -6753,9 +6743,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.6.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" dependencies = [ "core-foundation-sys", "libc", @@ -6802,9 +6792,9 @@ dependencies = [ [[package]] name = "send_wrapper" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "930c0acf610d3fdb5e2ab6213019aaa04e227ebe9547b0649ba599b16d788bd7" +checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "sensitive_url" @@ -6823,16 +6813,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde-big-array" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18b20e7752957bbe9661cff4e0bb04d183d0948cdab2ea58cdb9df36a61dfe62" -dependencies = [ - "serde", - "serde_derive", -] - [[package]] name = "serde_array_query" version = "0.1.0" @@ -6866,11 +6846,11 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.91" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883" +checksum = "cad406b69c91885b5107daf2c29572f6c8cdb3c66826821e286c533490c0bc76" dependencies = [ - "itoa 1.0.5", + "itoa", "ryu", "serde", ] @@ -6893,7 +6873,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", - "itoa 1.0.5", + "itoa", "ryu", "serde", ] @@ -7030,9 +7010,9 @@ checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" [[package]] name = "signal-hook-registry" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" dependencies = [ "libc", ] @@ -7278,14 +7258,14 @@ checksum = "5e9f0ab6ef7eb7353d9119c170a436d1bf248eea575ac42d19d12f4e34130831" [[package]] name = "snow" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "774d05a3edae07ce6d68ea6984f3c05e9bba8927e3dd591e3b479e5b03213d0d" +checksum = "12ba5f4d4ff12bdb6a169ed51b7c48c0e0ac4b0b4b31012b2571e97d78d3201d" dependencies = [ "aes-gcm 0.9.4", "blake2", "chacha20poly1305", - "curve25519-dalek 4.0.0-pre.5", + "curve25519-dalek 4.0.0-rc.0", "rand_core 0.6.4", "ring", "rustc_version 0.4.0", @@ -7309,7 +7289,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" dependencies = [ - "base64", + "base64 0.13.1", "bytes", "flate2", "futures", @@ -7470,7 +7450,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7e94b1ec00bad60e6410e058b52f1c66de3dc5fe4d62d09b3e52bb7d3b73e25" dependencies = [ - "base64", + "base64 0.13.1", "crc", "lazy_static", "md-5", @@ -7548,9 +7528,9 @@ dependencies = [ [[package]] name = "sync_wrapper" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20518fe4a4c9acf048008599e464deb21beeae3d3578418951a189c235a7a9a8" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] name = "synstructure" @@ -7566,9 +7546,9 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.26.8" +version = "0.26.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ddf41e393a9133c81d5f0974195366bd57082deac6e0eb02ed39b8341c2bb6" +checksum = "5c18a6156d1f27a9592ee18c1a846ca8dd5c258b7179fc193ae87c74ebb666f5" dependencies = [ "cfg-if", "core-foundation-sys", @@ -7678,9 +7658,9 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.1.3" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" dependencies = [ "winapi-util", ] @@ -7732,10 +7712,11 @@ dependencies = [ [[package]] name = "thread_local" -version = "1.1.4" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ + "cfg-if", "once_cell", ] @@ -7765,7 +7746,7 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376" dependencies = [ - "itoa 1.0.5", + "itoa", "libc", "num_threads", "serde", @@ -7848,15 +7829,15 @@ dependencies = [ [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.24.1" +version = "1.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d9f76183f91ecfb55e1d7d5602bd1d979e38a3a522fe900241cf195624d67ae" +checksum = "c8e00990ebabbe4c14c08aca901caed183ecd5c09562a12c824bb53d3c3fd3af" dependencies = [ "autocfg 1.1.0", "bytes", @@ -7869,7 +7850,7 @@ dependencies = [ "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -7895,9 +7876,9 @@ dependencies = [ [[package]] name = "tokio-native-tls" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" dependencies = [ "native-tls", "tokio", @@ -7920,7 +7901,7 @@ version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ - "rustls 0.20.7", + "rustls 0.20.8", "tokio", "webpki 0.22.0", ] @@ -7934,7 +7915,7 @@ dependencies = [ "futures-core", "pin-project-lite 0.2.9", "tokio", - "tokio-util 0.7.4", + "tokio-util 0.7.7", ] [[package]] @@ -7958,7 +7939,7 @@ checksum = "f714dd15bead90401d77e04243611caec13726c2408afd5b31901dfcdcb3b181" dependencies = [ "futures-util", "log", - "rustls 0.20.7", + "rustls 0.20.8", "tokio", "tokio-rustls 0.23.4", "tungstenite 0.17.3", @@ -7984,9 +7965,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.4" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" dependencies = [ "bytes", "futures-core", @@ -7999,9 +7980,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.10" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1333c76748e868a4d9d1017b5ab53171dfd095f70c712fdb4653a406547f598f" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" dependencies = [ "serde", ] @@ -8237,7 +8218,7 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0b2d8558abd2e276b0a8df5c05a2ec762609344191e5fd23e292c910e9165b5" dependencies = [ - "base64", + "base64 0.13.1", "byteorder", "bytes", "http", @@ -8256,14 +8237,14 @@ version = "0.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e27992fd6a8c29ee7eef28fc78349aa244134e10ad447ce3b9f0ac0ed0fa4ce0" dependencies = [ - "base64", + "base64 0.13.1", "byteorder", "bytes", "http", "httparse", "log", "rand 0.8.5", - "rustls 0.20.7", + "rustls 0.20.8", "sha-1 0.10.1", "thiserror", "url", @@ -8278,7 +8259,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4712ee30d123ec7ae26d1e1b218395a16c87cdbaf4b3925d170d684af62ea5e8" dependencies = [ "async-trait", - "base64", + "base64 0.13.1", "futures", "log", "md-5", @@ -8341,7 +8322,6 @@ dependencies = [ "rusqlite", "safe_arith", "serde", - "serde-big-array", "serde_derive", "serde_json", "serde_with", @@ -8394,9 +8374,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.8" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" +checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58" [[package]] name = "unicode-ident" @@ -8494,9 +8474,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.2.2" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "422ee0de9031b5b948b97a8fc04e3aa35230001a722ddd27943e0be31564ce4c" +checksum = "1674845326ee10d37ca60470760d4288a6f80f304007d92e5c53bab78c9cfd79" dependencies = [ "getrandom 0.2.8", ] @@ -8707,9 +8687,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -8717,9 +8697,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" dependencies = [ "bumpalo", "log", @@ -8732,9 +8712,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.33" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" +checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" dependencies = [ "cfg-if", "js-sys", @@ -8744,9 +8724,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -8754,9 +8734,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ "proc-macro2", "quote", @@ -8767,15 +8747,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" +checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" [[package]] name = "wasm-bindgen-test" -version = "0.3.33" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d2fff962180c3fadf677438054b1db62bee4aa32af26a45388af07d1287e1d" +checksum = "6db36fc0f9fb209e88fb3642590ae0205bb5a56216dabd963ba15879fe53a30b" dependencies = [ "console_error_panic_hook", "js-sys", @@ -8787,14 +8767,27 @@ dependencies = [ [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.33" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4683da3dfc016f704c9f82cf401520c4f1cb3ee440f7f52b3d6ac29506a49ca7" +checksum = "0734759ae6b3b1717d661fe4f016efcfb9828f5edb4520c18eaee05af3b43be9" dependencies = [ "proc-macro2", "quote", ] +[[package]] +name = "wasm-streams" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bbae3363c08332cadccd13b67db371814cd214c2524020932f0804b8cf7c078" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + [[package]] name = "wasm-timer" version = "0.2.5" @@ -8812,9 +8805,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.60" +version = "0.3.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" dependencies = [ "js-sys", "wasm-bindgen", @@ -8827,7 +8820,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44f258e254752d210b84fe117b31f1e3cc9cbf04c0d747eb7f8cf7cf5e370f6d" dependencies = [ "arrayvec", - "base64", + "base64 0.13.1", "bytes", "derive_more", "ethabi 16.0.0", @@ -9020,9 +9013,9 @@ dependencies = [ [[package]] name = "webrtc-ice" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "494483fbb2f5492620871fdc78b084aed8807377f6e3fe88b2e49f0a9c9c41d7" +checksum = "465a03cc11e9a7d7b4f9f99870558fe37a102b65b93f8045392fef7c67b39e80" dependencies = [ "arc-swap", "async-trait", @@ -9036,7 +9029,7 @@ dependencies = [ "tokio", "turn", "url", - "uuid 1.2.2", + "uuid 1.3.0", "waitgroup", "webrtc-mdns", "webrtc-util", @@ -9144,9 +9137,9 @@ dependencies = [ [[package]] name = "which" -version = "4.3.0" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c831fbbee9e129a8cf93e7747a82da9d95ba8e16621cae60ec2cdc849bacb7b" +checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" dependencies = [ "either", "libc", @@ -9228,19 +9221,43 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.0", - "windows_i686_gnu 0.42.0", - "windows_i686_msvc 0.42.0", - "windows_x86_64_gnu 0.42.0", + "windows_aarch64_msvc 0.42.1", + "windows_i686_gnu 0.42.1", + "windows_i686_msvc 0.42.1", + "windows_x86_64_gnu 0.42.1", "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.0", + "windows_x86_64_msvc 0.42.1", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.1", + "windows_i686_gnu 0.42.1", + "windows_i686_msvc 0.42.1", + "windows_x86_64_gnu 0.42.1", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.1", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" +checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" [[package]] name = "windows_aarch64_msvc" @@ -9250,9 +9267,9 @@ checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d" [[package]] name = "windows_aarch64_msvc" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" +checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" [[package]] name = "windows_i686_gnu" @@ -9262,9 +9279,9 @@ checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed" [[package]] name = "windows_i686_gnu" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" +checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" [[package]] name = "windows_i686_msvc" @@ -9274,9 +9291,9 @@ checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956" [[package]] name = "windows_i686_msvc" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" +checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" [[package]] name = "windows_x86_64_gnu" @@ -9286,15 +9303,15 @@ checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4" [[package]] name = "windows_x86_64_gnu" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" +checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" +checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" [[package]] name = "windows_x86_64_msvc" @@ -9304,9 +9321,9 @@ checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9" [[package]] name = "windows_x86_64_msvc" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" +checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" [[package]] name = "winreg" @@ -9319,13 +9336,14 @@ dependencies = [ [[package]] name = "ws_stream_wasm" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47ca1ab42f5afed7fc332b22b6e932ca5414b209465412c8cdf0ad23bc0de645" +checksum = "7999f5f4217fe3818726b66257a4475f71e74ffd190776ad053fa159e50737f5" dependencies = [ "async_io_stream", "futures", "js-sys", + "log", "pharos", "rustc_version 0.4.0", "send_wrapper", @@ -9379,11 +9397,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fb9bace5b5589ffead1afb76e43e34cff39cd0f3ce7e170ae0c29e53b88eb1c" dependencies = [ "asn1-rs 0.3.1", - "base64", + "base64 0.13.1", "data-encoding", "der-parser 7.0.0", "lazy_static", - "nom 7.1.2", + "nom 7.1.3", "oid-registry 0.4.0", "ring", "rusticata-macros", @@ -9398,11 +9416,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0ecbeb7b67ce215e40e3cc7f2ff902f94a223acf44995934763467e7b1febc8" dependencies = [ "asn1-rs 0.5.1", - "base64", + "base64 0.13.1", "data-encoding", "der-parser 8.1.0", "lazy_static", - "nom 7.1.2", + "nom 7.1.3", "oid-registry 0.6.1", "rusticata-macros", "thiserror", diff --git a/Cargo.toml b/Cargo.toml index 76edfbfe8..581c056a0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,7 +94,6 @@ resolver = "2" [patch] [patch.crates-io] -fixed-hash = { git = "https://github.com/paritytech/parity-common", rev="df638ab0885293d21d656dc300d39236b69ce57d" } warp = { git = "https://github.com/macladson/warp", rev="7e75acc368229a46a236a8c991bf251fe7fe50ef" } eth2_ssz = { path = "consensus/ssz" } eth2_ssz_derive = { path = "consensus/ssz_derive" } diff --git a/Makefile b/Makefile index 458ceefc7..8fd502ed2 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ PROFILE ?= release # List of all hard forks. This list is used to set env variables for several tests so that # they run for different forks. -FORKS=phase0 altair merge capella +FORKS=phase0 altair merge capella eip4844 # Builds the Lighthouse binary in release (optimized). # @@ -163,6 +163,7 @@ lint: cargo clippy --workspace --tests -- \ -D clippy::fn_to_numeric_cast_any \ -D warnings \ + -A clippy::uninlined-format-args \ -A clippy::derive_partial_eq_without_eq \ -A clippy::from-over-into \ -A clippy::upper-case-acronyms \ @@ -193,7 +194,7 @@ arbitrary-fuzz: # Runs cargo audit (Audit Cargo.lock files for crates with security vulnerabilities reported to the RustSec Advisory Database) audit: cargo install --force cargo-audit - cargo audit --ignore RUSTSEC-2020-0071 --ignore RUSTSEC-2020-0159 + cargo audit --ignore RUSTSEC-2020-0071 # Runs `cargo vendor` to make sure dependencies can be vendored for packaging, reproducibility and archival purpose. vendor: diff --git a/beacon_node/beacon_chain/Cargo.toml b/beacon_node/beacon_chain/Cargo.toml index a4182b773..26fdc0f5a 100644 --- a/beacon_node/beacon_chain/Cargo.toml +++ b/beacon_node/beacon_chain/Cargo.toml @@ -68,6 +68,8 @@ hex = "0.4.2" exit-future = "0.2.0" unused_port = {path = "../../common/unused_port"} oneshot_broadcast = { path = "../../common/oneshot_broadcast" } +slog-term = "2.6.0" +slog-async = "2.5.0" [[test]] name = "beacon_chain_tests" diff --git a/beacon_node/beacon_chain/src/attester_cache.rs b/beacon_node/beacon_chain/src/attester_cache.rs index 8e2dfdab8..24963a125 100644 --- a/beacon_node/beacon_chain/src/attester_cache.rs +++ b/beacon_node/beacon_chain/src/attester_cache.rs @@ -42,7 +42,6 @@ pub enum Error { // Boxed to avoid an infinite-size recursion issue. BeaconChain(Box), MissingBeaconState(Hash256), - MissingBlobs, FailedToTransitionState(StateAdvanceError), CannotAttestToFutureState { state_slot: Slot, diff --git a/beacon_node/beacon_chain/src/beacon_chain.rs b/beacon_node/beacon_chain/src/beacon_chain.rs index 980a31390..ff2992e0b 100644 --- a/beacon_node/beacon_chain/src/beacon_chain.rs +++ b/beacon_node/beacon_chain/src/beacon_chain.rs @@ -4579,7 +4579,6 @@ impl BeaconChain { let (payload, _, _) = block_contents .ok_or(BlockProductionError::MissingExecutionPayload)? .deconstruct(); - ( BeaconBlock::Capella(BeaconBlockCapella { slot, @@ -4610,7 +4609,6 @@ impl BeaconChain { let (payload, kzg_commitments, blobs) = block_contents .ok_or(BlockProductionError::MissingExecutionPayload)? .deconstruct(); - ( BeaconBlock::Eip4844(BeaconBlockEip4844 { slot, @@ -4694,8 +4692,8 @@ impl BeaconChain { .as_ref() .ok_or(BlockProductionError::TrustedSetupNotInitialized)?; let kzg_aggregated_proof = - kzg_utils::compute_aggregate_kzg_proof::(&kzg, &blobs) - .map_err(|e| BlockProductionError::KzgError(e))?; + kzg_utils::compute_aggregate_kzg_proof::(kzg, &blobs) + .map_err(BlockProductionError::KzgError)?; let beacon_block_root = block.canonical_root(); let expected_kzg_commitments = block.body().blob_kzg_commitments().map_err(|_| { BlockProductionError::InvalidBlockVariant( @@ -4709,7 +4707,7 @@ impl BeaconChain { kzg_aggregated_proof, }; kzg_utils::validate_blobs_sidecar( - &kzg, + kzg, slot, beacon_block_root, expected_kzg_commitments, @@ -5941,17 +5939,14 @@ impl BeaconChain { /// The epoch at which we require a data availability check in block processing. /// `None` if the `Eip4844` fork is disabled. pub fn data_availability_boundary(&self) -> Option { - self.spec - .eip4844_fork_epoch - .map(|fork_epoch| { - self.epoch().ok().map(|current_epoch| { - std::cmp::max( - fork_epoch, - current_epoch.saturating_sub(*MIN_EPOCHS_FOR_BLOBS_SIDECARS_REQUESTS), - ) - }) + self.spec.eip4844_fork_epoch.and_then(|fork_epoch| { + self.epoch().ok().map(|current_epoch| { + std::cmp::max( + fork_epoch, + current_epoch.saturating_sub(*MIN_EPOCHS_FOR_BLOBS_SIDECARS_REQUESTS), + ) }) - .flatten() + }) } /// The epoch that is a data availability boundary, or the latest finalized epoch. diff --git a/beacon_node/beacon_chain/src/blob_verification.rs b/beacon_node/beacon_chain/src/blob_verification.rs index 4abbddb33..1d7f9cc3c 100644 --- a/beacon_node/beacon_chain/src/blob_verification.rs +++ b/beacon_node/beacon_chain/src/blob_verification.rs @@ -292,12 +292,12 @@ impl AvailableBlock { let blobs_sidecar = beacon_block .reconstruct_empty_blobs(Some(block_root)) .map(Arc::new)?; - return Ok(AvailableBlock(AvailableBlockInner::BlockAndBlob( + Ok(AvailableBlock(AvailableBlockInner::BlockAndBlob( SignedBeaconBlockAndBlobsSidecar { beacon_block, blobs_sidecar, }, - ))); + ))) } DataAvailabilityCheckRequired::No => { Ok(AvailableBlock(AvailableBlockInner::Block(beacon_block))) @@ -391,6 +391,7 @@ pub trait AsBlock { fn message(&self) -> BeaconBlockRef; fn as_block(&self) -> &SignedBeaconBlock; fn block_cloned(&self) -> Arc>; + fn canonical_root(&self) -> Hash256; } impl AsBlock for BlockWrapper { @@ -432,8 +433,8 @@ impl AsBlock for BlockWrapper { } fn as_block(&self) -> &SignedBeaconBlock { match &self { - BlockWrapper::Block(block) => &block, - BlockWrapper::BlockAndBlob(block, _) => &block, + BlockWrapper::Block(block) => block, + BlockWrapper::BlockAndBlob(block, _) => block, } } fn block_cloned(&self) -> Arc> { @@ -442,6 +443,12 @@ impl AsBlock for BlockWrapper { BlockWrapper::BlockAndBlob(block, _) => block.clone(), } } + fn canonical_root(&self) -> Hash256 { + match &self { + BlockWrapper::Block(block) => block.canonical_root(), + BlockWrapper::BlockAndBlob(block, _) => block.canonical_root(), + } + } } impl AsBlock for &BlockWrapper { @@ -483,8 +490,8 @@ impl AsBlock for &BlockWrapper { } fn as_block(&self) -> &SignedBeaconBlock { match &self { - BlockWrapper::Block(block) => &block, - BlockWrapper::BlockAndBlob(block, _) => &block, + BlockWrapper::Block(block) => block, + BlockWrapper::BlockAndBlob(block, _) => block, } } fn block_cloned(&self) -> Arc> { @@ -493,6 +500,12 @@ impl AsBlock for &BlockWrapper { BlockWrapper::BlockAndBlob(block, _) => block.clone(), } } + fn canonical_root(&self) -> Hash256 { + match &self { + BlockWrapper::Block(block) => block.canonical_root(), + BlockWrapper::BlockAndBlob(block, _) => block.canonical_root(), + } + } } impl AsBlock for AvailableBlock { @@ -546,7 +559,7 @@ impl AsBlock for AvailableBlock { } fn as_block(&self) -> &SignedBeaconBlock { match &self.0 { - AvailableBlockInner::Block(block) => &block, + AvailableBlockInner::Block(block) => block, AvailableBlockInner::BlockAndBlob(block_sidecar_pair) => { &block_sidecar_pair.beacon_block } @@ -560,4 +573,12 @@ impl AsBlock for AvailableBlock { } } } + fn canonical_root(&self) -> Hash256 { + match &self.0 { + AvailableBlockInner::Block(block) => block.canonical_root(), + AvailableBlockInner::BlockAndBlob(block_sidecar_pair) => { + block_sidecar_pair.beacon_block.canonical_root() + } + } + } } diff --git a/beacon_node/beacon_chain/src/block_verification.rs b/beacon_node/beacon_chain/src/block_verification.rs index 70eec4ecc..cd178317f 100644 --- a/beacon_node/beacon_chain/src/block_verification.rs +++ b/beacon_node/beacon_chain/src/block_verification.rs @@ -1120,7 +1120,7 @@ impl IntoExecutionPendingBlock for SignatureVerifiedBloc } fn block(&self) -> &SignedBeaconBlock { - &self.block.as_block() + self.block.as_block() } } diff --git a/beacon_node/beacon_chain/src/builder.rs b/beacon_node/beacon_chain/src/builder.rs index 0fd016e0b..2d92ad6cb 100644 --- a/beacon_node/beacon_chain/src/builder.rs +++ b/beacon_node/beacon_chain/src/builder.rs @@ -1016,6 +1016,7 @@ fn descriptive_db_error(item: &str, error: &StoreError) -> String { #[cfg(test)] mod test { use super::*; + use crate::test_utils::EphemeralHarnessType; use crate::validator_monitor::DEFAULT_INDIVIDUAL_TRACKING_THRESHOLD; use eth2_hashing::hash; use genesis::{ @@ -1030,6 +1031,7 @@ mod test { use types::{EthSpec, MinimalEthSpec, Slot}; type TestEthSpec = MinimalEthSpec; + type Builder = BeaconChainBuilder>; fn get_logger() -> Logger { let builder = NullLoggerBuilder; @@ -1062,7 +1064,7 @@ mod test { let (shutdown_tx, _) = futures::channel::mpsc::channel(1); let runtime = TestRuntime::default(); - let chain = BeaconChainBuilder::new(MinimalEthSpec) + let chain = Builder::new(MinimalEthSpec) .logger(log.clone()) .store(Arc::new(store)) .task_executor(runtime.task_executor.clone()) diff --git a/beacon_node/beacon_chain/src/early_attester_cache.rs b/beacon_node/beacon_chain/src/early_attester_cache.rs index 189935ba4..dd4109da9 100644 --- a/beacon_node/beacon_chain/src/early_attester_cache.rs +++ b/beacon_node/beacon_chain/src/early_attester_cache.rs @@ -165,8 +165,7 @@ impl EarlyAttesterCache { .read() .as_ref() .filter(|item| item.beacon_block_root == block_root) - .map(|item| item.blobs.clone()) - .flatten() + .and_then(|item| item.blobs.clone()) } /// Returns the proto-array block, if `block_root` matches the cached item. diff --git a/beacon_node/beacon_chain/src/kzg_utils.rs b/beacon_node/beacon_chain/src/kzg_utils.rs index 8589a6fe4..4ee8c3506 100644 --- a/beacon_node/beacon_chain/src/kzg_utils.rs +++ b/beacon_node/beacon_chain/src/kzg_utils.rs @@ -40,7 +40,7 @@ pub fn compute_aggregate_kzg_proof( blobs: &[Blob], ) -> Result { let blobs = blobs - .into_iter() + .iter() .map(|blob| ssz_blob_to_crypto_blob::(blob.clone())) // TODO(pawan): avoid this clone .collect::>(); diff --git a/beacon_node/beacon_chain/src/test_utils.rs b/beacon_node/beacon_chain/src/test_utils.rs index 77863a556..8ede8672e 100644 --- a/beacon_node/beacon_chain/src/test_utils.rs +++ b/beacon_node/beacon_chain/src/test_utils.rs @@ -34,7 +34,9 @@ use rand::Rng; use rand::SeedableRng; use rayon::prelude::*; use sensitive_url::SensitiveUrl; -use slog::Logger; +use slog::{o, Drain, Logger}; +use slog_async::Async; +use slog_term::{FullFormat, TermDecorator}; use slot_clock::{SlotClock, TestingSlotClock}; use state_processing::per_block_processing::compute_timestamp_at_slot; use state_processing::{ @@ -1924,8 +1926,9 @@ where chain_dump .iter() .cloned() - .map(|checkpoint| checkpoint.beacon_state.finalized_checkpoint().root.into()) - .filter(|block_hash| *block_hash != Hash256::zero().into()) + .map(|checkpoint| checkpoint.beacon_state.finalized_checkpoint().root) + .filter(|block_hash| *block_hash != Hash256::zero()) + .map(|hash| hash.into()) .collect() } @@ -2125,3 +2128,15 @@ impl fmt::Debug for BeaconChainHarness { write!(f, "BeaconChainHarness") } } + +pub fn build_log(level: slog::Level, enabled: bool) -> Logger { + let decorator = TermDecorator::new().build(); + let drain = FullFormat::new(decorator).build().fuse(); + let drain = Async::new(drain).build().fuse(); + + if enabled { + Logger::root(drain.filter_level(level).fuse(), o!()) + } else { + Logger::root(drain.filter(|_| false).fuse(), o!()) + } +} diff --git a/beacon_node/beacon_chain/src/validator_pubkey_cache.rs b/beacon_node/beacon_chain/src/validator_pubkey_cache.rs index 85fd106ee..00140dd6e 100644 --- a/beacon_node/beacon_chain/src/validator_pubkey_cache.rs +++ b/beacon_node/beacon_chain/src/validator_pubkey_cache.rs @@ -299,7 +299,7 @@ mod test { let ops = cache .import_new_pubkeys(&state) .expect("should import pubkeys"); - store.do_atomically(ops).unwrap(); + store.do_atomically_with_block_and_blobs_cache(ops).unwrap(); check_cache_get(&cache, &keypairs[..]); drop(cache); diff --git a/beacon_node/beacon_chain/tests/attestation_production.rs b/beacon_node/beacon_chain/tests/attestation_production.rs index 5cab585b1..9cfff81c3 100644 --- a/beacon_node/beacon_chain/tests/attestation_production.rs +++ b/beacon_node/beacon_chain/tests/attestation_production.rs @@ -1,6 +1,9 @@ #![cfg(not(debug_assertions))] -use beacon_chain::test_utils::{AttestationStrategy, BeaconChainHarness, BlockStrategy}; +use beacon_chain::{ + blob_verification::{BlockWrapper, IntoAvailableBlock}, + test_utils::{AttestationStrategy, BeaconChainHarness, BlockStrategy}, +}; use beacon_chain::{StateSkipConfig, WhenSlotSkipped}; use lazy_static::lazy_static; use std::sync::Arc; @@ -131,6 +134,8 @@ async fn produces_attestations() { assert_eq!(data.target.epoch, state.current_epoch(), "bad target epoch"); assert_eq!(data.target.root, target_root, "bad target root"); + let block_wrapper: BlockWrapper = Arc::new(block.clone()).into(); + let early_attestation = { let proto_block = chain .canonical_head @@ -141,8 +146,9 @@ async fn produces_attestations() { .early_attester_cache .add_head_block( block_root, - Arc::new(block.clone()), - None, + block_wrapper + .into_available_block(block_root, chain) + .expect("should wrap into available block"), proto_block, &state, &chain.spec, @@ -193,13 +199,18 @@ async fn early_attester_cache_old_request() { .get_block(&head.beacon_block_root) .unwrap(); + let block: BlockWrapper = head.beacon_block.clone().into(); + + let chain = &harness.chain; harness .chain .early_attester_cache .add_head_block( head.beacon_block_root, - head.beacon_block.clone(), - None, + block + .clone() + .into_available_block(head.beacon_block_root, &chain) + .expect("should wrap into available block"), head_proto_block, &head.beacon_state, &harness.chain.spec, diff --git a/beacon_node/beacon_chain/tests/block_verification.rs b/beacon_node/beacon_chain/tests/block_verification.rs index 38a55e221..8de906afd 100644 --- a/beacon_node/beacon_chain/tests/block_verification.rs +++ b/beacon_node/beacon_chain/tests/block_verification.rs @@ -1,7 +1,8 @@ #![cfg(not(debug_assertions))] -use beacon_chain::test_utils::{ - AttestationStrategy, BeaconChainHarness, BlockStrategy, EphemeralHarnessType, +use beacon_chain::{ + blob_verification::{AsBlock, BlockWrapper}, + test_utils::{AttestationStrategy, BeaconChainHarness, BlockStrategy, EphemeralHarnessType}, }; use beacon_chain::{BeaconSnapshot, BlockError, ChainSegmentResult, NotifyExecutionLayer}; use fork_choice::CountUnrealized; @@ -80,7 +81,7 @@ fn get_harness(validator_count: usize) -> BeaconChainHarness]) -> Vec>> { chain_segment .iter() - .map(|snapshot| snapshot.beacon_block.clone()) + .map(|snapshot| snapshot.beacon_block.clone().into()) .collect() } @@ -137,7 +138,10 @@ fn update_parent_roots(snapshots: &mut [BeaconSnapshot]) { async fn chain_segment_full_segment() { let harness = get_harness(VALIDATOR_COUNT); let chain_segment = get_chain_segment().await; - let blocks = chain_segment_blocks(&chain_segment); + let blocks: Vec> = chain_segment_blocks(&chain_segment) + .into_iter() + .map(|block| block.into()) + .collect(); harness .chain @@ -177,7 +181,10 @@ async fn chain_segment_varying_chunk_size() { for chunk_size in &[1, 2, 3, 5, 31, 32, 33, 42] { let harness = get_harness(VALIDATOR_COUNT); let chain_segment = get_chain_segment().await; - let blocks = chain_segment_blocks(&chain_segment); + let blocks: Vec> = chain_segment_blocks(&chain_segment) + .into_iter() + .map(|block| block.into()) + .collect(); harness .chain @@ -220,7 +227,10 @@ async fn chain_segment_non_linear_parent_roots() { /* * Test with a block removed. */ - let mut blocks = chain_segment_blocks(&chain_segment); + let mut blocks: Vec> = chain_segment_blocks(&chain_segment) + .into_iter() + .map(|block| block.into()) + .collect(); blocks.remove(2); assert!( @@ -238,10 +248,14 @@ async fn chain_segment_non_linear_parent_roots() { /* * Test with a modified parent root. */ - let mut blocks = chain_segment_blocks(&chain_segment); - let (mut block, signature) = blocks[3].as_ref().clone().deconstruct(); + let mut blocks: Vec> = chain_segment_blocks(&chain_segment) + .into_iter() + .map(|block| block.into()) + .collect(); + + let (mut block, signature) = blocks[3].as_block().clone().deconstruct(); *block.parent_root_mut() = Hash256::zero(); - blocks[3] = Arc::new(SignedBeaconBlock::from_block(block, signature)); + blocks[3] = Arc::new(SignedBeaconBlock::from_block(block, signature)).into(); assert!( matches!( @@ -269,10 +283,13 @@ async fn chain_segment_non_linear_slots() { * Test where a child is lower than the parent. */ - let mut blocks = chain_segment_blocks(&chain_segment); - let (mut block, signature) = blocks[3].as_ref().clone().deconstruct(); + let mut blocks: Vec> = chain_segment_blocks(&chain_segment) + .into_iter() + .map(|block| block.into()) + .collect(); + let (mut block, signature) = blocks[3].as_block().clone().deconstruct(); *block.slot_mut() = Slot::new(0); - blocks[3] = Arc::new(SignedBeaconBlock::from_block(block, signature)); + blocks[3] = Arc::new(SignedBeaconBlock::from_block(block, signature)).into(); assert!( matches!( @@ -290,10 +307,13 @@ async fn chain_segment_non_linear_slots() { * Test where a child is equal to the parent. */ - let mut blocks = chain_segment_blocks(&chain_segment); - let (mut block, signature) = blocks[3].as_ref().clone().deconstruct(); + let mut blocks: Vec> = chain_segment_blocks(&chain_segment) + .into_iter() + .map(|block| block.into()) + .collect(); + let (mut block, signature) = blocks[3].as_block().clone().deconstruct(); *block.slot_mut() = blocks[2].slot(); - blocks[3] = Arc::new(SignedBeaconBlock::from_block(block, signature)); + blocks[3] = Arc::new(SignedBeaconBlock::from_block(block, signature)).into(); assert!( matches!( @@ -315,9 +335,9 @@ async fn assert_invalid_signature( snapshots: &[BeaconSnapshot], item: &str, ) { - let blocks = snapshots + let blocks: Vec> = snapshots .iter() - .map(|snapshot| snapshot.beacon_block.clone()) + .map(|snapshot| snapshot.beacon_block.clone().into()) .collect(); // Ensure the block will be rejected if imported in a chain segment. @@ -341,7 +361,7 @@ async fn assert_invalid_signature( let ancestor_blocks = chain_segment .iter() .take(block_index) - .map(|snapshot| snapshot.beacon_block.clone()) + .map(|snapshot| snapshot.beacon_block.clone().into()) .collect(); // We don't care if this fails, we just call this to ensure that all prior blocks have been // imported prior to this test. @@ -409,7 +429,7 @@ async fn invalid_signature_gossip_block() { let ancestor_blocks = chain_segment .iter() .take(block_index) - .map(|snapshot| snapshot.beacon_block.clone()) + .map(|snapshot| snapshot.beacon_block.clone().into()) .collect(); harness .chain @@ -455,9 +475,9 @@ async fn invalid_signature_block_proposal() { block.clone(), junk_signature(), )); - let blocks = snapshots + let blocks: Vec> = snapshots .iter() - .map(|snapshot| snapshot.beacon_block.clone()) + .map(|snapshot| snapshot.beacon_block.clone().into()) .collect::>(); // Ensure the block will be rejected if imported in a chain segment. assert!( @@ -654,9 +674,9 @@ async fn invalid_signature_deposit() { Arc::new(SignedBeaconBlock::from_block(block, signature)); update_parent_roots(&mut snapshots); update_proposal_signatures(&mut snapshots, &harness); - let blocks = snapshots + let blocks: Vec> = snapshots .iter() - .map(|snapshot| snapshot.beacon_block.clone()) + .map(|snapshot| snapshot.beacon_block.clone().into()) .collect(); assert!( !matches!( @@ -733,7 +753,7 @@ async fn block_gossip_verification() { for snapshot in &chain_segment[0..block_index] { let gossip_verified = harness .chain - .verify_block_for_gossip(snapshot.beacon_block.clone()) + .verify_block_for_gossip(snapshot.beacon_block.clone().into()) .await .expect("should obtain gossip verified block"); @@ -771,7 +791,7 @@ async fn block_gossip_verification() { *block.slot_mut() = expected_block_slot; assert!( matches!( - unwrap_err(harness.chain.verify_block_for_gossip(Arc::new(SignedBeaconBlock::from_block(block, signature))).await), + unwrap_err(harness.chain.verify_block_for_gossip(Arc::new(SignedBeaconBlock::from_block(block, signature)).into()).await), BlockError::FutureSlot { present_slot, block_slot, @@ -805,7 +825,7 @@ async fn block_gossip_verification() { *block.slot_mut() = expected_finalized_slot; assert!( matches!( - unwrap_err(harness.chain.verify_block_for_gossip(Arc::new(SignedBeaconBlock::from_block(block, signature))).await), + unwrap_err(harness.chain.verify_block_for_gossip(Arc::new(SignedBeaconBlock::from_block(block, signature)).into()).await), BlockError::WouldRevertFinalizedSlot { block_slot, finalized_slot, @@ -835,10 +855,9 @@ async fn block_gossip_verification() { unwrap_err( harness .chain - .verify_block_for_gossip(Arc::new(SignedBeaconBlock::from_block( - block, - junk_signature() - ))) + .verify_block_for_gossip( + Arc::new(SignedBeaconBlock::from_block(block, junk_signature())).into() + ) .await ), BlockError::ProposalSignatureInvalid @@ -863,7 +882,7 @@ async fn block_gossip_verification() { *block.parent_root_mut() = parent_root; assert!( matches!( - unwrap_err(harness.chain.verify_block_for_gossip(Arc::new(SignedBeaconBlock::from_block(block, signature))).await), + unwrap_err(harness.chain.verify_block_for_gossip(Arc::new(SignedBeaconBlock::from_block(block, signature)).into()).await), BlockError::ParentUnknown(block) if block.parent_root() == parent_root ), @@ -889,7 +908,7 @@ async fn block_gossip_verification() { *block.parent_root_mut() = parent_root; assert!( matches!( - unwrap_err(harness.chain.verify_block_for_gossip(Arc::new(SignedBeaconBlock::from_block(block, signature))).await), + unwrap_err(harness.chain.verify_block_for_gossip(Arc::new(SignedBeaconBlock::from_block(block, signature)).into()).await), BlockError::NotFinalizedDescendant { block_parent_root } if block_parent_root == parent_root ), @@ -927,7 +946,7 @@ async fn block_gossip_verification() { ); assert!( matches!( - unwrap_err(harness.chain.verify_block_for_gossip(Arc::new(block.clone())).await), + unwrap_err(harness.chain.verify_block_for_gossip(Arc::new(block.clone()).into()).await), BlockError::IncorrectBlockProposer { block, local_shuffling, @@ -939,7 +958,7 @@ async fn block_gossip_verification() { // Check to ensure that we registered this is a valid block from this proposer. assert!( matches!( - unwrap_err(harness.chain.verify_block_for_gossip(Arc::new(block.clone())).await), + unwrap_err(harness.chain.verify_block_for_gossip(Arc::new(block.clone()).into()).await), BlockError::RepeatProposal { proposer, slot, @@ -951,7 +970,11 @@ async fn block_gossip_verification() { let block = chain_segment[block_index].beacon_block.clone(); assert!( - harness.chain.verify_block_for_gossip(block).await.is_ok(), + harness + .chain + .verify_block_for_gossip(block.into()) + .await + .is_ok(), "the valid block should be processed" ); @@ -969,7 +992,7 @@ async fn block_gossip_verification() { matches!( harness .chain - .verify_block_for_gossip(block.clone()) + .verify_block_for_gossip(block.clone().into()) .await .err() .expect("should error when processing known block"), @@ -1006,7 +1029,7 @@ async fn verify_block_for_gossip_slashing_detection() { let verified_block = harness .chain - .verify_block_for_gossip(Arc::new(block1)) + .verify_block_for_gossip(Arc::new(block1).into()) .await .unwrap(); harness @@ -1022,7 +1045,7 @@ async fn verify_block_for_gossip_slashing_detection() { unwrap_err( harness .chain - .verify_block_for_gossip(Arc::new(block2)) + .verify_block_for_gossip(Arc::new(block2).into()) .await, ); @@ -1045,7 +1068,7 @@ async fn verify_block_for_gossip_doppelganger_detection() { let verified_block = harness .chain - .verify_block_for_gossip(Arc::new(block)) + .verify_block_for_gossip(Arc::new(block).into()) .await .unwrap(); let attestations = verified_block.block.message().body().attestations().clone(); @@ -1184,7 +1207,7 @@ async fn add_base_block_to_altair_chain() { assert!(matches!( harness .chain - .verify_block_for_gossip(Arc::new(base_block.clone())) + .verify_block_for_gossip(Arc::new(base_block.clone()).into()) .await .err() .expect("should error when processing base block"), @@ -1218,7 +1241,7 @@ async fn add_base_block_to_altair_chain() { harness .chain .process_chain_segment( - vec![Arc::new(base_block)], + vec![Arc::new(base_block).into()], CountUnrealized::True, NotifyExecutionLayer::Yes, ) @@ -1322,7 +1345,7 @@ async fn add_altair_block_to_base_chain() { assert!(matches!( harness .chain - .verify_block_for_gossip(Arc::new(altair_block.clone())) + .verify_block_for_gossip(Arc::new(altair_block.clone()).into()) .await .err() .expect("should error when processing altair block"), @@ -1356,7 +1379,7 @@ async fn add_altair_block_to_base_chain() { harness .chain .process_chain_segment( - vec![Arc::new(altair_block)], + vec![Arc::new(altair_block).into()], CountUnrealized::True, NotifyExecutionLayer::Yes ) diff --git a/beacon_node/beacon_chain/tests/op_verification.rs b/beacon_node/beacon_chain/tests/op_verification.rs index 535fe080a..f4af49071 100644 --- a/beacon_node/beacon_chain/tests/op_verification.rs +++ b/beacon_node/beacon_chain/tests/op_verification.rs @@ -31,8 +31,16 @@ fn get_store(db_path: &TempDir) -> Arc { let cold_path = db_path.path().join("cold_db"); let config = StoreConfig::default(); let log = NullLoggerBuilder.build().expect("logger should build"); - HotColdDB::open(&hot_path, &cold_path, |_, _, _| Ok(()), config, spec, log) - .expect("disk store should initialize") + HotColdDB::open( + &hot_path, + &cold_path, + None, + |_, _, _| Ok(()), + config, + spec, + log, + ) + .expect("disk store should initialize") } fn get_harness(store: Arc, validator_count: usize) -> TestHarness { diff --git a/beacon_node/beacon_chain/tests/payload_invalidation.rs b/beacon_node/beacon_chain/tests/payload_invalidation.rs index 54d773447..d0f81652b 100644 --- a/beacon_node/beacon_chain/tests/payload_invalidation.rs +++ b/beacon_node/beacon_chain/tests/payload_invalidation.rs @@ -1040,7 +1040,7 @@ async fn invalid_parent() { // Ensure the block built atop an invalid payload is invalid for gossip. assert!(matches!( - rig.harness.chain.clone().verify_block_for_gossip(block.clone()).await, + rig.harness.chain.clone().verify_block_for_gossip(block.clone().into()).await, Err(BlockError::ParentExecutionPayloadInvalid { parent_root: invalid_root }) if invalid_root == parent_root )); diff --git a/beacon_node/beacon_chain/tests/store_tests.rs b/beacon_node/beacon_chain/tests/store_tests.rs index 622ea7aec..6718791d7 100644 --- a/beacon_node/beacon_chain/tests/store_tests.rs +++ b/beacon_node/beacon_chain/tests/store_tests.rs @@ -11,7 +11,9 @@ use beacon_chain::{ BeaconChainError, BeaconChainTypes, BeaconSnapshot, ChainConfig, NotifyExecutionLayer, ServerSentEventHandler, WhenSlotSkipped, }; +use eth2_network_config::TRUSTED_SETUP; use fork_choice::CountUnrealized; +use kzg::TrustedSetup; use lazy_static::lazy_static; use logging::test_logger; use maplit::hashset; @@ -57,15 +59,23 @@ fn get_store_with_spec( let config = StoreConfig::default(); let log = test_logger(); - HotColdDB::open(&hot_path, &cold_path, |_, _, _| Ok(()), config, spec, log) - .expect("disk store should initialize") + HotColdDB::open( + &hot_path, + &cold_path, + None, + |_, _, _| Ok(()), + config, + spec, + log, + ) + .expect("disk store should initialize") } fn get_harness( store: Arc, LevelDB>>, validator_count: usize, ) -> TestHarness { - let harness = BeaconChainHarness::builder(MinimalEthSpec) + let harness = TestHarness::builder(MinimalEthSpec) .default_spec() .keypairs(KEYPAIRS[0..validator_count].to_vec()) .fresh_disk_store(store) @@ -565,7 +575,7 @@ async fn delete_blocks_and_states() { let store = get_store(&db_path); let validators_keypairs = types::test_utils::generate_deterministic_keypairs(LOW_VALIDATOR_COUNT); - let harness = BeaconChainHarness::builder(MinimalEthSpec) + let harness = TestHarness::builder(MinimalEthSpec) .default_spec() .keypairs(validators_keypairs) .fresh_disk_store(store.clone()) @@ -695,7 +705,7 @@ async fn multi_epoch_fork_valid_blocks_test( let store = get_store(&db_path); let validators_keypairs = types::test_utils::generate_deterministic_keypairs(LOW_VALIDATOR_COUNT); - let harness = BeaconChainHarness::builder(MinimalEthSpec) + let harness = TestHarness::builder(MinimalEthSpec) .default_spec() .keypairs(validators_keypairs) .fresh_disk_store(store) @@ -2101,10 +2111,13 @@ async fn weak_subjectivity_sync() { let store = get_store(&temp2); let spec = test_spec::(); let seconds_per_slot = spec.seconds_per_slot; + let trusted_setup: TrustedSetup = serde_json::from_reader(TRUSTED_SETUP) + .map_err(|e| println!("Unable to read trusted setup file: {}", e)) + .unwrap(); // Initialise a new beacon chain from the finalized checkpoint let beacon_chain = Arc::new( - BeaconChainBuilder::new(MinimalEthSpec) + BeaconChainBuilder::>::new(MinimalEthSpec) .store(store.clone()) .custom_spec(test_spec::()) .task_executor(harness.chain.task_executor.clone()) @@ -2123,6 +2136,7 @@ async fn weak_subjectivity_sync() { 1, ))) .monitor_validators(true, vec![], DEFAULT_INDIVIDUAL_TRACKING_THRESHOLD, log) + .trusted_setup(trusted_setup) .build() .expect("should build"), ); @@ -2300,7 +2314,7 @@ async fn finalizes_after_resuming_from_db() { let original_chain = harness.chain; - let resumed_harness = BeaconChainHarness::builder(MinimalEthSpec) + let resumed_harness = BeaconChainHarness::>::builder(MinimalEthSpec) .default_spec() .keypairs(KEYPAIRS[0..validator_count].to_vec()) .resumed_disk_store(store) @@ -2476,7 +2490,7 @@ async fn revert_minority_fork_on_resume() { drop(harness1); let resume_store = get_store_with_spec(&db_path1, spec2.clone()); - let resumed_harness = BeaconChainHarness::builder(MinimalEthSpec) + let resumed_harness = TestHarness::builder(MinimalEthSpec) .spec(spec2) .keypairs(KEYPAIRS[0..validator_count].to_vec()) .resumed_disk_store(resume_store) diff --git a/beacon_node/execution_layer/src/block_hash.rs b/beacon_node/execution_layer/src/block_hash.rs index 14993acac..c0bae9af7 100644 --- a/beacon_node/execution_layer/src/block_hash.rs +++ b/beacon_node/execution_layer/src/block_hash.rs @@ -133,6 +133,7 @@ mod test { nonce: Hash64::zero(), base_fee_per_gas: 0x036b_u64.into(), withdrawals_root: None, + excess_data_gas: None, }; let expected_rlp = "f90200a0e0a94a7a3c9617401586b1a27025d2d9671332d22d540e0af72b069170380f2aa01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d4934794ba5e000000000000000000000000000000000000a0ec3c94b18b8a1cff7d60f8d258ec723312932928626b4c9355eb4ab3568ec7f7a050f738580ed699f0469702c7ccc63ed2e51bc034be9479b7bff4e68dee84accfa029b0562f7140574dd0d50dee8a271b22e1a0a7b78fca58f7c60370d8317ba2a9b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000830200000188016345785d8a00008301553482079e42a0000000000000000000000000000000000000000000000000000000000000000088000000000000000082036b"; let expected_hash = @@ -161,6 +162,7 @@ mod test { nonce: Hash64::zero(), base_fee_per_gas: 0x036b_u64.into(), withdrawals_root: None, + excess_data_gas: None, }; let expected_rlp = "f901fda0927ca537f06c783a3a2635b8805eef1c8c2124f7444ad4a3389898dd832f2dbea01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d4934794ba5e000000000000000000000000000000000000a0e97859b065bd8dbbb4519c7cb935024de2484c2b7f881181b4360492f0b06b82a050f738580ed699f0469702c7ccc63ed2e51bc034be9479b7bff4e68dee84accfa029b0562f7140574dd0d50dee8a271b22e1a0a7b78fca58f7c60370d8317ba2a9b9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800188016345785d8a00008301553482079e42a0000000000000000000000000000000000000000000000000000000000002000088000000000000000082036b"; let expected_hash = @@ -190,6 +192,7 @@ mod test { nonce: Hash64::zero(), base_fee_per_gas: 0x34187b238_u64.into(), withdrawals_root: None, + excess_data_gas: None, }; let expected_hash = Hash256::from_str("6da69709cd5a34079b6604d29cd78fc01dacd7c6268980057ad92a2bede87351") diff --git a/beacon_node/execution_layer/src/engine_api.rs b/beacon_node/execution_layer/src/engine_api.rs index bbd0e4fd3..4e9dc4291 100644 --- a/beacon_node/execution_layer/src/engine_api.rs +++ b/beacon_node/execution_layer/src/engine_api.rs @@ -2,7 +2,7 @@ use crate::engines::ForkchoiceState; use crate::http::{ ENGINE_EXCHANGE_TRANSITION_CONFIGURATION_V1, ENGINE_FORKCHOICE_UPDATED_V1, ENGINE_FORKCHOICE_UPDATED_V2, ENGINE_GET_PAYLOAD_V1, ENGINE_GET_PAYLOAD_V2, - ENGINE_NEW_PAYLOAD_V1, ENGINE_NEW_PAYLOAD_V2, + ENGINE_GET_PAYLOAD_V3, ENGINE_NEW_PAYLOAD_V1, ENGINE_NEW_PAYLOAD_V2, ENGINE_NEW_PAYLOAD_V3, }; use crate::BlobTxConversionError; pub use ethers_core::types::Transaction; @@ -414,6 +414,9 @@ impl EngineCapabilities { if self.new_payload_v2 { response.push(ENGINE_NEW_PAYLOAD_V2); } + if self.new_payload_v3 { + response.push(ENGINE_NEW_PAYLOAD_V3); + } if self.forkchoice_updated_v1 { response.push(ENGINE_FORKCHOICE_UPDATED_V1); } @@ -426,6 +429,9 @@ impl EngineCapabilities { if self.get_payload_v2 { response.push(ENGINE_GET_PAYLOAD_V2); } + if self.get_payload_v3 { + response.push(ENGINE_GET_PAYLOAD_V3); + } if self.exchange_transition_configuration_v1 { response.push(ENGINE_EXCHANGE_TRANSITION_CONFIGURATION_V1); } diff --git a/beacon_node/execution_layer/src/engine_api/http.rs b/beacon_node/execution_layer/src/engine_api/http.rs index 8763ffd4d..e66630497 100644 --- a/beacon_node/execution_layer/src/engine_api/http.rs +++ b/beacon_node/execution_layer/src/engine_api/http.rs @@ -63,8 +63,10 @@ pub const METHOD_NOT_FOUND_CODE: i64 = -32601; pub static LIGHTHOUSE_CAPABILITIES: &[&str] = &[ ENGINE_NEW_PAYLOAD_V1, ENGINE_NEW_PAYLOAD_V2, + ENGINE_NEW_PAYLOAD_V3, ENGINE_GET_PAYLOAD_V1, ENGINE_GET_PAYLOAD_V2, + ENGINE_GET_PAYLOAD_V3, ENGINE_FORKCHOICE_UPDATED_V1, ENGINE_FORKCHOICE_UPDATED_V2, ENGINE_EXCHANGE_TRANSITION_CONFIGURATION_V1, diff --git a/beacon_node/execution_layer/src/engine_api/json_structures.rs b/beacon_node/execution_layer/src/engine_api/json_structures.rs index a2297b1f2..3a5f98779 100644 --- a/beacon_node/execution_layer/src/engine_api/json_structures.rs +++ b/beacon_node/execution_layer/src/engine_api/json_structures.rs @@ -2,13 +2,12 @@ use super::*; use serde::{Deserialize, Serialize}; use strum::EnumString; use superstruct::superstruct; +use types::blobs_sidecar::KzgCommitments; use types::{ - Blob, EthSpec, ExecutionBlockHash, FixedVector, KzgCommitment, Transaction, Unsigned, + Blobs, EthSpec, ExecutionBlockHash, ExecutionPayload, ExecutionPayloadCapella, + ExecutionPayloadEip4844, ExecutionPayloadMerge, FixedVector, Transaction, Unsigned, VariableList, Withdrawal, }; -use types::{ - ExecutionPayload, ExecutionPayloadCapella, ExecutionPayloadEip4844, ExecutionPayloadMerge, -}; #[derive(Debug, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] @@ -418,9 +417,9 @@ impl From for PayloadAttributes { #[serde(bound = "T: EthSpec", rename_all = "camelCase")] pub struct JsonBlobsBundle { pub block_hash: ExecutionBlockHash, - pub kzgs: VariableList, + pub kzgs: KzgCommitments, #[serde(with = "ssz_types::serde_utils::list_of_hex_fixed_vec")] - pub blobs: VariableList, T::MaxBlobsPerBlock>, + pub blobs: Blobs, } #[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] diff --git a/beacon_node/execution_layer/src/lib.rs b/beacon_node/execution_layer/src/lib.rs index bbf45b183..2018059cb 100644 --- a/beacon_node/execution_layer/src/lib.rs +++ b/beacon_node/execution_layer/src/lib.rs @@ -43,16 +43,15 @@ use tokio_stream::wrappers::WatchStream; use types::consts::eip4844::BLOB_TX_TYPE; use types::transaction::{AccessTuple, BlobTransaction, EcdsaSignature, SignedBlobTransaction}; use types::{ - AbstractExecPayload, BeaconStateError, Blob, ExecPayload, KzgCommitment, VersionedHash, + blobs_sidecar::{Blobs, KzgCommitments}, + ExecutionPayload, ExecutionPayloadCapella, ExecutionPayloadEip4844, ExecutionPayloadMerge, }; +use types::{AbstractExecPayload, BeaconStateError, ExecPayload, VersionedHash}; use types::{ BlindedPayload, BlockType, ChainSpec, Epoch, ExecutionBlockHash, ForkName, ProposerPreparationData, PublicKeyBytes, Signature, SignedBeaconBlock, Slot, Transaction, Uint256, }; -use types::{ - ExecutionPayload, ExecutionPayloadCapella, ExecutionPayloadEip4844, ExecutionPayloadMerge, -}; mod block_hash; mod engine_api; @@ -135,19 +134,13 @@ pub enum BlockProposalContents> { PayloadAndBlobs { payload: Payload, block_value: Uint256, - kzg_commitments: VariableList, - blobs: VariableList, T::MaxBlobsPerBlock>, + kzg_commitments: KzgCommitments, + blobs: Blobs, }, } impl> BlockProposalContents { - pub fn deconstruct( - self, - ) -> ( - Payload, - Option>, - Option, T::MaxBlobsPerBlock>>, - ) { + pub fn deconstruct(self) -> (Payload, Option>, Option>) { match self { Self::Payload { payload, @@ -2167,7 +2160,7 @@ fn ethers_tx_to_bytes( .ok_or(BlobTxConversionError::BlobVersionedHashesMissing)? .as_array() .ok_or(BlobTxConversionError::BlobVersionedHashesMissing)? - .into_iter() + .iter() .map(|versioned_hash| { let hash_bytes = eth2_serde_utils::hex::decode( versioned_hash diff --git a/beacon_node/execution_layer/src/test_utils/handle_rpc.rs b/beacon_node/execution_layer/src/test_utils/handle_rpc.rs index f5180c9a6..d8aeda8bc 100644 --- a/beacon_node/execution_layer/src/test_utils/handle_rpc.rs +++ b/beacon_node/execution_layer/src/test_utils/handle_rpc.rs @@ -152,7 +152,7 @@ pub async fn handle_rpc( ForkName::Eip4844 => { if method == ENGINE_NEW_PAYLOAD_V1 || method == ENGINE_NEW_PAYLOAD_V2 { return Err(( - format!("{} called after capella fork!", method), + format!("{} called after eip4844 fork!", method), GENERIC_ERROR_CODE, )); } diff --git a/beacon_node/http_api/src/block_id.rs b/beacon_node/http_api/src/block_id.rs index e8d463bbe..b484f4079 100644 --- a/beacon_node/http_api/src/block_id.rs +++ b/beacon_node/http_api/src/block_id.rs @@ -227,7 +227,7 @@ impl BlockId { "Blob with block root {} is not in the store", root ))), - Err(e) => Err(warp_utils::reject::beacon_chain_error(e.into())), + Err(e) => Err(warp_utils::reject::beacon_chain_error(e)), } } } diff --git a/beacon_node/http_api/src/publish_blocks.rs b/beacon_node/http_api/src/publish_blocks.rs index a9a0bc9c6..e41a90c95 100644 --- a/beacon_node/http_api/src/publish_blocks.rs +++ b/beacon_node/http_api/src/publish_blocks.rs @@ -46,9 +46,9 @@ pub async fn publish_block( block_and_blobs.into() } else { //FIXME(sean): This should probably return a specific no-blob-cached error code, beacon API coordination required - return Err(warp_utils::reject::broadcast_without_import(format!( - "no blob cached for block" - ))); + return Err(warp_utils::reject::broadcast_without_import( + "no blob cached for block".into(), + )); } } else { crate::publish_pubsub_message(network_tx, PubsubMessage::BeaconBlock(block.clone()))?; diff --git a/beacon_node/http_api/tests/common.rs b/beacon_node/http_api/tests/common.rs index ee0273579..d0eabcc26 100644 --- a/beacon_node/http_api/tests/common.rs +++ b/beacon_node/http_api/tests/common.rs @@ -1,7 +1,5 @@ use beacon_chain::{ - test_utils::{ - BeaconChainHarness, BoxedMutator, Builder as HarnessBuilder, EphemeralHarnessType, - }, + test_utils::{BeaconChainHarness, BoxedMutator, Builder, EphemeralHarnessType}, BeaconChain, BeaconChainTypes, }; use directory::DEFAULT_ROOT_DIR; @@ -57,9 +55,8 @@ pub struct ApiServer> { pub external_peer_id: PeerId, } -type Initializer = Box< - dyn FnOnce(HarnessBuilder>) -> HarnessBuilder>, ->; +type HarnessBuilder = Builder>; +type Initializer = Box) -> HarnessBuilder>; type Mutator = BoxedMutator, MemoryStore>; impl InteractiveTester { diff --git a/beacon_node/lighthouse_network/src/rpc/protocol.rs b/beacon_node/lighthouse_network/src/rpc/protocol.rs index 7f5419d16..ea48251d6 100644 --- a/beacon_node/lighthouse_network/src/rpc/protocol.rs +++ b/beacon_node/lighthouse_network/src/rpc/protocol.rs @@ -408,15 +408,12 @@ impl ProtocolId { /// Returns `true` if the given `ProtocolId` should expect `context_bytes` in the /// beginning of the stream, else returns `false`. pub fn has_context_bytes(&self) -> bool { - match self.version { - Version::V2 => match self.message_name { - Protocol::BlocksByRange | Protocol::BlocksByRoot => return true, - _ => return false, - }, - Version::V1 => match self.message_name { - Protocol::BlobsByRange | Protocol::BlobsByRoot => return true, - _ => return false, - }, + match self.message_name { + Protocol::BlocksByRange | Protocol::BlocksByRoot => { + !matches!(self.version, Version::V1) + } + Protocol::BlobsByRange | Protocol::BlobsByRoot | Protocol::LightClientBootstrap => true, + Protocol::Goodbye | Protocol::Ping | Protocol::Status | Protocol::MetaData => false, } } } diff --git a/beacon_node/network/src/beacon_processor/tests.rs b/beacon_node/network/src/beacon_processor/tests.rs index ea1a59e0d..e2b96fb47 100644 --- a/beacon_node/network/src/beacon_processor/tests.rs +++ b/beacon_node/network/src/beacon_processor/tests.rs @@ -243,7 +243,7 @@ impl TestRig { pub fn enqueue_rpc_block(&self) { let event = WorkEvent::rpc_beacon_block( self.next_block.canonical_root(), - self.next_block.clone(), + self.next_block.clone().into(), std::time::Duration::default(), BlockProcessType::ParentLookup { chain_hash: Hash256::random(), @@ -255,7 +255,7 @@ impl TestRig { pub fn enqueue_single_lookup_rpc_block(&self) { let event = WorkEvent::rpc_beacon_block( self.next_block.canonical_root(), - self.next_block.clone(), + self.next_block.clone().into(), std::time::Duration::default(), BlockProcessType::SingleBlock { id: 1 }, ); diff --git a/beacon_node/network/src/service/tests.rs b/beacon_node/network/src/service/tests.rs index f0dd0e75f..a21424d7d 100644 --- a/beacon_node/network/src/service/tests.rs +++ b/beacon_node/network/src/service/tests.rs @@ -3,14 +3,16 @@ mod tests { use crate::persisted_dht::load_dht; use crate::{NetworkConfig, NetworkService}; - use beacon_chain::test_utils::BeaconChainHarness; + use beacon_chain::test_utils::EphemeralHarnessType; use lighthouse_network::Enr; use slog::{o, Drain, Level, Logger}; use sloggers::{null::NullLoggerBuilder, Build}; use std::str::FromStr; use std::sync::Arc; use tokio::runtime::Runtime; - use types::MinimalEthSpec; + use types::MinimalEthSpec as E; + + type BeaconChainHarness = beacon_chain::test_utils::BeaconChainHarness>; fn get_logger(actual_log: bool) -> Logger { if actual_log { @@ -34,7 +36,7 @@ mod tests { fn test_dht_persistence() { let log = get_logger(false); - let beacon_chain = BeaconChainHarness::builder(MinimalEthSpec) + let beacon_chain = BeaconChainHarness::builder(E) .default_spec() .deterministic_keypairs(8) .fresh_ephemeral_store() diff --git a/beacon_node/network/src/sync/block_lookups/single_block_lookup.rs b/beacon_node/network/src/sync/block_lookups/single_block_lookup.rs index 0ba08571f..02482d619 100644 --- a/beacon_node/network/src/sync/block_lookups/single_block_lookup.rs +++ b/beacon_node/network/src/sync/block_lookups/single_block_lookup.rs @@ -204,8 +204,10 @@ impl slog::Value for SingleBlockRequest { #[cfg(test)] mod tests { use super::*; - use types::test_utils::{SeedableRng, TestRandom, XorShiftRng}; - use types::{MinimalEthSpec as E, SignedBeaconBlock}; + use types::{ + test_utils::{SeedableRng, TestRandom, XorShiftRng}, + MinimalEthSpec as E, SignedBeaconBlock, + }; fn rand_block() -> SignedBeaconBlock { let mut rng = XorShiftRng::from_seed([42; 16]); diff --git a/beacon_node/network/src/sync/block_lookups/tests.rs b/beacon_node/network/src/sync/block_lookups/tests.rs index 004d0479a..9bbd4790d 100644 --- a/beacon_node/network/src/sync/block_lookups/tests.rs +++ b/beacon_node/network/src/sync/block_lookups/tests.rs @@ -6,17 +6,23 @@ use crate::NetworkMessage; use super::*; -use beacon_chain::builder::Witness; -use beacon_chain::eth1_chain::CachingEth1Backend; +use beacon_chain::{ + builder::Witness, + eth1_chain::CachingEth1Backend, + test_utils::{build_log, BeaconChainHarness, EphemeralHarnessType}, +}; +pub use genesis::{interop_genesis_state, DEFAULT_ETH1_BLOCK_HASH}; use lighthouse_network::{NetworkGlobals, Request}; -use slog::{Drain, Level}; -use slot_clock::SystemTimeSlotClock; +use slot_clock::TestingSlotClock; +use std::time::Duration; use store::MemoryStore; use tokio::sync::mpsc; -use types::test_utils::{SeedableRng, TestRandom, XorShiftRng}; -use types::MinimalEthSpec as E; +use types::{ + test_utils::{SeedableRng, TestRandom, XorShiftRng}, + MinimalEthSpec as E, SignedBeaconBlock, +}; -type T = Witness, E, MemoryStore, MemoryStore>; +type T = Witness, E, MemoryStore, MemoryStore>; struct TestRig { beacon_processor_rx: mpsc::Receiver>, @@ -27,18 +33,18 @@ struct TestRig { const D: Duration = Duration::new(0, 0); impl TestRig { - fn test_setup(log_level: Option) -> (BlockLookups, SyncNetworkContext, Self) { - let log = { - let decorator = slog_term::TermDecorator::new().build(); - let drain = slog_term::FullFormat::new(decorator).build().fuse(); - let drain = slog_async::Async::new(drain).build().fuse(); + fn test_setup(enable_log: bool) -> (BlockLookups, SyncNetworkContext, Self) { + let log = build_log(slog::Level::Debug, enable_log); - if let Some(log_level) = log_level { - slog::Logger::root(drain.filter_level(log_level).fuse(), slog::o!()) - } else { - slog::Logger::root(drain.filter(|_| false).fuse(), slog::o!()) - } - }; + // Initialise a new beacon chain + let harness = BeaconChainHarness::>::builder(E::default()) + .default_spec() + .logger(log.clone()) + .deterministic_keypairs(1) + .fresh_ephemeral_store() + .build(); + + let chain = harness.chain; let (beacon_processor_tx, beacon_processor_rx) = mpsc::channel(100); let (network_tx, network_rx) = mpsc::unbounded_channel(); @@ -147,7 +153,7 @@ impl TestRig { #[test] fn test_single_block_lookup_happy_path() { - let (mut bl, mut cx, mut rig) = TestRig::test_setup(None); + let (mut bl, mut cx, mut rig) = TestRig::test_setup(false); let block = rig.rand_block(); let peer_id = PeerId::random(); @@ -175,7 +181,7 @@ fn test_single_block_lookup_happy_path() { #[test] fn test_single_block_lookup_empty_response() { - let (mut bl, mut cx, mut rig) = TestRig::test_setup(None); + let (mut bl, mut cx, mut rig) = TestRig::test_setup(false); let block_hash = Hash256::random(); let peer_id = PeerId::random(); @@ -193,7 +199,7 @@ fn test_single_block_lookup_empty_response() { #[test] fn test_single_block_lookup_wrong_response() { - let (mut bl, mut cx, mut rig) = TestRig::test_setup(None); + let (mut bl, mut cx, mut rig) = TestRig::test_setup(false); let block_hash = Hash256::random(); let peer_id = PeerId::random(); @@ -215,7 +221,7 @@ fn test_single_block_lookup_wrong_response() { #[test] fn test_single_block_lookup_failure() { - let (mut bl, mut cx, mut rig) = TestRig::test_setup(None); + let (mut bl, mut cx, mut rig) = TestRig::test_setup(false); let block_hash = Hash256::random(); let peer_id = PeerId::random(); @@ -232,7 +238,7 @@ fn test_single_block_lookup_failure() { #[test] fn test_single_block_lookup_becomes_parent_request() { - let (mut bl, mut cx, mut rig) = TestRig::test_setup(None); + let (mut bl, mut cx, mut rig) = TestRig::test_setup(false); let block = rig.rand_block(); let peer_id = PeerId::random(); @@ -261,7 +267,7 @@ fn test_single_block_lookup_becomes_parent_request() { #[test] fn test_parent_lookup_happy_path() { - let (mut bl, mut cx, mut rig) = TestRig::test_setup(None); + let (mut bl, mut cx, mut rig) = TestRig::test_setup(false); let parent = rig.rand_block(); let block = rig.block_with_parent(parent.canonical_root()); @@ -289,7 +295,7 @@ fn test_parent_lookup_happy_path() { #[test] fn test_parent_lookup_wrong_response() { - let (mut bl, mut cx, mut rig) = TestRig::test_setup(None); + let (mut bl, mut cx, mut rig) = TestRig::test_setup(false); let parent = rig.rand_block(); let block = rig.block_with_parent(parent.canonical_root()); @@ -326,7 +332,7 @@ fn test_parent_lookup_wrong_response() { #[test] fn test_parent_lookup_empty_response() { - let (mut bl, mut cx, mut rig) = TestRig::test_setup(None); + let (mut bl, mut cx, mut rig) = TestRig::test_setup(false); let parent = rig.rand_block(); let block = rig.block_with_parent(parent.canonical_root()); @@ -358,7 +364,7 @@ fn test_parent_lookup_empty_response() { #[test] fn test_parent_lookup_rpc_failure() { - let (mut bl, mut cx, mut rig) = TestRig::test_setup(None); + let (mut bl, mut cx, mut rig) = TestRig::test_setup(false); let parent = rig.rand_block(); let block = rig.block_with_parent(parent.canonical_root()); @@ -370,7 +376,15 @@ fn test_parent_lookup_rpc_failure() { let id1 = rig.expect_parent_request(); // The request fails. It should be tried again. - bl.parent_lookup_failed(id1, peer_id, &mut cx); + bl.parent_lookup_failed( + id1, + peer_id, + &mut cx, + RPCError::ErrorResponse( + RPCResponseErrorCode::ResourceUnavailable, + "older than eip4844".into(), + ), + ); let id2 = rig.expect_parent_request(); // Send the right block this time. @@ -389,7 +403,7 @@ fn test_parent_lookup_rpc_failure() { #[test] fn test_parent_lookup_too_many_attempts() { - let (mut bl, mut cx, mut rig) = TestRig::test_setup(None); + let (mut bl, mut cx, mut rig) = TestRig::test_setup(false); let parent = rig.rand_block(); let block = rig.block_with_parent(parent.canonical_root()); @@ -404,7 +418,15 @@ fn test_parent_lookup_too_many_attempts() { // make sure every error is accounted for 0 => { // The request fails. It should be tried again. - bl.parent_lookup_failed(id, peer_id, &mut cx); + bl.parent_lookup_failed( + id, + peer_id, + &mut cx, + RPCError::ErrorResponse( + RPCResponseErrorCode::ResourceUnavailable, + "older than eip4844".into(), + ), + ); } _ => { // Send a bad block this time. It should be tried again. @@ -425,7 +447,7 @@ fn test_parent_lookup_too_many_attempts() { #[test] fn test_parent_lookup_too_many_download_attempts_no_blacklist() { - let (mut bl, mut cx, mut rig) = TestRig::test_setup(None); + let (mut bl, mut cx, mut rig) = TestRig::test_setup(false); let parent = rig.rand_block(); let block = rig.block_with_parent(parent.canonical_root()); @@ -439,7 +461,15 @@ fn test_parent_lookup_too_many_download_attempts_no_blacklist() { let id = rig.expect_parent_request(); if i % 2 != 0 { // The request fails. It should be tried again. - bl.parent_lookup_failed(id, peer_id, &mut cx); + bl.parent_lookup_failed( + id, + peer_id, + &mut cx, + RPCError::ErrorResponse( + RPCResponseErrorCode::ResourceUnavailable, + "older than eip4844".into(), + ), + ); } else { // Send a bad block this time. It should be tried again. let bad_block = rig.rand_block(); @@ -459,7 +489,7 @@ fn test_parent_lookup_too_many_download_attempts_no_blacklist() { #[test] fn test_parent_lookup_too_many_processing_attempts_must_blacklist() { const PROCESSING_FAILURES: u8 = parent_lookup::PARENT_FAIL_TOLERANCE / 2 + 1; - let (mut bl, mut cx, mut rig) = TestRig::test_setup(None); + let (mut bl, mut cx, mut rig) = TestRig::test_setup(false); let parent = Arc::new(rig.rand_block()); let block = rig.block_with_parent(parent.canonical_root()); @@ -473,7 +503,15 @@ fn test_parent_lookup_too_many_processing_attempts_must_blacklist() { for _ in 0..(parent_lookup::PARENT_FAIL_TOLERANCE - PROCESSING_FAILURES) { let id = rig.expect_parent_request(); // The request fails. It should be tried again. - bl.parent_lookup_failed(id, peer_id, &mut cx); + bl.parent_lookup_failed( + id, + peer_id, + &mut cx, + RPCError::ErrorResponse( + RPCResponseErrorCode::ResourceUnavailable, + "older than eip4844".into(), + ), + ); } // Now fail processing a block in the parent request @@ -493,7 +531,7 @@ fn test_parent_lookup_too_many_processing_attempts_must_blacklist() { #[test] fn test_parent_lookup_too_deep() { - let (mut bl, mut cx, mut rig) = TestRig::test_setup(None); + let (mut bl, mut cx, mut rig) = TestRig::test_setup(false); let mut blocks = Vec::>::with_capacity(parent_lookup::PARENT_DEPTH_TOLERANCE); while blocks.len() < parent_lookup::PARENT_DEPTH_TOLERANCE { @@ -532,7 +570,7 @@ fn test_parent_lookup_too_deep() { #[test] fn test_parent_lookup_disconnection() { - let (mut bl, mut cx, mut rig) = TestRig::test_setup(None); + let (mut bl, mut cx, mut rig) = TestRig::test_setup(false); let peer_id = PeerId::random(); let trigger_block = rig.rand_block(); bl.search_parent( @@ -547,7 +585,7 @@ fn test_parent_lookup_disconnection() { #[test] fn test_single_block_lookup_ignored_response() { - let (mut bl, mut cx, mut rig) = TestRig::test_setup(None); + let (mut bl, mut cx, mut rig) = TestRig::test_setup(false); let block = rig.rand_block(); let peer_id = PeerId::random(); @@ -576,7 +614,7 @@ fn test_single_block_lookup_ignored_response() { #[test] fn test_parent_lookup_ignored_response() { - let (mut bl, mut cx, mut rig) = TestRig::test_setup(None); + let (mut bl, mut cx, mut rig) = TestRig::test_setup(false); let parent = rig.rand_block(); let block = rig.block_with_parent(parent.canonical_root()); @@ -601,7 +639,7 @@ fn test_parent_lookup_ignored_response() { /// This is a regression test. #[test] fn test_same_chain_race_condition() { - let (mut bl, mut cx, mut rig) = TestRig::test_setup(Some(Level::Debug)); + let (mut bl, mut cx, mut rig) = TestRig::test_setup(true); #[track_caller] fn parent_lookups_consistency(bl: &BlockLookups) { @@ -636,12 +674,12 @@ fn test_same_chain_race_condition() { let peer_id = PeerId::random(); let trigger_block = blocks.pop().unwrap(); let chain_hash = trigger_block.canonical_root(); - bl.search_parent(chain_hash, trigger_block.clone(), peer_id, &mut cx); + bl.search_parent(chain_hash, trigger_block.clone().into(), peer_id, &mut cx); for (i, block) in blocks.into_iter().rev().enumerate() { let id = rig.expect_parent_request(); // the block - bl.parent_lookup_response(id, peer_id, Some(block.clone()), D, &mut cx); + bl.parent_lookup_response(id, peer_id, Some(block.clone().into()), D, &mut cx); // the stream termination bl.parent_lookup_response(id, peer_id, None, D, &mut cx); // the processing request @@ -651,7 +689,11 @@ fn test_same_chain_race_condition() { // one block was removed bl.parent_block_processed(chain_hash, BlockError::BlockIsAlreadyKnown.into(), &mut cx) } else { - bl.parent_block_processed(chain_hash, BlockError::ParentUnknown(block).into(), &mut cx) + bl.parent_block_processed( + chain_hash, + BlockError::ParentUnknown(block.into()).into(), + &mut cx, + ) } parent_lookups_consistency(&bl) } @@ -661,7 +703,7 @@ fn test_same_chain_race_condition() { // Try to get this block again while the chain is being processed. We should not request it again. let peer_id = PeerId::random(); - bl.search_parent(chain_hash, trigger_block, peer_id, &mut cx); + bl.search_parent(chain_hash, trigger_block.into(), peer_id, &mut cx); parent_lookups_consistency(&bl); let process_result = BatchProcessResult::Success { diff --git a/beacon_node/network/src/sync/manager.rs b/beacon_node/network/src/sync/manager.rs index 6b3a7b5de..fa171cd04 100644 --- a/beacon_node/network/src/sync/manager.rs +++ b/beacon_node/network/src/sync/manager.rs @@ -803,15 +803,15 @@ impl SyncManager { peer_id: PeerId, block_or_blob: BlockOrBlobs, ) { - if let Some((chain_id, batch_id, block_responses)) = self + if let Some((chain_id, resp)) = self .network .range_sync_block_and_blob_response(id, block_or_blob) { - match block_responses { + match resp.responses { Ok(blocks) => { for block in blocks .into_iter() - .map(|block| Some(block)) + .map(Some) // chain the stream terminator .chain(vec![None]) { @@ -819,7 +819,7 @@ impl SyncManager { &mut self.network, peer_id, chain_id, - batch_id, + resp.batch_id, id, block, ); @@ -831,7 +831,7 @@ impl SyncManager { // With time we will want to downgrade this log warn!( self.log, "Blocks and blobs request for range received invalid data"; - "peer_id" => %peer_id, "batch_id" => batch_id, "error" => e + "peer_id" => %peer_id, "batch_id" => resp.batch_id, "error" => e ); // TODO: penalize the peer for being a bad boy let id = RequestId::RangeBlobs { id }; @@ -849,21 +849,21 @@ impl SyncManager { peer_id: PeerId, block_or_blob: BlockOrBlobs, ) { - if let Some((batch_id, block_responses)) = self + if let Some(resp) = self .network .backfill_sync_block_and_blob_response(id, block_or_blob) { - match block_responses { + match resp.responses { Ok(blocks) => { for block in blocks .into_iter() - .map(|block| Some(block)) + .map(Some) // chain the stream terminator .chain(vec![None]) { match self.backfill_sync.on_block_response( &mut self.network, - batch_id, + resp.batch_id, &peer_id, id, block, @@ -883,7 +883,7 @@ impl SyncManager { // With time we will want to downgrade this log warn!( self.log, "Blocks and blobs request for backfill received invalid data"; - "peer_id" => %peer_id, "batch_id" => batch_id, "error" => e + "peer_id" => %peer_id, "batch_id" => resp.batch_id, "error" => e ); // TODO: penalize the peer for being a bad boy let id = RequestId::BackFillBlobs { id }; diff --git a/beacon_node/network/src/sync/network_context.rs b/beacon_node/network/src/sync/network_context.rs index 2a0f2ea95..ef8f872cb 100644 --- a/beacon_node/network/src/sync/network_context.rs +++ b/beacon_node/network/src/sync/network_context.rs @@ -20,6 +20,17 @@ use std::sync::Arc; use tokio::sync::mpsc; use types::{BlobsSidecar, EthSpec, SignedBeaconBlock}; +pub struct BlocksAndBlobsByRangeResponse { + pub batch_id: BatchId, + pub responses: Result>, &'static str>, +} + +pub struct BlocksAndBlobsByRangeRequest { + pub chain_id: ChainId, + pub batch_id: BatchId, + pub block_blob_info: BlocksAndBlobsRequestInfo, +} + /// Wraps a Network channel to employ various RPC related network functionality for the Sync manager. This includes management of a global RPC request Id. pub struct SyncNetworkContext { /// The network channel to relay messages to the Network service. @@ -38,8 +49,7 @@ pub struct SyncNetworkContext { backfill_requests: FnvHashMap, /// BlocksByRange requests paired with BlobsByRange requests made by the range. - range_blocks_and_blobs_requests: - FnvHashMap)>, + range_blocks_and_blobs_requests: FnvHashMap>, /// BlocksByRange requests paired with BlobsByRange requests made by the backfill sync. backfill_blocks_and_blobs_requests: @@ -198,8 +208,14 @@ impl SyncNetworkContext { request_id, })?; let block_blob_info = BlocksAndBlobsRequestInfo::default(); - self.range_blocks_and_blobs_requests - .insert(id, (chain_id, batch_id, block_blob_info)); + self.range_blocks_and_blobs_requests.insert( + id, + BlocksAndBlobsByRangeRequest { + chain_id, + batch_id, + block_blob_info, + }, + ); Ok(id) } } @@ -290,22 +306,30 @@ impl SyncNetworkContext { &mut self, request_id: Id, block_or_blob: BlockOrBlobs, - ) -> Option<( - ChainId, - BatchId, - Result>, &'static str>, - )> { + ) -> Option<(ChainId, BlocksAndBlobsByRangeResponse)> { match self.range_blocks_and_blobs_requests.entry(request_id) { Entry::Occupied(mut entry) => { - let (_, _, info) = entry.get_mut(); + let req = entry.get_mut(); + let info = &mut req.block_blob_info; match block_or_blob { BlockOrBlobs::Block(maybe_block) => info.add_block_response(maybe_block), BlockOrBlobs::Blobs(maybe_sidecar) => info.add_sidecar_response(maybe_sidecar), } if info.is_finished() { // If the request is finished, dequeue everything - let (chain_id, batch_id, info) = entry.remove(); - Some((chain_id, batch_id, info.into_responses())) + let BlocksAndBlobsByRangeRequest { + chain_id, + batch_id, + block_blob_info, + } = entry.remove(); + + Some(( + chain_id, + BlocksAndBlobsByRangeResponse { + batch_id, + responses: block_blob_info.into_responses(), + }, + )) } else { None } @@ -323,7 +347,7 @@ impl SyncNetworkContext { ByRangeRequestType::BlocksAndBlobs => self .range_blocks_and_blobs_requests .remove(&request_id) - .map(|(chain_id, batch_id, _info)| (chain_id, batch_id)), + .map(|req| (req.chain_id, req.batch_id)), ByRangeRequestType::Blocks => self.range_requests.remove(&request_id), } } @@ -349,20 +373,19 @@ impl SyncNetworkContext { is_stream_terminator: bool, ) -> Option { if is_stream_terminator { - self.backfill_requests - .remove(&request_id) - .map(|batch_id| batch_id) + self.backfill_requests.remove(&request_id) } else { self.backfill_requests.get(&request_id).copied() } } - /// Received a blocks by range response for a request that couples blocks and blobs. + /// Received a blocks by range or blobs by range response for a request that couples blocks ' + /// and blobs. pub fn backfill_sync_block_and_blob_response( &mut self, request_id: Id, block_or_blob: BlockOrBlobs, - ) -> Option<(BatchId, Result>, &'static str>)> { + ) -> Option> { match self.backfill_blocks_and_blobs_requests.entry(request_id) { Entry::Occupied(mut entry) => { let (_, info) = entry.get_mut(); @@ -373,7 +396,10 @@ impl SyncNetworkContext { if info.is_finished() { // If the request is finished, dequeue everything let (batch_id, info) = entry.remove(); - Some((batch_id, info.into_responses())) + Some(BlocksAndBlobsByRangeResponse { + batch_id, + responses: info.into_responses(), + }) } else { None } @@ -534,16 +560,20 @@ impl SyncNetworkContext { /// Check whether a batch for this epoch (and only this epoch) should request just blocks or /// blocks and blobs. + #[allow(unused)] pub fn batch_type(&self, epoch: types::Epoch) -> ByRangeRequestType { + // Induces a compile time panic if this doesn't hold true. + #[allow(clippy::assertions_on_constants)] const _: () = assert!( super::backfill_sync::BACKFILL_EPOCHS_PER_BATCH == 1 && super::range_sync::EPOCHS_PER_BATCH == 1, "To deal with alignment with 4844 boundaries, batches need to be of just one epoch" ); + #[cfg(test)] { // Keep tests only for blocks. - return ByRangeRequestType::Blocks; + ByRangeRequestType::Blocks } #[cfg(not(test))] { diff --git a/beacon_node/network/src/sync/range_sync/chain.rs b/beacon_node/network/src/sync/range_sync/chain.rs index ea78cd3c5..262e14e4e 100644 --- a/beacon_node/network/src/sync/range_sync/chain.rs +++ b/beacon_node/network/src/sync/range_sync/chain.rs @@ -615,6 +615,7 @@ impl SyncingChain { /// /// If a previous batch has been validated and it had been re-processed, penalize the original /// peer. + #[allow(clippy::modulo_one)] fn advance_chain(&mut self, network: &mut SyncNetworkContext, validating_epoch: Epoch) { // make sure this epoch produces an advancement if validating_epoch <= self.start_epoch { diff --git a/beacon_node/network/src/sync/range_sync/range.rs b/beacon_node/network/src/sync/range_sync/range.rs index e3fceef66..b53fa872d 100644 --- a/beacon_node/network/src/sync/range_sync/range.rs +++ b/beacon_node/network/src/sync/range_sync/range.rs @@ -372,26 +372,27 @@ where #[cfg(test)] mod tests { - use crate::service::RequestId; - use crate::sync::range_sync::ByRangeRequestType; - use crate::NetworkMessage; - use super::*; - use crate::beacon_processor::WorkEvent as BeaconWorkEvent; - use beacon_chain::builder::Witness; - use beacon_chain::eth1_chain::CachingEth1Backend; - use beacon_chain::parking_lot::RwLock; - use beacon_chain::EngineState; - use lighthouse_network::rpc::BlocksByRangeRequest; - use lighthouse_network::Request; - use lighthouse_network::{rpc::StatusMessage, NetworkGlobals}; - use slog::{o, Drain}; - use tokio::sync::mpsc; - use slot_clock::SystemTimeSlotClock; - use std::collections::HashSet; - use std::sync::Arc; + use crate::beacon_processor::WorkEvent as BeaconWorkEvent; + use crate::service::RequestId; + use crate::NetworkMessage; + use beacon_chain::{ + builder::Witness, + eth1_chain::CachingEth1Backend, + parking_lot::RwLock, + test_utils::{build_log, BeaconChainHarness, EphemeralHarnessType}, + EngineState, + }; + use lighthouse_network::{ + rpc::{BlocksByRangeRequest, StatusMessage}, + NetworkGlobals, Request, + }; + use slog::o; + use slot_clock::TestingSlotClock; + use std::{collections::HashSet, sync::Arc}; use store::MemoryStore; + use tokio::sync::mpsc; use types::{Hash256, MinimalEthSpec as E}; #[derive(Debug)] @@ -439,19 +440,7 @@ mod tests { } type TestBeaconChainType = - Witness, E, MemoryStore, MemoryStore>; - - fn build_log(level: slog::Level, enabled: bool) -> slog::Logger { - let decorator = slog_term::TermDecorator::new().build(); - let drain = slog_term::FullFormat::new(decorator).build().fuse(); - let drain = slog_async::Async::new(drain).build().fuse(); - - if enabled { - slog::Logger::root(drain.filter_level(level).fuse(), o!()) - } else { - slog::Logger::root(drain.filter(|_| false).fuse(), o!()) - } - } + Witness, E, MemoryStore, MemoryStore>; #[allow(unused)] struct TestRig { @@ -593,11 +582,20 @@ mod tests { } fn range(log_enabled: bool) -> (TestRig, RangeSync) { - let chain = Arc::new(FakeStorage::default()); let log = build_log(slog::Level::Trace, log_enabled); + // Initialise a new beacon chain + let harness = BeaconChainHarness::>::builder(E::default()) + .default_spec() + .logger(log.clone()) + .deterministic_keypairs(1) + .fresh_ephemeral_store() + .build(); + let chain = harness.chain; + + let fake_store = Arc::new(FakeStorage::default()); let (beacon_processor_tx, beacon_processor_rx) = mpsc::channel(10); let range_sync = RangeSync::::new( - chain.clone(), + fake_store.clone(), log.new(o!("component" => "range")), ); let (network_tx, network_rx) = mpsc::unbounded_channel(); @@ -612,7 +610,7 @@ mod tests { let test_rig = TestRig { log, beacon_processor_rx, - chain, + chain: fake_store, cx, network_rx, globals, @@ -687,7 +685,7 @@ mod tests { range.add_peer(&mut rig.cx, local_info, peer1, head_info); let ((chain1, batch1), id1) = match rig.grab_request(&peer1).0 { RequestId::Sync(crate::sync::manager::RequestId::RangeBlocks { id }) => { - (rig.cx.range_sync_response(id, true).unwrap(), id) + (rig.cx.range_sync_block_response(id, true).unwrap(), id) } other => panic!("unexpected request {:?}", other), }; @@ -706,7 +704,7 @@ mod tests { range.add_peer(&mut rig.cx, local_info, peer2, finalized_info); let ((chain2, batch2), id2) = match rig.grab_request(&peer2).0 { RequestId::Sync(crate::sync::manager::RequestId::RangeBlocks { id }) => { - (rig.cx.range_sync_response(id, true).unwrap(), id) + (rig.cx.range_sync_block_response(id, true).unwrap(), id) } other => panic!("unexpected request {:?}", other), }; diff --git a/beacon_node/store/src/hot_cold_store.rs b/beacon_node/store/src/hot_cold_store.rs index 3128f6596..fba0acad0 100644 --- a/beacon_node/store/src/hot_cold_store.rs +++ b/beacon_node/store/src/hot_cold_store.rs @@ -1907,13 +1907,12 @@ impl, Cold: ItemStore> HotColdDB let margin_epochs = self.get_config().blob_prune_margin_epochs; let end_epoch = earliest_prunable_epoch - margin_epochs; - if !force { - if last_pruned_epoch.as_u64() + self.get_config().epochs_per_blob_prune + if !force + && last_pruned_epoch.as_u64() + self.get_config().epochs_per_blob_prune > end_epoch.as_u64() - { - info!(self.log, "Blobs sidecars are pruned"); - return Ok(()); - } + { + info!(self.log, "Blobs sidecars are pruned"); + return Ok(()); } // Iterate block roots forwards from the oldest blob slot. diff --git a/common/eth2_network_config/built_in_network_configs/eip4844/config.yaml b/common/eth2_network_config/built_in_network_configs/eip4844/config.yaml index 156fea17a..f7334b618 100644 --- a/common/eth2_network_config/built_in_network_configs/eip4844/config.yaml +++ b/common/eth2_network_config/built_in_network_configs/eip4844/config.yaml @@ -1,6 +1,6 @@ # Extends the mainnet preset PRESET_BASE: 'mainnet' -CONFIG_NAME: testnet # needs to exist because of Prysm. Otherwise it conflicts with mainnet genesis +CONFIG_NAME: 'eip4844' # needs to exist because of Prysm. Otherwise it conflicts with mainnet genesis and needs to match configuration in common_eth2_config/src/lib.rs to pass lh ci. # Genesis # --------------------------------------------------------------- diff --git a/common/eth2_network_config/src/lib.rs b/common/eth2_network_config/src/lib.rs index d708b7854..1a1d2a432 100644 --- a/common/eth2_network_config/src/lib.rs +++ b/common/eth2_network_config/src/lib.rs @@ -362,11 +362,12 @@ mod tests { let base_dir = temp_dir.path().join("my_testnet"); let deposit_contract_deploy_block = 42; - let testnet: Eth2NetworkConfig = Eth2NetworkConfig { + let testnet = Eth2NetworkConfig { deposit_contract_deploy_block, boot_enr, genesis_state_bytes: genesis_state.as_ref().map(Encode::as_ssz_bytes), config, + kzg_trusted_setup: None, }; testnet diff --git a/common/slot_clock/src/lib.rs b/common/slot_clock/src/lib.rs index 183f5c931..760b2f9cd 100644 --- a/common/slot_clock/src/lib.rs +++ b/common/slot_clock/src/lib.rs @@ -7,8 +7,8 @@ mod system_time_slot_clock; use std::time::Duration; -pub use crate::manual_slot_clock::ManualSlotClock; pub use crate::manual_slot_clock::ManualSlotClock as TestingSlotClock; +pub use crate::manual_slot_clock::ManualSlotClock; pub use crate::system_time_slot_clock::SystemTimeSlotClock; pub use metrics::scrape_for_metrics; use types::consts::merge::INTERVALS_PER_SLOT; diff --git a/consensus/ssz/src/decode/impls.rs b/consensus/ssz/src/decode/impls.rs index 3d36fb437..f58ecd3b8 100644 --- a/consensus/ssz/src/decode/impls.rs +++ b/consensus/ssz/src/decode/impls.rs @@ -479,7 +479,7 @@ pub fn decode_list_of_variable_length_items ) -> Result { if bytes.is_empty() { return Container::try_from_iter(iter::empty()).map_err(|e| { - DecodeError::BytesInvalid(format!("Error trying to collect empty list: {:?}", e)) + DecodeError::BytesInvalid(format!("Error trying to collect empty list: {e:?}")) }); } @@ -494,8 +494,7 @@ pub fn decode_list_of_variable_length_items if max_len.map_or(false, |max| num_items > max) { return Err(DecodeError::BytesInvalid(format!( - "Variable length list of {} items exceeds maximum of {:?}", - num_items, max_len + "Variable length list of {num_items} items exceeds maximum of {max_len:?}", ))); } @@ -519,7 +518,7 @@ pub fn decode_list_of_variable_length_items }), |iter| iter.try_collect(), )? - .map_err(|e| DecodeError::BytesInvalid(format!("Error collecting into container: {:?}", e))) + .map_err(|e| DecodeError::BytesInvalid(format!("Error collecting into container: {e:?}"))) } #[cfg(test)] diff --git a/consensus/state_processing/src/per_block_processing/eip4844/eip4844.rs b/consensus/state_processing/src/per_block_processing/eip4844/eip4844.rs index be4afc57d..51dead06d 100644 --- a/consensus/state_processing/src/per_block_processing/eip4844/eip4844.rs +++ b/consensus/state_processing/src/per_block_processing/eip4844/eip4844.rs @@ -49,7 +49,7 @@ pub fn verify_kzg_commitments_against_transactions( .flatten() // Need to use `itertools::zip_longest` here because just zipping hides if one iter is shorter // and `itertools::zip_eq` panics. - .zip_longest(kzg_commitments.into_iter()) + .zip_longest(kzg_commitments.iter()) .enumerate() .map(|(index, next)| match next { EitherOrBoth::Both(hash, commitment) => Ok((hash?, commitment)), diff --git a/consensus/state_processing/src/per_block_processing/tests.rs b/consensus/state_processing/src/per_block_processing/tests.rs index b7d28832d..db0b91d03 100644 --- a/consensus/state_processing/src/per_block_processing/tests.rs +++ b/consensus/state_processing/src/per_block_processing/tests.rs @@ -34,7 +34,7 @@ async fn get_harness( // Set the state and block to be in the last slot of the `epoch_offset`th epoch. let last_slot_of_epoch = (MainnetEthSpec::genesis_epoch() + epoch_offset).end_slot(E::slots_per_epoch()); - let harness = BeaconChainHarness::builder(E::default()) + let harness = BeaconChainHarness::>::builder(E::default()) .default_spec() .keypairs(KEYPAIRS[0..num_validators].to_vec()) .fresh_ephemeral_store() diff --git a/consensus/tree_hash/src/lib.rs b/consensus/tree_hash/src/lib.rs index ec40de916..d9ab4bd70 100644 --- a/consensus/tree_hash/src/lib.rs +++ b/consensus/tree_hash/src/lib.rs @@ -97,7 +97,7 @@ fn get_zero_hash(height: usize) -> &'static [u8] { if height <= ZERO_HASHES_MAX_INDEX { &ZERO_HASHES[height] } else { - panic!("Tree exceeds MAX_TREE_DEPTH of {}", ZERO_HASHES_MAX_INDEX) + panic!("Tree exceeds MAX_TREE_DEPTH of {ZERO_HASHES_MAX_INDEX}") } } diff --git a/consensus/types/Cargo.toml b/consensus/types/Cargo.toml index 97ce90de6..1ddf6058e 100644 --- a/consensus/types/Cargo.toml +++ b/consensus/types/Cargo.toml @@ -9,7 +9,6 @@ name = "benches" harness = false [dependencies] -serde-big-array = {version = "0.3.2", features = ["const-generics"]} merkle_proof = { path = "../../consensus/merkle_proof" } bls = { path = "../../crypto/bls", features = ["arbitrary"] } kzg = { path = "../../crypto/kzg", features = ["arbitrary"] } @@ -39,10 +38,10 @@ cached_tree_hash = { path = "../cached_tree_hash" } serde_yaml = "0.8.13" tempfile = "3.1.0" derivative = "2.1.1" -rusqlite = { version = "0.25.3", features = ["bundled"], optional = true } # The arbitrary dependency is enabled by default since Capella to avoid complexity introduced by # `AbstractExecPayload` arbitrary = { version = "1.0", features = ["derive"] } +rusqlite = { version = "0.28.0", features = ["bundled"], optional = true } eth2_serde_utils = "0.1.1" regex = "1.5.5" lazy_static = "1.4.0" diff --git a/consensus/types/src/beacon_block_body.rs b/consensus/types/src/beacon_block_body.rs index dc94ecdd5..11a47ccb0 100644 --- a/consensus/types/src/beacon_block_body.rs +++ b/consensus/types/src/beacon_block_body.rs @@ -1,5 +1,5 @@ -use crate::test_utils::TestRandom; use crate::*; +use crate::{blobs_sidecar::KzgCommitments, test_utils::TestRandom}; use derivative::Derivative; use serde_derive::{Deserialize, Serialize}; use ssz_derive::{Decode, Encode}; @@ -69,7 +69,7 @@ pub struct BeaconBlockBody = FullPay pub bls_to_execution_changes: VariableList, #[superstruct(only(Eip4844))] - pub blob_kzg_commitments: VariableList, + pub blob_kzg_commitments: KzgCommitments, #[superstruct(only(Base, Altair))] #[ssz(skip_serializing, skip_deserializing)] #[tree_hash(skip_hashing)] diff --git a/consensus/types/src/blobs_sidecar.rs b/consensus/types/src/blobs_sidecar.rs index 06bcba4ff..e2560fb30 100644 --- a/consensus/types/src/blobs_sidecar.rs +++ b/consensus/types/src/blobs_sidecar.rs @@ -1,5 +1,5 @@ use crate::test_utils::TestRandom; -use crate::{Blob, EthSpec, Hash256, SignedRoot, Slot}; +use crate::{Blob, EthSpec, Hash256, KzgCommitment, SignedRoot, Slot}; use derivative::Derivative; use kzg::KzgProof; use serde_derive::{Deserialize, Serialize}; @@ -9,6 +9,9 @@ use ssz_types::VariableList; use test_random_derive::TestRandom; use tree_hash_derive::TreeHash; +pub type KzgCommitments = VariableList::MaxBlobsPerBlock>; +pub type Blobs = VariableList, ::MaxBlobsPerBlock>; + #[derive( Debug, Clone, @@ -29,7 +32,7 @@ pub struct BlobsSidecar { pub beacon_block_root: Hash256, pub beacon_block_slot: Slot, #[serde(with = "ssz_types::serde_utils::list_of_hex_fixed_vec")] - pub blobs: VariableList, T::MaxBlobsPerBlock>, + pub blobs: Blobs, pub kzg_aggregated_proof: KzgProof, } diff --git a/consensus/types/src/lib.rs b/consensus/types/src/lib.rs index c09b34f87..49829389c 100644 --- a/consensus/types/src/lib.rs +++ b/consensus/types/src/lib.rs @@ -121,7 +121,7 @@ pub use crate::beacon_block_body::{ pub use crate::beacon_block_header::BeaconBlockHeader; pub use crate::beacon_committee::{BeaconCommittee, OwnedBeaconCommittee}; pub use crate::beacon_state::{BeaconTreeHashCache, Error as BeaconStateError, *}; -pub use crate::blobs_sidecar::BlobsSidecar; +pub use crate::blobs_sidecar::{Blobs, BlobsSidecar, KzgCommitments}; pub use crate::bls_to_execution_change::BlsToExecutionChange; pub use crate::chain_spec::{ChainSpec, Config, Domain}; pub use crate::checkpoint::Checkpoint; diff --git a/consensus/types/src/signed_beacon_block.rs b/consensus/types/src/signed_beacon_block.rs index 25d5970b2..f147cefe9 100644 --- a/consensus/types/src/signed_beacon_block.rs +++ b/consensus/types/src/signed_beacon_block.rs @@ -265,7 +265,7 @@ impl> SignedBeaconBlock .map_err(|_| BlobReconstructionError::InconsistentFork)?; if kzg_commitments.is_empty() { Ok(BlobsSidecar::empty_from_parts( - block_root_opt.unwrap_or(self.canonical_root()), + block_root_opt.unwrap_or_else(|| self.canonical_root()), self.slot(), )) } else { diff --git a/crypto/kzg/Cargo.toml b/crypto/kzg/Cargo.toml index 1fbf4871e..d37fda1ea 100644 --- a/crypto/kzg/Cargo.toml +++ b/crypto/kzg/Cargo.toml @@ -11,13 +11,11 @@ eth2_ssz = "0.4.1" eth2_ssz_derive = "0.3.1" tree_hash = "0.4.1" derivative = "2.1.1" -rand = "0.7.3" serde = "1.0.116" serde_derive = "1.0.116" eth2_serde_utils = "0.1.1" hex = "0.4.2" eth2_hashing = "0.3.0" -ethereum-types = "0.12.1" c-kzg = {git = "https://github.com/ethereum/c-kzg-4844", rev = "69f6155d7524247be9d3f54ab3bfbe33a0345622" } arbitrary = { version = "1.0", features = ["derive"], optional = true } diff --git a/crypto/kzg/src/kzg_commitment.rs b/crypto/kzg/src/kzg_commitment.rs index 8d6eefecd..16fe1d830 100644 --- a/crypto/kzg/src/kzg_commitment.rs +++ b/crypto/kzg/src/kzg_commitment.rs @@ -99,7 +99,7 @@ impl FromStr for KzgCommitment { impl Debug for KzgCommitment { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", eth2_serde_utils::hex::encode(&self.0)) + write!(f, "{}", eth2_serde_utils::hex::encode(self.0)) } } diff --git a/crypto/kzg/src/kzg_proof.rs b/crypto/kzg/src/kzg_proof.rs index 32166ee84..2dac5669b 100644 --- a/crypto/kzg/src/kzg_proof.rs +++ b/crypto/kzg/src/kzg_proof.rs @@ -123,7 +123,7 @@ impl FromStr for KzgProof { impl Debug for KzgProof { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", eth2_serde_utils::hex::encode(&self.0)) + write!(f, "{}", eth2_serde_utils::hex::encode(self.0)) } } diff --git a/crypto/kzg/src/lib.rs b/crypto/kzg/src/lib.rs index c179be06f..b6d62e053 100644 --- a/crypto/kzg/src/lib.rs +++ b/crypto/kzg/src/lib.rs @@ -72,7 +72,7 @@ impl Kzg { )); } let commitments = expected_kzg_commitments - .into_iter() + .iter() .map(|comm| comm.0.into()) .collect::>(); let proof: c_kzg::KZGProof = kzg_aggregated_proof.0.into(); diff --git a/lcli/src/new_testnet.rs b/lcli/src/new_testnet.rs index e4f68e41a..e28197e61 100644 --- a/lcli/src/new_testnet.rs +++ b/lcli/src/new_testnet.rs @@ -215,7 +215,7 @@ fn initialize_state_with_validators( // Seed RANDAO with Eth1 entropy state.fill_randao_mixes_with(eth1_block_hash); - for keypair in keypairs.into_iter() { + for keypair in keypairs.iter() { let withdrawal_credentials = |pubkey: &PublicKey| { let mut credentials = hash(&pubkey.as_ssz_bytes()); credentials[0] = spec.bls_withdrawal_prefix_byte; diff --git a/lighthouse/tests/beacon_node.rs b/lighthouse/tests/beacon_node.rs index 237ca2db5..d6cdbd2aa 100644 --- a/lighthouse/tests/beacon_node.rs +++ b/lighthouse/tests/beacon_node.rs @@ -1357,27 +1357,27 @@ fn prune_blobs_on_startup_false() { fn epochs_per_blob_prune_default() { CommandLineTest::new() .run_with_zero_port() - .with_config(|config| assert!(config.epochs_per_blob_prune == 1)); + .with_config(|config| assert!(config.store.epochs_per_blob_prune == 1)); } #[test] fn epochs_per_blob_prune_on_startup_five() { CommandLineTest::new() - .flag("epochs-per-blob-prune", Some(5)) + .flag("epochs-per-blob-prune", Some("5")) .run_with_zero_port() - .with_config(|config| assert!(!config.epochs_per_blob_prune == 5)); + .with_config(|config| assert!(config.store.epochs_per_blob_prune == 5)); } #[test] fn blob_prune_margin_epochs_default() { CommandLineTest::new() .run_with_zero_port() - .with_config(|config| assert!(config.blob_prune_margin_epochs == 0)); + .with_config(|config| assert!(config.store.blob_prune_margin_epochs == 0)); } #[test] fn blob_prune_margin_epochs_on_startup_ten() { CommandLineTest::new() - .flag("blob-prune-margin-epochs", Some(10)) + .flag("blob-prune-margin-epochs", Some("10")) .run_with_zero_port() - .with_config(|config| assert!(!config.blob_prune_margin_epochs == Some(10))); + .with_config(|config| assert!(config.store.blob_prune_margin_epochs == 10)); } #[test] fn reconstruct_historic_states_flag() { diff --git a/testing/ef_tests/src/cases/fork_choice.rs b/testing/ef_tests/src/cases/fork_choice.rs index 31165d632..8b4d0caf5 100644 --- a/testing/ef_tests/src/cases/fork_choice.rs +++ b/testing/ef_tests/src/cases/fork_choice.rs @@ -306,7 +306,7 @@ impl Tester { )); } - let harness = BeaconChainHarness::builder(E::default()) + let harness = BeaconChainHarness::>::builder(E::default()) .spec(spec.clone()) .keypairs(vec![]) .genesis_state_ephemeral_store(case.anchor_state.clone()) diff --git a/validator_client/slashing_protection/Cargo.toml b/validator_client/slashing_protection/Cargo.toml index 55e7f3f71..631e54dc4 100644 --- a/validator_client/slashing_protection/Cargo.toml +++ b/validator_client/slashing_protection/Cargo.toml @@ -12,9 +12,9 @@ path = "tests/main.rs" [dependencies] tempfile = "3.1.0" types = { path = "../../consensus/types" } -rusqlite = { version = "0.25.3", features = ["bundled"] } +rusqlite = { version = "0.28.0", features = ["bundled"] } r2d2 = "0.8.9" -r2d2_sqlite = "0.18.0" +r2d2_sqlite = "0.21.0" serde = "1.0.116" serde_derive = "1.0.116" serde_json = "1.0.58" diff --git a/validator_client/slashing_protection/src/slashing_database.rs b/validator_client/slashing_protection/src/slashing_database.rs index bd5f97f4d..c8be85147 100644 --- a/validator_client/slashing_protection/src/slashing_database.rs +++ b/validator_client/slashing_protection/src/slashing_database.rs @@ -162,8 +162,8 @@ impl SlashingDatabase { /// The exclusive locking mode also has the benefit of applying to other processes, so multiple /// Lighthouse processes trying to access the same database will also be blocked. fn apply_pragmas(conn: &mut rusqlite::Connection) -> Result<(), rusqlite::Error> { - conn.pragma_update(None, "foreign_keys", &true)?; - conn.pragma_update(None, "locking_mode", &"EXCLUSIVE")?; + conn.pragma_update(None, "foreign_keys", true)?; + conn.pragma_update(None, "locking_mode", "EXCLUSIVE")?; Ok(()) }