diff --git a/Cargo.lock b/Cargo.lock index 27f775b2d0d..622ff881837 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -119,9 +119,9 @@ checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "alloy-chains" -version = "0.2.20" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bc32535569185cbcb6ad5fa64d989a47bccb9a08e27284b1f2a3ccf16e6d010" +checksum = "35d744058a9daa51a8cf22a3009607498fcf82d3cf4c5444dd8056cdf651f471" dependencies = [ "alloy-primitives", "num_enum", @@ -143,7 +143,7 @@ dependencies = [ "auto_impl", "borsh", "c-kzg", - "derive_more 2.0.1", + "derive_more 2.1.0", "either", "k256", "once_cell", @@ -171,9 +171,9 @@ dependencies = [ [[package]] name = "alloy-dyn-abi" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdff496dd4e98a81f4861e66f7eaf5f2488971848bb42d9c892f871730245c8" +checksum = "f3b1db3281bcaf03cfadb9d125fac55603526cc1d0577da555dc6184f5188f6f" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -236,7 +236,7 @@ dependencies = [ "auto_impl", "borsh", "c-kzg", - "derive_more 2.0.1", + "derive_more 2.1.0", "either", "serde", "serde_with", @@ -246,9 +246,9 @@ dependencies = [ [[package]] name = "alloy-json-abi" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5513d5e6bd1cba6bdcf5373470f559f320c05c8c59493b6e98912fbe6733943f" +checksum = "6bfca3dbbcb7498f0f60e67aff2ad6aff57032e22eb2fd03189854be11a22c03" dependencies = [ "alloy-primitives", "alloy-sol-type-parser", @@ -264,7 +264,7 @@ checksum = "f72cf87cda808e593381fb9f005ffa4d2475552b7a6c5ac33d087bf77d82abd0" dependencies = [ "alloy-primitives", "alloy-sol-types", - "http 1.3.1", + "http 1.4.0", "serde", "serde_json", "thiserror 2.0.17", @@ -290,7 +290,7 @@ dependencies = [ "alloy-sol-types", "async-trait", "auto_impl", - "derive_more 2.0.1", + "derive_more 2.1.0", "futures-utils-wasm", "serde", "serde_json", @@ -312,20 +312,20 @@ dependencies = [ [[package]] name = "alloy-primitives" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "355bf68a433e0fd7f7d33d5a9fc2583fde70bf5c530f63b80845f8da5505cf28" +checksum = "5c850e6ccbd34b8a463a1e934ffc8fc00e1efc5e5489f2ad82d7797949f3bd4e" dependencies = [ "alloy-rlp", "arbitrary", "bytes", "cfg-if", "const-hex", - "derive_more 2.0.1", + "derive_more 2.1.0", "foldhash 0.2.0", "getrandom 0.3.4", - "hashbrown 0.16.0", - "indexmap 2.12.0", + "hashbrown 0.16.1", + "indexmap 2.12.1", "itoa", "k256", "keccak-asm", @@ -333,6 +333,7 @@ dependencies = [ "proptest", "proptest-derive", "rand 0.9.2", + "rapidhash", "ruint", "rustc-hash 2.1.1", "serde", @@ -398,7 +399,7 @@ checksum = "64b728d511962dda67c1bc7ea7c03736ec275ed2cf4c35d9585298ac9ccf3b73" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -500,41 +501,41 @@ dependencies = [ [[package]] name = "alloy-sol-macro" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3ce480400051b5217f19d6e9a82d9010cdde20f1ae9c00d53591e4a1afbb312" +checksum = "b2218e3aeb3ee665d117fdf188db0d5acfdc3f7b7502c827421cb78f26a2aec0" dependencies = [ "alloy-sol-macro-expander", "alloy-sol-macro-input", "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] name = "alloy-sol-macro-expander" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d792e205ed3b72f795a8044c52877d2e6b6e9b1d13f431478121d8d4eaa9028" +checksum = "b231cb8cc48e66dd1c6e11a1402f3ac86c3667cbc13a6969a0ac030ba7bb8c88" dependencies = [ "alloy-sol-macro-input", "const-hex", "heck", - "indexmap 2.12.0", + "indexmap 2.12.1", "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", "syn-solidity", "tiny-keccak", ] [[package]] name = "alloy-sol-macro-input" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bd1247a8f90b465ef3f1207627547ec16940c35597875cdc09c49d58b19693c" +checksum = "49a522d79929c1bf0152b07567a38f7eaed3ab149e53e7528afa78ff11994668" dependencies = [ "const-hex", "dunce", @@ -542,15 +543,15 @@ dependencies = [ "macro-string", "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", "syn-solidity", ] [[package]] name = "alloy-sol-type-parser" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "954d1b2533b9b2c7959652df3076954ecb1122a28cc740aa84e7b0a49f6ac0a9" +checksum = "0475c459859c8d9428af6ff3736614655a57efda8cc435a3b8b4796fa5ac1dd0" dependencies = [ "serde", "winnow", @@ -558,9 +559,9 @@ dependencies = [ [[package]] name = "alloy-sol-types" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70319350969a3af119da6fb3e9bddb1bce66c9ea933600cb297c8b1850ad2a3c" +checksum = "35287d9d821d5f26011bcd8d9101340898f761c9933cf50fca689bb7ed62fdeb" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -577,7 +578,7 @@ dependencies = [ "alloy-json-rpc", "auto_impl", "base64 0.22.1", - "derive_more 2.0.1", + "derive_more 2.1.0", "futures", "futures-utils-wasm", "parking_lot", @@ -615,7 +616,7 @@ dependencies = [ "alloy-primitives", "alloy-rlp", "arrayvec", - "derive_more 2.0.1", + "derive_more 2.1.0", "nybbles", "serde", "smallvec", @@ -631,7 +632,7 @@ dependencies = [ "darling 0.21.3", "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -685,7 +686,7 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -696,7 +697,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -814,7 +815,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" dependencies = [ "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -852,7 +853,7 @@ dependencies = [ "num-traits", "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -963,7 +964,7 @@ checksum = "3109e49b1e4909e9db6515a30c633684d68cdeaa252f215214cb4fa1a5bfee2c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", "synstructure", ] @@ -975,7 +976,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -1054,7 +1055,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -1065,7 +1066,7 @@ checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -1094,7 +1095,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16e2cdb6d5ed835199484bb92bb8b3edd526effe995c61732580439c1a67e2e9" dependencies = [ "base64 0.22.1", - "http 1.3.1", + "http 1.4.0", "log", "url", ] @@ -1107,7 +1108,7 @@ checksum = "ffdcb70bdbc4d478427380519163274ac86e52916e10f0a8889adf0f96d3fee7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -1126,7 +1127,7 @@ dependencies = [ "axum-core", "bytes", "futures-util", - "http 1.3.1", + "http 1.4.0", "http-body 1.0.1", "http-body-util", "itoa", @@ -1152,7 +1153,7 @@ dependencies = [ "async-trait", "bytes", "futures-util", - "http 1.3.1", + "http 1.4.0", "http-body 1.0.1", "http-body-util", "mime", @@ -1205,9 +1206,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba" +checksum = "0e050f626429857a27ddccb31e0aca21356bfa709c04041aefddac081a8f068a" [[package]] name = "beacon_chain" @@ -1233,7 +1234,6 @@ dependencies = [ "int_to_bytes", "itertools 0.10.5", "kzg", - "lighthouse_tracing", "lighthouse_version", "logging", "lru 0.12.5", @@ -1378,7 +1378,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.110", + "syn 2.0.111", "which", ] @@ -1399,15 +1399,15 @@ checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" [[package]] name = "bitcoin-io" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b47c4ab7a93edb0c7198c5535ed9b52b63095f4e9b45279c6736cec4b856baf" +checksum = "2dee39a0ee5b4095224a0cfc6bf4cc1baf0f9624b96b367e53b66d974e51d953" [[package]] name = "bitcoin_hashes" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16" +checksum = "26ec84b80c482df901772e931a9a681e26a1b9ee2302edeff23cb30328745c8b" dependencies = [ "bitcoin-io", "hex-conservative", @@ -1535,9 +1535,9 @@ dependencies = [ [[package]] name = "borsh" -version = "1.5.7" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad8646f98db542e39fc66e68a20b2144f6a732636df7c2354e74645faaa433ce" +checksum = "d1da5ab77c1437701eeff7c88d968729e7766172279eab0676857b3d63af7a6f" dependencies = [ "borsh-derive", "cfg_aliases", @@ -1545,15 +1545,15 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "1.5.7" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdd1d3c0c2f5833f22386f252fe8ed005c7f59fdcddeef025c01b4c3b9fd9ac3" +checksum = "0686c856aa6aac0c4498f936d7d6a02df690f614c03e4d906d1018062b5c5e2c" dependencies = [ "once_cell", "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -1590,9 +1590,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.19.0" +version = "3.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" +checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" [[package]] name = "byte-slice-cast" @@ -1632,9 +1632,9 @@ dependencies = [ [[package]] name = "camino" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "276a59bf2b2c967788139340c9f0c5b12d7fd6630315c15c217e559de85d2609" +checksum = "e629a66d692cb9ff1a1c664e41771b3dcaf961985a9774c0eb0bd1b51cf60a48" dependencies = [ "serde_core", ] @@ -1670,9 +1670,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.2.46" +version = "1.2.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97463e1064cb1b1c1384ad0a0b9c8abd0988e2a91f52606c80ef14aadb63e36" +checksum = "90583009037521a116abf44494efecd645ba48b6622457080f080b85544e2215" dependencies = [ "find-msvc-tools", "jobserver", @@ -1820,7 +1820,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -1890,9 +1890,9 @@ dependencies = [ [[package]] name = "cmake" -version = "0.1.54" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7caa3f9de89ddbe2c607f4101924c5abec803763ae9534e4f4d7d8f84aa81f0" +checksum = "75443c44cd6b379beb8c5b45d85d0773baf31cce901fe7bb252f4eff3008ef7d" dependencies = [ "cc", ] @@ -2050,6 +2050,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" +[[package]] +name = "convert_case" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "633458d4ef8c78b72454de2d54fd6ab2e60f9e02be22f3c6104cdc8a4e0fceb9" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -2096,9 +2105,9 @@ dependencies = [ [[package]] name = "crc" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9710d3b3739c2e349eb44fe848ad0b7c8cb1e42bd87ee49371df2f7acaf3e675" +checksum = "5eb8a2a1cd12ab0d987a5d5e825195d372001a4094a0376319d5a0ad71c1ba0d" dependencies = [ "crc-catalog", ] @@ -2267,7 +2276,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -2325,7 +2334,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -2340,7 +2349,7 @@ dependencies = [ "quote", "serde", "strsim 0.11.1", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -2362,7 +2371,7 @@ checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ "darling_core 0.20.11", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -2373,7 +2382,7 @@ checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81" dependencies = [ "darling_core 0.21.3", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -2433,7 +2442,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d162beedaa69905488a8da94f5ac3edb4dd4788b732fadb7bd120b2625c1976" dependencies = [ "data-encoding", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -2540,7 +2549,38 @@ checksum = "1e567bd82dcff979e4b03460c307b3cdc9e96fde3d73bed1496d2bc75d9dd62a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", +] + +[[package]] +name = "derive_builder" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "507dfb09ea8b7fa618fcf76e953f4f5e192547945816d5358edffe39f6f94947" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8" +dependencies = [ + "darling 0.20.11", + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "derive_builder_macro" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" +dependencies = [ + "derive_builder_core", + "syn 2.0.111", ] [[package]] @@ -2549,31 +2589,33 @@ version = "0.99.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6edb4b64a43d977b8e99788fe3a04d483834fba1215a7e02caa415b626497f7f" dependencies = [ - "convert_case", + "convert_case 0.4.0", "proc-macro2", "quote", "rustc_version 0.4.1", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] name = "derive_more" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +checksum = "10b768e943bed7bf2cab53df09f4bc34bfd217cdb57d971e769874c9a6710618" dependencies = [ "derive_more-impl", ] [[package]] name = "derive_more-impl" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +checksum = "6d286bfdaf75e988b4a78e013ecd79c581e06399ab53fbacd2d916c2f904f30b" dependencies = [ + "convert_case 0.10.0", "proc-macro2", "quote", - "syn 2.0.110", + "rustc_version 0.4.1", + "syn 2.0.111", "unicode-xid", ] @@ -2680,7 +2722,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -2775,7 +2817,7 @@ dependencies = [ "enum-ordinalize", "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -2998,7 +3040,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -3018,7 +3060,7 @@ checksum = "8ca9601fb2d62598ee17836250842873a413586e5d7ed88b356e38ddbb0ec631" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -3056,7 +3098,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -3245,7 +3287,7 @@ dependencies = [ "darling 0.20.11", "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -3658,7 +3700,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -3768,6 +3810,18 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "getset" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf0fc11e47561d47397154977bc219f4cf809b2974facc3ccb3b89e2436f912" +dependencies = [ + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.111", +] + [[package]] name = "ghash" version = "0.5.1" @@ -3821,7 +3875,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.12.0", + "indexmap 2.12.1", "slab", "tokio", "tokio-util", @@ -3839,8 +3893,8 @@ dependencies = [ "fnv", "futures-core", "futures-sink", - "http 1.3.1", - "indexmap 2.12.0", + "http 1.4.0", + "indexmap 2.12.1", "slab", "tokio", "tokio-util", @@ -3902,12 +3956,13 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" dependencies = [ "foldhash 0.2.0", "serde", + "serde_core", ] [[package]] @@ -4004,9 +4059,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-conservative" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5313b072ce3c597065a808dbf612c4c8e8590bdbf8b579508bf7a762c5eae6cd" +checksum = "fda06d18ac606267c40c04e41b9947729bf8b9efe74bd4e82b61a5f26a510b9f" dependencies = [ "arrayvec", ] @@ -4104,12 +4159,11 @@ dependencies = [ [[package]] name = "http" -version = "1.3.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" +checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" dependencies = [ "bytes", - "fnv", "itoa", ] @@ -4131,7 +4185,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", - "http 1.3.1", + "http 1.4.0", ] [[package]] @@ -4142,7 +4196,7 @@ checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" dependencies = [ "bytes", "futures-core", - "http 1.3.1", + "http 1.4.0", "http-body 1.0.1", "pin-project-lite", ] @@ -4169,7 +4223,6 @@ dependencies = [ "health_metrics", "hex", "lighthouse_network", - "lighthouse_tracing", "lighthouse_version", "logging", "lru 0.12.5", @@ -4275,7 +4328,7 @@ dependencies = [ "futures-channel", "futures-core", "h2 0.4.12", - "http 1.3.1", + "http 1.4.0", "http-body 1.0.1", "httparse", "httpdate", @@ -4293,7 +4346,7 @@ version = "0.27.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" dependencies = [ - "http 1.3.1", + "http 1.4.0", "hyper 1.8.1", "hyper-util", "rustls 0.23.35", @@ -4335,16 +4388,16 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e9a2a24dc5c6821e71a7030e1e14b7b632acac55c40e9d2e082c621261bb56" +checksum = "727805d60e7938b76b826a6ef209eb70eaa1812794f9424d4a4e2d740662df5f" dependencies = [ "base64 0.22.1", "bytes", "futures-channel", "futures-core", "futures-util", - "http 1.3.1", + "http 1.4.0", "http-body 1.0.1", "hyper 1.8.1", "ipnet", @@ -4429,9 +4482,9 @@ checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" [[package]] name = "icu_properties" -version = "2.1.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e93fcd3157766c0c8da2f8cff6ce651a31f0810eaa1c51ec363ef790bbb5fb99" +checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" dependencies = [ "icu_collections", "icu_locale_core", @@ -4443,9 +4496,9 @@ dependencies = [ [[package]] name = "icu_properties_data" -version = "2.1.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02845b3647bb045f1100ecd6480ff52f34c35f82d9880e029d329c21d1054899" +checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" [[package]] name = "icu_provider" @@ -4532,7 +4585,7 @@ dependencies = [ "attohttpc", "bytes", "futures", - "http 1.3.1", + "http 1.4.0", "http-body-util", "hyper 1.8.1", "hyper-util", @@ -4560,7 +4613,7 @@ checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -4576,13 +4629,13 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.12.0" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6717a8d2a5a929a1a2eb43a12812498ed141a0bcfb7e8f7844fbdbe4303bba9f" +checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2" dependencies = [ "arbitrary", "equivalent", - "hashbrown 0.16.0", + "hashbrown 0.16.1", "serde", "serde_core", ] @@ -4676,7 +4729,7 @@ checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" dependencies = [ "hermit-abi", "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -4739,9 +4792,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.82" +version = "0.3.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b011eec8cc36da2aab2d5cff675ec18454fad408585853910a202391cf9f8e65" +checksum = "464a3709c7f55f1f721e5389aa6ea4e3bc6aba669353300af094b29ffbdde1d8" dependencies = [ "once_cell", "wasm-bindgen", @@ -4905,9 +4958,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.177" +version = "0.2.178" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" +checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091" [[package]] name = "libloading" @@ -4942,9 +4995,8 @@ dependencies = [ [[package]] name = "libp2p" -version = "0.56.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce71348bf5838e46449ae240631117b487073d5f347c06d434caddcb91dceb5a" +version = "0.56.1" +source = "git+https://github.com/libp2p/rust-libp2p.git#5e3519fb66b92c7f7c0dc744ab360fd8b669fe54" dependencies = [ "bytes", "either", @@ -4955,12 +5007,12 @@ dependencies = [ "libp2p-connection-limits", "libp2p-core", "libp2p-dns", + "libp2p-gossipsub", "libp2p-identify", "libp2p-identity", "libp2p-mdns", "libp2p-metrics", "libp2p-noise", - "libp2p-plaintext", "libp2p-quic", "libp2p-swarm", "libp2p-tcp", @@ -4975,8 +5027,7 @@ dependencies = [ [[package]] name = "libp2p-allow-block-list" version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16ccf824ee859ca83df301e1c0205270206223fd4b1f2e512a693e1912a8f4a" +source = "git+https://github.com/libp2p/rust-libp2p.git#5e3519fb66b92c7f7c0dc744ab360fd8b669fe54" dependencies = [ "libp2p-core", "libp2p-identity", @@ -4986,8 +5037,7 @@ dependencies = [ [[package]] name = "libp2p-connection-limits" version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18b8b607cf3bfa2f8c57db9c7d8569a315d5cc0a282e6bfd5ebfc0a9840b2a0" +source = "git+https://github.com/libp2p/rust-libp2p.git#5e3519fb66b92c7f7c0dc744ab360fd8b669fe54" dependencies = [ "libp2p-core", "libp2p-identity", @@ -4996,9 +5046,8 @@ dependencies = [ [[package]] name = "libp2p-core" -version = "0.43.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d28e2d2def7c344170f5c6450c0dbe3dfef655610dbfde2f6ac28a527abbe36" +version = "0.43.2" +source = "git+https://github.com/libp2p/rust-libp2p.git#5e3519fb66b92c7f7c0dc744ab360fd8b669fe54" dependencies = [ "either", "fnv", @@ -5015,15 +5064,14 @@ dependencies = [ "rw-stream-sink", "thiserror 2.0.17", "tracing", - "unsigned-varint 0.8.0", + "unsigned-varint", "web-time", ] [[package]] name = "libp2p-dns" version = "0.44.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b770c1c8476736ca98c578cba4b505104ff8e842c2876b528925f9766379f9a" +source = "git+https://github.com/libp2p/rust-libp2p.git#5e3519fb66b92c7f7c0dc744ab360fd8b669fe54" dependencies = [ "async-trait", "futures", @@ -5038,7 +5086,7 @@ dependencies = [ [[package]] name = "libp2p-gossipsub" version = "0.50.0" -source = "git+https://github.com/sigp/rust-libp2p.git?rev=5acdf89a65d64098f9346efa5769e57bcd19dea9#5acdf89a65d64098f9346efa5769e57bcd19dea9" +source = "git+https://github.com/libp2p/rust-libp2p.git#5e3519fb66b92c7f7c0dc744ab360fd8b669fe54" dependencies = [ "async-channel 2.5.0", "asynchronous-codec", @@ -5068,8 +5116,7 @@ dependencies = [ [[package]] name = "libp2p-identify" version = "0.47.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ab792a8b68fdef443a62155b01970c81c3aadab5e659621b063ef252a8e65e8" +source = "git+https://github.com/libp2p/rust-libp2p.git#5e3519fb66b92c7f7c0dc744ab360fd8b669fe54" dependencies = [ "asynchronous-codec", "either", @@ -5088,9 +5135,9 @@ dependencies = [ [[package]] name = "libp2p-identity" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3104e13b51e4711ff5738caa1fb54467c8604c2e94d607e27745bcf709068774" +checksum = "f0c7892c221730ba55f7196e98b0b8ba5e04b4155651736036628e9f73ed6fc3" dependencies = [ "asn1_der", "bs58 0.5.1", @@ -5109,8 +5156,7 @@ dependencies = [ [[package]] name = "libp2p-mdns" version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c66872d0f1ffcded2788683f76931be1c52e27f343edb93bc6d0bcd8887be443" +source = "git+https://github.com/libp2p/rust-libp2p.git#5e3519fb66b92c7f7c0dc744ab360fd8b669fe54" dependencies = [ "futures", "hickory-proto", @@ -5120,19 +5166,19 @@ dependencies = [ "libp2p-swarm", "rand 0.8.5", "smallvec", - "socket2 0.5.10", + "socket2 0.6.1", "tokio", "tracing", ] [[package]] name = "libp2p-metrics" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "805a555148522cb3414493a5153451910cb1a146c53ffbf4385708349baf62b7" +version = "0.17.1" +source = "git+https://github.com/libp2p/rust-libp2p.git#5e3519fb66b92c7f7c0dc744ab360fd8b669fe54" dependencies = [ "futures", "libp2p-core", + "libp2p-gossipsub", "libp2p-identify", "libp2p-identity", "libp2p-swarm", @@ -5144,8 +5190,7 @@ dependencies = [ [[package]] name = "libp2p-mplex" version = "0.43.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a4019ba30c4e42b776113e9778071691fe3f34bf23b6b3bf0dfcf29d801f3d" +source = "git+https://github.com/libp2p/rust-libp2p.git#5e3519fb66b92c7f7c0dc744ab360fd8b669fe54" dependencies = [ "asynchronous-codec", "bytes", @@ -5157,14 +5202,13 @@ dependencies = [ "rand 0.8.5", "smallvec", "tracing", - "unsigned-varint 0.8.0", + "unsigned-varint", ] [[package]] name = "libp2p-noise" version = "0.46.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc73eacbe6462a0eb92a6527cac6e63f02026e5407f8831bde8293f19217bfbf" +source = "git+https://github.com/libp2p/rust-libp2p.git#5e3519fb66b92c7f7c0dc744ab360fd8b669fe54" dependencies = [ "asynchronous-codec", "bytes", @@ -5183,27 +5227,10 @@ dependencies = [ "zeroize", ] -[[package]] -name = "libp2p-plaintext" -version = "0.43.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e659439578fc6d305da8303834beb9d62f155f40e7f5b9d81c9f2b2c69d1926" -dependencies = [ - "asynchronous-codec", - "bytes", - "futures", - "libp2p-core", - "libp2p-identity", - "quick-protobuf", - "quick-protobuf-codec", - "tracing", -] - [[package]] name = "libp2p-quic" version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dc448b2de9f4745784e3751fe8bc6c473d01b8317edd5ababcb0dec803d843f" +source = "git+https://github.com/libp2p/rust-libp2p.git#5e3519fb66b92c7f7c0dc744ab360fd8b669fe54" dependencies = [ "futures", "futures-timer", @@ -5215,7 +5242,7 @@ dependencies = [ "rand 0.8.5", "ring", "rustls 0.23.35", - "socket2 0.5.10", + "socket2 0.6.1", "thiserror 2.0.17", "tokio", "tracing", @@ -5224,17 +5251,16 @@ dependencies = [ [[package]] name = "libp2p-swarm" version = "0.47.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aa762e5215919a34e31c35d4b18bf2e18566ecab7f8a3d39535f4a3068f8b62" +source = "git+https://github.com/libp2p/rust-libp2p.git#5e3519fb66b92c7f7c0dc744ab360fd8b669fe54" dependencies = [ "either", "fnv", "futures", "futures-timer", + "hashlink 0.10.0", "libp2p-core", "libp2p-identity", "libp2p-swarm-derive", - "lru 0.12.5", "multistream-select", "rand 0.8.5", "smallvec", @@ -5246,26 +5272,24 @@ dependencies = [ [[package]] name = "libp2p-swarm-derive" version = "0.35.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd297cf53f0cb3dee4d2620bb319ae47ef27c702684309f682bdb7e55a18ae9c" +source = "git+https://github.com/libp2p/rust-libp2p.git#5e3519fb66b92c7f7c0dc744ab360fd8b669fe54" dependencies = [ "heck", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] name = "libp2p-tcp" -version = "0.44.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65b4e030c52c46c8d01559b2b8ca9b7c4185f10576016853129ca1fe5cd1a644" +version = "0.44.1" +source = "git+https://github.com/libp2p/rust-libp2p.git#5e3519fb66b92c7f7c0dc744ab360fd8b669fe54" dependencies = [ "futures", "futures-timer", "if-watch", "libc", "libp2p-core", - "socket2 0.5.10", + "socket2 0.6.1", "tokio", "tracing", ] @@ -5273,8 +5297,7 @@ dependencies = [ [[package]] name = "libp2p-tls" version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96ff65a82e35375cbc31ebb99cacbbf28cb6c4fefe26bf13756ddcf708d40080" +source = "git+https://github.com/libp2p/rust-libp2p.git#5e3519fb66b92c7f7c0dc744ab360fd8b669fe54" dependencies = [ "futures", "futures-rustls", @@ -5291,9 +5314,8 @@ dependencies = [ [[package]] name = "libp2p-upnp" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4757e65fe69399c1a243bbb90ec1ae5a2114b907467bf09f3575e899815bb8d3" +version = "0.6.0" +source = "git+https://github.com/libp2p/rust-libp2p.git#5e3519fb66b92c7f7c0dc744ab360fd8b669fe54" dependencies = [ "futures", "futures-timer", @@ -5307,8 +5329,7 @@ dependencies = [ [[package]] name = "libp2p-yamux" version = "0.47.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f15df094914eb4af272acf9adaa9e287baa269943f32ea348ba29cfb9bfc60d8" +source = "git+https://github.com/libp2p/rust-libp2p.git#5e3519fb66b92c7f7c0dc744ab360fd8b669fe54" dependencies = [ "either", "futures", @@ -5321,9 +5342,9 @@ dependencies = [ [[package]] name = "libredox" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "416f7e718bdb06000964960ffa43b4335ad4012ae8b99060261aa4a8088d5ccb" +checksum = "df15f6eac291ed1cf25865b1ee60399f57e7c227e7f51bdbd4c5270396a9ed50" dependencies = [ "bitflags 2.10.0", "libc", @@ -5383,7 +5404,6 @@ dependencies = [ "futures", "initialized_validators", "lighthouse_network", - "lighthouse_tracing", "lighthouse_version", "logging", "malloc_utils", @@ -5404,6 +5424,7 @@ dependencies = [ "tracing", "tracing-opentelemetry", "tracing-subscriber", + "tracing_samplers", "types", "validator_client", "validator_dir", @@ -5434,7 +5455,6 @@ dependencies = [ "hex", "itertools 0.10.5", "libp2p", - "libp2p-gossipsub", "libp2p-mplex", "lighthouse_version", "local-ip-address", @@ -5463,13 +5483,9 @@ dependencies = [ "tracing-subscriber", "typenum", "types", - "unsigned-varint 0.8.0", + "unsigned-varint", ] -[[package]] -name = "lighthouse_tracing" -version = "0.1.0" - [[package]] name = "lighthouse_validator_store" version = "0.1.0" @@ -5545,14 +5561,14 @@ dependencies = [ [[package]] name = "local-ip-address" -version = "0.6.5" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "656b3b27f8893f7bbf9485148ff9a65f019e3f33bd5cdc87c83cab16b3fd9ec8" +checksum = "0a60bf300a990b2d1ebdde4228e873e8e4da40d834adbf5265f3da1457ede652" dependencies = [ "libc", "neli", "thiserror 2.0.17", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -5574,9 +5590,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.28" +version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" [[package]] name = "logging" @@ -5657,7 +5673,7 @@ checksum = "1b27834086c65ec3f9387b096d66e99f221cf081c2b738042aa252bcd41204e3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -5840,9 +5856,9 @@ dependencies = [ [[package]] name = "mio" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69d83b0086dc8ecf3ce9ae2874b2d1290252e2a30720bea58a5c6639b0092873" +checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" dependencies = [ "libc", "wasi", @@ -5878,7 +5894,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -5890,25 +5906,26 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] name = "mockito" -version = "1.7.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7760e0e418d9b7e5777c0374009ca4c93861b9066f18cb334a20ce50ab63aa48" +checksum = "7e0603425789b4a70fcc4ac4f5a46a566c116ee3e2a6b768dc623f7719c611de" dependencies = [ "assert-json-diff", "bytes", "colored", - "futures-util", - "http 1.3.1", + "futures-core", + "http 1.4.0", "http-body 1.0.1", "http-body-util", "hyper 1.8.1", "hyper-util", "log", + "pin-project-lite", "rand 0.9.2", "regex", "serde_json", @@ -5932,7 +5949,7 @@ dependencies = [ "rustc_version 0.4.1", "smallvec", "tagptr", - "uuid 1.18.1", + "uuid 1.19.0", ] [[package]] @@ -5975,7 +5992,7 @@ dependencies = [ "percent-encoding", "serde", "static_assertions", - "unsigned-varint 0.8.0", + "unsigned-varint", "url", ] @@ -5998,21 +6015,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b430e7953c29dd6a09afc29ff0bb69c6e306329ee6794700aee27b76a1aea8d" dependencies = [ "core2", - "unsigned-varint 0.8.0", + "unsigned-varint", ] [[package]] name = "multistream-select" version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0df8e5eec2298a62b326ee4f0d7fe1a6b90a09dfcf9df37b38f947a8c42f19" +source = "git+https://github.com/libp2p/rust-libp2p.git#5e3519fb66b92c7f7c0dc744ab360fd8b669fe54" dependencies = [ "bytes", "futures", - "log", "pin-project", "smallvec", - "unsigned-varint 0.7.2", + "tracing", + "unsigned-varint", ] [[package]] @@ -6034,27 +6050,31 @@ dependencies = [ [[package]] name = "neli" -version = "0.6.5" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93062a0dce6da2517ea35f301dfc88184ce18d3601ec786a727a87bf535deca9" +checksum = "e23bebbf3e157c402c4d5ee113233e5e0610cc27453b2f07eefce649c7365dcc" dependencies = [ + "bitflags 2.10.0", "byteorder", + "derive_builder", + "getset", "libc", "log", "neli-proc-macros", + "parking_lot", ] [[package]] name = "neli-proc-macros" -version = "0.1.4" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c8034b7fbb6f9455b2a96c19e6edf8dc9fc34c70449938d8ee3b4df363f61fe" +checksum = "05d8d08c6e98f20a62417478ebf7be8e1425ec9acecc6f63e22da633f6b71609" dependencies = [ "either", "proc-macro2", "quote", "serde", - "syn 1.0.109", + "syn 2.0.111", ] [[package]] @@ -6147,9 +6167,8 @@ dependencies = [ "itertools 0.10.5", "k256", "kzg", - "libp2p-gossipsub", + "libp2p", "lighthouse_network", - "lighthouse_tracing", "logging", "lru_cache", "matches", @@ -6366,7 +6385,7 @@ checksum = "ff32365de1b6743cb203b710788263c44a03de03802daf96092f2da4fe6ba4d7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -6465,7 +6484,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -6518,7 +6537,7 @@ checksum = "50f6639e842a97dbea8886e3439710ae463120091e2e064518ba8e716e6ac36d" dependencies = [ "async-trait", "bytes", - "http 1.3.1", + "http 1.4.0", "opentelemetry", "reqwest", ] @@ -6529,7 +6548,7 @@ version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbee664a43e07615731afc539ca60c6d9f1a9425e25ca09c57bc36c87c55852b" dependencies = [ - "http 1.3.1", + "http 1.4.0", "opentelemetry", "opentelemetry-http", "opentelemetry-proto", @@ -6630,7 +6649,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -6696,9 +6715,9 @@ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "pest" -version = "2.8.3" +version = "2.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "989e7521a040efde50c3ab6bbadafbe15ab6dc042686926be59ac35d74607df4" +checksum = "cbcfd20a6d4eeba40179f05735784ad32bdaef05ce8e8af05f180d45bb3e7e22" dependencies = [ "memchr", "ucd-trie", @@ -6721,7 +6740,7 @@ checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -6894,7 +6913,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ "proc-macro2", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -6936,7 +6955,7 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -6985,9 +7004,9 @@ dependencies = [ [[package]] name = "prometheus-client" -version = "0.23.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf41c1a7c32ed72abe5082fb19505b969095c12da9f5732a4bc9878757fd087c" +checksum = "e4500adecd7af8e0e9f4dbce15cfee07ce913fbf6ad605cc468b83f2d531ee94" dependencies = [ "dtoa", "itoa", @@ -6997,13 +7016,13 @@ dependencies = [ [[package]] name = "prometheus-client-derive-encode" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" +checksum = "9adf1691c04c0a5ff46ff8f262b58beb07b0dbb61f96f9f54f6cbd82106ed87f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -7033,7 +7052,7 @@ checksum = "095a99f75c69734802359b682be8daaf8980296731f6470434ea2c652af1dd30" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -7056,7 +7075,7 @@ dependencies = [ "itertools 0.14.0", "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -7118,14 +7137,13 @@ dependencies = [ [[package]] name = "quick-protobuf-codec" version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15a0580ab32b169745d7a39db2ba969226ca16738931be152a3209b409de2474" +source = "git+https://github.com/libp2p/rust-libp2p.git#5e3519fb66b92c7f7c0dc744ab360fd8b669fe54" dependencies = [ "asynchronous-codec", "bytes", "quick-protobuf", - "thiserror 1.0.69", - "unsigned-varint 0.8.0", + "thiserror 2.0.17", + "unsigned-varint", ] [[package]] @@ -7181,7 +7199,7 @@ dependencies = [ "once_cell", "socket2 0.6.1", "tracing", - "windows-sys 0.60.2", + "windows-sys 0.59.0", ] [[package]] @@ -7306,6 +7324,15 @@ dependencies = [ "rand_core 0.9.3", ] +[[package]] +name = "rapidhash" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8e65c75143ce5d47c55b510297eeb1182f3c739b6043c537670e9fc18612dae" +dependencies = [ + "rustversion", +] + [[package]] name = "rayon" version = "1.11.0" @@ -7385,7 +7412,7 @@ checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -7419,16 +7446,16 @@ checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" [[package]] name = "reqwest" -version = "0.12.24" +version = "0.12.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d0946410b9f7b082a427e4ef5c8ff541a88b357bc6c637c40db3a68ac70a36f" +checksum = "3b4c14b2d9afca6a60277086b0cc6a6ae0b568f6f7916c943a8cdc79f8be240f" dependencies = [ "base64 0.22.1", "bytes", "futures-channel", "futures-core", "futures-util", - "http 1.3.1", + "http 1.4.0", "http-body 1.0.1", "http-body-util", "hyper 1.8.1", @@ -7676,7 +7703,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.4.15", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -7689,7 +7716,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.11.0", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -7744,9 +7771,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.13.0" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94182ad936a0c91c324cd46c6511b9510ed16af436d7b5bab34beab0afd55f7a" +checksum = "21e6f2ab2928ca4291b86736a8bd920a277a399bba1589409d72154ff87c1282" dependencies = [ "web-time", "zeroize", @@ -7795,8 +7822,7 @@ dependencies = [ [[package]] name = "rw-stream-sink" version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8c9026ff5d2f23da5e45bbc283f156383001bfb09c4e44256d02c1a685fe9a1" +source = "git+https://github.com/libp2p/rust-libp2p.git#5e3519fb66b92c7f7c0dc744ab360fd8b669fe54" dependencies = [ "futures", "pin-project", @@ -8045,7 +8071,7 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -8069,7 +8095,7 @@ checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -8086,15 +8112,15 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.16.0" +version = "3.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10574371d41b0d9b2cff89418eda27da52bcaff2cc8741db26382a77c29131f1" +checksum = "4fa237f2807440d238e0364a218270b98f767a00d3dada77b1c53ae88940e2e7" dependencies = [ "base64 0.22.1", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.12.0", + "indexmap 2.12.1", "schemars 0.9.0", "schemars 1.1.0", "serde_core", @@ -8105,14 +8131,14 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.16.0" +version = "3.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08a72d8216842fdd57820dc78d840bef99248e35fb2554ff923319e60f2d686b" +checksum = "52a8e3ca0ca629121f70ab50f95249e5a6f925cc0f6ffe8256c45b728875706c" dependencies = [ "darling 0.21.3", "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -8121,7 +8147,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.12.0", + "indexmap 2.12.1", "itoa", "ryu", "serde", @@ -8197,9 +8223,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.6" +version = "1.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2a4719bff48cee6b39d12c020eeb490953ad2443b7055bd0b21fca26bd8c28b" +checksum = "7664a098b8e616bdfcc2dc0e9ac44eb231eedf41db4e9fe95d8d32ec728dedad" dependencies = [ "libc", ] @@ -8234,9 +8260,9 @@ dependencies = [ [[package]] name = "simd-adler32" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" +checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" [[package]] name = "similar" @@ -8577,7 +8603,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -8597,7 +8623,7 @@ dependencies = [ "proc-macro2", "quote", "smallvec", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -8623,9 +8649,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.110" +version = "2.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a99801b5bd34ede4cf3fc688c5919368fea4e4814a4664359503e6015b280aea" +checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87" dependencies = [ "proc-macro2", "quote", @@ -8634,14 +8660,14 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff790eb176cc81bb8936aed0f7b9f14fc4670069a2d371b3e3b0ecce908b2cb3" +checksum = "60ceeb7c95a4536de0c0e1649bd98d1a72a4bb9590b1f3e45a8a0bfdb7c188c0" dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -8661,7 +8687,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -8755,7 +8781,7 @@ dependencies = [ "getrandom 0.3.4", "once_cell", "rustix 1.1.2", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -8779,7 +8805,7 @@ name = "test_random_derive" version = "0.2.0" dependencies = [ "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -8808,7 +8834,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -8819,7 +8845,7 @@ checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -9000,7 +9026,7 @@ checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -9063,20 +9089,20 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.7.3" +version = "0.7.4+spec-1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2cdb639ebbc97961c51720f858597f7f24c4fc295327923af55b74c3c724533" +checksum = "fe3cea6b2aa3b910092f6abd4053ea464fab5f9c170ba5e9a6aead16ec4af2b6" dependencies = [ "serde_core", ] [[package]] name = "toml_edit" -version = "0.23.7" +version = "0.23.10+spec-1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6485ef6d0d9b5d0ec17244ff7eb05310113c3f316f2d14200d4de56b3cb98f8d" +checksum = "84c8b9f757e028cee9fa244aea147aab2a9ec09d5325a9b01e0a49730c2b5269" dependencies = [ - "indexmap 2.12.0", + "indexmap 2.12.1", "toml_datetime", "toml_parser", "winnow", @@ -9084,9 +9110,9 @@ dependencies = [ [[package]] name = "toml_parser" -version = "1.0.4" +version = "1.0.5+spec-1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0cbe268d35bdb4bb5a56a2de88d0ad0eb70af5384a99d648cd4b3d04039800e" +checksum = "4c03bee5ce3696f31250db0bbaff18bc43301ce0e8db2ed1f07cbb2acf89984c" dependencies = [ "winnow", ] @@ -9103,7 +9129,7 @@ dependencies = [ "base64 0.22.1", "bytes", "h2 0.4.12", - "http 1.3.1", + "http 1.4.0", "http-body 1.0.1", "http-body-util", "hyper 1.8.1", @@ -9130,7 +9156,7 @@ dependencies = [ "async-trait", "base64 0.22.1", "bytes", - "http 1.3.1", + "http 1.4.0", "http-body 1.0.1", "http-body-util", "hyper 1.8.1", @@ -9177,7 +9203,7 @@ checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" dependencies = [ "futures-core", "futures-util", - "indexmap 2.12.0", + "indexmap 2.12.1", "pin-project-lite", "slab", "sync_wrapper", @@ -9190,14 +9216,14 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.6.6" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2" +checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" dependencies = [ "bitflags 2.10.0", "bytes", "futures-util", - "http 1.3.1", + "http 1.4.0", "http-body 1.0.1", "iri-string", "pin-project-lite", @@ -9220,9 +9246,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.41" +version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +checksum = "2d15d90a0b5c19378952d479dc858407149d7bb45a14de0142f6c534b16fc647" dependencies = [ "log", "pin-project-lite", @@ -9232,32 +9258,32 @@ dependencies = [ [[package]] name = "tracing-appender" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3566e8ce28cc0a3fe42519fc80e6b4c943cc4c8cef275620eb8dac2d3d4e06cf" +checksum = "786d480bce6247ab75f005b14ae1624ad978d3029d9113f0a22fa1ac773faeaf" dependencies = [ "crossbeam-channel", - "thiserror 1.0.69", + "thiserror 2.0.17", "time", "tracing-subscriber", ] [[package]] name = "tracing-attributes" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] name = "tracing-core" -version = "0.1.34" +version = "0.1.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" +checksum = "7a04e24fab5c89c6a36eb8558c9656f30d81de51dfa4d3b45f26b21d61fa0a6c" dependencies = [ "once_cell", "valuable", @@ -9304,9 +9330,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.20" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5" +checksum = "2f30143827ddab0d256fd843b7a66d164e9f271cfa0dde49142c5ca0ca291f1e" dependencies = [ "matchers", "nu-ansi-term", @@ -9323,6 +9349,14 @@ dependencies = [ "tracing-serde", ] +[[package]] +name = "tracing_samplers" +version = "0.1.0" +dependencies = [ + "opentelemetry", + "opentelemetry_sdk", +] + [[package]] name = "tree_hash" version = "0.12.0" @@ -9345,7 +9379,7 @@ dependencies = [ "darling 0.21.3", "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -9496,6 +9530,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-segmentation" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + [[package]] name = "unicode-xid" version = "0.2.6" @@ -9518,12 +9558,6 @@ version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" -[[package]] -name = "unsigned-varint" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" - [[package]] name = "unsigned-varint" version = "0.8.0" @@ -9577,9 +9611,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.18.1" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f87b8aa10b915a06587d0dec516c282ff295b475d94abf425d62b57710070a2" +checksum = "e2e054861b4bd027cd373e18e8d8d8e6548085000e41290d95ce0c373a654b4a" dependencies = [ "getrandom 0.3.4", "js-sys", @@ -9907,9 +9941,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.105" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da95793dfc411fbbd93f5be7715b0578ec61fe87cb1a42b12eb625caa5c5ea60" +checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd" dependencies = [ "cfg-if", "once_cell", @@ -9920,9 +9954,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.55" +version = "0.4.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "551f88106c6d5e7ccc7cd9a16f312dd3b5d36ea8b4954304657d5dfba115d4a0" +checksum = "836d9622d604feee9e5de25ac10e3ea5f2d65b41eac0d9ce72eb5deae707ce7c" dependencies = [ "cfg-if", "js-sys", @@ -9933,9 +9967,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.105" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04264334509e04a7bf8690f2384ef5265f05143a4bff3889ab7a3269adab59c2" +checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -9943,22 +9977,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.105" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "420bc339d9f322e562942d52e115d57e950d12d88983a14c79b86859ee6c7ebc" +checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40" dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.105" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76f218a38c84bcb33c25ec7059b07847d465ce0e0a76b995e134a45adcb6af76" +checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4" dependencies = [ "unicode-ident", ] @@ -9992,9 +10026,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.82" +version = "0.3.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a1f95c0d03a47f4ae1f7a64643a6bb97465d9b740f0fa8f90ea33915c99a9a1" +checksum = "9b32828d774c412041098d182a8b38b16ea816958e07cf40eec2bc080ae137ac" dependencies = [ "js-sys", "wasm-bindgen", @@ -10098,7 +10132,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -10160,7 +10194,7 @@ checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -10171,7 +10205,7 @@ checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -10440,9 +10474,9 @@ checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" [[package]] name = "winnow" -version = "0.7.13" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" +checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" dependencies = [ "memchr", ] @@ -10614,28 +10648,28 @@ checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", "synstructure", ] [[package]] name = "zerocopy" -version = "0.8.27" +version = "0.8.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0894878a5fa3edfd6da3f88c4805f4c8558e2b996227a3d864f47fe11e38282c" +checksum = "fd74ec98b9250adb3ca554bdde269adf631549f51d8a8f8f0a10b50f1cb298c3" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.27" +version = "0.8.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831" +checksum = "d8a8d209fdf45cf5138cbb5a506f6b52522a25afccc534d1475dad8e31105c6a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -10655,7 +10689,7 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", "synstructure", ] @@ -10677,7 +10711,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -10710,7 +10744,7 @@ checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.110", + "syn 2.0.111", ] [[package]] @@ -10722,7 +10756,7 @@ dependencies = [ "arbitrary", "crc32fast", "flate2", - "indexmap 2.12.0", + "indexmap 2.12.1", "memchr", "zopfli", ] diff --git a/Cargo.toml b/Cargo.toml index 441490ee1b9..2726af13a1a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,6 @@ members = [ "beacon_node/http_api", "beacon_node/http_metrics", "beacon_node/lighthouse_network", - "beacon_node/lighthouse_tracing", "beacon_node/network", "beacon_node/operation_pool", "beacon_node/store", @@ -44,6 +43,7 @@ members = [ "common/target_check", "common/task_executor", "common/test_random_derive", + "common/tracing_samplers", "common/validator_dir", "common/warp_utils", "common/workspace_members", @@ -156,8 +156,6 @@ fork_choice = { path = "consensus/fork_choice" } fs2 = "0.4" futures = "0.3" genesis = { path = "beacon_node/genesis" } -# This is tracking the sigp-gossipsub branch on sigp/rust-libp2p commit: Aug 20 2025 -gossipsub = { package = "libp2p-gossipsub", git = "https://github.com/sigp/rust-libp2p.git", rev = "5acdf89a65d64098f9346efa5769e57bcd19dea9", "features" = ["metrics"] } graffiti_file = { path = "validator_client/graffiti_file" } hashlink = "0.9.0" health_metrics = { path = "common/health_metrics" } @@ -168,9 +166,22 @@ initialized_validators = { path = "validator_client/initialized_validators" } int_to_bytes = { path = "consensus/int_to_bytes" } itertools = "0.10" kzg = { path = "crypto/kzg" } +libp2p = { git = "https://github.com/libp2p/rust-libp2p.git", default-features = false, features = [ + "identify", + "yamux", + "noise", + "dns", + "tcp", + "tokio", + "secp256k1", + "macros", + "metrics", + "quic", + "upnp", + "gossipsub", +] } libsecp256k1 = "0.7" lighthouse_network = { path = "beacon_node/lighthouse_network" } -lighthouse_tracing = { path = "beacon_node/lighthouse_tracing" } lighthouse_validator_store = { path = "validator_client/lighthouse_validator_store" } lighthouse_version = { path = "common/lighthouse_version" } lockfile = { path = "common/lockfile" } @@ -257,6 +268,7 @@ tracing-core = "0.1" tracing-log = "0.2" tracing-opentelemetry = "0.31.0" tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] } +tracing_samplers = { path = "common/tracing_samplers" } tree_hash = "0.12.0" tree_hash_derive = "0.12.0" typenum = "1" diff --git a/beacon_node/beacon_chain/Cargo.toml b/beacon_node/beacon_chain/Cargo.toml index 734cfdf32bb..5e1c41b8302 100644 --- a/beacon_node/beacon_chain/Cargo.toml +++ b/beacon_node/beacon_chain/Cargo.toml @@ -34,7 +34,6 @@ hex = { workspace = true } int_to_bytes = { workspace = true } itertools = { workspace = true } kzg = { workspace = true } -lighthouse_tracing = { workspace = true } lighthouse_version = { workspace = true } logging = { workspace = true } lru = { workspace = true } diff --git a/beacon_node/beacon_chain/benches/benches.rs b/beacon_node/beacon_chain/benches/benches.rs index de3ced3be11..0d4040155d0 100644 --- a/beacon_node/beacon_chain/benches/benches.rs +++ b/beacon_node/beacon_chain/benches/benches.rs @@ -8,7 +8,7 @@ use bls::Signature; use kzg::{KzgCommitment, KzgProof}; use types::{ BeaconBlock, BeaconBlockFulu, Blob, BlobsList, ChainSpec, EmptyBlock, EthSpec, KzgProofs, - MainnetEthSpec, SignedBeaconBlock, beacon_block_body::KzgCommitments, + MainnetEthSpec, SignedBeaconBlock, kzg_ext::KzgCommitments, }; fn create_test_block_and_blobs( diff --git a/beacon_node/beacon_chain/src/beacon_block_reward.rs b/beacon_node/beacon_chain/src/beacon_block_reward.rs index ac4ed2ab678..88686696ed2 100644 --- a/beacon_node/beacon_chain/src/beacon_block_reward.rs +++ b/beacon_node/beacon_chain/src/beacon_block_reward.rs @@ -135,7 +135,7 @@ impl BeaconChain { state .get_validator(proposer_slashing.proposer_index() as usize)? .effective_balance - .safe_div(self.spec.whistleblower_reward_quotient_for_state(state))?, + .safe_div(state.get_whistleblower_reward_quotient(&self.spec))?, )?; } @@ -157,7 +157,7 @@ impl BeaconChain { state .get_validator(attester_index as usize)? .effective_balance - .safe_div(self.spec.whistleblower_reward_quotient_for_state(state))?, + .safe_div(state.get_whistleblower_reward_quotient(&self.spec))?, )?; } } diff --git a/beacon_node/beacon_chain/src/beacon_chain.rs b/beacon_node/beacon_chain/src/beacon_chain.rs index a6be3dde8cb..e5bdda384fe 100644 --- a/beacon_node/beacon_chain/src/beacon_chain.rs +++ b/beacon_node/beacon_chain/src/beacon_chain.rs @@ -91,7 +91,6 @@ use futures::channel::mpsc::Sender; use itertools::Itertools; use itertools::process_results; use kzg::Kzg; -use lighthouse_tracing::SPAN_PRODUCE_UNAGGREGATED_ATTESTATION; use logging::crit; use operation_pool::{ CompactAttestationRef, OperationPool, PersistedOperationPool, ReceivedPreCapella, @@ -132,9 +131,8 @@ use task_executor::{RayonPoolType, ShutdownReason, TaskExecutor}; use tokio_stream::Stream; use tracing::{Span, debug, debug_span, error, info, info_span, instrument, trace, warn}; use tree_hash::TreeHash; -use types::blob_sidecar::FixedBlobSidecarList; -use types::data_column_sidecar::ColumnIndex; -use types::payload::BlockProductionVersion; +use types::data::{ColumnIndex, FixedBlobSidecarList}; +use types::execution::BlockProductionVersion; use types::*; pub type ForkChoiceError = fork_choice::Error; @@ -1844,7 +1842,7 @@ impl BeaconChain { /// ## Errors /// /// May return an error if the `request_slot` is too far behind the head state. - #[instrument(name = SPAN_PRODUCE_UNAGGREGATED_ATTESTATION, skip_all, fields(%request_slot, %request_index), level = "debug")] + #[instrument(name = "lh_produce_unaggregated_attestation", skip_all, fields(%request_slot, %request_index), level = "debug")] pub fn produce_unaggregated_attestation( &self, request_slot: Slot, diff --git a/beacon_node/beacon_chain/src/beacon_proposer_cache.rs b/beacon_node/beacon_chain/src/beacon_proposer_cache.rs index a923d657a86..912f7f3bade 100644 --- a/beacon_node/beacon_chain/src/beacon_proposer_cache.rs +++ b/beacon_node/beacon_chain/src/beacon_proposer_cache.rs @@ -19,7 +19,7 @@ use std::num::NonZeroUsize; use std::sync::Arc; use tracing::instrument; use typenum::Unsigned; -use types::non_zero_usize::new_non_zero_usize; +use types::new_non_zero_usize; use types::{BeaconState, BeaconStateError, ChainSpec, Epoch, EthSpec, Fork, Hash256, Slot}; /// The number of sets of proposer indices that should be cached. diff --git a/beacon_node/beacon_chain/src/blob_verification.rs b/beacon_node/beacon_chain/src/blob_verification.rs index 874673b52e8..45374f509b2 100644 --- a/beacon_node/beacon_chain/src/blob_verification.rs +++ b/beacon_node/beacon_chain/src/blob_verification.rs @@ -15,7 +15,7 @@ use ssz_derive::{Decode, Encode}; use std::time::Duration; use tracing::{debug, instrument}; use tree_hash::TreeHash; -use types::blob_sidecar::BlobIdentifier; +use types::data::BlobIdentifier; use types::{ BeaconStateError, BlobSidecar, Epoch, EthSpec, Hash256, SignedBeaconBlockHeader, Slot, }; diff --git a/beacon_node/beacon_chain/src/block_verification.rs b/beacon_node/beacon_chain/src/block_verification.rs index bca8d2bc57b..df8c49f8deb 100644 --- a/beacon_node/beacon_chain/src/block_verification.rs +++ b/beacon_node/beacon_chain/src/block_verification.rs @@ -98,8 +98,7 @@ use tracing::{Instrument, Span, debug, debug_span, error, info_span, instrument} use types::{ BeaconBlockRef, BeaconState, BeaconStateError, BlobsList, ChainSpec, DataColumnSidecarList, Epoch, EthSpec, ExecutionBlockHash, FullPayload, Hash256, InconsistentFork, KzgProofs, - RelativeEpoch, SignedBeaconBlock, SignedBeaconBlockHeader, Slot, - data_column_sidecar::DataColumnSidecarError, + RelativeEpoch, SignedBeaconBlock, SignedBeaconBlockHeader, Slot, data::DataColumnSidecarError, }; pub const POS_PANDA_BANNER: &str = r#" diff --git a/beacon_node/beacon_chain/src/block_verification_types.rs b/beacon_node/beacon_chain/src/block_verification_types.rs index 5978e97c4d9..f7831d5c770 100644 --- a/beacon_node/beacon_chain/src/block_verification_types.rs +++ b/beacon_node/beacon_chain/src/block_verification_types.rs @@ -7,7 +7,7 @@ use ssz_types::VariableList; use state_processing::ConsensusContext; use std::fmt::{Debug, Formatter}; use std::sync::Arc; -use types::blob_sidecar::BlobIdentifier; +use types::data::BlobIdentifier; use types::{ BeaconBlockRef, BeaconState, BlindedPayload, BlobSidecarList, Epoch, EthSpec, Hash256, SignedBeaconBlock, SignedBeaconBlockHeader, Slot, diff --git a/beacon_node/beacon_chain/src/builder.rs b/beacon_node/beacon_chain/src/builder.rs index b8770b89112..dc38fc1c292 100644 --- a/beacon_node/beacon_chain/src/builder.rs +++ b/beacon_node/beacon_chain/src/builder.rs @@ -42,7 +42,7 @@ use std::time::Duration; use store::{Error as StoreError, HotColdDB, ItemStore, KeyValueStoreOp}; use task_executor::{ShutdownReason, TaskExecutor}; use tracing::{debug, error, info}; -use types::data_column_custody_group::CustodyIndex; +use types::data::CustodyIndex; use types::{ BeaconBlock, BeaconState, BlobSidecarList, ChainSpec, ColumnIndex, DataColumnSidecarList, Epoch, EthSpec, Hash256, SignedBeaconBlock, Slot, diff --git a/beacon_node/beacon_chain/src/canonical_head.rs b/beacon_node/beacon_chain/src/canonical_head.rs index 76c08c5e39c..f18fdb25f69 100644 --- a/beacon_node/beacon_chain/src/canonical_head.rs +++ b/beacon_node/beacon_chain/src/canonical_head.rs @@ -47,7 +47,7 @@ use fork_choice::{ ResetPayloadStatuses, }; use itertools::process_results; -use lighthouse_tracing::SPAN_RECOMPUTE_HEAD; + use logging::crit; use parking_lot::{Mutex, RwLock, RwLockReadGuard, RwLockUpgradableReadGuard, RwLockWriteGuard}; use slot_clock::SlotClock; @@ -514,7 +514,7 @@ impl BeaconChain { /// can't abort block import because an error is returned here. pub async fn recompute_head_at_slot(self: &Arc, current_slot: Slot) { let span = info_span!( - SPAN_RECOMPUTE_HEAD, + "lh_recompute_head_at_slot", slot = %current_slot ); diff --git a/beacon_node/beacon_chain/src/data_availability_checker.rs b/beacon_node/beacon_chain/src/data_availability_checker.rs index 3e859456b18..7aec24b8e52 100644 --- a/beacon_node/beacon_chain/src/data_availability_checker.rs +++ b/beacon_node/beacon_chain/src/data_availability_checker.rs @@ -19,7 +19,7 @@ use std::sync::Arc; use std::time::Duration; use task_executor::TaskExecutor; use tracing::{debug, error, instrument}; -use types::blob_sidecar::{BlobIdentifier, BlobSidecar, FixedBlobSidecarList}; +use types::data::{BlobIdentifier, BlobSidecar, FixedBlobSidecarList}; use types::{ BlobSidecarList, BlockImportSource, ChainSpec, DataColumnSidecar, DataColumnSidecarList, Epoch, EthSpec, Hash256, SignedBeaconBlock, Slot, @@ -39,7 +39,7 @@ use crate::metrics::{ }; use crate::observed_data_sidecars::ObservationStrategy; pub use error::{Error as AvailabilityCheckError, ErrorCategory as AvailabilityCheckErrorCategory}; -use types::non_zero_usize::new_non_zero_usize; +use types::new_non_zero_usize; /// The LRU Cache stores `PendingComponents`, which store block and its associated blob data: /// @@ -876,7 +876,7 @@ mod test { use std::sync::Arc; use std::time::Duration; use store::HotColdDB; - use types::data_column_sidecar::DataColumn; + use types::data::DataColumn; use types::{ChainSpec, ColumnIndex, EthSpec, ForkName, MainnetEthSpec, Slot}; type E = MainnetEthSpec; diff --git a/beacon_node/beacon_chain/src/data_availability_checker/overflow_lru_cache.rs b/beacon_node/beacon_chain/src/data_availability_checker/overflow_lru_cache.rs index 776fb50f619..ff098a827db 100644 --- a/beacon_node/beacon_chain/src/data_availability_checker/overflow_lru_cache.rs +++ b/beacon_node/beacon_chain/src/data_availability_checker/overflow_lru_cache.rs @@ -9,7 +9,6 @@ use crate::block_verification_types::{ use crate::data_availability_checker::{Availability, AvailabilityCheckError}; use crate::data_column_verification::KzgVerifiedCustodyDataColumn; use crate::{BeaconChainTypes, BlockProcessStatus}; -use lighthouse_tracing::SPAN_PENDING_COMPONENTS; use lru::LruCache; use parking_lot::{MappedRwLockReadGuard, RwLock, RwLockReadGuard, RwLockWriteGuard}; use ssz_types::{RuntimeFixedVector, RuntimeVariableList}; @@ -17,8 +16,8 @@ use std::cmp::Ordering; use std::num::NonZeroUsize; use std::sync::Arc; use tracing::{Span, debug, debug_span}; -use types::beacon_block_body::KzgCommitments; -use types::blob_sidecar::BlobIdentifier; +use types::data::BlobIdentifier; +use types::kzg_ext::KzgCommitments; use types::{ BlobSidecar, BlockImportSource, ChainSpec, ColumnIndex, DataColumnSidecar, DataColumnSidecarList, Epoch, EthSpec, Hash256, SignedBeaconBlock, @@ -334,7 +333,7 @@ impl PendingComponents { /// Returns an empty `PendingComponents` object with the given block root. pub fn empty(block_root: Hash256, max_len: usize) -> Self { - let span = debug_span!(parent: None, SPAN_PENDING_COMPONENTS, %block_root); + let span = debug_span!(parent: None, "lh_pending_components", %block_root); let _guard = span.clone().entered(); Self { block_root, @@ -839,7 +838,7 @@ mod test { use store::{HotColdDB, ItemStore, StoreConfig, database::interface::BeaconNodeBackend}; use tempfile::{TempDir, tempdir}; use tracing::{debug_span, info}; - use types::non_zero_usize::new_non_zero_usize; + use types::new_non_zero_usize; use types::{ExecPayload, MinimalEthSpec}; const LOW_VALIDATOR_COUNT: usize = 32; diff --git a/beacon_node/beacon_chain/src/data_column_verification.rs b/beacon_node/beacon_chain/src/data_column_verification.rs index b9986025667..7bb139756d9 100644 --- a/beacon_node/beacon_chain/src/data_column_verification.rs +++ b/beacon_node/beacon_chain/src/data_column_verification.rs @@ -15,7 +15,7 @@ use std::iter; use std::marker::PhantomData; use std::sync::Arc; use tracing::{debug, instrument}; -use types::data_column_sidecar::ColumnIndex; +use types::data::ColumnIndex; use types::{ BeaconStateError, ChainSpec, DataColumnSidecar, DataColumnSubnetId, EthSpec, Hash256, SignedBeaconBlockHeader, Slot, diff --git a/beacon_node/beacon_chain/src/errors.rs b/beacon_node/beacon_chain/src/errors.rs index 7fa6a0b510c..816e75fd242 100644 --- a/beacon_node/beacon_chain/src/errors.rs +++ b/beacon_node/beacon_chain/src/errors.rs @@ -219,7 +219,7 @@ pub enum BeaconChainError { UnableToPublish, UnableToBuildColumnSidecar(String), AvailabilityCheckError(AvailabilityCheckError), - LightClientUpdateError(LightClientUpdateError), + LightClientError(LightClientError), LightClientBootstrapError(String), UnsupportedFork, MilhouseError(MilhouseError), @@ -274,7 +274,7 @@ easy_from_to!(BlockReplayError, BeaconChainError); easy_from_to!(InconsistentFork, BeaconChainError); easy_from_to!(AvailabilityCheckError, BeaconChainError); easy_from_to!(EpochCacheError, BeaconChainError); -easy_from_to!(LightClientUpdateError, BeaconChainError); +easy_from_to!(LightClientError, BeaconChainError); easy_from_to!(MilhouseError, BeaconChainError); easy_from_to!(AttestationError, BeaconChainError); diff --git a/beacon_node/beacon_chain/src/execution_payload.rs b/beacon_node/beacon_chain/src/execution_payload.rs index f0cab06ca3d..9459b1acd7d 100644 --- a/beacon_node/beacon_chain/src/execution_payload.rs +++ b/beacon_node/beacon_chain/src/execution_payload.rs @@ -26,7 +26,7 @@ use std::sync::Arc; use tokio::task::JoinHandle; use tracing::{Instrument, debug, debug_span, warn}; use tree_hash::TreeHash; -use types::payload::BlockProductionVersion; +use types::execution::BlockProductionVersion; use types::*; pub type PreparePayloadResult = Result, BlockProductionError>; diff --git a/beacon_node/beacon_chain/src/fetch_blobs/mod.rs b/beacon_node/beacon_chain/src/fetch_blobs/mod.rs index 4c6b2d10a95..6559f24d23d 100644 --- a/beacon_node/beacon_chain/src/fetch_blobs/mod.rs +++ b/beacon_node/beacon_chain/src/fetch_blobs/mod.rs @@ -33,8 +33,7 @@ use ssz_types::FixedVector; use state_processing::per_block_processing::deneb::kzg_commitment_to_versioned_hash; use std::sync::Arc; use tracing::{Span, debug, instrument, warn}; -use types::blob_sidecar::BlobSidecarError; -use types::data_column_sidecar::DataColumnSidecarError; +use types::data::{BlobSidecarError, DataColumnSidecarError}; use types::{ BeaconStateError, Blob, BlobSidecar, ColumnIndex, EthSpec, FullPayload, Hash256, KzgProofs, SignedBeaconBlock, SignedBeaconBlockHeader, VersionedHash, @@ -247,6 +246,12 @@ async fn fetch_and_process_blobs_v2( metrics::observe(&metrics::BLOBS_FROM_EL_EXPECTED, num_expected_blobs as f64); debug!(num_expected_blobs, "Fetching blobs from the EL"); + + // Track request count and duration for standardized metrics + inc_counter(&metrics::BEACON_ENGINE_GET_BLOBS_V2_REQUESTS_TOTAL); + let _timer = + metrics::start_timer(&metrics::BEACON_ENGINE_GET_BLOBS_V2_REQUEST_DURATION_SECONDS); + let response = chain_adapter .get_blobs_v2(versioned_hashes) .await @@ -254,6 +259,11 @@ async fn fetch_and_process_blobs_v2( inc_counter(&metrics::BLOBS_FROM_EL_ERROR_TOTAL); })?; + drop(_timer); + + // Track successful response + inc_counter(&metrics::BEACON_ENGINE_GET_BLOBS_V2_RESPONSES_TOTAL); + let Some(blobs_and_proofs) = response else { debug!(num_expected_blobs, "No blobs fetched from the EL"); inc_counter(&metrics::BLOBS_FROM_EL_MISS_TOTAL); diff --git a/beacon_node/beacon_chain/src/kzg_utils.rs b/beacon_node/beacon_chain/src/kzg_utils.rs index 334124419b9..a1c255e3b3c 100644 --- a/beacon_node/beacon_chain/src/kzg_utils.rs +++ b/beacon_node/beacon_chain/src/kzg_utils.rs @@ -6,8 +6,8 @@ use rayon::prelude::*; use ssz_types::{FixedVector, VariableList}; use std::sync::Arc; use tracing::instrument; -use types::beacon_block_body::KzgCommitments; -use types::data_column_sidecar::{Cell, DataColumn, DataColumnSidecarError}; +use types::data::{Cell, DataColumn, DataColumnSidecarError}; +use types::kzg_ext::KzgCommitments; use types::{ Blob, BlobSidecar, BlobSidecarList, ChainSpec, DataColumnSidecar, DataColumnSidecarList, EthSpec, Hash256, KzgCommitment, KzgProof, SignedBeaconBlock, SignedBeaconBlockHeader, @@ -448,8 +448,7 @@ mod test { use kzg::{Kzg, KzgCommitment, trusted_setup::get_trusted_setup}; use types::{ BeaconBlock, BeaconBlockFulu, BlobsList, ChainSpec, EmptyBlock, EthSpec, ForkName, - FullPayload, KzgProofs, MainnetEthSpec, SignedBeaconBlock, - beacon_block_body::KzgCommitments, + FullPayload, KzgProofs, MainnetEthSpec, SignedBeaconBlock, kzg_ext::KzgCommitments, }; type E = MainnetEthSpec; diff --git a/beacon_node/beacon_chain/src/light_client_server_cache.rs b/beacon_node/beacon_chain/src/light_client_server_cache.rs index 487ddfd3ec9..5b405234e72 100644 --- a/beacon_node/beacon_chain/src/light_client_server_cache.rs +++ b/beacon_node/beacon_chain/src/light_client_server_cache.rs @@ -9,7 +9,7 @@ use store::DBColumn; use store::KeyValueStore; use tracing::debug; use tree_hash::TreeHash; -use types::non_zero_usize::new_non_zero_usize; +use types::new_non_zero_usize; use types::{ BeaconBlockRef, BeaconState, ChainSpec, Checkpoint, EthSpec, ForkName, Hash256, LightClientBootstrap, LightClientFinalityUpdate, LightClientOptimisticUpdate, diff --git a/beacon_node/beacon_chain/src/metrics.rs b/beacon_node/beacon_chain/src/metrics.rs index cf295d99515..6be07faa240 100644 --- a/beacon_node/beacon_chain/src/metrics.rs +++ b/beacon_node/beacon_chain/src/metrics.rs @@ -1613,10 +1613,9 @@ pub static BLOB_SIDECAR_INCLUSION_PROOF_COMPUTATION: LazyLock> ) }); pub static DATA_COLUMN_SIDECAR_COMPUTATION: LazyLock> = LazyLock::new(|| { - try_create_histogram_vec_with_buckets( + try_create_histogram_vec( "beacon_data_column_sidecar_computation_seconds", "Time taken to compute data column sidecar, including cells, proofs and inclusion proof", - Ok(vec![0.1, 0.15, 0.25, 0.35, 0.5, 0.7, 1.0, 2.5, 5.0, 10.0]), &["blob_count"], ) }); @@ -1690,6 +1689,33 @@ pub static BLOBS_FROM_EL_RECEIVED: LazyLock> = LazyLock::new(| ) }); +/* + * Standardized getBlobs metrics across clients from https://github.com/ethereum/beacon-metrics + */ +pub static BEACON_ENGINE_GET_BLOBS_V2_REQUESTS_TOTAL: LazyLock> = + LazyLock::new(|| { + try_create_int_counter( + "beacon_engine_getBlobsV2_requests_total", + "Total number of engine_getBlobsV2 requests made to the execution layer", + ) + }); + +pub static BEACON_ENGINE_GET_BLOBS_V2_RESPONSES_TOTAL: LazyLock> = + LazyLock::new(|| { + try_create_int_counter( + "beacon_engine_getBlobsV2_responses_total", + "Total number of successful engine_getBlobsV2 responses from the execution layer", + ) + }); + +pub static BEACON_ENGINE_GET_BLOBS_V2_REQUEST_DURATION_SECONDS: LazyLock> = + LazyLock::new(|| { + try_create_histogram( + "beacon_engine_getBlobsV2_request_duration_seconds", + "Duration of engine_getBlobsV2 requests to the execution layer in seconds", + ) + }); + /* * Light server message verification */ diff --git a/beacon_node/beacon_chain/src/naive_aggregation_pool.rs b/beacon_node/beacon_chain/src/naive_aggregation_pool.rs index beefc2d678b..72080b92daf 100644 --- a/beacon_node/beacon_chain/src/naive_aggregation_pool.rs +++ b/beacon_node/beacon_chain/src/naive_aggregation_pool.rs @@ -4,9 +4,9 @@ use itertools::Itertools; use smallvec::SmallVec; use std::collections::HashMap; use tree_hash::{MerkleHasher, TreeHash, TreeHashType}; +use types::SlotData; use types::consts::altair::SYNC_COMMITTEE_SUBNET_COUNT; -use types::slot_data::SlotData; -use types::sync_committee_contribution::SyncContributionData; +use types::sync_committee::SyncContributionData; use types::{ Attestation, AttestationData, AttestationRef, CommitteeIndex, EthSpec, Hash256, Slot, SyncCommitteeContribution, diff --git a/beacon_node/beacon_chain/src/observed_aggregates.rs b/beacon_node/beacon_chain/src/observed_aggregates.rs index b2c5cb4b38a..7ecd581e853 100644 --- a/beacon_node/beacon_chain/src/observed_aggregates.rs +++ b/beacon_node/beacon_chain/src/observed_aggregates.rs @@ -7,10 +7,10 @@ use std::collections::HashMap; use std::marker::PhantomData; use tree_hash::TreeHash; use tree_hash_derive::TreeHash; +use types::SlotData; use types::consts::altair::{ SYNC_COMMITTEE_SUBNET_COUNT, TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE, }; -use types::slot_data::SlotData; use types::{ Attestation, AttestationData, AttestationRef, EthSpec, Hash256, Slot, SyncCommitteeContribution, }; diff --git a/beacon_node/beacon_chain/src/observed_attesters.rs b/beacon_node/beacon_chain/src/observed_attesters.rs index d5433f49d1b..277bf38ffc9 100644 --- a/beacon_node/beacon_chain/src/observed_attesters.rs +++ b/beacon_node/beacon_chain/src/observed_attesters.rs @@ -20,7 +20,7 @@ use std::collections::{HashMap, HashSet}; use std::hash::Hash; use std::marker::PhantomData; use typenum::Unsigned; -use types::slot_data::SlotData; +use types::SlotData; use types::{Epoch, EthSpec, Hash256, Slot}; /// The maximum capacity of the `AutoPruningEpochContainer`. diff --git a/beacon_node/beacon_chain/src/pre_finalization_cache.rs b/beacon_node/beacon_chain/src/pre_finalization_cache.rs index 8996d6b8745..54bd5c19408 100644 --- a/beacon_node/beacon_chain/src/pre_finalization_cache.rs +++ b/beacon_node/beacon_chain/src/pre_finalization_cache.rs @@ -6,7 +6,7 @@ use std::num::NonZeroUsize; use std::time::Duration; use tracing::debug; use types::Hash256; -use types::non_zero_usize::new_non_zero_usize; +use types::new_non_zero_usize; const BLOCK_ROOT_CACHE_LIMIT: NonZeroUsize = new_non_zero_usize(512); const LOOKUP_LIMIT: NonZeroUsize = new_non_zero_usize(8); diff --git a/beacon_node/beacon_chain/src/shuffling_cache.rs b/beacon_node/beacon_chain/src/shuffling_cache.rs index 618d459754d..3d0fd80cf6d 100644 --- a/beacon_node/beacon_chain/src/shuffling_cache.rs +++ b/beacon_node/beacon_chain/src/shuffling_cache.rs @@ -6,7 +6,7 @@ use oneshot_broadcast::{Receiver, Sender, oneshot}; use tracing::debug; use types::{ AttestationShufflingId, BeaconState, Epoch, EthSpec, Hash256, RelativeEpoch, - beacon_state::CommitteeCache, + state::CommitteeCache, }; use crate::{BeaconChainError, metrics}; diff --git a/beacon_node/beacon_chain/src/sync_committee_verification.rs b/beacon_node/beacon_chain/src/sync_committee_verification.rs index e74e284e583..2491e08effb 100644 --- a/beacon_node/beacon_chain/src/sync_committee_verification.rs +++ b/beacon_node/beacon_chain/src/sync_committee_verification.rs @@ -48,13 +48,13 @@ use strum::AsRefStr; use tree_hash::TreeHash; use tree_hash_derive::TreeHash; use types::ChainSpec; +use types::SlotData; use types::consts::altair::SYNC_COMMITTEE_SUBNET_COUNT; -use types::slot_data::SlotData; use types::sync_committee::SyncCommitteeError; use types::{ BeaconStateError, EthSpec, Hash256, SignedContributionAndProof, Slot, SyncCommitteeContribution, SyncCommitteeMessage, SyncSelectionProof, SyncSubnetId, - sync_committee_contribution::Error as ContributionError, + sync_committee::SyncCommitteeContributionError as ContributionError, }; /// Returned when a sync committee contribution was not successfully verified. It might not have been verified for diff --git a/beacon_node/beacon_chain/src/test_utils.rs b/beacon_node/beacon_chain/src/test_utils.rs index 6d17d6d85c5..b6c235a4cb0 100644 --- a/beacon_node/beacon_chain/src/test_utils.rs +++ b/beacon_node/beacon_chain/src/test_utils.rs @@ -67,9 +67,9 @@ use task_executor::TaskExecutor; use task_executor::{ShutdownReason, test_utils::TestRuntime}; use tree_hash::TreeHash; use typenum::U4294967296; -use types::data_column_custody_group::CustodyIndex; -use types::indexed_attestation::IndexedAttestationBase; -use types::payload::BlockProductionVersion; +use types::attestation::IndexedAttestationBase; +use types::data::CustodyIndex; +use types::execution::BlockProductionVersion; use types::test_utils::TestRandom; pub use types::test_utils::generate_deterministic_keypairs; use types::*; diff --git a/beacon_node/beacon_chain/tests/attestation_verification.rs b/beacon_node/beacon_chain/tests/attestation_verification.rs index 7984ea47081..208798dfdfc 100644 --- a/beacon_node/beacon_chain/tests/attestation_verification.rs +++ b/beacon_node/beacon_chain/tests/attestation_verification.rs @@ -24,8 +24,7 @@ use typenum::Unsigned; use types::{ Address, Attestation, AttestationRef, ChainSpec, Epoch, EthSpec, ForkName, Hash256, MainnetEthSpec, SelectionProof, SignedAggregateAndProof, SingleAttestation, Slot, SubnetId, - signed_aggregate_and_proof::SignedAggregateAndProofRefMut, - test_utils::generate_deterministic_keypair, + attestation::SignedAggregateAndProofRefMut, test_utils::generate_deterministic_keypair, }; pub type E = MainnetEthSpec; diff --git a/beacon_node/beacon_chain/tests/blob_verification.rs b/beacon_node/beacon_chain/tests/blob_verification.rs index d1a0d87adf1..019736ca01b 100644 --- a/beacon_node/beacon_chain/tests/blob_verification.rs +++ b/beacon_node/beacon_chain/tests/blob_verification.rs @@ -10,7 +10,7 @@ use beacon_chain::{ use bls::{Keypair, Signature}; use logging::create_test_tracing_subscriber; use std::sync::{Arc, LazyLock}; -use types::{blob_sidecar::FixedBlobSidecarList, *}; +use types::{data::FixedBlobSidecarList, *}; type E = MainnetEthSpec; diff --git a/beacon_node/beacon_chain/tests/events.rs b/beacon_node/beacon_chain/tests/events.rs index 86bdb03dafd..35884541e19 100644 --- a/beacon_node/beacon_chain/tests/events.rs +++ b/beacon_node/beacon_chain/tests/events.rs @@ -7,7 +7,7 @@ use eth2::types::{EventKind, SseBlobSidecar, SseDataColumnSidecar}; use rand::SeedableRng; use rand::rngs::StdRng; use std::sync::Arc; -use types::blob_sidecar::FixedBlobSidecarList; +use types::data::FixedBlobSidecarList; use types::test_utils::TestRandom; use types::{BlobSidecar, DataColumnSidecar, EthSpec, MinimalEthSpec, Slot}; diff --git a/beacon_node/beacon_chain/tests/rewards.rs b/beacon_node/beacon_chain/tests/rewards.rs index ee9cf511ea5..94ad97c9635 100644 --- a/beacon_node/beacon_chain/tests/rewards.rs +++ b/beacon_node/beacon_chain/tests/rewards.rs @@ -269,16 +269,16 @@ async fn test_rewards_electra_slashings() { harness.add_attester_slashing(vec![0]).unwrap(); let slashed_balance_1 = initial_balances.get_mut(0).unwrap(); let validator_1_effective_balance = state.get_effective_balance(0).unwrap(); - let delta_1 = validator_1_effective_balance - / harness.spec.min_slashing_penalty_quotient_for_state(&state); + let delta_1 = + validator_1_effective_balance / state.get_min_slashing_penalty_quotient(&harness.spec); *slashed_balance_1 -= delta_1; // add a proposer slashing and calculating slashing penalties harness.add_proposer_slashing(1).unwrap(); let slashed_balance_2 = initial_balances.get_mut(1).unwrap(); let validator_2_effective_balance = state.get_effective_balance(1).unwrap(); - let delta_2 = validator_2_effective_balance - / harness.spec.min_slashing_penalty_quotient_for_state(&state); + let delta_2 = + validator_2_effective_balance / state.get_min_slashing_penalty_quotient(&harness.spec); *slashed_balance_2 -= delta_2; check_all_electra_rewards(&harness, initial_balances).await; diff --git a/beacon_node/beacon_chain/tests/store_tests.rs b/beacon_node/beacon_chain/tests/store_tests.rs index ba0621ae720..69e1346cfd6 100644 --- a/beacon_node/beacon_chain/tests/store_tests.rs +++ b/beacon_node/beacon_chain/tests/store_tests.rs @@ -1364,6 +1364,7 @@ async fn proposer_shuffling_root_consistency_at_fork_boundary() { } #[tokio::test] +#[allow(clippy::large_stack_frames)] async fn proposer_shuffling_changing_with_lookahead() { let initial_blocks = E::slots_per_epoch() * 4 - 1; diff --git a/beacon_node/beacon_processor/src/lib.rs b/beacon_node/beacon_processor/src/lib.rs index 0a2665ab110..d9ae0e23451 100644 --- a/beacon_node/beacon_processor/src/lib.rs +++ b/beacon_node/beacon_processor/src/lib.rs @@ -921,13 +921,13 @@ impl BeaconProcessor { // and BlocksByRoot) } else if let Some(item) = work_queues.status_queue.pop() { Some(item) - } else if let Some(item) = work_queues.bbrange_queue.pop() { + } else if let Some(item) = work_queues.block_brange_queue.pop() { Some(item) - } else if let Some(item) = work_queues.bbroots_queue.pop() { + } else if let Some(item) = work_queues.block_broots_queue.pop() { Some(item) - } else if let Some(item) = work_queues.blbrange_queue.pop() { + } else if let Some(item) = work_queues.blob_brange_queue.pop() { Some(item) - } else if let Some(item) = work_queues.blbroots_queue.pop() { + } else if let Some(item) = work_queues.blob_broots_queue.pop() { Some(item) } else if let Some(item) = work_queues.dcbroots_queue.pop() { Some(item) @@ -1114,13 +1114,13 @@ impl BeaconProcessor { } Work::Status { .. } => work_queues.status_queue.push(work, work_id), Work::BlocksByRangeRequest { .. } => { - work_queues.bbrange_queue.push(work, work_id) + work_queues.block_brange_queue.push(work, work_id) } Work::BlocksByRootsRequest { .. } => { - work_queues.bbroots_queue.push(work, work_id) + work_queues.block_broots_queue.push(work, work_id) } Work::BlobsByRangeRequest { .. } => { - work_queues.blbrange_queue.push(work, work_id) + work_queues.blob_brange_queue.push(work, work_id) } Work::LightClientBootstrapRequest { .. } => { work_queues.lc_bootstrap_queue.push(work, work_id) @@ -1144,7 +1144,7 @@ impl BeaconProcessor { .gossip_bls_to_execution_change_queue .push(work, work_id), Work::BlobsByRootsRequest { .. } => { - work_queues.blbroots_queue.push(work, work_id) + work_queues.blob_broots_queue.push(work, work_id) } Work::DataColumnsByRootsRequest { .. } => { work_queues.dcbroots_queue.push(work, work_id) @@ -1220,10 +1220,10 @@ impl BeaconProcessor { WorkType::ChainSegment => work_queues.chain_segment_queue.len(), WorkType::ChainSegmentBackfill => work_queues.backfill_chain_segment.len(), WorkType::Status => work_queues.status_queue.len(), - WorkType::BlocksByRangeRequest => work_queues.blbrange_queue.len(), - WorkType::BlocksByRootsRequest => work_queues.blbroots_queue.len(), - WorkType::BlobsByRangeRequest => work_queues.bbrange_queue.len(), - WorkType::BlobsByRootsRequest => work_queues.bbroots_queue.len(), + WorkType::BlocksByRangeRequest => work_queues.block_brange_queue.len(), + WorkType::BlocksByRootsRequest => work_queues.block_broots_queue.len(), + WorkType::BlobsByRangeRequest => work_queues.blob_brange_queue.len(), + WorkType::BlobsByRootsRequest => work_queues.blob_broots_queue.len(), WorkType::DataColumnsByRootsRequest => work_queues.dcbroots_queue.len(), WorkType::DataColumnsByRangeRequest => work_queues.dcbrange_queue.len(), WorkType::GossipBlsToExecutionChange => { diff --git a/beacon_node/beacon_processor/src/scheduler/work_queue.rs b/beacon_node/beacon_processor/src/scheduler/work_queue.rs index bfebbf12737..c6f74961d17 100644 --- a/beacon_node/beacon_processor/src/scheduler/work_queue.rs +++ b/beacon_node/beacon_processor/src/scheduler/work_queue.rs @@ -128,10 +128,10 @@ pub struct BeaconProcessorQueueLengths { gossip_data_column_queue: usize, delayed_block_queue: usize, status_queue: usize, - bbrange_queue: usize, - bbroots_queue: usize, - blbroots_queue: usize, - blbrange_queue: usize, + block_brange_queue: usize, + block_broots_queue: usize, + blob_broots_queue: usize, + blob_brange_queue: usize, dcbroots_queue: usize, dcbrange_queue: usize, gossip_bls_to_execution_change_queue: usize, @@ -194,10 +194,10 @@ impl BeaconProcessorQueueLengths { gossip_data_column_queue: 1024, delayed_block_queue: 1024, status_queue: 1024, - bbrange_queue: 1024, - bbroots_queue: 1024, - blbroots_queue: 1024, - blbrange_queue: 1024, + block_brange_queue: 1024, + block_broots_queue: 1024, + blob_broots_queue: 1024, + blob_brange_queue: 1024, dcbroots_queue: 1024, dcbrange_queue: 1024, gossip_bls_to_execution_change_queue: 16384, @@ -238,10 +238,10 @@ pub struct WorkQueues { pub gossip_data_column_queue: FifoQueue>, pub delayed_block_queue: FifoQueue>, pub status_queue: FifoQueue>, - pub bbrange_queue: FifoQueue>, - pub bbroots_queue: FifoQueue>, - pub blbroots_queue: FifoQueue>, - pub blbrange_queue: FifoQueue>, + pub block_brange_queue: FifoQueue>, + pub block_broots_queue: FifoQueue>, + pub blob_broots_queue: FifoQueue>, + pub blob_brange_queue: FifoQueue>, pub dcbroots_queue: FifoQueue>, pub dcbrange_queue: FifoQueue>, pub gossip_bls_to_execution_change_queue: FifoQueue>, @@ -300,10 +300,10 @@ impl WorkQueues { let delayed_block_queue = FifoQueue::new(queue_lengths.delayed_block_queue); let status_queue = FifoQueue::new(queue_lengths.status_queue); - let bbrange_queue = FifoQueue::new(queue_lengths.bbrange_queue); - let bbroots_queue = FifoQueue::new(queue_lengths.bbroots_queue); - let blbroots_queue = FifoQueue::new(queue_lengths.blbroots_queue); - let blbrange_queue = FifoQueue::new(queue_lengths.blbrange_queue); + let block_brange_queue = FifoQueue::new(queue_lengths.block_brange_queue); + let block_broots_queue = FifoQueue::new(queue_lengths.block_broots_queue); + let blob_broots_queue = FifoQueue::new(queue_lengths.blob_broots_queue); + let blob_brange_queue = FifoQueue::new(queue_lengths.blob_brange_queue); let dcbroots_queue = FifoQueue::new(queue_lengths.dcbroots_queue); let dcbrange_queue = FifoQueue::new(queue_lengths.dcbrange_queue); @@ -350,10 +350,10 @@ impl WorkQueues { gossip_data_column_queue, delayed_block_queue, status_queue, - bbrange_queue, - bbroots_queue, - blbroots_queue, - blbrange_queue, + block_brange_queue, + block_broots_queue, + blob_broots_queue, + blob_brange_queue, dcbroots_queue, dcbrange_queue, gossip_bls_to_execution_change_queue, diff --git a/beacon_node/builder_client/src/lib.rs b/beacon_node/builder_client/src/lib.rs index 4fc6b3a379b..b17a824fd7f 100644 --- a/beacon_node/builder_client/src/lib.rs +++ b/beacon_node/builder_client/src/lib.rs @@ -2,7 +2,7 @@ use bls::PublicKeyBytes; use context_deserialize::ContextDeserialize; pub use eth2::Error; use eth2::types::beacon_response::EmptyMetadata; -use eth2::types::builder_bid::SignedBuilderBid; +use eth2::types::builder::SignedBuilderBid; use eth2::types::{ ContentType, EthSpec, ExecutionBlockHash, ForkName, ForkVersionDecode, ForkVersionedResponse, SignedValidatorRegistrationData, Slot, @@ -542,7 +542,7 @@ mod tests { use super::*; use bls::Signature; use eth2::types::MainnetEthSpec; - use eth2::types::builder_bid::{BuilderBid, BuilderBidFulu}; + use eth2::types::builder::{BuilderBid, BuilderBidFulu}; use eth2::types::test_utils::{SeedableRng, TestRandom, XorShiftRng}; use mockito::{Matcher, Server, ServerGuard}; diff --git a/beacon_node/client/src/builder.rs b/beacon_node/client/src/builder.rs index 694c6fb356a..ba90cbd8bec 100644 --- a/beacon_node/client/src/builder.rs +++ b/beacon_node/client/src/builder.rs @@ -43,7 +43,7 @@ use std::time::{SystemTime, UNIX_EPOCH}; use store::database::interface::BeaconNodeBackend; use timer::spawn_timer; use tracing::{debug, info, instrument, warn}; -use types::data_column_custody_group::compute_ordered_custody_column_indices; +use types::data::compute_ordered_custody_column_indices; use types::{ BeaconState, BlobSidecarList, ChainSpec, EthSpec, ExecutionBlockHash, Hash256, SignedBeaconBlock, test_utils::generate_deterministic_keypairs, 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 fc8eae015b9..97c8e8a6259 100644 --- a/beacon_node/execution_layer/src/engine_api/json_structures.rs +++ b/beacon_node/execution_layer/src/engine_api/json_structures.rs @@ -5,11 +5,9 @@ use ssz::{Decode, TryFromIter}; use ssz_types::{FixedVector, VariableList, typenum::Unsigned}; use strum::EnumString; use superstruct::superstruct; -use types::beacon_block_body::KzgCommitments; -use types::blob_sidecar::BlobsList; -use types::execution_requests::{ - ConsolidationRequests, DepositRequests, RequestType, WithdrawalRequests, -}; +use types::data::BlobsList; +use types::execution::{ConsolidationRequests, DepositRequests, RequestType, WithdrawalRequests}; +use types::kzg_ext::KzgCommitments; use types::{Blob, KzgProof}; #[derive(Debug, PartialEq, Serialize, Deserialize)] diff --git a/beacon_node/execution_layer/src/engines.rs b/beacon_node/execution_layer/src/engines.rs index cc2bfcc7b6c..3e6f78abbe9 100644 --- a/beacon_node/execution_layer/src/engines.rs +++ b/beacon_node/execution_layer/src/engines.rs @@ -15,7 +15,7 @@ use tokio::sync::{Mutex, RwLock, watch}; use tokio_stream::wrappers::WatchStream; use tracing::{debug, error, info, warn}; use types::ExecutionBlockHash; -use types::non_zero_usize::new_non_zero_usize; +use types::new_non_zero_usize; /// The number of payload IDs that will be stored for each `Engine`. /// diff --git a/beacon_node/execution_layer/src/lib.rs b/beacon_node/execution_layer/src/lib.rs index 554668dd8a7..33b83aab09f 100644 --- a/beacon_node/execution_layer/src/lib.rs +++ b/beacon_node/execution_layer/src/lib.rs @@ -18,7 +18,7 @@ pub use engine_api::{http, http::HttpJsonRpc, http::deposit_methods}; use engines::{Engine, EngineError}; pub use engines::{EngineState, ForkchoiceState}; use eth2::types::{BlobsBundle, FullPayloadContents}; -use eth2::types::{ForkVersionedResponse, builder_bid::SignedBuilderBid}; +use eth2::types::{ForkVersionedResponse, builder::SignedBuilderBid}; use fixed_bytes::UintExtended; use fork_choice::ForkchoiceUpdateParameters; use logging::crit; @@ -45,10 +45,10 @@ use tokio::{ use tokio_stream::wrappers::WatchStream; use tracing::{Instrument, debug, debug_span, error, info, instrument, warn}; use tree_hash::TreeHash; -use types::beacon_block_body::KzgCommitments; -use types::builder_bid::BuilderBid; -use types::non_zero_usize::new_non_zero_usize; -use types::payload::BlockProductionVersion; +use types::builder::BuilderBid; +use types::execution::BlockProductionVersion; +use types::kzg_ext::KzgCommitments; +use types::new_non_zero_usize; use types::{ AbstractExecPayload, BlobsList, ExecutionPayloadDeneb, ExecutionRequests, KzgProofs, SignedBlindedBeaconBlock, diff --git a/beacon_node/execution_layer/src/payload_cache.rs b/beacon_node/execution_layer/src/payload_cache.rs index 26ae89b5cb3..ce65a53ef18 100644 --- a/beacon_node/execution_layer/src/payload_cache.rs +++ b/beacon_node/execution_layer/src/payload_cache.rs @@ -3,7 +3,7 @@ use lru::LruCache; use parking_lot::Mutex; use std::num::NonZeroUsize; use tree_hash::TreeHash; -use types::non_zero_usize::new_non_zero_usize; +use types::new_non_zero_usize; use types::{EthSpec, Hash256}; pub const DEFAULT_PAYLOAD_CACHE_SIZE: NonZeroUsize = new_non_zero_usize(10); diff --git a/beacon_node/execution_layer/src/test_utils/mock_builder.rs b/beacon_node/execution_layer/src/test_utils/mock_builder.rs index 884aa9bf47a..0016db9e0c7 100644 --- a/beacon_node/execution_layer/src/test_utils/mock_builder.rs +++ b/beacon_node/execution_layer/src/test_utils/mock_builder.rs @@ -29,7 +29,7 @@ use tokio_stream::StreamExt; use tracing::{debug, error, info, warn}; use tree_hash::TreeHash; use types::ExecutionBlockHash; -use types::builder_bid::{ +use types::builder::{ BuilderBid, BuilderBidBellatrix, BuilderBidCapella, BuilderBidDeneb, BuilderBidElectra, BuilderBidFulu, SignedBuilderBid, }; diff --git a/beacon_node/http_api/Cargo.toml b/beacon_node/http_api/Cargo.toml index 571dab10273..6211ac67265 100644 --- a/beacon_node/http_api/Cargo.toml +++ b/beacon_node/http_api/Cargo.toml @@ -23,7 +23,6 @@ futures = { workspace = true } health_metrics = { workspace = true } hex = { workspace = true } lighthouse_network = { workspace = true } -lighthouse_tracing = { workspace = true } lighthouse_version = { workspace = true } logging = { workspace = true } lru = { workspace = true } diff --git a/beacon_node/http_api/src/beacon/states.rs b/beacon_node/http_api/src/beacon/states.rs index 6d06bcc77d6..828efb86a76 100644 --- a/beacon_node/http_api/src/beacon/states.rs +++ b/beacon_node/http_api/src/beacon/states.rs @@ -12,9 +12,7 @@ use eth2::types::{ ValidatorsRequestBody, }; use std::sync::Arc; -use types::{ - AttestationShufflingId, CommitteeCache, Error as BeaconStateError, EthSpec, RelativeEpoch, -}; +use types::{AttestationShufflingId, BeaconStateError, CommitteeCache, EthSpec, RelativeEpoch}; use warp::filters::BoxedFilter; use warp::{Filter, Reply}; use warp_utils::query::multi_key_query; diff --git a/beacon_node/http_api/src/block_rewards.rs b/beacon_node/http_api/src/block_rewards.rs index 29b23e89a79..891f024bf9c 100644 --- a/beacon_node/http_api/src/block_rewards.rs +++ b/beacon_node/http_api/src/block_rewards.rs @@ -5,8 +5,8 @@ use state_processing::BlockReplayer; use std::num::NonZeroUsize; use std::sync::Arc; use tracing::{debug, warn}; -use types::beacon_block::BlindedBeaconBlock; -use types::non_zero_usize::new_non_zero_usize; +use types::block::BlindedBeaconBlock; +use types::new_non_zero_usize; use warp_utils::reject::{beacon_state_error, custom_bad_request, unhandled_error}; const STATE_CACHE_SIZE: NonZeroUsize = new_non_zero_usize(2); diff --git a/beacon_node/http_api/src/produce_block.rs b/beacon_node/http_api/src/produce_block.rs index 3bd0cec7e33..6a549c91eff 100644 --- a/beacon_node/http_api/src/produce_block.rs +++ b/beacon_node/http_api/src/produce_block.rs @@ -12,11 +12,10 @@ use beacon_chain::{ }; use eth2::beacon_response::ForkVersionedResponse; use eth2::types::{self as api_types, ProduceBlockV3Metadata, SkipRandaoVerification}; -use lighthouse_tracing::{SPAN_PRODUCE_BLOCK_V2, SPAN_PRODUCE_BLOCK_V3}; use ssz::Encode; use std::sync::Arc; use tracing::instrument; -use types::{payload::BlockProductionVersion, *}; +use types::{execution::BlockProductionVersion, *}; use warp::{ Reply, hyper::{Body, Response}, @@ -45,7 +44,7 @@ pub fn get_randao_verification( } #[instrument( - name = SPAN_PRODUCE_BLOCK_V3, + name = "lh_produce_block_v3", skip_all, fields(%slot) )] @@ -169,7 +168,7 @@ pub async fn produce_blinded_block_v2( } #[instrument( - name = SPAN_PRODUCE_BLOCK_V2, + name = "lh_produce_block_v2", skip_all, fields(%slot) )] diff --git a/beacon_node/http_api/src/publish_blocks.rs b/beacon_node/http_api/src/publish_blocks.rs index b54c071eb80..99a00f5f97b 100644 --- a/beacon_node/http_api/src/publish_blocks.rs +++ b/beacon_node/http_api/src/publish_blocks.rs @@ -19,7 +19,6 @@ use eth2::{ use execution_layer::{ProvenancedPayload, SubmitBlindedBlockResponse}; use futures::TryFutureExt; use lighthouse_network::PubsubMessage; -use lighthouse_tracing::SPAN_PUBLISH_BLOCK; use network::NetworkMessage; use rand::prelude::SliceRandom; use slot_clock::SlotClock; @@ -79,7 +78,7 @@ impl ProvenancedBlock> /// Handles a request from the HTTP API for full blocks. #[allow(clippy::too_many_arguments)] #[instrument( - name = SPAN_PUBLISH_BLOCK, + name = "lh_publish_block", level = "info", skip_all, fields(block_root = field::Empty, ?validation_level, block_slot = field::Empty, provenance = field::Empty) diff --git a/beacon_node/http_api/src/sync_committees.rs b/beacon_node/http_api/src/sync_committees.rs index b9fa24ad6a4..6e2f4c95851 100644 --- a/beacon_node/http_api/src/sync_committees.rs +++ b/beacon_node/http_api/src/sync_committees.rs @@ -17,8 +17,8 @@ use std::collections::HashMap; use tokio::sync::mpsc::UnboundedSender; use tracing::{debug, error, warn}; use types::{ - BeaconStateError, Epoch, EthSpec, SignedContributionAndProof, SyncCommitteeMessage, SyncDuty, - SyncSubnetId, slot_data::SlotData, + BeaconStateError, Epoch, EthSpec, SignedContributionAndProof, SlotData, SyncCommitteeMessage, + SyncDuty, SyncSubnetId, }; /// The struct that is returned to the requesting HTTP client. diff --git a/beacon_node/http_api/tests/tests.rs b/beacon_node/http_api/tests/tests.rs index 72e21869596..8a79541363a 100644 --- a/beacon_node/http_api/tests/tests.rs +++ b/beacon_node/http_api/tests/tests.rs @@ -44,7 +44,7 @@ use std::convert::TryInto; use std::sync::Arc; use tokio::time::Duration; use tree_hash::TreeHash; -use types::application_domain::ApplicationDomain; +use types::ApplicationDomain; use types::{ Domain, EthSpec, ExecutionBlockHash, Hash256, MainnetEthSpec, RelativeEpoch, SelectionProof, SignedRoot, SingleAttestation, Slot, attestation::AttestationBase, diff --git a/beacon_node/lighthouse_network/Cargo.toml b/beacon_node/lighthouse_network/Cargo.toml index efb6f27dc52..eb0cc2cc990 100644 --- a/beacon_node/lighthouse_network/Cargo.toml +++ b/beacon_node/lighthouse_network/Cargo.toml @@ -5,9 +5,6 @@ authors = ["Sigma Prime "] edition = { workspace = true } autotests = false -[features] -libp2p-websocket = [] - [dependencies] alloy-primitives = { workspace = true } alloy-rlp = { workspace = true } @@ -24,10 +21,10 @@ ethereum_ssz_derive = { workspace = true } fixed_bytes = { workspace = true } fnv = { workspace = true } futures = { workspace = true } -gossipsub = { workspace = true } hex = { workspace = true } itertools = { workspace = true } -libp2p-mplex = "0.43" +libp2p = { workspace = true } +libp2p-mplex = { git = "https://github.com/libp2p/rust-libp2p.git" } lighthouse_version = { workspace = true } local-ip-address = "0.6" logging = { workspace = true } @@ -36,7 +33,7 @@ lru_cache = { workspace = true } metrics = { workspace = true } network_utils = { workspace = true } parking_lot = { workspace = true } -prometheus-client = "0.23.0" +prometheus-client = "0.24.0" rand = { workspace = true } regex = { workspace = true } serde = { workspace = true } @@ -55,24 +52,6 @@ typenum = { workspace = true } types = { workspace = true } unsigned-varint = { version = "0.8", features = ["codec"] } -[dependencies.libp2p] -version = "0.56" -default-features = false -features = [ - "identify", - "yamux", - "noise", - "dns", - "tcp", - "tokio", - "plaintext", - "secp256k1", - "macros", - "metrics", - "quic", - "upnp", -] - [dev-dependencies] async-channel = { workspace = true } logging = { workspace = true } diff --git a/beacon_node/lighthouse_network/src/config.rs b/beacon_node/lighthouse_network/src/config.rs index 416ca73e08e..c14d2074845 100644 --- a/beacon_node/lighthouse_network/src/config.rs +++ b/beacon_node/lighthouse_network/src/config.rs @@ -5,7 +5,7 @@ use crate::{Enr, PeerIdSerialized}; use directory::{ DEFAULT_BEACON_NODE_DIR, DEFAULT_HARDCODED_NETWORK, DEFAULT_NETWORK_DIR, DEFAULT_ROOT_DIR, }; -use libp2p::Multiaddr; +use libp2p::{Multiaddr, gossipsub}; use local_ip_address::local_ipv6; use network_utils::listen_addr::{ListenAddr, ListenAddress}; use serde::{Deserialize, Serialize}; diff --git a/beacon_node/lighthouse_network/src/discovery/mod.rs b/beacon_node/lighthouse_network/src/discovery/mod.rs index a8c87523a54..939eca3b946 100644 --- a/beacon_node/lighthouse_network/src/discovery/mod.rs +++ b/beacon_node/lighthouse_network/src/discovery/mod.rs @@ -51,7 +51,7 @@ use types::{ChainSpec, EnrForkId, EthSpec}; mod subnet_predicate; use crate::discovery::enr::{NEXT_FORK_DIGEST_ENR_KEY, PEERDAS_CUSTODY_GROUP_COUNT_ENR_KEY}; pub use subnet_predicate::subnet_predicate; -use types::non_zero_usize::new_non_zero_usize; +use types::new_non_zero_usize; /// Local ENR storage filename. pub const ENR_FILENAME: &str = "enr.dat"; diff --git a/beacon_node/lighthouse_network/src/discovery/subnet_predicate.rs b/beacon_node/lighthouse_network/src/discovery/subnet_predicate.rs index 6e841c25a50..757dbb58534 100644 --- a/beacon_node/lighthouse_network/src/discovery/subnet_predicate.rs +++ b/beacon_node/lighthouse_network/src/discovery/subnet_predicate.rs @@ -4,7 +4,7 @@ use crate::types::{EnrAttestationBitfield, EnrSyncCommitteeBitfield}; use std::ops::Deref; use tracing::trace; use types::ChainSpec; -use types::data_column_custody_group::compute_subnets_for_node; +use types::data::compute_subnets_for_node; /// Returns the predicate for a given subnet. pub fn subnet_predicate( diff --git a/beacon_node/lighthouse_network/src/lib.rs b/beacon_node/lighthouse_network/src/lib.rs index 3d96a08357d..863a7a4a430 100644 --- a/beacon_node/lighthouse_network/src/lib.rs +++ b/beacon_node/lighthouse_network/src/lib.rs @@ -107,8 +107,8 @@ pub use prometheus_client; pub use config::Config as NetworkConfig; pub use discovery::Eth2Enr; pub use discv5; -pub use gossipsub::{IdentTopic, MessageAcceptance, MessageId, Topic, TopicHash}; pub use libp2p; +pub use libp2p::gossipsub::{IdentTopic, MessageAcceptance, MessageId, Topic, TopicHash}; pub use libp2p::{Multiaddr, identity, multiaddr}; pub use libp2p::{PeerId, Swarm, core::ConnectedPoint}; pub use peer_manager::{ diff --git a/beacon_node/lighthouse_network/src/peer_manager/mod.rs b/beacon_node/lighthouse_network/src/peer_manager/mod.rs index 3cfe2b3c3b7..43a44c85fc8 100644 --- a/beacon_node/lighthouse_network/src/peer_manager/mod.rs +++ b/beacon_node/lighthouse_network/src/peer_manager/mod.rs @@ -33,9 +33,7 @@ pub use peerdb::sync_status::{SyncInfo, SyncStatus}; use std::collections::{HashMap, HashSet, hash_map::Entry}; use std::net::IpAddr; use strum::IntoEnumIterator; -use types::data_column_custody_group::{ - CustodyIndex, compute_subnets_from_custody_group, get_custody_groups, -}; +use types::data::{CustodyIndex, compute_subnets_from_custody_group, get_custody_groups}; /// Unified peer subnet information structure for pruning logic. struct PeerSubnetInfo { diff --git a/beacon_node/lighthouse_network/src/peer_manager/peerdb.rs b/beacon_node/lighthouse_network/src/peer_manager/peerdb.rs index dc1686523f7..11ce7853507 100644 --- a/beacon_node/lighthouse_network/src/peer_manager/peerdb.rs +++ b/beacon_node/lighthouse_network/src/peer_manager/peerdb.rs @@ -15,7 +15,7 @@ use std::{ }; use sync_status::SyncStatus; use tracing::{debug, error, trace, warn}; -use types::data_column_custody_group::compute_subnets_for_node; +use types::data::compute_subnets_for_node; use types::{ChainSpec, DataColumnSubnetId, Epoch, EthSpec, Hash256, Slot}; pub mod client; diff --git a/beacon_node/lighthouse_network/src/rpc/codec.rs b/beacon_node/lighthouse_network/src/rpc/codec.rs index 48a29699c8f..3611f023917 100644 --- a/beacon_node/lighthouse_network/src/rpc/codec.rs +++ b/beacon_node/lighthouse_network/src/rpc/codec.rs @@ -913,7 +913,8 @@ mod tests { use types::{ BeaconBlock, BeaconBlockAltair, BeaconBlockBase, BeaconBlockBellatrix, BeaconBlockHeader, DataColumnsByRootIdentifier, EmptyBlock, Epoch, FullPayload, KzgCommitment, KzgProof, - SignedBeaconBlockHeader, Slot, blob_sidecar::BlobIdentifier, data_column_sidecar::Cell, + SignedBeaconBlockHeader, Slot, + data::{BlobIdentifier, Cell}, }; type Spec = types::MainnetEthSpec; diff --git a/beacon_node/lighthouse_network/src/rpc/methods.rs b/beacon_node/lighthouse_network/src/rpc/methods.rs index a9b4aa2fbad..0539877c722 100644 --- a/beacon_node/lighthouse_network/src/rpc/methods.rs +++ b/beacon_node/lighthouse_network/src/rpc/methods.rs @@ -12,13 +12,12 @@ use std::ops::Deref; use std::sync::Arc; use strum::IntoStaticStr; use superstruct::superstruct; -use types::blob_sidecar::BlobIdentifier; -use types::light_client_update::MAX_REQUEST_LIGHT_CLIENT_UPDATES; +use types::data::BlobIdentifier; +use types::light_client::consts::MAX_REQUEST_LIGHT_CLIENT_UPDATES; use types::{ ChainSpec, ColumnIndex, DataColumnSidecar, DataColumnsByRootIdentifier, Epoch, EthSpec, ForkContext, Hash256, LightClientBootstrap, LightClientFinalityUpdate, - LightClientOptimisticUpdate, LightClientUpdate, SignedBeaconBlock, Slot, - blob_sidecar::BlobSidecar, + LightClientOptimisticUpdate, LightClientUpdate, SignedBeaconBlock, Slot, data::BlobSidecar, }; /// Maximum length of error message. diff --git a/beacon_node/lighthouse_network/src/service/gossipsub_scoring_parameters.rs b/beacon_node/lighthouse_network/src/service/gossipsub_scoring_parameters.rs index 873d3f92525..2cfae672818 100644 --- a/beacon_node/lighthouse_network/src/service/gossipsub_scoring_parameters.rs +++ b/beacon_node/lighthouse_network/src/service/gossipsub_scoring_parameters.rs @@ -1,6 +1,8 @@ use crate::TopicHash; use crate::types::{GossipEncoding, GossipKind, GossipTopic}; -use gossipsub::{IdentTopic as Topic, PeerScoreParams, PeerScoreThresholds, TopicScoreParams}; +use libp2p::gossipsub::{ + IdentTopic as Topic, PeerScoreParams, PeerScoreThresholds, TopicScoreParams, +}; use std::cmp::max; use std::collections::HashMap; use std::marker::PhantomData; diff --git a/beacon_node/lighthouse_network/src/service/mod.rs b/beacon_node/lighthouse_network/src/service/mod.rs index 4eebda1decb..8b52096b38f 100644 --- a/beacon_node/lighthouse_network/src/service/mod.rs +++ b/beacon_node/lighthouse_network/src/service/mod.rs @@ -21,11 +21,11 @@ use crate::types::{ use crate::{Enr, NetworkGlobals, PubsubMessage, TopicHash, metrics}; use api_types::{AppRequestId, Response}; use futures::stream::StreamExt; -use gossipsub::{ - IdentTopic as Topic, MessageAcceptance, MessageAuthenticity, MessageId, PublishError, +use gossipsub_scoring_parameters::{PeerScoreSettings, lighthouse_gossip_thresholds}; +use libp2p::gossipsub::{ + self, IdentTopic as Topic, MessageAcceptance, MessageAuthenticity, MessageId, PublishError, TopicScoreParams, }; -use gossipsub_scoring_parameters::{PeerScoreSettings, lighthouse_gossip_thresholds}; use libp2p::identity::Keypair; use libp2p::multiaddr::{self, Multiaddr, Protocol as MProtocol}; use libp2p::swarm::behaviour::toggle::Toggle; @@ -1764,9 +1764,9 @@ impl Network { fn inject_upnp_event(&mut self, event: libp2p::upnp::Event) { match event { - libp2p::upnp::Event::NewExternalAddr(addr) => { - info!(%addr, "UPnP route established"); - let mut iter = addr.iter(); + libp2p::upnp::Event::NewExternalAddr { external_addr, .. } => { + info!(%external_addr, "UPnP route established"); + let mut iter = external_addr.iter(); let is_ip6 = { let addr = iter.next(); matches!(addr, Some(MProtocol::Ip6(_))) @@ -1781,7 +1781,7 @@ impl Network { } } _ => { - trace!(%addr, "UPnP address mapped multiaddr from unknown transport"); + trace!(%external_addr, "UPnP address mapped multiaddr from unknown transport"); } }, Some(multiaddr::Protocol::Tcp(tcp_port)) => { @@ -1790,11 +1790,11 @@ impl Network { } } _ => { - trace!(%addr, "UPnP address mapped multiaddr from unknown transport"); + trace!(%external_addr, "UPnP address mapped multiaddr from unknown transport"); } } } - libp2p::upnp::Event::ExpiredExternalAddr(_) => {} + libp2p::upnp::Event::ExpiredExternalAddr { .. } => {} libp2p::upnp::Event::GatewayNotFound => { info!("UPnP not available"); } diff --git a/beacon_node/lighthouse_network/src/service/utils.rs b/beacon_node/lighthouse_network/src/service/utils.rs index 63f22be5e2c..c9b4906f342 100644 --- a/beacon_node/lighthouse_network/src/service/utils.rs +++ b/beacon_node/lighthouse_network/src/service/utils.rs @@ -3,11 +3,10 @@ use crate::rpc::{MetaData, MetaDataV2, MetaDataV3}; use crate::types::{EnrAttestationBitfield, EnrSyncCommitteeBitfield, GossipEncoding, GossipKind}; use crate::{GossipTopic, NetworkConfig}; use futures::future::Either; -use gossipsub; use libp2p::core::{multiaddr::Multiaddr, muxing::StreamMuxerBox, transport::Boxed}; use libp2p::identity::{Keypair, secp256k1}; use libp2p::metrics::Registry; -use libp2p::{PeerId, Transport, core, noise, yamux}; +use libp2p::{PeerId, Transport, core, gossipsub, noise, yamux}; use ssz::Decode; use std::collections::HashSet; use std::fs::File; diff --git a/beacon_node/lighthouse_network/src/types/globals.rs b/beacon_node/lighthouse_network/src/types/globals.rs index 3217f41f61a..df8dbdc559e 100644 --- a/beacon_node/lighthouse_network/src/types/globals.rs +++ b/beacon_node/lighthouse_network/src/types/globals.rs @@ -10,7 +10,7 @@ use parking_lot::RwLock; use std::collections::HashSet; use std::sync::Arc; use tracing::{debug, error}; -use types::data_column_custody_group::{compute_subnets_from_custody_group, get_custody_groups}; +use types::data::{compute_subnets_from_custody_group, get_custody_groups}; use types::{ChainSpec, ColumnIndex, DataColumnSubnetId, EthSpec}; pub struct NetworkGlobals { diff --git a/beacon_node/lighthouse_network/src/types/pubsub.rs b/beacon_node/lighthouse_network/src/types/pubsub.rs index 72f2873def9..231e71742f4 100644 --- a/beacon_node/lighthouse_network/src/types/pubsub.rs +++ b/beacon_node/lighthouse_network/src/types/pubsub.rs @@ -2,6 +2,7 @@ use crate::TopicHash; use crate::types::{GossipEncoding, GossipKind, GossipTopic}; +use libp2p::gossipsub; use snap::raw::{Decoder, Encoder, decompress_len}; use ssz::{Decode, Encode}; use std::io::{Error, ErrorKind}; diff --git a/beacon_node/lighthouse_network/src/types/topics.rs b/beacon_node/lighthouse_network/src/types/topics.rs index 0c988f35c39..a06c65679d6 100644 --- a/beacon_node/lighthouse_network/src/types/topics.rs +++ b/beacon_node/lighthouse_network/src/types/topics.rs @@ -1,4 +1,4 @@ -use gossipsub::{IdentTopic as Topic, TopicHash}; +use libp2p::gossipsub::{IdentTopic as Topic, TopicHash}; use serde::{Deserialize, Serialize}; use std::collections::HashSet; use strum::AsRefStr; diff --git a/beacon_node/lighthouse_tracing/Cargo.toml b/beacon_node/lighthouse_tracing/Cargo.toml deleted file mode 100644 index cd71c202531..00000000000 --- a/beacon_node/lighthouse_tracing/Cargo.toml +++ /dev/null @@ -1,4 +0,0 @@ -[package] -name = "lighthouse_tracing" -version = "0.1.0" -edition = { workspace = true } diff --git a/beacon_node/lighthouse_tracing/src/lib.rs b/beacon_node/lighthouse_tracing/src/lib.rs deleted file mode 100644 index 094ad042fc6..00000000000 --- a/beacon_node/lighthouse_tracing/src/lib.rs +++ /dev/null @@ -1,83 +0,0 @@ -//! This module contains root span identifiers for key code paths in the beacon node. -//! -//! TODO: These span identifiers will be used to implement selective tracing export (to be implemented), -//! where only the listed root spans and their descendants will be exported to the tracing backend. - -/// Root span names for block production and publishing -pub const SPAN_PRODUCE_BLOCK_V2: &str = "produce_block_v2"; -pub const SPAN_PRODUCE_BLOCK_V3: &str = "produce_block_v3"; -pub const SPAN_PUBLISH_BLOCK: &str = "publish_block"; - -/// Root span names for attestation production -pub const SPAN_PRODUCE_UNAGGREGATED_ATTESTATION: &str = "produce_unaggregated_attestation"; - -/// Data Availability checker span identifiers -pub const SPAN_PENDING_COMPONENTS: &str = "pending_components"; - -/// Gossip methods root spans -pub const SPAN_PROCESS_GOSSIP_DATA_COLUMN: &str = "process_gossip_data_column"; -pub const SPAN_PROCESS_GOSSIP_BLOB: &str = "process_gossip_blob"; -pub const SPAN_PROCESS_GOSSIP_BLOCK: &str = "process_gossip_block"; - -/// Sync methods root spans -pub const SPAN_SYNCING_CHAIN: &str = "syncing_chain"; -pub const SPAN_OUTGOING_RANGE_REQUEST: &str = "outgoing_range_request"; -pub const SPAN_SINGLE_BLOCK_LOOKUP: &str = "single_block_lookup"; -pub const SPAN_OUTGOING_BLOCK_BY_ROOT_REQUEST: &str = "outgoing_block_by_root_request"; -pub const SPAN_OUTGOING_CUSTODY_REQUEST: &str = "outgoing_custody_request"; -pub const SPAN_PROCESS_RPC_BLOCK: &str = "process_rpc_block"; -pub const SPAN_PROCESS_RPC_BLOBS: &str = "process_rpc_blobs"; -pub const SPAN_PROCESS_RPC_CUSTODY_COLUMNS: &str = "process_rpc_custody_columns"; -pub const SPAN_PROCESS_CHAIN_SEGMENT: &str = "process_chain_segment"; -pub const SPAN_CUSTODY_BACKFILL_SYNC_BATCH_REQUEST: &str = "custody_backfill_sync_batch_request"; -pub const SPAN_PROCESS_CHAIN_SEGMENT_BACKFILL: &str = "process_chain_segment_backfill"; -pub const SPAN_CUSTODY_BACKFILL_SYNC_IMPORT_COLUMNS: &str = "custody_backfill_sync_import_columns"; - -/// Fork choice root spans -pub const SPAN_RECOMPUTE_HEAD: &str = "recompute_head_at_slot"; - -/// RPC methods root spans -pub const SPAN_HANDLE_BLOCKS_BY_RANGE_REQUEST: &str = "handle_blocks_by_range_request"; -pub const SPAN_HANDLE_BLOBS_BY_RANGE_REQUEST: &str = "handle_blobs_by_range_request"; -pub const SPAN_HANDLE_DATA_COLUMNS_BY_RANGE_REQUEST: &str = "handle_data_columns_by_range_request"; -pub const SPAN_HANDLE_BLOCKS_BY_ROOT_REQUEST: &str = "handle_blocks_by_root_request"; -pub const SPAN_HANDLE_BLOBS_BY_ROOT_REQUEST: &str = "handle_blobs_by_root_request"; -pub const SPAN_HANDLE_DATA_COLUMNS_BY_ROOT_REQUEST: &str = "handle_data_columns_by_root_request"; -pub const SPAN_HANDLE_LIGHT_CLIENT_UPDATES_BY_RANGE: &str = "handle_light_client_updates_by_range"; -pub const SPAN_HANDLE_LIGHT_CLIENT_BOOTSTRAP: &str = "handle_light_client_bootstrap"; -pub const SPAN_HANDLE_LIGHT_CLIENT_OPTIMISTIC_UPDATE: &str = - "handle_light_client_optimistic_update"; -pub const SPAN_HANDLE_LIGHT_CLIENT_FINALITY_UPDATE: &str = "handle_light_client_finality_update"; - -/// List of all root span names that are allowed to be exported to the tracing backend. -/// Only these spans and their descendants will be processed to reduce noise from -/// uninstrumented code paths. New root spans must be added to this list to be traced. -pub const LH_BN_ROOT_SPAN_NAMES: &[&str] = &[ - SPAN_PRODUCE_BLOCK_V2, - SPAN_PRODUCE_BLOCK_V3, - SPAN_PUBLISH_BLOCK, - SPAN_PENDING_COMPONENTS, - SPAN_PROCESS_GOSSIP_DATA_COLUMN, - SPAN_PROCESS_GOSSIP_BLOB, - SPAN_PROCESS_GOSSIP_BLOCK, - SPAN_SYNCING_CHAIN, - SPAN_OUTGOING_RANGE_REQUEST, - SPAN_SINGLE_BLOCK_LOOKUP, - SPAN_PROCESS_RPC_BLOCK, - SPAN_PROCESS_RPC_BLOBS, - SPAN_PROCESS_RPC_CUSTODY_COLUMNS, - SPAN_PROCESS_CHAIN_SEGMENT, - SPAN_PROCESS_CHAIN_SEGMENT_BACKFILL, - SPAN_HANDLE_BLOCKS_BY_RANGE_REQUEST, - SPAN_HANDLE_BLOBS_BY_RANGE_REQUEST, - SPAN_HANDLE_DATA_COLUMNS_BY_RANGE_REQUEST, - SPAN_HANDLE_BLOCKS_BY_ROOT_REQUEST, - SPAN_HANDLE_BLOBS_BY_ROOT_REQUEST, - SPAN_HANDLE_DATA_COLUMNS_BY_ROOT_REQUEST, - SPAN_HANDLE_LIGHT_CLIENT_UPDATES_BY_RANGE, - SPAN_HANDLE_LIGHT_CLIENT_BOOTSTRAP, - SPAN_HANDLE_LIGHT_CLIENT_OPTIMISTIC_UPDATE, - SPAN_HANDLE_LIGHT_CLIENT_FINALITY_UPDATE, - SPAN_CUSTODY_BACKFILL_SYNC_BATCH_REQUEST, - SPAN_CUSTODY_BACKFILL_SYNC_IMPORT_COLUMNS, -]; diff --git a/beacon_node/network/Cargo.toml b/beacon_node/network/Cargo.toml index bf261965760..78dc0c48a75 100644 --- a/beacon_node/network/Cargo.toml +++ b/beacon_node/network/Cargo.toml @@ -29,7 +29,6 @@ hex = { workspace = true } igd-next = { version = "0.16", features = ["aio_tokio"] } itertools = { workspace = true } lighthouse_network = { workspace = true } -lighthouse_tracing = { workspace = true } logging = { workspace = true } lru_cache = { workspace = true } metrics = { workspace = true } @@ -54,9 +53,9 @@ bls = { workspace = true } eth2 = { workspace = true } eth2_network_config = { workspace = true } genesis = { workspace = true } -gossipsub = { workspace = true } k256 = "0.13.4" kzg = { workspace = true } +libp2p = { workspace = true } matches = "0.1.8" rand_08 = { package = "rand", version = "0.8.5" } rand_chacha = "0.9.0" diff --git a/beacon_node/network/src/network_beacon_processor/gossip_methods.rs b/beacon_node/network/src/network_beacon_processor/gossip_methods.rs index eb70147c6ef..e51e73b756a 100644 --- a/beacon_node/network/src/network_beacon_processor/gossip_methods.rs +++ b/beacon_node/network/src/network_beacon_processor/gossip_methods.rs @@ -21,9 +21,6 @@ use beacon_chain::{ }; use beacon_processor::{Work, WorkEvent}; use lighthouse_network::{Client, MessageAcceptance, MessageId, PeerAction, PeerId, ReportSource}; -use lighthouse_tracing::{ - SPAN_PROCESS_GOSSIP_BLOB, SPAN_PROCESS_GOSSIP_BLOCK, SPAN_PROCESS_GOSSIP_DATA_COLUMN, -}; use logging::crit; use operation_pool::ReceivedPreCapella; use slot_clock::SlotClock; @@ -40,7 +37,7 @@ use types::{ DataColumnSubnetId, EthSpec, Hash256, IndexedAttestation, LightClientFinalityUpdate, LightClientOptimisticUpdate, ProposerSlashing, SignedAggregateAndProof, SignedBeaconBlock, SignedBlsToExecutionChange, SignedContributionAndProof, SignedVoluntaryExit, SingleAttestation, - Slot, SubnetId, SyncCommitteeMessage, SyncSubnetId, beacon_block::BlockImportSource, + Slot, SubnetId, SyncCommitteeMessage, SyncSubnetId, block::BlockImportSource, }; use beacon_processor::work_reprocessing_queue::QueuedColumnReconstruction; @@ -605,7 +602,7 @@ impl NetworkBeaconProcessor { } #[instrument( - name = SPAN_PROCESS_GOSSIP_DATA_COLUMN, + name = "lh_process_gossip_data_column", parent = None, level = "debug", skip_all, @@ -769,7 +766,7 @@ impl NetworkBeaconProcessor { #[allow(clippy::too_many_arguments)] #[instrument( - name = SPAN_PROCESS_GOSSIP_BLOB, + name = "lh_process_gossip_blob", parent = None, level = "debug", skip_all, @@ -1135,7 +1132,7 @@ impl NetworkBeaconProcessor { /// Raises a log if there are errors. #[allow(clippy::too_many_arguments)] #[instrument( - name = SPAN_PROCESS_GOSSIP_BLOCK, + name = "lh_process_gossip_block", parent = None, level = "debug", skip_all, diff --git a/beacon_node/network/src/network_beacon_processor/mod.rs b/beacon_node/network/src/network_beacon_processor/mod.rs index bebda36d71c..fd9c2c1e55c 100644 --- a/beacon_node/network/src/network_beacon_processor/mod.rs +++ b/beacon_node/network/src/network_beacon_processor/mod.rs @@ -31,7 +31,7 @@ use tracing::{debug, error, instrument, trace, warn}; use types::*; pub use sync_methods::ChainSegmentProcessId; -use types::blob_sidecar::FixedBlobSidecarList; +use types::data::FixedBlobSidecarList; pub type Error = TrySendError>; diff --git a/beacon_node/network/src/network_beacon_processor/rpc_methods.rs b/beacon_node/network/src/network_beacon_processor/rpc_methods.rs index ac24b648e05..7cf7c01416c 100644 --- a/beacon_node/network/src/network_beacon_processor/rpc_methods.rs +++ b/beacon_node/network/src/network_beacon_processor/rpc_methods.rs @@ -10,20 +10,13 @@ use lighthouse_network::rpc::methods::{ }; use lighthouse_network::rpc::*; use lighthouse_network::{PeerId, ReportSource, Response, SyncInfo}; -use lighthouse_tracing::{ - SPAN_HANDLE_BLOBS_BY_RANGE_REQUEST, SPAN_HANDLE_BLOBS_BY_ROOT_REQUEST, - SPAN_HANDLE_BLOCKS_BY_RANGE_REQUEST, SPAN_HANDLE_BLOCKS_BY_ROOT_REQUEST, - SPAN_HANDLE_DATA_COLUMNS_BY_RANGE_REQUEST, SPAN_HANDLE_DATA_COLUMNS_BY_ROOT_REQUEST, - SPAN_HANDLE_LIGHT_CLIENT_BOOTSTRAP, SPAN_HANDLE_LIGHT_CLIENT_FINALITY_UPDATE, - SPAN_HANDLE_LIGHT_CLIENT_OPTIMISTIC_UPDATE, SPAN_HANDLE_LIGHT_CLIENT_UPDATES_BY_RANGE, -}; use methods::LightClientUpdatesByRangeRequest; use slot_clock::SlotClock; use std::collections::{HashMap, HashSet, hash_map::Entry}; use std::sync::Arc; use tokio_stream::StreamExt; use tracing::{Span, debug, error, field, instrument, warn}; -use types::blob_sidecar::BlobIdentifier; +use types::data::BlobIdentifier; use types::{ColumnIndex, Epoch, EthSpec, Hash256, Slot}; impl NetworkBeaconProcessor { @@ -163,7 +156,7 @@ impl NetworkBeaconProcessor { /// Handle a `BlocksByRoot` request from the peer. #[instrument( - name = SPAN_HANDLE_BLOCKS_BY_ROOT_REQUEST, + name = "lh_handle_blocks_by_root_request", parent = None, level = "debug", skip_all, @@ -263,7 +256,7 @@ impl NetworkBeaconProcessor { /// Handle a `BlobsByRoot` request from the peer. #[instrument( - name = SPAN_HANDLE_BLOBS_BY_ROOT_REQUEST, + name = "lh_handle_blobs_by_root_request", parent = None, level = "debug", skip_all, @@ -392,7 +385,7 @@ impl NetworkBeaconProcessor { /// Handle a `DataColumnsByRoot` request from the peer. #[instrument( - name = SPAN_HANDLE_DATA_COLUMNS_BY_ROOT_REQUEST, + name = "lh_handle_data_columns_by_root_request", parent = None, level = "debug", skip_all, @@ -485,7 +478,7 @@ impl NetworkBeaconProcessor { } #[instrument( - name = SPAN_HANDLE_LIGHT_CLIENT_UPDATES_BY_RANGE, + name = "lh_handle_light_client_updates_by_range", parent = None, level = "debug", skip_all, @@ -586,7 +579,7 @@ impl NetworkBeaconProcessor { /// Handle a `LightClientBootstrap` request from the peer. #[instrument( - name = SPAN_HANDLE_LIGHT_CLIENT_BOOTSTRAP, + name = "lh_handle_light_client_bootstrap", parent = None, level = "debug", skip_all, @@ -626,7 +619,7 @@ impl NetworkBeaconProcessor { /// Handle a `LightClientOptimisticUpdate` request from the peer. #[instrument( - name = SPAN_HANDLE_LIGHT_CLIENT_OPTIMISTIC_UPDATE, + name = "lh_handle_light_client_optimistic_update", parent = None, level = "debug", skip_all, @@ -660,7 +653,7 @@ impl NetworkBeaconProcessor { /// Handle a `LightClientFinalityUpdate` request from the peer. #[instrument( - name = SPAN_HANDLE_LIGHT_CLIENT_FINALITY_UPDATE, + name = "lh_handle_light_client_finality_update", parent = None, level = "debug", skip_all, @@ -694,7 +687,7 @@ impl NetworkBeaconProcessor { /// Handle a `BlocksByRange` request from the peer. #[instrument( - name = SPAN_HANDLE_BLOCKS_BY_RANGE_REQUEST, + name = "lh_handle_blocks_by_range_request", parent = None, level = "debug", skip_all, @@ -990,7 +983,7 @@ impl NetworkBeaconProcessor { /// Handle a `BlobsByRange` request from the peer. #[instrument( - name = SPAN_HANDLE_BLOBS_BY_RANGE_REQUEST, + name = "lh_handle_blobs_by_range_request", parent = None, skip_all, level = "debug", @@ -1155,7 +1148,7 @@ impl NetworkBeaconProcessor { /// Handle a `DataColumnsByRange` request from the peer. #[instrument( - name = SPAN_HANDLE_DATA_COLUMNS_BY_RANGE_REQUEST, + name = "lh_handle_data_columns_by_range_request", parent = None, skip_all, level = "debug", diff --git a/beacon_node/network/src/network_beacon_processor/sync_methods.rs b/beacon_node/network/src/network_beacon_processor/sync_methods.rs index e49ae134fe4..6ba8bd4d3e0 100644 --- a/beacon_node/network/src/network_beacon_processor/sync_methods.rs +++ b/beacon_node/network/src/network_beacon_processor/sync_methods.rs @@ -21,18 +21,13 @@ use beacon_processor::{ use beacon_processor::{Work, WorkEvent}; use lighthouse_network::PeerAction; use lighthouse_network::service::api_types::CustodyBackfillBatchId; -use lighthouse_tracing::{ - SPAN_CUSTODY_BACKFILL_SYNC_IMPORT_COLUMNS, SPAN_PROCESS_CHAIN_SEGMENT, - SPAN_PROCESS_CHAIN_SEGMENT_BACKFILL, SPAN_PROCESS_RPC_BLOBS, SPAN_PROCESS_RPC_BLOCK, - SPAN_PROCESS_RPC_CUSTODY_COLUMNS, -}; use logging::crit; use std::sync::Arc; use std::time::Duration; use store::KzgCommitment; use tracing::{debug, debug_span, error, info, instrument, warn}; -use types::beacon_block_body::format_kzg_commitments; -use types::blob_sidecar::FixedBlobSidecarList; +use types::data::FixedBlobSidecarList; +use types::kzg_ext::format_kzg_commitments; use types::{BlockImportSource, DataColumnSidecarList, Epoch, Hash256}; /// Id associated to a batch processing request, either a sync batch or a parent lookup. @@ -107,7 +102,7 @@ impl NetworkBeaconProcessor { /// Attempt to process a block received from a direct RPC request. #[allow(clippy::too_many_arguments)] #[instrument( - name = SPAN_PROCESS_RPC_BLOCK, + name = "lh_process_rpc_block", parent = None, level = "debug", skip_all, @@ -261,7 +256,7 @@ impl NetworkBeaconProcessor { /// Attempt to process a list of blobs received from a direct RPC request. #[instrument( - name = SPAN_PROCESS_RPC_BLOBS, + name = "lh_process_rpc_blobs", parent = None, level = "debug", skip_all, @@ -349,7 +344,7 @@ impl NetworkBeaconProcessor { } #[instrument( - name = SPAN_PROCESS_RPC_CUSTODY_COLUMNS, + name = "lh_process_rpc_custody_columns", parent = None, level = "debug", skip_all, @@ -429,7 +424,7 @@ impl NetworkBeaconProcessor { expected_cgc: u64, ) { let _guard = debug_span!( - SPAN_CUSTODY_BACKFILL_SYNC_IMPORT_COLUMNS, + "lh_custody_backfill_sync_import_columns", epoch = %batch_id.epoch, columns_received_count = downloaded_columns.len() ) @@ -524,7 +519,7 @@ impl NetworkBeaconProcessor { /// Attempt to import the chain segment (`blocks`) to the beacon chain, informing the sync /// thread if more blocks are needed to process it. #[instrument( - name = SPAN_PROCESS_CHAIN_SEGMENT, + name = "lh_process_chain_segment", parent = None, level = "debug", skip_all, @@ -605,7 +600,7 @@ impl NetworkBeaconProcessor { /// Attempt to import the chain segment (`blocks`) to the beacon chain, informing the sync /// thread if more blocks are needed to process it. #[instrument( - name = SPAN_PROCESS_CHAIN_SEGMENT_BACKFILL, + name = "lh_process_chain_segment_backfill", parent = None, level = "debug", skip_all, diff --git a/beacon_node/network/src/network_beacon_processor/tests.rs b/beacon_node/network/src/network_beacon_processor/tests.rs index ed04fe7bb97..7b8554662b8 100644 --- a/beacon_node/network/src/network_beacon_processor/tests.rs +++ b/beacon_node/network/src/network_beacon_processor/tests.rs @@ -19,8 +19,8 @@ use beacon_chain::test_utils::{ }; use beacon_chain::{BeaconChain, WhenSlotSkipped}; use beacon_processor::{work_reprocessing_queue::*, *}; -use gossipsub::MessageAcceptance; use itertools::Itertools; +use libp2p::gossipsub::MessageAcceptance; use lighthouse_network::rpc::InboundRequestId; use lighthouse_network::rpc::methods::{ BlobsByRangeRequest, BlobsByRootRequest, DataColumnsByRangeRequest, MetaDataV3, @@ -39,7 +39,7 @@ use std::iter::Iterator; use std::sync::Arc; use std::time::Duration; use tokio::sync::mpsc; -use types::blob_sidecar::{BlobIdentifier, FixedBlobSidecarList}; +use types::data::{BlobIdentifier, FixedBlobSidecarList}; use types::{ AttesterSlashing, BlobSidecar, BlobSidecarList, ChainSpec, DataColumnSidecarList, DataColumnSubnetId, Epoch, EthSpec, Hash256, MainnetEthSpec, ProposerSlashing, diff --git a/beacon_node/network/src/service/tests.rs b/beacon_node/network/src/service/tests.rs index 5fabab19ea4..417947150ce 100644 --- a/beacon_node/network/src/service/tests.rs +++ b/beacon_node/network/src/service/tests.rs @@ -6,6 +6,7 @@ use beacon_chain::BeaconChainTypes; use beacon_chain::test_utils::BeaconChainHarness; use beacon_processor::{BeaconProcessorChannels, BeaconProcessorConfig}; use futures::StreamExt; +use libp2p::gossipsub; use lighthouse_network::identity::secp256k1; use lighthouse_network::types::{GossipEncoding, GossipKind}; use lighthouse_network::{Enr, GossipTopic}; diff --git a/beacon_node/network/src/sync/block_lookups/common.rs b/beacon_node/network/src/sync/block_lookups/common.rs index c6b05190871..edd99345b43 100644 --- a/beacon_node/network/src/sync/block_lookups/common.rs +++ b/beacon_node/network/src/sync/block_lookups/common.rs @@ -11,7 +11,7 @@ use lighthouse_network::service::api_types::Id; use parking_lot::RwLock; use std::collections::HashSet; use std::sync::Arc; -use types::blob_sidecar::FixedBlobSidecarList; +use types::data::FixedBlobSidecarList; use types::{DataColumnSidecarList, SignedBeaconBlock}; use super::SingleLookupId; 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 46897b2283b..43bfe29a84f 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 @@ -7,7 +7,6 @@ use crate::sync::network_context::{ use beacon_chain::{BeaconChainTypes, BlockProcessStatus}; use educe::Educe; use lighthouse_network::service::api_types::Id; -use lighthouse_tracing::SPAN_SINGLE_BLOCK_LOOKUP; use parking_lot::RwLock; use std::collections::HashSet; use std::fmt::Debug; @@ -16,7 +15,7 @@ use std::time::{Duration, Instant}; use store::Hash256; use strum::IntoStaticStr; use tracing::{Span, debug_span}; -use types::blob_sidecar::FixedBlobSidecarList; +use types::data::FixedBlobSidecarList; use types::{DataColumnSidecarList, EthSpec, SignedBeaconBlock, Slot}; // Dedicated enum for LookupResult to force its usage @@ -93,7 +92,7 @@ impl SingleBlockLookup { awaiting_parent: Option, ) -> Self { let lookup_span = debug_span!( - SPAN_SINGLE_BLOCK_LOOKUP, + "lh_single_block_lookup", block_root = %requested_block_root, id = id, ); diff --git a/beacon_node/network/src/sync/custody_backfill_sync/mod.rs b/beacon_node/network/src/sync/custody_backfill_sync/mod.rs index bb2c6799f1d..fa8b70c8b46 100644 --- a/beacon_node/network/src/sync/custody_backfill_sync/mod.rs +++ b/beacon_node/network/src/sync/custody_backfill_sync/mod.rs @@ -10,7 +10,6 @@ use lighthouse_network::{ service::api_types::{CustodyBackFillBatchRequestId, CustodyBackfillBatchId}, types::CustodyBackFillState, }; -use lighthouse_tracing::SPAN_CUSTODY_BACKFILL_SYNC_BATCH_REQUEST; use logging::crit; use std::hash::{DefaultHasher, Hash, Hasher}; use tracing::{debug, error, info, info_span, warn}; @@ -1004,7 +1003,7 @@ impl CustodyBackFillSync { network: &mut SyncNetworkContext, batch_id: BatchId, ) -> Result<(), CustodyBackfillError> { - let span = info_span!(SPAN_CUSTODY_BACKFILL_SYNC_BATCH_REQUEST); + let span = info_span!("lh_custody_backfill_sync_batch_request"); let _enter = span.enter(); if let Some(batch) = self.batches.get_mut(&batch_id) { diff --git a/beacon_node/network/src/sync/network_context.rs b/beacon_node/network/src/sync/network_context.rs index 2e0c56db23f..069d51764f0 100644 --- a/beacon_node/network/src/sync/network_context.rs +++ b/beacon_node/network/src/sync/network_context.rs @@ -31,7 +31,6 @@ use lighthouse_network::service::api_types::{ DataColumnsByRootRequester, Id, SingleLookupReqId, SyncRequestId, }; use lighthouse_network::{Client, NetworkGlobals, PeerAction, PeerId, ReportSource}; -use lighthouse_tracing::{SPAN_OUTGOING_BLOCK_BY_ROOT_REQUEST, SPAN_OUTGOING_RANGE_REQUEST}; use parking_lot::RwLock; pub use requests::LookupVerifyError; use requests::{ @@ -49,7 +48,7 @@ use std::time::Duration; use task_executor::TaskExecutor; use tokio::sync::mpsc; use tracing::{Span, debug, debug_span, error, warn}; -use types::blob_sidecar::FixedBlobSidecarList; +use types::data::FixedBlobSidecarList; use types::{ BlobSidecar, BlockImportSource, ColumnIndex, DataColumnSidecar, DataColumnSidecarList, EthSpec, ForkContext, Hash256, SignedBeaconBlock, Slot, @@ -546,7 +545,7 @@ impl SyncNetworkContext { ) -> Result { let range_request_span = debug_span!( parent: None, - SPAN_OUTGOING_RANGE_REQUEST, + "lh_outgoing_range_request", range_req_id = %requester, block_peers = block_peers.len(), column_peers = column_peers.len() @@ -908,7 +907,7 @@ impl SyncNetworkContext { let request_span = debug_span!( parent: Span::current(), - SPAN_OUTGOING_BLOCK_BY_ROOT_REQUEST, + "lh_outgoing_block_by_root_request", %block_root, ); self.blocks_by_root_requests.insert( diff --git a/beacon_node/network/src/sync/network_context/custody.rs b/beacon_node/network/src/sync/network_context/custody.rs index 71e002cc422..c94065b0154 100644 --- a/beacon_node/network/src/sync/network_context/custody.rs +++ b/beacon_node/network/src/sync/network_context/custody.rs @@ -6,14 +6,13 @@ use beacon_chain::validator_monitor::timestamp_now; use fnv::FnvHashMap; use lighthouse_network::PeerId; use lighthouse_network::service::api_types::{CustodyId, DataColumnsByRootRequester}; -use lighthouse_tracing::SPAN_OUTGOING_CUSTODY_REQUEST; use parking_lot::RwLock; use std::collections::HashSet; use std::hash::{BuildHasher, RandomState}; use std::time::{Duration, Instant}; use std::{collections::HashMap, marker::PhantomData, sync::Arc}; use tracing::{Span, debug, debug_span, warn}; -use types::{DataColumnSidecar, Hash256, data_column_sidecar::ColumnIndex}; +use types::{DataColumnSidecar, Hash256, data::ColumnIndex}; use types::{DataColumnSidecarList, EthSpec}; use super::{LookupRequestResult, PeerGroup, RpcResponseResult, SyncNetworkContext}; @@ -69,7 +68,7 @@ impl ActiveCustodyRequest { ) -> Self { let span = debug_span!( parent: Span::current(), - SPAN_OUTGOING_CUSTODY_REQUEST, + "lh_outgoing_custody_request", %block_root, ); Self { diff --git a/beacon_node/network/src/sync/network_context/requests/blobs_by_root.rs b/beacon_node/network/src/sync/network_context/requests/blobs_by_root.rs index 39886d814e8..556985c2b48 100644 --- a/beacon_node/network/src/sync/network_context/requests/blobs_by_root.rs +++ b/beacon_node/network/src/sync/network_context/requests/blobs_by_root.rs @@ -1,6 +1,6 @@ use lighthouse_network::rpc::methods::BlobsByRootRequest; use std::sync::Arc; -use types::{BlobSidecar, EthSpec, ForkContext, Hash256, blob_sidecar::BlobIdentifier}; +use types::{BlobSidecar, EthSpec, ForkContext, Hash256, data::BlobIdentifier}; use super::{ActiveRequestItems, LookupVerifyError}; diff --git a/beacon_node/network/src/sync/range_sync/chain.rs b/beacon_node/network/src/sync/range_sync/chain.rs index a3f2b798b1e..d67d6468a92 100644 --- a/beacon_node/network/src/sync/range_sync/chain.rs +++ b/beacon_node/network/src/sync/range_sync/chain.rs @@ -12,7 +12,6 @@ use beacon_chain::BeaconChainTypes; use beacon_chain::block_verification_types::RpcBlock; use lighthouse_network::service::api_types::Id; use lighthouse_network::{PeerAction, PeerId}; -use lighthouse_tracing::SPAN_SYNCING_CHAIN; use logging::crit; use std::collections::{BTreeMap, HashSet, btree_map::Entry}; use std::hash::{Hash, Hasher}; @@ -161,7 +160,7 @@ pub enum ChainSyncingState { impl SyncingChain { #[allow(clippy::too_many_arguments)] #[instrument( - name = SPAN_SYNCING_CHAIN, + name = "lh_syncing_chain", parent = None, level="debug", skip_all, diff --git a/beacon_node/network/src/sync/tests/lookups.rs b/beacon_node/network/src/sync/tests/lookups.rs index ef52f896785..715928906ee 100644 --- a/beacon_node/network/src/sync/tests/lookups.rs +++ b/beacon_node/network/src/sync/tests/lookups.rs @@ -43,7 +43,7 @@ use tracing::info; use types::{ BeaconState, BeaconStateBase, BlobSidecar, BlockImportSource, DataColumnSidecar, EthSpec, ForkContext, ForkName, Hash256, MinimalEthSpec as E, SignedBeaconBlock, Slot, - data_column_sidecar::ColumnIndex, + data::ColumnIndex, test_utils::{SeedableRng, TestRandom, XorShiftRng}, }; diff --git a/beacon_node/operation_pool/src/attestation.rs b/beacon_node/operation_pool/src/attestation.rs index 897a7e5eccc..045adfebe02 100644 --- a/beacon_node/operation_pool/src/attestation.rs +++ b/beacon_node/operation_pool/src/attestation.rs @@ -8,8 +8,8 @@ use state_processing::common::{ use std::collections::HashMap; use types::{ Attestation, BeaconState, ChainSpec, EthSpec, - beacon_state::BeaconStateBase, consts::altair::{PARTICIPATION_FLAG_WEIGHTS, PROPOSER_WEIGHT, WEIGHT_DENOMINATOR}, + state::BeaconStateBase, }; pub const PROPOSER_REWARD_DENOMINATOR: u64 = diff --git a/beacon_node/operation_pool/src/lib.rs b/beacon_node/operation_pool/src/lib.rs index 00361450a5b..81423d6abd4 100644 --- a/beacon_node/operation_pool/src/lib.rs +++ b/beacon_node/operation_pool/src/lib.rs @@ -39,8 +39,8 @@ use typenum::Unsigned; use types::{ AbstractExecPayload, Attestation, AttestationData, AttesterSlashing, BeaconState, BeaconStateError, ChainSpec, Epoch, EthSpec, ProposerSlashing, SignedBeaconBlock, - SignedBlsToExecutionChange, SignedVoluntaryExit, Slot, SyncAggregate, - SyncCommitteeContribution, Validator, sync_aggregate::Error as SyncAggregateError, + SignedBlsToExecutionChange, SignedVoluntaryExit, Slot, SyncAggregate, SyncAggregateError, + SyncCommitteeContribution, Validator, }; type SyncContributions = RwLock>>>; diff --git a/beacon_node/store/src/config.rs b/beacon_node/store/src/config.rs index 0aa00e659bc..29705283fa9 100644 --- a/beacon_node/store/src/config.rs +++ b/beacon_node/store/src/config.rs @@ -8,7 +8,7 @@ use std::num::NonZeroUsize; use strum::{Display, EnumString, VariantNames}; use superstruct::superstruct; use types::EthSpec; -use types::non_zero_usize::new_non_zero_usize; +use types::new_non_zero_usize; use zstd::{Decoder, Encoder}; #[cfg(all(feature = "redb", not(feature = "leveldb")))] diff --git a/beacon_node/store/src/hdiff.rs b/beacon_node/store/src/hdiff.rs index 323c87a9142..3777c83b609 100644 --- a/beacon_node/store/src/hdiff.rs +++ b/beacon_node/store/src/hdiff.rs @@ -11,7 +11,7 @@ use std::ops::RangeInclusive; use std::str::FromStr; use std::sync::LazyLock; use superstruct::superstruct; -use types::historical_summary::HistoricalSummary; +use types::state::HistoricalSummary; use types::{BeaconState, ChainSpec, Epoch, EthSpec, Hash256, Slot, Validator}; static EMPTY_PUBKEY: LazyLock = LazyLock::new(PublicKeyBytes::empty); diff --git a/beacon_node/store/src/hot_cold_store.rs b/beacon_node/store/src/hot_cold_store.rs index c4137191744..8eec4d5eceb 100644 --- a/beacon_node/store/src/hot_cold_store.rs +++ b/beacon_node/store/src/hot_cold_store.rs @@ -40,7 +40,7 @@ use std::sync::Arc; use std::time::Duration; use tracing::{debug, error, info, instrument, warn}; use typenum::Unsigned; -use types::data_column_sidecar::{ColumnIndex, DataColumnSidecar, DataColumnSidecarList}; +use types::data::{ColumnIndex, DataColumnSidecar, DataColumnSidecarList}; use types::*; use zstd::{Decoder, Encoder}; diff --git a/common/eth2_config/src/lib.rs b/common/eth2_config/src/lib.rs index 544138f0fa9..2c06fe146ab 100644 --- a/common/eth2_config/src/lib.rs +++ b/common/eth2_config/src/lib.rs @@ -33,6 +33,8 @@ const HOLESKY_GENESIS_STATE_SOURCE: GenesisStateSource = GenesisStateSource::Url checksum: "0xd750639607c337bbb192b15c27f447732267bf72d1650180a0e44c2d93a80741", genesis_validators_root: "0x9143aa7c615a7f7115e2b6aac319c03529df8242ae705fba9df39b79c59fa8b1", genesis_state_root: "0x0ea3f6f9515823b59c863454675fefcd1d8b4f2dbe454db166206a41fda060a0", + // ref: https://github.com/eth-clients/holesky/blob/main/README.md - Launch Epoch time + genesis_time: 1695902400, }; const HOODI_GENESIS_STATE_SOURCE: GenesisStateSource = GenesisStateSource::Url { @@ -44,6 +46,8 @@ const HOODI_GENESIS_STATE_SOURCE: GenesisStateSource = GenesisStateSource::Url { checksum: "0x7f42257ef69e055496c964a753bb07e54001ccd57ab467ef72d67af086bcfce7", genesis_validators_root: "0x212f13fc4df078b6cb7db228f1c8307566dcecf900867401a92023d7ba99cb5f", genesis_state_root: "0x2683ebc120f91f740c7bed4c866672d01e1ba51b4cc360297138465ee5df40f0", + // ref: https://github.com/eth-clients/hoodi/blob/main/README.md - Launch Epoch time + genesis_time: 1742213400, }; const CHIADO_GENESIS_STATE_SOURCE: GenesisStateSource = GenesisStateSource::Url { @@ -52,6 +56,8 @@ const CHIADO_GENESIS_STATE_SOURCE: GenesisStateSource = GenesisStateSource::Url checksum: "0xd4a039454c7429f1dfaa7e11e397ef3d0f50d2d5e4c0e4dc04919d153aa13af1", genesis_validators_root: "0x9d642dac73058fbf39c0ae41ab1e34e4d889043cb199851ded7095bc99eb4c1e", genesis_state_root: "0xa48419160f8f146ecaa53d12a5d6e1e6af414a328afdc56b60d5002bb472a077", + // ref: https://github.com/gnosischain/configs/blob/main/chiado/genesis.ssz + genesis_time: 1665396300, }; /// The core configuration of a Lighthouse beacon node. @@ -117,6 +123,10 @@ pub enum GenesisStateSource { /// /// The format should be 0x-prefixed ASCII bytes. genesis_state_root: &'static str, + /// The genesis time. + /// + /// The format should be u64. + genesis_time: u64, }, } diff --git a/common/eth2_network_config/built_in_network_configs/chiado/config.yaml b/common/eth2_network_config/built_in_network_configs/chiado/config.yaml index 6bc41113d6f..eafe1ad38c4 100644 --- a/common/eth2_network_config/built_in_network_configs/chiado/config.yaml +++ b/common/eth2_network_config/built_in_network_configs/chiado/config.yaml @@ -125,6 +125,7 @@ SUBNETS_PER_NODE: 2 ATTESTATION_SUBNET_COUNT: 64 ATTESTATION_SUBNET_EXTRA_BITS: 0 # ceillog2(ATTESTATION_SUBNET_COUNT) + ATTESTATION_SUBNET_EXTRA_BITS +# computed at runtime ATTESTATION_SUBNET_PREFIX_BITS: 6 # Deneb diff --git a/common/eth2_network_config/built_in_network_configs/gnosis/config.yaml b/common/eth2_network_config/built_in_network_configs/gnosis/config.yaml index aa2dbb35d35..2beeb45b25e 100644 --- a/common/eth2_network_config/built_in_network_configs/gnosis/config.yaml +++ b/common/eth2_network_config/built_in_network_configs/gnosis/config.yaml @@ -108,6 +108,8 @@ MESSAGE_DOMAIN_INVALID_SNAPPY: 0x00000000 MESSAGE_DOMAIN_VALID_SNAPPY: 0x01000000 ATTESTATION_SUBNET_COUNT: 64 ATTESTATION_SUBNET_EXTRA_BITS: 0 +# ceillog2(ATTESTATION_SUBNET_COUNT) + ATTESTATION_SUBNET_EXTRA_BITS +# computed at runtime ATTESTATION_SUBNET_PREFIX_BITS: 6 ATTESTATION_SUBNET_SHUFFLING_PREFIX_BITS: 3 diff --git a/common/eth2_network_config/built_in_network_configs/holesky/config.yaml b/common/eth2_network_config/built_in_network_configs/holesky/config.yaml index b1e9faea1d6..fc5b53173be 100644 --- a/common/eth2_network_config/built_in_network_configs/holesky/config.yaml +++ b/common/eth2_network_config/built_in_network_configs/holesky/config.yaml @@ -127,6 +127,7 @@ SUBNETS_PER_NODE: 2 ATTESTATION_SUBNET_COUNT: 64 ATTESTATION_SUBNET_EXTRA_BITS: 0 # ceillog2(ATTESTATION_SUBNET_COUNT) + ATTESTATION_SUBNET_EXTRA_BITS +# computed at runtime ATTESTATION_SUBNET_PREFIX_BITS: 6 ATTESTATION_SUBNET_SHUFFLING_PREFIX_BITS: 3 diff --git a/common/eth2_network_config/built_in_network_configs/hoodi/config.yaml b/common/eth2_network_config/built_in_network_configs/hoodi/config.yaml index 256957e1197..947caa21f0f 100644 --- a/common/eth2_network_config/built_in_network_configs/hoodi/config.yaml +++ b/common/eth2_network_config/built_in_network_configs/hoodi/config.yaml @@ -133,6 +133,7 @@ SUBNETS_PER_NODE: 2 ATTESTATION_SUBNET_COUNT: 64 ATTESTATION_SUBNET_EXTRA_BITS: 0 # ceillog2(ATTESTATION_SUBNET_COUNT) + ATTESTATION_SUBNET_EXTRA_BITS +# computed at runtime ATTESTATION_SUBNET_PREFIX_BITS: 6 # Deneb diff --git a/common/eth2_network_config/built_in_network_configs/mainnet/config.yaml b/common/eth2_network_config/built_in_network_configs/mainnet/config.yaml index 49168018cbe..5df6370abe2 100644 --- a/common/eth2_network_config/built_in_network_configs/mainnet/config.yaml +++ b/common/eth2_network_config/built_in_network_configs/mainnet/config.yaml @@ -22,13 +22,13 @@ TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH: 18446744073709551615 # Genesis # --------------------------------------------------------------- -# `2**14` (= 16,384) +# 2**14 (= 16,384) validators MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: 16384 # Dec 1, 2020, 12pm UTC MIN_GENESIS_TIME: 1606824000 -# Mainnet initial fork version, recommend altering for testnets +# Initial fork version for mainnet GENESIS_FORK_VERSION: 0x00000000 -# 604800 seconds (7 days) +# 7 * 24 * 3,600 (= 604,800) seconds, 7 days GENESIS_DELAY: 604800 # Forking @@ -39,25 +39,34 @@ GENESIS_DELAY: 604800 # Altair ALTAIR_FORK_VERSION: 0x01000000 -ALTAIR_FORK_EPOCH: 74240 # Oct 27, 2021, 10:56:23am UTC +ALTAIR_FORK_EPOCH: 74240 # Oct 27, 2021, 10:56:23am UTC # Bellatrix BELLATRIX_FORK_VERSION: 0x02000000 -BELLATRIX_FORK_EPOCH: 144896 # Sept 6, 2022, 11:34:47am UTC +BELLATRIX_FORK_EPOCH: 144896 # Sept 6, 2022, 11:34:47am UTC # Capella CAPELLA_FORK_VERSION: 0x03000000 -CAPELLA_FORK_EPOCH: 194048 # April 12, 2023, 10:27:35pm UTC +CAPELLA_FORK_EPOCH: 194048 # April 12, 2023, 10:27:35pm UTC # Deneb DENEB_FORK_VERSION: 0x04000000 -DENEB_FORK_EPOCH: 269568 # March 13, 2024, 01:55:35pm UTC +DENEB_FORK_EPOCH: 269568 # March 13, 2024, 01:55:35pm UTC # Electra ELECTRA_FORK_VERSION: 0x05000000 -ELECTRA_FORK_EPOCH: 364032 # May 7, 2025, 10:05:11am UTC +ELECTRA_FORK_EPOCH: 364032 # May 7, 2025, 10:05:11am UTC # Fulu FULU_FORK_VERSION: 0x06000000 -FULU_FORK_EPOCH: 411392 # December 3, 2025, 09:49:11pm UTC +FULU_FORK_EPOCH: 411392 # December 3, 2025, 09:49:11pm UTC # Gloas -GLOAS_FORK_VERSION: 0x07000000 +GLOAS_FORK_VERSION: 0x07000000 # temporary stub GLOAS_FORK_EPOCH: 18446744073709551615 +# EIP7441 +EIP7441_FORK_VERSION: 0x08000000 # temporary stub +EIP7441_FORK_EPOCH: 18446744073709551615 +# EIP7805 +EIP7805_FORK_VERSION: 0x0a000000 # temporary stub +EIP7805_FORK_EPOCH: 18446744073709551615 +# EIP7928 +EIP7928_FORK_VERSION: 0x0b000000 # temporary stub +EIP7928_FORK_EPOCH: 18446744073709551615 # Time parameters # --------------------------------------------------------------- @@ -86,6 +95,28 @@ SYNC_MESSAGE_DUE_BPS: 3333 # 6667 basis points, ~67% of SLOT_DURATION_MS CONTRIBUTION_DUE_BPS: 6667 +# Gloas +# 2**12 (= 4,096) epochs +MIN_BUILDER_WITHDRAWABILITY_DELAY: 4096 +# 2500 basis points, 25% of SLOT_DURATION_MS +ATTESTATION_DUE_BPS_GLOAS: 2500 +# 5000 basis points, 50% of SLOT_DURATION_MS +AGGREGATE_DUE_BPS_GLOAS: 5000 +# 2500 basis points, 25% of SLOT_DURATION_MS +SYNC_MESSAGE_DUE_BPS_GLOAS: 2500 +# 5000 basis points, 50% of SLOT_DURATION_MS +CONTRIBUTION_DUE_BPS_GLOAS: 5000 +# 7500 basis points, 75% of SLOT_DURATION_MS +PAYLOAD_ATTESTATION_DUE_BPS: 7500 + +# EIP7805 +# 7500 basis points, 75% of SLOT_DURATION_MS +VIEW_FREEZE_CUTOFF_BPS: 7500 +# 6667 basis points, ~67% of SLOT_DURATION_MS +INCLUSION_LIST_SUBMISSION_DUE_BPS: 6667 +# 9167 basis points, ~92% of SLOT_DURATION_MS +PROPOSER_INCLUSION_LIST_CUTOFF_BPS: 9167 + # Validator cycle # --------------------------------------------------------------- # 2**2 (= 4) @@ -137,10 +168,6 @@ MAX_REQUEST_BLOCKS: 1024 EPOCHS_PER_SUBNET_SUBSCRIPTION: 256 # MIN_VALIDATOR_WITHDRAWABILITY_DELAY + CHURN_LIMIT_QUOTIENT // 2 (= 33,024) epochs MIN_EPOCHS_FOR_BLOCK_REQUESTS: 33024 -# 5s -TTFB_TIMEOUT: 5 -# 10s -RESP_TIMEOUT: 10 # 2**5 (= 32) slots ATTESTATION_PROPAGATION_SLOT_RANGE: 32 # 500ms @@ -155,7 +182,6 @@ ATTESTATION_SUBNET_COUNT: 64 ATTESTATION_SUBNET_EXTRA_BITS: 0 # ceillog2(ATTESTATION_SUBNET_COUNT) + ATTESTATION_SUBNET_EXTRA_BITS (= 6 + 0) bits ATTESTATION_SUBNET_PREFIX_BITS: 6 -ATTESTATION_SUBNET_SHUFFLING_PREFIX_BITS: 3 # Deneb # 2**7 (= 128) blocks @@ -195,6 +221,22 @@ BALANCE_PER_ADDITIONAL_CUSTODY_GROUP: 32000000000 # 2**12 (= 4,096) epochs MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS: 4096 +# Gloas +# 2**7 (= 128) payloads +MAX_REQUEST_PAYLOADS: 128 + +# EIP7441 +# 2**8 (= 256) epochs +EPOCHS_PER_SHUFFLING_PHASE: 256 +# 2**1 (= 2) epochs +PROPOSER_SELECTION_GAP: 2 + +# EIP7805 +# 2**4 (= 16) inclusion lists +MAX_REQUEST_INCLUSION_LIST: 16 +# 2**13 (= 8,192) bytes +MAX_BYTES_PER_INCLUSION_LIST: 8192 + # Blob Scheduling # --------------------------------------------------------------- @@ -203,5 +245,3 @@ BLOB_SCHEDULE: MAX_BLOBS_PER_BLOCK: 15 - EPOCH: 419072 # January 7, 2026, 01:01:11am UTC MAX_BLOBS_PER_BLOCK: 21 - -# Gloas diff --git a/common/eth2_network_config/built_in_network_configs/sepolia/config.yaml b/common/eth2_network_config/built_in_network_configs/sepolia/config.yaml index b1a01933d70..6a655d8e84e 100644 --- a/common/eth2_network_config/built_in_network_configs/sepolia/config.yaml +++ b/common/eth2_network_config/built_in_network_configs/sepolia/config.yaml @@ -133,6 +133,7 @@ SUBNETS_PER_NODE: 2 ATTESTATION_SUBNET_COUNT: 64 ATTESTATION_SUBNET_EXTRA_BITS: 0 # ceillog2(ATTESTATION_SUBNET_COUNT) + ATTESTATION_SUBNET_EXTRA_BITS +# computed at runtime ATTESTATION_SUBNET_PREFIX_BITS: 6 ATTESTATION_SUBNET_SHUFFLING_PREFIX_BITS: 3 diff --git a/common/eth2_network_config/src/lib.rs b/common/eth2_network_config/src/lib.rs index 16ee45e524e..6fd8567bed5 100644 --- a/common/eth2_network_config/src/lib.rs +++ b/common/eth2_network_config/src/lib.rs @@ -133,6 +133,16 @@ impl Eth2NetworkConfig { self.genesis_state_source != GenesisStateSource::Unknown } + /// The `genesis_time` of the genesis state. + pub fn genesis_time(&self) -> Result, String> { + if let GenesisStateSource::Url { genesis_time, .. } = self.genesis_state_source { + Ok(Some(genesis_time)) + } else { + self.get_genesis_state_from_bytes::() + .map(|state| Some(state.genesis_time())) + } + } + /// The `genesis_validators_root` of the genesis state. pub fn genesis_validators_root(&self) -> Result, String> { if let GenesisStateSource::Url { diff --git a/common/tracing_samplers/Cargo.toml b/common/tracing_samplers/Cargo.toml new file mode 100644 index 00000000000..76afc10ee71 --- /dev/null +++ b/common/tracing_samplers/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "tracing_samplers" +version = "0.1.0" +edition = { workspace = true } + +[dependencies] +opentelemetry = { workspace = true } +opentelemetry_sdk = { workspace = true } diff --git a/common/tracing_samplers/src/lib.rs b/common/tracing_samplers/src/lib.rs new file mode 100644 index 00000000000..e34518ac4a1 --- /dev/null +++ b/common/tracing_samplers/src/lib.rs @@ -0,0 +1,78 @@ +//! OpenTelemetry samplers for filtering traces. + +use opentelemetry::Context; +use opentelemetry::trace::{Link, SamplingDecision, SamplingResult, SpanKind, TraceState}; +use opentelemetry_sdk::trace::ShouldSample; + +/// A sampler that only samples spans whose names start with a given prefix. +/// +/// This sampler is designed to be used with `Sampler::ParentBased`, which will: +/// - Use this sampler's decision for root spans (no parent) +/// - Automatically inherit the parent's sampling decision for child spans +/// +/// This ensures that only traces starting from known instrumented code paths are exported, +/// reducing noise from partially instrumented code paths. +#[derive(Debug, Clone)] +pub struct PrefixBasedSampler { + prefix: &'static str, +} + +impl PrefixBasedSampler { + pub fn new(prefix: &'static str) -> Self { + Self { prefix } + } +} + +impl ShouldSample for PrefixBasedSampler { + fn should_sample( + &self, + _parent_context: Option<&Context>, + _trace_id: opentelemetry::trace::TraceId, + name: &str, + _span_kind: &SpanKind, + _attributes: &[opentelemetry::KeyValue], + _links: &[Link], + ) -> SamplingResult { + if name.starts_with(self.prefix) { + SamplingResult { + decision: SamplingDecision::RecordAndSample, + attributes: Vec::new(), + trace_state: TraceState::default(), + } + } else { + SamplingResult { + decision: SamplingDecision::Drop, + attributes: Vec::new(), + trace_state: TraceState::default(), + } + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + use opentelemetry::trace::TraceId; + + #[test] + fn prefix_based_sampler_filters_by_prefix() { + let sampler = PrefixBasedSampler::new("test_"); + let trace_id = TraceId::from_hex("0123456789abcdef0123456789abcdef").unwrap(); + + // Spans with prefix should be sampled + let result = sampler.should_sample( + None, + trace_id, + "test_my_span", + &SpanKind::Internal, + &[], + &[], + ); + assert!(matches!(result.decision, SamplingDecision::RecordAndSample)); + + // Spans without prefix should be dropped + let result = + sampler.should_sample(None, trace_id, "other_span", &SpanKind::Internal, &[], &[]); + assert!(matches!(result.decision, SamplingDecision::Drop)); + } +} diff --git a/consensus/state_processing/src/common/altair.rs b/consensus/state_processing/src/common/altair.rs index 43801541336..dae6b0302d7 100644 --- a/consensus/state_processing/src/common/altair.rs +++ b/consensus/state_processing/src/common/altair.rs @@ -28,7 +28,7 @@ pub fn get_base_reward( validator_effective_balance: u64, base_reward_per_increment: BaseRewardPerIncrement, spec: &ChainSpec, -) -> Result { +) -> Result { validator_effective_balance .safe_div(spec.effective_balance_increment)? .safe_mul(base_reward_per_increment.as_u64()) diff --git a/consensus/state_processing/src/common/get_attesting_indices.rs b/consensus/state_processing/src/common/get_attesting_indices.rs index dc7be7c2515..ff9f60c5ea3 100644 --- a/consensus/state_processing/src/common/get_attesting_indices.rs +++ b/consensus/state_processing/src/common/get_attesting_indices.rs @@ -107,7 +107,7 @@ pub mod attesting_indices_electra { for committee_index in committee_indices { let beacon_committee = committees .get(committee_index as usize) - .ok_or(Error::NoCommitteeFound(committee_index))?; + .ok_or(BeaconStateError::NoCommitteeFound(committee_index))?; // This check is new to the spec's `process_attestation` in Electra. if committee_index >= committee_count_per_slot { diff --git a/consensus/state_processing/src/common/slash_validator.rs b/consensus/state_processing/src/common/slash_validator.rs index 01c1855fb10..ac7379abd90 100644 --- a/consensus/state_processing/src/common/slash_validator.rs +++ b/consensus/state_processing/src/common/slash_validator.rs @@ -42,8 +42,7 @@ pub fn slash_validator( decrease_balance( state, slashed_index, - validator_effective_balance - .safe_div(spec.min_slashing_penalty_quotient_for_state(state))?, + validator_effective_balance.safe_div(state.get_min_slashing_penalty_quotient(spec))?, )?; update_progressive_balances_on_slashing(state, slashed_index, validator_effective_balance)?; @@ -54,8 +53,8 @@ pub fn slash_validator( // Apply proposer and whistleblower rewards let proposer_index = ctxt.get_proposer_index(state, spec)? as usize; let whistleblower_index = opt_whistleblower_index.unwrap_or(proposer_index); - let whistleblower_reward = validator_effective_balance - .safe_div(spec.whistleblower_reward_quotient_for_state(state))?; + let whistleblower_reward = + validator_effective_balance.safe_div(state.get_whistleblower_reward_quotient(spec))?; let proposer_reward = if state.fork_name_unchecked().altair_enabled() { whistleblower_reward .safe_mul(PROPOSER_WEIGHT)? diff --git a/consensus/state_processing/src/epoch_cache.rs b/consensus/state_processing/src/epoch_cache.rs index ee03596d098..b890694a7ee 100644 --- a/consensus/state_processing/src/epoch_cache.rs +++ b/consensus/state_processing/src/epoch_cache.rs @@ -5,7 +5,7 @@ use crate::metrics; use fixed_bytes::FixedBytesExtended; use safe_arith::SafeArith; use tracing::instrument; -use types::epoch_cache::{EpochCache, EpochCacheError, EpochCacheKey}; +use types::state::{EpochCache, EpochCacheError, EpochCacheKey}; use types::{ActivationQueue, BeaconState, ChainSpec, EthSpec, ForkName, Hash256}; /// Precursor to an `EpochCache`. diff --git a/consensus/state_processing/src/genesis.rs b/consensus/state_processing/src/genesis.rs index 1575fce22f2..861fccb3742 100644 --- a/consensus/state_processing/src/genesis.rs +++ b/consensus/state_processing/src/genesis.rs @@ -195,7 +195,7 @@ pub fn is_valid_genesis_state(state: &BeaconState, spec: &ChainSp pub fn process_activations( state: &mut BeaconState, spec: &ChainSpec, -) -> Result<(), Error> { +) -> Result<(), BeaconStateError> { let (validators, balances, _) = state.validators_and_balances_and_progressive_balances_mut(); let mut validators_iter = validators.iter_cow(); while let Some((index, validator)) = validators_iter.next_cow() { @@ -203,7 +203,7 @@ pub fn process_activations( let balance = balances .get(index) .copied() - .ok_or(Error::BalancesOutOfBounds(index))?; + .ok_or(BeaconStateError::BalancesOutOfBounds(index))?; validator.effective_balance = std::cmp::min( balance.safe_sub(balance.safe_rem(spec.effective_balance_increment)?)?, spec.max_effective_balance, diff --git a/consensus/state_processing/src/per_block_processing.rs b/consensus/state_processing/src/per_block_processing.rs index 07149ff2ee8..cd1c1b9849d 100644 --- a/consensus/state_processing/src/per_block_processing.rs +++ b/consensus/state_processing/src/per_block_processing.rs @@ -322,7 +322,7 @@ pub fn process_randao>( pub fn process_eth1_data( state: &mut BeaconState, eth1_data: &Eth1Data, -) -> Result<(), Error> { +) -> Result<(), BeaconStateError> { if let Some(new_eth1_data) = get_new_eth1_data(state, eth1_data)? { *state.eth1_data_mut() = new_eth1_data; } diff --git a/consensus/state_processing/src/per_block_processing/deneb.rs b/consensus/state_processing/src/per_block_processing/deneb.rs index a57c080c03b..911e7e037ec 100644 --- a/consensus/state_processing/src/per_block_processing/deneb.rs +++ b/consensus/state_processing/src/per_block_processing/deneb.rs @@ -1,5 +1,5 @@ use ethereum_hashing::hash_fixed; -use types::{KzgCommitment, VERSIONED_HASH_VERSION_KZG, VersionedHash}; +use types::{VersionedHash, kzg_ext::KzgCommitment, kzg_ext::consts::VERSIONED_HASH_VERSION_KZG}; pub fn kzg_commitment_to_versioned_hash(kzg_commitment: &KzgCommitment) -> VersionedHash { let mut hashed_commitment = hash_fixed(&kzg_commitment.0); diff --git a/consensus/state_processing/src/per_epoch_processing/altair/inactivity_updates.rs b/consensus/state_processing/src/per_epoch_processing/altair/inactivity_updates.rs index 9e8a36b6d5c..34ead069f8c 100644 --- a/consensus/state_processing/src/per_epoch_processing/altair/inactivity_updates.rs +++ b/consensus/state_processing/src/per_epoch_processing/altair/inactivity_updates.rs @@ -1,8 +1,7 @@ use crate::EpochProcessingError; use crate::per_epoch_processing::single_pass::{SinglePassConfig, process_epoch_single_pass}; -use types::beacon_state::BeaconState; -use types::chain_spec::ChainSpec; -use types::eth_spec::EthSpec; +use types::core::{ChainSpec, EthSpec}; +use types::state::BeaconState; /// Slow version of `process_inactivity_updates` that runs a subset of single-pass processing. /// diff --git a/consensus/state_processing/src/per_epoch_processing/altair/participation_flag_updates.rs b/consensus/state_processing/src/per_epoch_processing/altair/participation_flag_updates.rs index 5e177c5d2b7..f9b60437548 100644 --- a/consensus/state_processing/src/per_epoch_processing/altair/participation_flag_updates.rs +++ b/consensus/state_processing/src/per_epoch_processing/altair/participation_flag_updates.rs @@ -1,8 +1,8 @@ use crate::EpochProcessingError; use milhouse::List; -use types::beacon_state::BeaconState; -use types::eth_spec::EthSpec; -use types::participation_flags::ParticipationFlags; +use types::attestation::ParticipationFlags; +use types::core::EthSpec; +use types::state::BeaconState; pub fn process_participation_flag_updates( state: &mut BeaconState, diff --git a/consensus/state_processing/src/per_epoch_processing/altair/sync_committee_updates.rs b/consensus/state_processing/src/per_epoch_processing/altair/sync_committee_updates.rs index 3bb2ced9824..12e80d608b1 100644 --- a/consensus/state_processing/src/per_epoch_processing/altair/sync_committee_updates.rs +++ b/consensus/state_processing/src/per_epoch_processing/altair/sync_committee_updates.rs @@ -1,9 +1,8 @@ use crate::EpochProcessingError; use safe_arith::SafeArith; use std::sync::Arc; -use types::beacon_state::BeaconState; -use types::chain_spec::ChainSpec; -use types::eth_spec::EthSpec; +use types::core::{ChainSpec, EthSpec}; +use types::state::BeaconState; pub fn process_sync_committee_updates( state: &mut BeaconState, diff --git a/consensus/state_processing/src/per_epoch_processing/base/participation_record_updates.rs b/consensus/state_processing/src/per_epoch_processing/base/participation_record_updates.rs index 52646e2269c..74f71ad3bcb 100644 --- a/consensus/state_processing/src/per_epoch_processing/base/participation_record_updates.rs +++ b/consensus/state_processing/src/per_epoch_processing/base/participation_record_updates.rs @@ -1,6 +1,6 @@ use crate::EpochProcessingError; -use types::beacon_state::BeaconState; -use types::eth_spec::EthSpec; +use types::core::EthSpec; +use types::state::BeaconState; pub fn process_participation_record_updates( state: &mut BeaconState, diff --git a/consensus/state_processing/src/per_epoch_processing/capella/historical_summaries_update.rs b/consensus/state_processing/src/per_epoch_processing/capella/historical_summaries_update.rs index 00adabdcfe9..92ba3326f5e 100644 --- a/consensus/state_processing/src/per_epoch_processing/capella/historical_summaries_update.rs +++ b/consensus/state_processing/src/per_epoch_processing/capella/historical_summaries_update.rs @@ -1,6 +1,6 @@ use crate::EpochProcessingError; use safe_arith::SafeArith; -use types::historical_summary::HistoricalSummary; +use types::state::HistoricalSummary; use types::{BeaconState, EthSpec}; pub fn process_historical_summaries_update( diff --git a/consensus/state_processing/src/per_epoch_processing/effective_balance_updates.rs b/consensus/state_processing/src/per_epoch_processing/effective_balance_updates.rs index 8daad83a157..6d00cb77ff1 100644 --- a/consensus/state_processing/src/per_epoch_processing/effective_balance_updates.rs +++ b/consensus/state_processing/src/per_epoch_processing/effective_balance_updates.rs @@ -1,8 +1,8 @@ use super::errors::EpochProcessingError; use crate::per_epoch_processing::single_pass::{SinglePassConfig, process_epoch_single_pass}; use safe_arith::SafeArith; -use types::beacon_state::BeaconState; -use types::chain_spec::ChainSpec; +use types::core::ChainSpec; +use types::state::BeaconState; use types::{BeaconStateError, EthSpec}; /// This implementation is now only used in phase0. Later hard forks use single-pass. diff --git a/consensus/state_processing/src/per_epoch_processing/historical_roots_update.rs b/consensus/state_processing/src/per_epoch_processing/historical_roots_update.rs index 9172d954bc8..1bb814af059 100644 --- a/consensus/state_processing/src/per_epoch_processing/historical_roots_update.rs +++ b/consensus/state_processing/src/per_epoch_processing/historical_roots_update.rs @@ -2,8 +2,8 @@ use super::errors::EpochProcessingError; use safe_arith::SafeArith; use tree_hash::TreeHash; use typenum::Unsigned; -use types::beacon_state::BeaconState; -use types::eth_spec::EthSpec; +use types::core::EthSpec; +use types::state::BeaconState; pub fn process_historical_roots_update( state: &mut BeaconState, diff --git a/consensus/state_processing/src/per_epoch_processing/resets.rs b/consensus/state_processing/src/per_epoch_processing/resets.rs index e05fb30c334..c00cb7d6352 100644 --- a/consensus/state_processing/src/per_epoch_processing/resets.rs +++ b/consensus/state_processing/src/per_epoch_processing/resets.rs @@ -2,8 +2,8 @@ use super::errors::EpochProcessingError; use milhouse::List; use safe_arith::SafeArith; use typenum::Unsigned; -use types::beacon_state::BeaconState; -use types::eth_spec::EthSpec; +use types::core::EthSpec; +use types::state::BeaconState; pub fn process_eth1_data_reset( state: &mut BeaconState, diff --git a/consensus/state_processing/src/per_epoch_processing/single_pass.rs b/consensus/state_processing/src/per_epoch_processing/single_pass.rs index 914e025f2fe..3e07803aa6a 100644 --- a/consensus/state_processing/src/per_epoch_processing/single_pass.rs +++ b/consensus/state_processing/src/per_epoch_processing/single_pass.rs @@ -886,7 +886,7 @@ impl SlashingsContext { ) -> Result { let sum_slashings = state.get_all_slashings().iter().copied().safe_sum()?; let adjusted_total_slashing_balance = min( - sum_slashings.safe_mul(spec.proportional_slashing_multiplier_for_state(state))?, + sum_slashings.safe_mul(state.get_proportional_slashing_multiplier(spec))?, state_ctxt.total_active_balance, ); diff --git a/consensus/state_processing/src/per_epoch_processing/slashings.rs b/consensus/state_processing/src/per_epoch_processing/slashings.rs index 6008276d150..cf5e82663c9 100644 --- a/consensus/state_processing/src/per_epoch_processing/slashings.rs +++ b/consensus/state_processing/src/per_epoch_processing/slashings.rs @@ -17,7 +17,7 @@ pub fn process_slashings( let sum_slashings = state.get_all_slashings().iter().copied().safe_sum()?; let adjusted_total_slashing_balance = std::cmp::min( - sum_slashings.safe_mul(spec.proportional_slashing_multiplier_for_state(state))?, + sum_slashings.safe_mul(state.get_proportional_slashing_multiplier(spec))?, total_balance, ); diff --git a/consensus/state_processing/src/upgrade/gloas.rs b/consensus/state_processing/src/upgrade/gloas.rs index 81c0fcfe63e..0e0f39fa023 100644 --- a/consensus/state_processing/src/upgrade/gloas.rs +++ b/consensus/state_processing/src/upgrade/gloas.rs @@ -1,7 +1,7 @@ -use bls::Hash256; use milhouse::{List, Vector}; use ssz_types::BitVector; use std::mem; +use typenum::Unsigned; use types::{ BeaconState, BeaconStateError as Error, BeaconStateGloas, BuilderPendingPayment, ChainSpec, EthSpec, ExecutionPayloadBid, Fork, @@ -88,15 +88,23 @@ pub fn upgrade_state_to_gloas( pending_deposits: pre.pending_deposits.clone(), pending_partial_withdrawals: pre.pending_partial_withdrawals.clone(), pending_consolidations: pre.pending_consolidations.clone(), + proposer_lookahead: mem::take(&mut pre.proposer_lookahead), // Gloas - execution_payload_availability: BitVector::default(), // All bits set to false initially + builders: List::default(), + next_withdrawal_builder_index: 0, + // All bits set to true per spec: + // execution_payload_availability = [0b1 for _ in range(SLOTS_PER_HISTORICAL_ROOT)] + execution_payload_availability: BitVector::from_bytes( + vec![0xFFu8; E::SlotsPerHistoricalRoot::to_usize() / 8].into(), + ) + .map_err(|_| Error::InvalidBitfield)?, builder_pending_payments: Vector::new(vec![ BuilderPendingPayment::default(); E::builder_pending_payments_limit() ])?, builder_pending_withdrawals: List::default(), // Empty list initially, latest_block_hash: pre.latest_execution_payload_header.block_hash, - latest_withdrawals_root: Hash256::default(), + payload_expected_withdrawals: List::default(), // Caches total_active_balance: pre.total_active_balance, progressive_balances_cache: mem::take(&mut pre.progressive_balances_cache), @@ -105,7 +113,6 @@ pub fn upgrade_state_to_gloas( exit_cache: mem::take(&mut pre.exit_cache), slashings_cache: mem::take(&mut pre.slashings_cache), epoch_cache: mem::take(&mut pre.epoch_cache), - proposer_lookahead: mem::take(&mut pre.proposer_lookahead), }); Ok(post) } diff --git a/consensus/types/presets/mainnet/gloas.yaml b/consensus/types/presets/mainnet/gloas.yaml index 45b7b8ae968..2da198dcae6 100644 --- a/consensus/types/presets/mainnet/gloas.yaml +++ b/consensus/types/presets/mainnet/gloas.yaml @@ -1 +1,23 @@ # Mainnet preset - Gloas + +# Misc +# --------------------------------------------------------------- +# 2**9 (= 512) validators +PTC_SIZE: 512 + +# Max operations per block +# --------------------------------------------------------------- +# 2**2 (= 4) attestations +MAX_PAYLOAD_ATTESTATIONS: 4 + +# State list lengths +# --------------------------------------------------------------- +# 2**40 (= 1,099,511,627,776) builder spots +BUILDER_REGISTRY_LIMIT: 1099511627776 +# 2**20 (= 1,048,576) builder pending withdrawals +BUILDER_PENDING_WITHDRAWALS_LIMIT: 1048576 + +# Withdrawals processing +# --------------------------------------------------------------- +# 2**14 (= 16,384) builders +MAX_BUILDERS_PER_WITHDRAWALS_SWEEP: 16384 \ No newline at end of file diff --git a/consensus/types/presets/minimal/gloas.yaml b/consensus/types/presets/minimal/gloas.yaml index 51b3f048571..7ae61ddf97f 100644 --- a/consensus/types/presets/minimal/gloas.yaml +++ b/consensus/types/presets/minimal/gloas.yaml @@ -1 +1,23 @@ # Minimal preset - Gloas + +# Misc +# --------------------------------------------------------------- +# [customized] 2**1 (= 2) validators +PTC_SIZE: 2 + +# Max operations per block +# --------------------------------------------------------------- +# 2**2 (= 4) attestations +MAX_PAYLOAD_ATTESTATIONS: 4 + +# State list lengths +# --------------------------------------------------------------- +# 2**40 (= 1,099,511,627,776) builder spots +BUILDER_REGISTRY_LIMIT: 1099511627776 +# 2**20 (= 1,048,576) builder pending withdrawals +BUILDER_PENDING_WITHDRAWALS_LIMIT: 1048576 + +# Withdrawals processing +# --------------------------------------------------------------- +# [customized] 2**4 (= 16) builders +MAX_BUILDERS_PER_WITHDRAWALS_SWEEP: 16 diff --git a/consensus/types/src/attestation/mod.rs b/consensus/types/src/attestation/mod.rs index 586d99bd900..5b59b83e726 100644 --- a/consensus/types/src/attestation/mod.rs +++ b/consensus/types/src/attestation/mod.rs @@ -11,6 +11,7 @@ mod payload_attestation; mod payload_attestation_data; mod payload_attestation_message; mod pending_attestation; +mod ptc; mod selection_proof; mod shuffling_id; mod signed_aggregate_and_proof; @@ -36,6 +37,7 @@ pub use payload_attestation::PayloadAttestation; pub use payload_attestation_data::PayloadAttestationData; pub use payload_attestation_message::PayloadAttestationMessage; pub use pending_attestation::PendingAttestation; +pub use ptc::PTC; pub use selection_proof::SelectionProof; pub use shuffling_id::AttestationShufflingId; pub use signed_aggregate_and_proof::{ diff --git a/consensus/types/src/attestation/payload_attestation.rs b/consensus/types/src/attestation/payload_attestation.rs index 192a4a8fea5..115a5ec4d62 100644 --- a/consensus/types/src/attestation/payload_attestation.rs +++ b/consensus/types/src/attestation/payload_attestation.rs @@ -5,7 +5,7 @@ use bls::AggregateSignature; use context_deserialize::context_deserialize; use educe::Educe; use serde::{Deserialize, Serialize}; -use ssz::BitList; +use ssz::BitVector; use ssz_derive::{Decode, Encode}; use test_random_derive::TestRandom; use tree_hash_derive::TreeHash; @@ -17,7 +17,7 @@ use tree_hash_derive::TreeHash; #[educe(PartialEq, Hash)] #[context_deserialize(ForkName)] pub struct PayloadAttestation { - pub aggregation_bits: BitList, + pub aggregation_bits: BitVector, pub data: PayloadAttestationData, pub signature: AggregateSignature, } diff --git a/consensus/types/src/attestation/ptc.rs b/consensus/types/src/attestation/ptc.rs new file mode 100644 index 00000000000..1eef2f7d683 --- /dev/null +++ b/consensus/types/src/attestation/ptc.rs @@ -0,0 +1,23 @@ +use crate::EthSpec; +use ssz_types::FixedVector; + +#[derive(Clone, Debug, PartialEq)] +pub struct PTC(pub FixedVector); + +impl<'a, E: EthSpec> IntoIterator for &'a PTC { + type Item = &'a usize; + type IntoIter = std::slice::Iter<'a, usize>; + + fn into_iter(self) -> Self::IntoIter { + self.0.iter() + } +} + +impl IntoIterator for PTC { + type Item = usize; + type IntoIter = std::vec::IntoIter; + + fn into_iter(self) -> Self::IntoIter { + self.0.into_iter() + } +} diff --git a/consensus/types/src/block/beacon_block_body.rs b/consensus/types/src/block/beacon_block_body.rs index 1a0b3859002..a113f85fd31 100644 --- a/consensus/types/src/block/beacon_block_body.rs +++ b/consensus/types/src/block/beacon_block_body.rs @@ -13,10 +13,11 @@ use test_random_derive::TestRandom; use tree_hash::{BYTES_PER_CHUNK, TreeHash}; use tree_hash_derive::TreeHash; -use crate::payload_attestation::PayloadAttestation; use crate::{ SignedExecutionPayloadBid, - attestation::{AttestationBase, AttestationElectra, AttestationRef, AttestationRefMut}, + attestation::{ + AttestationBase, AttestationElectra, AttestationRef, AttestationRefMut, PayloadAttestation, + }, core::{EthSpec, Graffiti, Hash256}, deposit::Deposit, execution::{ diff --git a/consensus/types/src/builder/builder.rs b/consensus/types/src/builder/builder.rs new file mode 100644 index 00000000000..81ca45046c7 --- /dev/null +++ b/consensus/types/src/builder/builder.rs @@ -0,0 +1,24 @@ +use crate::test_utils::TestRandom; +use crate::{Address, Epoch}; +use bls::PublicKeyBytes; +use serde::{Deserialize, Serialize}; +use ssz_derive::{Decode, Encode}; +use test_random_derive::TestRandom; +use tree_hash_derive::TreeHash; + +pub type BuilderIndex = u64; + +#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] +#[derive( + Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Encode, Decode, TestRandom, TreeHash, +)] +pub struct Builder { + pub pubkey: PublicKeyBytes, + #[serde(with = "serde_utils::quoted_u8")] + pub version: u8, + pub execution_address: Address, + #[serde(with = "serde_utils::quoted_u64")] + pub balance: u64, + pub deposit_epoch: Epoch, + pub withdrawable_epoch: Epoch, +} diff --git a/consensus/types/src/builder/builder_pending_withdrawal.rs b/consensus/types/src/builder/builder_pending_withdrawal.rs index 436d331c003..dbbb029a5d8 100644 --- a/consensus/types/src/builder/builder_pending_withdrawal.rs +++ b/consensus/types/src/builder/builder_pending_withdrawal.rs @@ -1,5 +1,5 @@ use crate::test_utils::TestRandom; -use crate::{Address, Epoch, ForkName}; +use crate::{Address, ForkName}; use context_deserialize::context_deserialize; use serde::{Deserialize, Serialize}; use ssz_derive::{Decode, Encode}; @@ -29,7 +29,6 @@ pub struct BuilderPendingWithdrawal { pub amount: u64, #[serde(with = "serde_utils::quoted_u64")] pub builder_index: u64, - pub withdrawable_epoch: Epoch, } #[cfg(test)] diff --git a/consensus/types/src/builder/mod.rs b/consensus/types/src/builder/mod.rs index 54d0ae4eb73..f4e0e346f24 100644 --- a/consensus/types/src/builder/mod.rs +++ b/consensus/types/src/builder/mod.rs @@ -1,7 +1,9 @@ +mod builder; mod builder_bid; mod builder_pending_payment; mod builder_pending_withdrawal; +pub use builder::{Builder, BuilderIndex}; pub use builder_bid::{ BuilderBid, BuilderBidBellatrix, BuilderBidCapella, BuilderBidDeneb, BuilderBidElectra, BuilderBidFulu, SignedBuilderBid, diff --git a/consensus/types/src/core/chain_spec.rs b/consensus/types/src/core/chain_spec.rs index da3f9b90ccc..c02456540c1 100644 --- a/consensus/types/src/core/chain_spec.rs +++ b/consensus/types/src/core/chain_spec.rs @@ -14,12 +14,10 @@ use tree_hash::TreeHash; use crate::{ core::{ APPLICATION_DOMAIN_BUILDER, Address, ApplicationDomain, EnrForkId, Epoch, EthSpec, - EthSpecId, Hash256, MainnetEthSpec, Slot, Uint256, + EthSpecId, ExecutionBlockHash, Hash256, MainnetEthSpec, Slot, Uint256, }, data::{BlobIdentifier, DataColumnSubnetId, DataColumnsByRootIdentifier}, - execution::ExecutionBlockHash, fork::{Fork, ForkData, ForkName}, - state::BeaconState, }; /// Each of the BLS signature domains. @@ -38,6 +36,7 @@ pub enum Domain { SyncCommitteeSelectionProof, BeaconBuilder, PTCAttester, + ProposerPreferences, ApplicationMask(ApplicationDomain), } @@ -132,6 +131,7 @@ pub struct ChainSpec { pub(crate) domain_aggregate_and_proof: u32, pub(crate) domain_beacon_builder: u32, pub(crate) domain_ptc_attester: u32, + pub(crate) domain_proposer_preferences: u32, /* * Fork choice @@ -164,6 +164,7 @@ pub struct ChainSpec { pub inactivity_score_bias: u64, pub inactivity_score_recovery_rate: u64, pub min_sync_committee_participants: u64, + pub update_timeout: u64, pub(crate) domain_sync_committee: u32, pub(crate) domain_sync_committee_selection_proof: u32, pub(crate) domain_contribution_and_proof: u32, @@ -235,6 +236,7 @@ pub struct ChainSpec { pub gloas_fork_epoch: Option, pub builder_payment_threshold_numerator: u64, pub builder_payment_threshold_denominator: u64, + pub min_builder_withdrawability_delay: Epoch, /* * Networking @@ -252,7 +254,9 @@ pub struct ChainSpec { pub message_domain_invalid_snappy: [u8; 4], pub message_domain_valid_snappy: [u8; 4], pub subnets_per_node: u8, + pub epochs_per_subnet_subscription: u64, pub attestation_subnet_count: u64, + pub attestation_subnet_extra_bits: u8, pub attestation_subnet_prefix_bits: u8, /* @@ -418,51 +422,6 @@ impl ChainSpec { } } - /// For a given `BeaconState`, return the proportional slashing multiplier associated with its variant. - pub fn proportional_slashing_multiplier_for_state( - &self, - state: &BeaconState, - ) -> u64 { - let fork_name = state.fork_name_unchecked(); - if fork_name >= ForkName::Bellatrix { - self.proportional_slashing_multiplier_bellatrix - } else if fork_name >= ForkName::Altair { - self.proportional_slashing_multiplier_altair - } else { - self.proportional_slashing_multiplier - } - } - - /// For a given `BeaconState`, return the minimum slashing penalty quotient associated with its variant. - pub fn min_slashing_penalty_quotient_for_state( - &self, - state: &BeaconState, - ) -> u64 { - let fork_name = state.fork_name_unchecked(); - if fork_name.electra_enabled() { - self.min_slashing_penalty_quotient_electra - } else if fork_name >= ForkName::Bellatrix { - self.min_slashing_penalty_quotient_bellatrix - } else if fork_name >= ForkName::Altair { - self.min_slashing_penalty_quotient_altair - } else { - self.min_slashing_penalty_quotient - } - } - - /// For a given `BeaconState`, return the whistleblower reward quotient associated with its variant. - pub fn whistleblower_reward_quotient_for_state( - &self, - state: &BeaconState, - ) -> u64 { - let fork_name = state.fork_name_unchecked(); - if fork_name.electra_enabled() { - self.whistleblower_reward_quotient_electra - } else { - self.whistleblower_reward_quotient - } - } - pub fn max_effective_balance_for_fork(&self, fork_name: ForkName) -> u64 { if fork_name.electra_enabled() { self.max_effective_balance_electra @@ -544,6 +503,7 @@ impl ChainSpec { Domain::AggregateAndProof => self.domain_aggregate_and_proof, Domain::BeaconBuilder => self.domain_beacon_builder, Domain::PTCAttester => self.domain_ptc_attester, + Domain::ProposerPreferences => self.domain_proposer_preferences, Domain::SyncCommittee => self.domain_sync_committee, Domain::ContributionAndProof => self.domain_contribution_and_proof, Domain::SyncCommitteeSelectionProof => self.domain_sync_committee_selection_proof, @@ -1021,8 +981,9 @@ impl ChainSpec { domain_voluntary_exit: 4, domain_selection_proof: 5, domain_aggregate_and_proof: 6, - domain_beacon_builder: 0x1B, + domain_beacon_builder: 0x0B, domain_ptc_attester: 0x0C, + domain_proposer_preferences: 0x0D, /* * Fork choice @@ -1060,6 +1021,7 @@ impl ChainSpec { inactivity_score_bias: 4, inactivity_score_recovery_rate: 16, min_sync_committee_participants: 1, + update_timeout: 8192, epochs_per_sync_committee_period: Epoch::new(256), domain_sync_committee: 7, domain_sync_committee_selection_proof: 8, @@ -1145,6 +1107,7 @@ impl ChainSpec { gloas_fork_epoch: None, builder_payment_threshold_numerator: 6, builder_payment_threshold_denominator: 10, + min_builder_withdrawability_delay: Epoch::new(4096), /* * Network specific @@ -1152,7 +1115,9 @@ impl ChainSpec { boot_nodes: vec![], network_id: 1, // mainnet network id attestation_propagation_slot_range: default_attestation_propagation_slot_range(), + epochs_per_subnet_subscription: 256, attestation_subnet_count: 64, + attestation_subnet_extra_bits: 0, subnets_per_node: 2, maximum_gossip_clock_disparity: default_maximum_gossip_clock_disparity(), target_aggregators_per_committee: 16, @@ -1162,7 +1127,10 @@ impl ChainSpec { resp_timeout: default_resp_timeout(), message_domain_invalid_snappy: default_message_domain_invalid_snappy(), message_domain_valid_snappy: default_message_domain_valid_snappy(), - attestation_subnet_prefix_bits: default_attestation_subnet_prefix_bits(), + attestation_subnet_prefix_bits: compute_attestation_subnet_prefix_bits( + default_attestation_subnet_count(), + default_attestation_subnet_extra_bits(), + ), max_request_blocks: default_max_request_blocks(), /* @@ -1243,6 +1211,7 @@ impl ChainSpec { proportional_slashing_multiplier: 2, // Altair epochs_per_sync_committee_period: Epoch::new(8), + update_timeout: 64, altair_fork_version: [0x01, 0x00, 0x00, 0x01], altair_fork_epoch: None, // Bellatrix @@ -1279,7 +1248,7 @@ impl ChainSpec { fulu_fork_version: [0x06, 0x00, 0x00, 0x01], fulu_fork_epoch: None, // Gloas - gloas_fork_version: [0x07, 0x00, 0x00, 0x00], + gloas_fork_version: [0x07, 0x00, 0x00, 0x01], gloas_fork_epoch: None, // Other network_id: 2, // lighthouse testnet network id @@ -1387,8 +1356,9 @@ impl ChainSpec { domain_voluntary_exit: 4, domain_selection_proof: 5, domain_aggregate_and_proof: 6, - domain_beacon_builder: 0x1B, + domain_beacon_builder: 0x0B, domain_ptc_attester: 0x0C, + domain_proposer_preferences: 0x0D, /* * Fork choice @@ -1426,6 +1396,7 @@ impl ChainSpec { inactivity_score_bias: 4, inactivity_score_recovery_rate: 16, min_sync_committee_participants: 1, + update_timeout: 8192, epochs_per_sync_committee_period: Epoch::new(512), domain_sync_committee: 7, domain_sync_committee_selection_proof: 8, @@ -1510,6 +1481,7 @@ impl ChainSpec { gloas_fork_epoch: None, builder_payment_threshold_numerator: 6, builder_payment_threshold_denominator: 10, + min_builder_withdrawability_delay: Epoch::new(4096), /* * Network specific @@ -1517,7 +1489,9 @@ impl ChainSpec { boot_nodes: vec![], network_id: 100, // Gnosis Chain network id attestation_propagation_slot_range: default_attestation_propagation_slot_range(), + epochs_per_subnet_subscription: 256, attestation_subnet_count: 64, + attestation_subnet_extra_bits: 0, subnets_per_node: 4, // Make this larger than usual to avoid network damage maximum_gossip_clock_disparity: default_maximum_gossip_clock_disparity(), target_aggregators_per_committee: 16, @@ -1528,7 +1502,10 @@ impl ChainSpec { message_domain_invalid_snappy: default_message_domain_invalid_snappy(), message_domain_valid_snappy: default_message_domain_valid_snappy(), max_request_blocks: default_max_request_blocks(), - attestation_subnet_prefix_bits: default_attestation_subnet_prefix_bits(), + attestation_subnet_prefix_bits: compute_attestation_subnet_prefix_bits( + default_attestation_subnet_count(), + default_attestation_subnet_extra_bits(), + ), /* * Networking Deneb Specific @@ -1849,9 +1826,15 @@ pub struct Config { #[serde(default = "default_message_domain_valid_snappy")] #[serde(with = "serde_utils::bytes_4_hex")] message_domain_valid_snappy: [u8; 4], - #[serde(default = "default_attestation_subnet_prefix_bits")] + #[serde(default = "default_epochs_per_subnet_subscription")] + #[serde(with = "serde_utils::quoted_u64")] + epochs_per_subnet_subscription: u64, + #[serde(default = "default_attestation_subnet_count")] + #[serde(with = "serde_utils::quoted_u64")] + attestation_subnet_count: u64, + #[serde(default = "default_attestation_subnet_extra_bits")] #[serde(with = "serde_utils::quoted_u8")] - attestation_subnet_prefix_bits: u8, + attestation_subnet_extra_bits: u8, #[serde(default = "default_max_request_blocks_deneb")] #[serde(with = "serde_utils::quoted_u64")] max_request_blocks_deneb: u64, @@ -1966,8 +1949,36 @@ fn default_subnets_per_node() -> u8 { 2u8 } -fn default_attestation_subnet_prefix_bits() -> u8 { - 6 +const fn default_epochs_per_subnet_subscription() -> u64 { + 256 +} + +const fn default_attestation_subnet_count() -> u64 { + 64 +} + +const fn default_attestation_subnet_extra_bits() -> u8 { + 0 +} + +/// Compute attestation_subnet_prefix_bits dynamically as: +/// ceillog2(ATTESTATION_SUBNET_COUNT) + ATTESTATION_SUBNET_EXTRA_BITS +fn compute_attestation_subnet_prefix_bits( + attestation_subnet_count: u64, + attestation_subnet_extra_bits: u8, +) -> u8 { + let default_attestation_subnet_prefix_bits = 6u8; + + // ceillog2() = next_power_of_two().ilog2() + // casting to u8 is fine given ilog2(u64::MAX) = 63 + let min_bits_needed = attestation_subnet_count + .checked_next_power_of_two() + .and_then(|x| x.checked_ilog2()) + .unwrap_or(default_attestation_subnet_prefix_bits as u32) as u8; + + min_bits_needed + .safe_add(attestation_subnet_extra_bits) + .unwrap_or(default_attestation_subnet_prefix_bits) } const fn default_max_per_epoch_activation_churn_limit() -> u64 { @@ -2252,7 +2263,9 @@ impl Config { shard_committee_period: spec.shard_committee_period, eth1_follow_distance: spec.eth1_follow_distance, subnets_per_node: spec.subnets_per_node, - attestation_subnet_prefix_bits: spec.attestation_subnet_prefix_bits, + epochs_per_subnet_subscription: spec.epochs_per_subnet_subscription, + attestation_subnet_count: spec.attestation_subnet_count, + attestation_subnet_extra_bits: spec.attestation_subnet_extra_bits, inactivity_score_bias: spec.inactivity_score_bias, inactivity_score_recovery_rate: spec.inactivity_score_recovery_rate, @@ -2343,7 +2356,9 @@ impl Config { shard_committee_period, eth1_follow_distance, subnets_per_node, - attestation_subnet_prefix_bits, + epochs_per_subnet_subscription, + attestation_subnet_count, + attestation_subnet_extra_bits, inactivity_score_bias, inactivity_score_recovery_rate, ejection_balance, @@ -2416,6 +2431,9 @@ impl Config { shard_committee_period, eth1_follow_distance, subnets_per_node, + epochs_per_subnet_subscription, + attestation_subnet_count, + attestation_subnet_extra_bits, inactivity_score_bias, inactivity_score_recovery_rate, ejection_balance, @@ -2436,7 +2454,11 @@ impl Config { resp_timeout, message_domain_invalid_snappy, message_domain_valid_snappy, - attestation_subnet_prefix_bits, + // Compute attestation_subnet_prefix_bits dynamically + attestation_subnet_prefix_bits: compute_attestation_subnet_prefix_bits( + attestation_subnet_count, + attestation_subnet_extra_bits, + ), max_request_blocks, attestation_propagation_slot_range, maximum_gossip_clock_disparity, @@ -2605,6 +2627,13 @@ mod tests { } } } + + #[test] + fn test_compute_min_bits_for_n_values_edge_cases() { + assert_eq!(compute_attestation_subnet_prefix_bits(64, 0), 6); + assert_eq!(compute_attestation_subnet_prefix_bits(65, 0), 7); + assert_eq!(compute_attestation_subnet_prefix_bits(0, 1), 1); + } } #[cfg(test)] @@ -2684,6 +2713,9 @@ mod yaml_tests { REORG_HEAD_WEIGHT_THRESHOLD: 20 REORG_PARENT_WEIGHT_THRESHOLD: 160 REORG_MAX_EPOCHS_SINCE_FINALIZATION: 2 + EPOCHS_PER_SUBNET_SUBSCRIPTION: 256 + ATTESTATION_SUBNET_COUNT: 64 + ATTESTATION_SUBNET_EXTRA_BITS: 0 DEPOSIT_CHAIN_ID: 7042643276 DEPOSIT_NETWORK_ID: 7042643276 DEPOSIT_CONTRACT_ADDRESS: 0x00000000219ab540356cBB839Cbe05303d7705Fa @@ -2833,6 +2865,9 @@ mod yaml_tests { REORG_HEAD_WEIGHT_THRESHOLD: 20 REORG_PARENT_WEIGHT_THRESHOLD: 160 REORG_MAX_EPOCHS_SINCE_FINALIZATION: 2 + EPOCHS_PER_SUBNET_SUBSCRIPTION: 256 + ATTESTATION_SUBNET_COUNT: 64 + ATTESTATION_SUBNET_EXTRA_BITS: 0 DEPOSIT_CHAIN_ID: 7042643276 DEPOSIT_NETWORK_ID: 7042643276 DEPOSIT_CONTRACT_ADDRESS: 0x00000000219ab540356cBB839Cbe05303d7705Fa @@ -2942,6 +2977,9 @@ mod yaml_tests { MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT: 8 CHURN_LIMIT_QUOTIENT: 65536 PROPOSER_SCORE_BOOST: 40 + EPOCHS_PER_SUBNET_SUBSCRIPTION: 256 + ATTESTATION_SUBNET_COUNT: 64 + ATTESTATION_SUBNET_EXTRA_BITS: 0 DEPOSIT_CHAIN_ID: 1 DEPOSIT_NETWORK_ID: 1 DEPOSIT_CONTRACT_ADDRESS: 0x00000000219ab540356cBB839Cbe05303d7705Fa @@ -2974,7 +3012,6 @@ mod yaml_tests { check_default!(resp_timeout); check_default!(message_domain_invalid_snappy); check_default!(message_domain_valid_snappy); - check_default!(attestation_subnet_prefix_bits); assert_eq!(chain_spec.bellatrix_fork_epoch, None); } diff --git a/consensus/types/src/core/config_and_preset.rs b/consensus/types/src/core/config_and_preset.rs index 08141c77311..5b8b27b02e2 100644 --- a/consensus/types/src/core/config_and_preset.rs +++ b/consensus/types/src/core/config_and_preset.rs @@ -114,6 +114,7 @@ pub fn get_extra_fields(spec: &ChainSpec) -> HashMap { let u32_hex = |v: u32| hex_string(&v.to_le_bytes()); let u8_hex = |v: u8| hex_string(&v.to_le_bytes()); hashmap! { + "attestation_subnet_prefix_bits".to_uppercase() => spec.attestation_subnet_prefix_bits.to_string().into(), "bls_withdrawal_prefix".to_uppercase() => u8_hex(spec.bls_withdrawal_prefix_byte), "eth1_address_withdrawal_prefix".to_uppercase() => u8_hex(spec.eth1_address_withdrawal_prefix_byte), "domain_beacon_proposer".to_uppercase() => u32_hex(spec.domain_beacon_proposer), @@ -131,6 +132,7 @@ pub fn get_extra_fields(spec: &ChainSpec) -> HashMap { "domain_sync_committee".to_uppercase() => u32_hex(spec.domain_sync_committee), "domain_sync_committee_selection_proof".to_uppercase() => u32_hex(spec.domain_sync_committee_selection_proof), + "domain_bls_to_execution_change".to_uppercase() => u32_hex(spec.domain_bls_to_execution_change), "sync_committee_subnet_count".to_uppercase() => consts::altair::SYNC_COMMITTEE_SUBNET_COUNT.to_string().into(), "target_aggregators_per_sync_subcommittee".to_uppercase() => @@ -183,4 +185,38 @@ mod test { serde_yaml::from_reader(reader).expect("error while deserializing"); assert_eq!(ConfigAndPreset::Gloas(from), yamlconfig); } + + #[test] + fn test_attestation_subnet_prefix_bits_in_extra_fields() { + let mainnet_spec = ChainSpec::mainnet(); + let config = ConfigAndPreset::from_chain_spec::(&mainnet_spec); + let extra_fields = config.extra_fields(); + assert!(extra_fields.contains_key("ATTESTATION_SUBNET_PREFIX_BITS")); + + // For mainnet: 64 subnets, 0 extra bits -> ceil(log2(64)) + 0 = 6 + assert_eq!( + extra_fields.get("ATTESTATION_SUBNET_PREFIX_BITS"), + Some(&Value::String("6".to_string())) + ); + } + + // This is not exhaustive, but it can be extended as new fields are added to the spec. + #[test] + fn test_required_spec_fields_exist() { + let mainnet_spec = ChainSpec::mainnet(); + let config = ConfigAndPreset::from_chain_spec::(&mainnet_spec); + let json = serde_json::to_value(&config).expect("should serialize"); + let obj = json.as_object().expect("should be an object"); + let required_fields = [ + "EPOCHS_PER_SUBNET_SUBSCRIPTION", + "ATTESTATION_SUBNET_COUNT", + "ATTESTATION_SUBNET_EXTRA_BITS", + "ATTESTATION_SUBNET_PREFIX_BITS", + "UPDATE_TIMEOUT", + "DOMAIN_BLS_TO_EXECUTION_CHANGE", + ]; + for field in required_fields { + assert!(obj.contains_key(field), "Missing required field: {}", field); + } + } } diff --git a/consensus/types/src/core/consts.rs b/consensus/types/src/core/consts.rs index b6d63c47a88..2c67657ee6d 100644 --- a/consensus/types/src/core/consts.rs +++ b/consensus/types/src/core/consts.rs @@ -25,3 +25,17 @@ pub mod bellatrix { pub mod deneb { pub use kzg::VERSIONED_HASH_VERSION_KZG; } +pub mod gloas { + pub const BUILDER_INDEX_SELF_BUILD: u64 = u64::MAX; + pub const BUILDER_INDEX_FLAG: u64 = 1 << 40; + + // Fork choice constants + pub type PayloadStatus = u8; + pub const PAYLOAD_STATUS_PENDING: PayloadStatus = 0; + pub const PAYLOAD_STATUS_EMPTY: PayloadStatus = 1; + pub const PAYLOAD_STATUS_FULL: PayloadStatus = 2; + + pub const ATTESTATION_TIMELINESS_INDEX: usize = 0; + pub const PTC_TIMELINESS_INDEX: usize = 1; + pub const NUM_BLOCK_TIMELINESS_DEADLINES: usize = 2; +} diff --git a/consensus/types/src/core/eth_spec.rs b/consensus/types/src/core/eth_spec.rs index 74795fdfc31..a4b22da3f88 100644 --- a/consensus/types/src/core/eth_spec.rs +++ b/consensus/types/src/core/eth_spec.rs @@ -3,18 +3,15 @@ use std::{ str::FromStr, }; -use safe_arith::SafeArith; +use safe_arith::{ArithError, SafeArith}; use serde::{Deserialize, Serialize}; use typenum::{ U0, U1, U2, U4, U8, U16, U17, U32, U64, U128, U256, U512, U625, U1024, U2048, U4096, U8192, - U65536, U131072, U262144, U1048576, U16777216, U33554432, U134217728, U1073741824, + U16384, U65536, U131072, U262144, U1048576, U16777216, U33554432, U134217728, U1073741824, U1099511627776, UInt, Unsigned, bit::B0, }; -use crate::{ - core::{ChainSpec, Epoch}, - state::BeaconStateError, -}; +use crate::core::{ChainSpec, Epoch}; type U5000 = UInt, B0>, B0>; // 625 * 8 = 5000 @@ -125,6 +122,10 @@ pub trait EthSpec: 'static + Default + Sync + Send + Clone + Debug + PartialEq + type CellsPerExtBlob: Unsigned + Clone + Sync + Send + Debug + PartialEq; type NumberOfColumns: Unsigned + Clone + Sync + Send + Debug + PartialEq; type ProposerLookaheadSlots: Unsigned + Clone + Sync + Send + Debug + PartialEq; + /* + * New in Gloas + */ + type BuilderRegistryLimit: Unsigned + Clone + Sync + Send + Debug + PartialEq; /* * Derived values (set these CAREFULLY) */ @@ -178,6 +179,7 @@ pub trait EthSpec: 'static + Default + Sync + Send + Clone + Debug + PartialEq + type MaxPayloadAttestations: Unsigned + Clone + Sync + Send + Debug + PartialEq; type BuilderPendingPaymentsLimit: Unsigned + Clone + Sync + Send + Debug + PartialEq; type BuilderPendingWithdrawalsLimit: Unsigned + Clone + Sync + Send + Debug + PartialEq; + type MaxBuildersPerWithdrawalsSweep: Unsigned + Clone + Sync + Send + Debug + PartialEq; fn default_spec() -> ChainSpec; @@ -196,7 +198,7 @@ pub trait EthSpec: 'static + Default + Sync + Send + Clone + Debug + PartialEq + fn get_committee_count_per_slot( active_validator_count: usize, spec: &ChainSpec, - ) -> Result { + ) -> Result { Self::get_committee_count_per_slot_with( active_validator_count, spec.max_committees_per_slot, @@ -208,7 +210,7 @@ pub trait EthSpec: 'static + Default + Sync + Send + Clone + Debug + PartialEq + active_validator_count: usize, max_committees_per_slot: usize, target_committee_size: usize, - ) -> Result { + ) -> Result { let slots_per_epoch = Self::SlotsPerEpoch::to_usize(); Ok(std::cmp::max( @@ -430,6 +432,16 @@ pub trait EthSpec: 'static + Default + Sync + Send + Clone + Debug + PartialEq + fn max_payload_attestations() -> usize { Self::MaxPayloadAttestations::to_usize() } + + /// Returns the `MaxBuildersPerWithdrawalsSweep` constant for this specification. + fn max_builders_per_withdrawals_sweep() -> usize { + Self::MaxBuildersPerWithdrawalsSweep::to_usize() + } + + /// Returns the `PAYLOAD_TIMELY_THRESHOLD` constant (PTC_SIZE / 2). + fn payload_timely_threshold() -> usize { + Self::PTCSize::to_usize() / 2 + } } /// Macro to inherit some type values from another EthSpec. @@ -487,6 +499,7 @@ impl EthSpec for MainnetEthSpec { type CellsPerExtBlob = U128; type NumberOfColumns = U128; type ProposerLookaheadSlots = U64; // Derived from (MIN_SEED_LOOKAHEAD + 1) * SLOTS_PER_EPOCH + type BuilderRegistryLimit = U1099511627776; type SyncSubcommitteeSize = U128; // 512 committee size / 4 sync committee subnet count type MaxPendingAttestations = U4096; // 128 max attestations * 32 slots per epoch type SlotsPerEth1VotingPeriod = U2048; // 64 epochs * 32 slots per epoch @@ -503,6 +516,7 @@ impl EthSpec for MainnetEthSpec { type MaxPendingDepositsPerEpoch = U16; type PTCSize = U512; type MaxPayloadAttestations = U4; + type MaxBuildersPerWithdrawalsSweep = U16384; fn default_spec() -> ChainSpec { ChainSpec::mainnet() @@ -546,6 +560,8 @@ impl EthSpec for MinimalEthSpec { type NumberOfColumns = U128; type ProposerLookaheadSlots = U16; // Derived from (MIN_SEED_LOOKAHEAD + 1) * SLOTS_PER_EPOCH type BuilderPendingPaymentsLimit = U16; // 2 * SLOTS_PER_EPOCH = 2 * 8 = 16 + type PTCSize = U2; + type MaxBuildersPerWithdrawalsSweep = U16; params_from_eth_spec!(MainnetEthSpec { JustificationBitsLength, @@ -576,8 +592,8 @@ impl EthSpec for MinimalEthSpec { MaxAttestationsElectra, MaxDepositRequestsPerPayload, MaxWithdrawalRequestsPerPayload, - PTCSize, - MaxPayloadAttestations + MaxPayloadAttestations, + BuilderRegistryLimit }); fn default_spec() -> ChainSpec { @@ -650,8 +666,10 @@ impl EthSpec for GnosisEthSpec { type CellsPerExtBlob = U128; type NumberOfColumns = U128; type ProposerLookaheadSlots = U32; // Derived from (MIN_SEED_LOOKAHEAD + 1) * SLOTS_PER_EPOCH + type BuilderRegistryLimit = U1099511627776; type PTCSize = U512; type MaxPayloadAttestations = U2; + type MaxBuildersPerWithdrawalsSweep = U16384; fn default_spec() -> ChainSpec { ChainSpec::gnosis() diff --git a/consensus/types/src/execution/execution_block_hash.rs b/consensus/types/src/core/execution_block_hash.rs similarity index 100% rename from consensus/types/src/execution/execution_block_hash.rs rename to consensus/types/src/core/execution_block_hash.rs diff --git a/consensus/types/src/core/mod.rs b/consensus/types/src/core/mod.rs index bb50bb18568..33d5856deaa 100644 --- a/consensus/types/src/core/mod.rs +++ b/consensus/types/src/core/mod.rs @@ -5,6 +5,7 @@ mod chain_spec; mod config_and_preset; mod enr_fork_id; mod eth_spec; +mod execution_block_hash; mod graffiti; mod non_zero_usize; mod preset; @@ -25,6 +26,7 @@ pub use config_and_preset::{ }; pub use enr_fork_id::EnrForkId; pub use eth_spec::{EthSpec, EthSpecId, GNOSIS, GnosisEthSpec, MainnetEthSpec, MinimalEthSpec}; +pub use execution_block_hash::ExecutionBlockHash; pub use graffiti::{GRAFFITI_BYTES_LEN, Graffiti, GraffitiString}; pub use non_zero_usize::new_non_zero_usize; pub use preset::{ diff --git a/consensus/types/src/core/preset.rs b/consensus/types/src/core/preset.rs index 75d2d8df6b3..5b1978f8e9e 100644 --- a/consensus/types/src/core/preset.rs +++ b/consensus/types/src/core/preset.rs @@ -134,6 +134,9 @@ pub struct AltairPreset { pub epochs_per_sync_committee_period: Epoch, #[serde(with = "serde_utils::quoted_u64")] pub min_sync_committee_participants: u64, + #[serde(default = "default_update_timeout")] + #[serde(with = "serde_utils::quoted_u64")] + pub update_timeout: u64, } impl AltairPreset { @@ -145,10 +148,15 @@ impl AltairPreset { sync_committee_size: E::SyncCommitteeSize::to_u64(), epochs_per_sync_committee_period: spec.epochs_per_sync_committee_period, min_sync_committee_participants: spec.min_sync_committee_participants, + update_timeout: spec.update_timeout, } } } +const fn default_update_timeout() -> u64 { + 8192 +} + #[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] #[serde(rename_all = "UPPERCASE")] pub struct BellatrixPreset { diff --git a/consensus/types/src/execution/execution_payload.rs b/consensus/types/src/execution/execution_payload.rs index b2278c91667..d99b8785fa2 100644 --- a/consensus/types/src/execution/execution_payload.rs +++ b/consensus/types/src/execution/execution_payload.rs @@ -10,8 +10,7 @@ use test_random_derive::TestRandom; use tree_hash_derive::TreeHash; use crate::{ - core::{Address, EthSpec, Hash256}, - execution::ExecutionBlockHash, + core::{Address, EthSpec, ExecutionBlockHash, Hash256}, fork::{ForkName, ForkVersionDecode}, state::BeaconStateError, test_utils::TestRandom, diff --git a/consensus/types/src/execution/execution_payload_header.rs b/consensus/types/src/execution/execution_payload_header.rs index cf78f7871b4..0b8556634ae 100644 --- a/consensus/types/src/execution/execution_payload_header.rs +++ b/consensus/types/src/execution/execution_payload_header.rs @@ -11,11 +11,10 @@ use tree_hash::TreeHash; use tree_hash_derive::TreeHash; use crate::{ - core::{Address, EthSpec, Hash256, Uint256}, + core::{Address, EthSpec, ExecutionBlockHash, Hash256, Uint256}, execution::{ - ExecutionBlockHash, ExecutionPayloadBellatrix, ExecutionPayloadCapella, - ExecutionPayloadDeneb, ExecutionPayloadElectra, ExecutionPayloadFulu, ExecutionPayloadRef, - Transactions, + ExecutionPayloadBellatrix, ExecutionPayloadCapella, ExecutionPayloadDeneb, + ExecutionPayloadElectra, ExecutionPayloadFulu, ExecutionPayloadRef, Transactions, }, fork::ForkName, map_execution_payload_ref_into_execution_payload_header, diff --git a/consensus/types/src/execution/mod.rs b/consensus/types/src/execution/mod.rs index da6c8606002..a3d4ed87301 100644 --- a/consensus/types/src/execution/mod.rs +++ b/consensus/types/src/execution/mod.rs @@ -1,5 +1,4 @@ mod eth1_data; -mod execution_block_hash; mod execution_block_header; #[macro_use] mod execution_payload; @@ -16,7 +15,6 @@ mod signed_execution_payload_envelope; pub use bls_to_execution_change::BlsToExecutionChange; pub use eth1_data::Eth1Data; -pub use execution_block_hash::ExecutionBlockHash; pub use execution_block_header::{EncodableExecutionBlockHeader, ExecutionBlockHeader}; pub use execution_payload::{ ExecutionPayload, ExecutionPayloadBellatrix, ExecutionPayloadCapella, ExecutionPayloadDeneb, diff --git a/consensus/types/src/execution/payload.rs b/consensus/types/src/execution/payload.rs index 703b082c182..c51369034cd 100644 --- a/consensus/types/src/execution/payload.rs +++ b/consensus/types/src/execution/payload.rs @@ -11,9 +11,9 @@ use tree_hash::TreeHash; use tree_hash_derive::TreeHash; use crate::{ - core::{Address, EthSpec, Hash256}, + core::{Address, EthSpec, ExecutionBlockHash, Hash256}, execution::{ - ExecutionBlockHash, ExecutionPayload, ExecutionPayloadBellatrix, ExecutionPayloadCapella, + ExecutionPayload, ExecutionPayloadBellatrix, ExecutionPayloadCapella, ExecutionPayloadDeneb, ExecutionPayloadElectra, ExecutionPayloadFulu, ExecutionPayloadHeader, ExecutionPayloadHeaderBellatrix, ExecutionPayloadHeaderCapella, ExecutionPayloadHeaderDeneb, ExecutionPayloadHeaderElectra, ExecutionPayloadHeaderFulu, diff --git a/consensus/types/src/execution/signed_execution_payload_envelope.rs b/consensus/types/src/execution/signed_execution_payload_envelope.rs index 16410416157..cdcebc7b31e 100644 --- a/consensus/types/src/execution/signed_execution_payload_envelope.rs +++ b/consensus/types/src/execution/signed_execution_payload_envelope.rs @@ -1,6 +1,9 @@ use crate::test_utils::TestRandom; -use crate::{EthSpec, ExecutionPayloadEnvelope}; -use bls::Signature; +use crate::{ + ChainSpec, Domain, Epoch, EthSpec, ExecutionBlockHash, ExecutionPayloadEnvelope, Fork, Hash256, + SignedRoot, Slot, +}; +use bls::{PublicKey, Signature}; use educe::Educe; use serde::{Deserialize, Serialize}; use ssz_derive::{Decode, Encode}; @@ -15,6 +18,46 @@ pub struct SignedExecutionPayloadEnvelope { pub signature: Signature, } +impl SignedExecutionPayloadEnvelope { + pub fn slot(&self) -> Slot { + self.message.slot + } + + pub fn epoch(&self) -> Epoch { + self.slot().epoch(E::slots_per_epoch()) + } + + pub fn beacon_block_root(&self) -> Hash256 { + self.message.beacon_block_root + } + + pub fn block_hash(&self) -> ExecutionBlockHash { + self.message.payload.block_hash + } + + /// Verify `self.signature`. + pub fn verify_signature( + &self, + pubkey: &PublicKey, + fork: &Fork, + genesis_validators_root: Hash256, + spec: &ChainSpec, + ) -> bool { + // Signed envelopes using the new BeaconBuilder domain per the spec: + // https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.1/specs/gloas/beacon-chain.md#new-verify_execution_payload_envelope_signature + let domain = spec.get_domain( + self.epoch(), + Domain::BeaconBuilder, + fork, + genesis_validators_root, + ); + + let message = self.message.signing_root(domain); + + self.signature.verify(pubkey, message) + } +} + #[cfg(test)] mod tests { use super::*; diff --git a/consensus/types/src/lib.rs b/consensus/types/src/lib.rs index 5a89fcb1d48..f6d94331dee 100644 --- a/consensus/types/src/lib.rs +++ b/consensus/types/src/lib.rs @@ -49,129 +49,6 @@ pub use sync_committee::*; pub use validator::*; pub use withdrawal::*; -// Temporary facade modules to maintain backwards compatibility for Lighthouse. -pub mod eth_spec { - pub use crate::core::EthSpec; -} - -pub mod chain_spec { - pub use crate::core::ChainSpec; -} - -pub mod beacon_block { - pub use crate::block::{BlindedBeaconBlock, BlockImportSource}; -} - -pub mod beacon_block_body { - pub use crate::kzg_ext::{KzgCommitments, format_kzg_commitments}; -} - -pub mod beacon_state { - pub use crate::state::{ - BeaconState, BeaconStateBase, CommitteeCache, compute_committee_index_in_epoch, - compute_committee_range_in_epoch, epoch_committee_count, - }; -} - pub mod graffiti { - pub use crate::core::GraffitiString; + pub use crate::core::{GRAFFITI_BYTES_LEN, Graffiti, GraffitiString}; } - -pub mod indexed_attestation { - pub use crate::attestation::{IndexedAttestationBase, IndexedAttestationElectra}; -} - -pub mod historical_summary { - pub use crate::state::HistoricalSummary; -} - -pub mod participation_flags { - pub use crate::attestation::ParticipationFlags; -} - -pub mod epoch_cache { - pub use crate::state::{EpochCache, EpochCacheError, EpochCacheKey}; -} - -pub mod non_zero_usize { - pub use crate::core::new_non_zero_usize; -} - -pub mod data_column_sidecar { - pub use crate::data::{ - Cell, ColumnIndex, DataColumn, DataColumnSidecar, DataColumnSidecarError, - DataColumnSidecarList, - }; -} - -pub mod builder_bid { - pub use crate::builder::*; -} - -pub mod blob_sidecar { - pub use crate::data::{ - BlobIdentifier, BlobSidecar, BlobSidecarError, BlobsList, FixedBlobSidecarList, - }; -} - -pub mod payload { - pub use crate::execution::BlockProductionVersion; -} - -pub mod execution_requests { - pub use crate::execution::{ - ConsolidationRequests, DepositRequests, ExecutionRequests, RequestType, WithdrawalRequests, - }; -} - -pub mod execution_payload_envelope { - pub use crate::execution::{ExecutionPayloadEnvelope, SignedExecutionPayloadEnvelope}; -} - -pub mod data_column_custody_group { - pub use crate::data::{ - CustodyIndex, compute_columns_for_custody_group, compute_ordered_custody_column_indices, - compute_subnets_for_node, compute_subnets_from_custody_group, get_custody_groups, - }; -} - -pub mod sync_aggregate { - pub use crate::sync_committee::SyncAggregateError as Error; -} - -pub mod light_client_update { - pub use crate::light_client::consts::{ - CURRENT_SYNC_COMMITTEE_INDEX, CURRENT_SYNC_COMMITTEE_INDEX_ELECTRA, FINALIZED_ROOT_INDEX, - FINALIZED_ROOT_INDEX_ELECTRA, MAX_REQUEST_LIGHT_CLIENT_UPDATES, NEXT_SYNC_COMMITTEE_INDEX, - NEXT_SYNC_COMMITTEE_INDEX_ELECTRA, - }; -} - -pub mod sync_committee_contribution { - pub use crate::sync_committee::{ - SyncCommitteeContributionError as Error, SyncContributionData, - }; -} - -pub mod slot_data { - pub use crate::core::SlotData; -} - -pub mod signed_aggregate_and_proof { - pub use crate::attestation::SignedAggregateAndProofRefMut; -} - -pub mod payload_attestation { - pub use crate::attestation::{ - PayloadAttestation, PayloadAttestationData, PayloadAttestationMessage, - }; -} - -pub mod application_domain { - pub use crate::core::ApplicationDomain; -} - -// Temporary re-exports to maintain backwards compatibility for Lighthouse. -pub use crate::kzg_ext::consts::VERSIONED_HASH_VERSION_KZG; -pub use crate::light_client::LightClientError as LightClientUpdateError; -pub use crate::state::BeaconStateError as Error; diff --git a/consensus/types/src/state/beacon_state.rs b/consensus/types/src/state/beacon_state.rs index c1b6f0dc0c1..3f8fa4cfff7 100644 --- a/consensus/types/src/state/beacon_state.rs +++ b/consensus/types/src/state/beacon_state.rs @@ -23,10 +23,11 @@ use tree_hash_derive::TreeHash; use typenum::Unsigned; use crate::{ - BuilderPendingPayment, BuilderPendingWithdrawal, ExecutionBlockHash, ExecutionPayloadBid, + Builder, BuilderIndex, BuilderPendingPayment, BuilderPendingWithdrawal, ExecutionBlockHash, + ExecutionPayloadBid, Withdrawal, attestation::{ - AttestationDuty, BeaconCommittee, Checkpoint, CommitteeIndex, ParticipationFlags, - PendingAttestation, + AttestationData, AttestationDuty, BeaconCommittee, Checkpoint, CommitteeIndex, PTC, + ParticipationFlags, PendingAttestation, }, block::{BeaconBlock, BeaconBlockHeader, SignedBeaconBlockHash}, consolidation::PendingConsolidation, @@ -195,6 +196,7 @@ pub enum BeaconStateError { ProposerLookaheadOutOfBounds { i: usize, }, + InvalidIndicesCount, } /// Control whether an epoch-indexed field can be indexed at the next epoch or not. @@ -602,8 +604,17 @@ where #[superstruct(only(Fulu, Gloas))] #[serde(with = "ssz_types::serde_utils::quoted_u64_fixed_vec")] pub proposer_lookahead: Vector, - // Gloas + #[compare_fields(as_iter)] + #[test_random(default)] + #[superstruct(only(Gloas))] + pub builders: List, + + #[metastruct(exclude_from(tree_lists))] + #[serde(with = "serde_utils::quoted_u64")] + #[superstruct(only(Gloas), partial_getter(copy))] + pub next_withdrawal_builder_index: BuilderIndex, + #[test_random(default)] #[superstruct(only(Gloas))] #[metastruct(exclude_from(tree_lists))] @@ -625,10 +636,10 @@ where #[metastruct(exclude_from(tree_lists))] pub latest_block_hash: ExecutionBlockHash, + #[compare_fields(as_iter)] #[test_random(default)] #[superstruct(only(Gloas))] - #[metastruct(exclude_from(tree_lists))] - pub latest_withdrawals_root: Hash256, + pub payload_expected_withdrawals: List, // Caching (not in the spec) #[serde(skip_serializing, skip_deserializing)] @@ -1115,13 +1126,22 @@ impl BeaconState { } } + let gloas_enabled = self.fork_name_unchecked().gloas_enabled(); epoch .slot_iter(E::slots_per_epoch()) .map(|slot| { let mut preimage = seed.to_vec(); preimage.append(&mut int_to_bytes8(slot.as_u64())); let seed = hash(&preimage); - self.compute_proposer_index(indices, &seed, spec) + + if gloas_enabled { + self.compute_balance_weighted_selection(indices, &seed, 1, true, spec)? + .first() + .copied() + .ok_or(BeaconStateError::InsufficientValidators) + } else { + self.compute_proposer_index(indices, &seed, spec) + } }) .collect() } @@ -1378,39 +1398,50 @@ impl BeaconState { let epoch = self.current_epoch().safe_add(1)?; let active_validator_indices = self.get_active_validator_indices(epoch, spec)?; - let active_validator_count = active_validator_indices.len(); - let seed = self.get_seed(epoch, Domain::SyncCommittee, spec)?; - let max_effective_balance = spec.max_effective_balance_for_fork(self.fork_name_unchecked()); - let max_random_value = if self.fork_name_unchecked().electra_enabled() { - MAX_RANDOM_VALUE - } else { - MAX_RANDOM_BYTE - }; - let mut i = 0; - let mut sync_committee_indices = Vec::with_capacity(E::SyncCommitteeSize::to_usize()); - while sync_committee_indices.len() < E::SyncCommitteeSize::to_usize() { - let shuffled_index = compute_shuffled_index( - i.safe_rem(active_validator_count)?, - active_validator_count, + if self.fork_name_unchecked().gloas_enabled() { + self.compute_balance_weighted_selection( + &active_validator_indices, seed.as_slice(), - spec.shuffle_round_count, + E::SyncCommitteeSize::to_usize(), + true, + spec, ) - .ok_or(BeaconStateError::UnableToShuffle)?; - let candidate_index = *active_validator_indices - .get(shuffled_index) - .ok_or(BeaconStateError::ShuffleIndexOutOfBounds(shuffled_index))?; - let random_value = self.shuffling_random_value(i, seed.as_slice())?; - let effective_balance = self.get_validator(candidate_index)?.effective_balance; - if effective_balance.safe_mul(max_random_value)? - >= max_effective_balance.safe_mul(random_value)? - { - sync_committee_indices.push(candidate_index); + } else { + let active_validator_count = active_validator_indices.len(); + let max_effective_balance = + spec.max_effective_balance_for_fork(self.fork_name_unchecked()); + let max_random_value = if self.fork_name_unchecked().electra_enabled() { + MAX_RANDOM_VALUE + } else { + MAX_RANDOM_BYTE + }; + + let mut i = 0; + let mut sync_committee_indices = Vec::with_capacity(E::SyncCommitteeSize::to_usize()); + while sync_committee_indices.len() < E::SyncCommitteeSize::to_usize() { + let shuffled_index = compute_shuffled_index( + i.safe_rem(active_validator_count)?, + active_validator_count, + seed.as_slice(), + spec.shuffle_round_count, + ) + .ok_or(BeaconStateError::UnableToShuffle)?; + let candidate_index = *active_validator_indices + .get(shuffled_index) + .ok_or(BeaconStateError::ShuffleIndexOutOfBounds(shuffled_index))?; + let random_value = self.shuffling_random_value(i, seed.as_slice())?; + let effective_balance = self.get_validator(candidate_index)?.effective_balance; + if effective_balance.safe_mul(max_random_value)? + >= max_effective_balance.safe_mul(random_value)? + { + sync_committee_indices.push(candidate_index); + } + i.safe_add_assign(1)?; } - i.safe_add_assign(1)?; + Ok(sync_committee_indices) } - Ok(sync_committee_indices) } /// Compute the next sync committee. @@ -2032,6 +2063,25 @@ impl BeaconState { Ok(cache.get_attestation_duties(validator_index)) } + /// Check if the attestation is for the block proposed at the attestation slot. + /// + /// Returns `true` if the attestation's block root matches the block root at the + /// attestation's slot, and the block root differs from the previous slot's root. + pub fn is_attestation_same_slot( + &self, + data: &AttestationData, + ) -> Result { + if data.slot == 0 { + return Ok(true); + } + + let block_root = data.beacon_block_root; + let slot_block_root = *self.get_block_root(data.slot)?; + let prev_block_root = *self.get_block_root(data.slot.safe_sub(1)?)?; + + Ok(block_root == slot_block_root && block_root != prev_block_root) + } + /// Compute the total active balance cache from scratch. /// /// This method should rarely be invoked because single-pass epoch processing keeps the total @@ -2292,6 +2342,7 @@ impl BeaconState { } } + /// Return true if the parent block was full (both beacon block and execution payload were present). pub fn is_parent_block_full(&self) -> bool { match self { BeaconState::Base(_) | BeaconState::Altair(_) => false, @@ -2528,6 +2579,42 @@ impl BeaconState { self.epoch_cache().get_base_reward(validator_index) } + /// Get the proportional slashing multiplier for the current fork. + pub fn get_proportional_slashing_multiplier(&self, spec: &ChainSpec) -> u64 { + let fork_name = self.fork_name_unchecked(); + if fork_name >= ForkName::Bellatrix { + spec.proportional_slashing_multiplier_bellatrix + } else if fork_name >= ForkName::Altair { + spec.proportional_slashing_multiplier_altair + } else { + spec.proportional_slashing_multiplier + } + } + + /// Get the minimum slashing penalty quotient for the current fork. + pub fn get_min_slashing_penalty_quotient(&self, spec: &ChainSpec) -> u64 { + let fork_name = self.fork_name_unchecked(); + if fork_name.electra_enabled() { + spec.min_slashing_penalty_quotient_electra + } else if fork_name >= ForkName::Bellatrix { + spec.min_slashing_penalty_quotient_bellatrix + } else if fork_name >= ForkName::Altair { + spec.min_slashing_penalty_quotient_altair + } else { + spec.min_slashing_penalty_quotient + } + } + + /// Get the whistleblower reward quotient for the current fork. + pub fn get_whistleblower_reward_quotient(&self, spec: &ChainSpec) -> u64 { + let fork_name = self.fork_name_unchecked(); + if fork_name.electra_enabled() { + spec.whistleblower_reward_quotient_electra + } else { + spec.whistleblower_reward_quotient + } + } + // ******* Electra accessors ******* /// Return the churn limit for the current epoch. @@ -2842,6 +2929,111 @@ impl BeaconState { Ok(()) } + + /// Get the payload timeliness committee for the given `slot`. + /// + /// Requires the committee cache to be initialized. + /// TODO(EIP-7732): definitely gonna have to cache this.. + pub fn get_ptc(&self, slot: Slot, spec: &ChainSpec) -> Result, BeaconStateError> { + let committee_cache = self.committee_cache_at_slot(slot)?; + let committees = committee_cache.get_beacon_committees_at_slot(slot)?; + + let seed = self.get_ptc_attester_seed(slot, spec)?; + + let committee_indices: Vec = committees + .iter() + .flat_map(|committee| committee.committee.iter().copied()) + .collect(); + let selected_indices = self.compute_balance_weighted_selection( + &committee_indices, + &seed, + E::ptc_size(), + false, + spec, + )?; + + Ok(PTC(FixedVector::new(selected_indices)?)) + } + + /// Compute the seed to use for the ptc attester selection at the given `slot`. + pub fn get_ptc_attester_seed( + &self, + slot: Slot, + spec: &ChainSpec, + ) -> Result, BeaconStateError> { + let epoch = slot.epoch(E::slots_per_epoch()); + let mut preimage = self + .get_seed(epoch, Domain::PTCAttester, spec)? + .as_slice() + .to_vec(); + preimage.append(&mut int_to_bytes8(slot.as_u64())); + Ok(hash(&preimage)) + } + + /// Return size indices sampled by effective balance, using indices as candidates. + /// + /// If shuffle_indices is True, candidate indices are themselves sampled from indices + /// by shuffling it, otherwise indices is traversed in order. + fn compute_balance_weighted_selection( + &self, + indices: &[usize], + seed: &[u8], + size: usize, + shuffle_indices: bool, + spec: &ChainSpec, + ) -> Result, BeaconStateError> { + let total = indices.len(); + if total == 0 { + return Err(BeaconStateError::InvalidIndicesCount); + } + + let mut selected = Vec::with_capacity(size); + let mut i = 0usize; + + while selected.len() < size { + let mut next_index = i.safe_rem(total)?; + + if shuffle_indices { + next_index = + compute_shuffled_index(next_index, total, seed, spec.shuffle_round_count) + .ok_or(BeaconStateError::UnableToShuffle)?; + } + + let candidate_index = indices + .get(next_index) + .ok_or(BeaconStateError::InvalidIndicesCount)?; + + if self.compute_balance_weighted_acceptance(*candidate_index, seed, i, spec)? { + selected.push(*candidate_index); + } + + i.safe_add_assign(1)?; + } + + Ok(selected) + } + + /// Return whether to accept the selection of the validator `index`, with probability + /// proportional to its `effective_balance`, and randomness given by `seed` and `iteration`. + fn compute_balance_weighted_acceptance( + &self, + index: usize, + seed: &[u8], + iteration: usize, + spec: &ChainSpec, + ) -> Result { + // TODO(EIP-7732): Consider grabbing effective balances from the epoch cache here. + // Note that this function will be used in a loop, so using cached values could be nice for performance. + // However, post-gloas, this function will be used in `compute_proposer_indices`, `get_next_sync_committee_indices`, and `get_ptc`, which has ~15 call sites in total + // so we will need to check each one to ensure epoch cache is initialized first, if we deem a good idea. + // Currently, we can't test if making the change would work since the test suite is not ready for gloas. + let effective_balance = self.get_effective_balance(index)?; + let max_effective_balance = spec.max_effective_balance_for_fork(self.fork_name_unchecked()); + let random_value = self.shuffling_random_value(iteration, seed)?; + + Ok(effective_balance.safe_mul(MAX_RANDOM_VALUE)? + >= max_effective_balance.safe_mul(random_value)?) + } } impl ForkVersionDecode for BeaconState { diff --git a/consensus/types/src/state/committee_cache.rs b/consensus/types/src/state/committee_cache.rs index 15f6a4cd376..39e9011ef40 100644 --- a/consensus/types/src/state/committee_cache.rs +++ b/consensus/types/src/state/committee_cache.rs @@ -100,7 +100,8 @@ impl CommitteeCache { } let committees_per_slot = - E::get_committee_count_per_slot(active_validator_indices.len(), spec)? as u64; + E::get_committee_count_per_slot(active_validator_indices.len(), spec) + .map_err(BeaconStateError::ArithError)? as u64; let seed = state.get_seed(epoch, Domain::BeaconAttester, spec)?; diff --git a/lighthouse/Cargo.toml b/lighthouse/Cargo.toml index ebe00c9be59..000c6fd0da4 100644 --- a/lighthouse/Cargo.toml +++ b/lighthouse/Cargo.toml @@ -53,7 +53,6 @@ environment = { workspace = true } eth2_network_config = { workspace = true } ethereum_hashing = { workspace = true } futures = { workspace = true } -lighthouse_tracing = { workspace = true } lighthouse_version = { workspace = true } logging = { workspace = true } metrics = { workspace = true } @@ -70,6 +69,7 @@ task_executor = { workspace = true } tracing = { workspace = true } tracing-opentelemetry = { workspace = true } tracing-subscriber = { workspace = true } +tracing_samplers = { workspace = true } types = { workspace = true } validator_client = { workspace = true } validator_manager = { path = "../validator_manager" } diff --git a/lighthouse/environment/tests/testnet_dir/config.yaml b/lighthouse/environment/tests/testnet_dir/config.yaml index 24c4a67225b..7cfeb746f2d 100644 --- a/lighthouse/environment/tests/testnet_dir/config.yaml +++ b/lighthouse/environment/tests/testnet_dir/config.yaml @@ -93,6 +93,7 @@ TTFB_TIMEOUT: 5 RESP_TIMEOUT: 10 MESSAGE_DOMAIN_INVALID_SNAPPY: 0x00000000 MESSAGE_DOMAIN_VALID_SNAPPY: 0x01000000 +EPOCHS_PER_SUBNET_SUBSCRIPTION: 256 ATTESTATION_SUBNET_COUNT: 64 ATTESTATION_SUBNET_EXTRA_BITS: 0 ATTESTATION_SUBNET_PREFIX_BITS: 6 diff --git a/lighthouse/src/main.rs b/lighthouse/src/main.rs index 2592d2e6042..53946ed2730 100644 --- a/lighthouse/src/main.rs +++ b/lighthouse/src/main.rs @@ -29,6 +29,7 @@ use std::process::exit; use std::sync::LazyLock; use task_executor::ShutdownReason; use tracing::{Level, info}; +use tracing_samplers::PrefixBasedSampler; use tracing_subscriber::{Layer, filter::EnvFilter, layer::SubscriberExt, util::SubscriberInitExt}; use types::{EthSpec, EthSpecId}; use validator_client::ProductionValidatorClient; @@ -675,7 +676,15 @@ fn run( _ => "lighthouse".to_string(), }); + // Use ParentBased sampler with PrefixBasedSampler to only export traces + // that start from known instrumented code paths (lh_ prefix). Child spans + // automatically inherit their parent's sampling decision. + let sampler = opentelemetry_sdk::trace::Sampler::ParentBased(Box::new( + PrefixBasedSampler::new("lh_"), + )); + let provider = opentelemetry_sdk::trace::SdkTracerProvider::builder() + .with_sampler(sampler) .with_batch_exporter(exporter) .with_resource( opentelemetry_sdk::Resource::builder() diff --git a/lighthouse/tests/beacon_node.rs b/lighthouse/tests/beacon_node.rs index 207324ea33f..69817e5c9dc 100644 --- a/lighthouse/tests/beacon_node.rs +++ b/lighthouse/tests/beacon_node.rs @@ -24,7 +24,7 @@ use std::str::FromStr; use std::string::ToString; use std::time::Duration; use tempfile::TempDir; -use types::non_zero_usize::new_non_zero_usize; +use types::new_non_zero_usize; use types::{Address, Checkpoint, Epoch, Hash256, MainnetEthSpec}; const DEFAULT_EXECUTION_ENDPOINT: &str = "http://localhost:8551/"; diff --git a/slasher/src/config.rs b/slasher/src/config.rs index 144016efd24..50b4b7a858e 100644 --- a/slasher/src/config.rs +++ b/slasher/src/config.rs @@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize}; use std::num::NonZeroUsize; use std::path::PathBuf; use strum::{Display, EnumString, VariantNames}; -use types::non_zero_usize::new_non_zero_usize; +use types::new_non_zero_usize; use types::{Epoch, EthSpec, IndexedAttestation}; pub const DEFAULT_CHUNK_SIZE: usize = 16; diff --git a/slasher/src/test_utils.rs b/slasher/src/test_utils.rs index 20d1ee92175..82b7f885ec6 100644 --- a/slasher/src/test_utils.rs +++ b/slasher/src/test_utils.rs @@ -6,7 +6,7 @@ use types::{ AttestationData, AttesterSlashing, AttesterSlashingBase, AttesterSlashingElectra, BeaconBlockHeader, ChainSpec, Checkpoint, Epoch, EthSpec, Hash256, IndexedAttestation, MainnetEthSpec, SignedBeaconBlockHeader, Slot, - indexed_attestation::{IndexedAttestationBase, IndexedAttestationElectra}, + attestation::{IndexedAttestationBase, IndexedAttestationElectra}, }; pub type E = MainnetEthSpec; diff --git a/testing/ef_tests/Makefile b/testing/ef_tests/Makefile index 0ead9d00472..0c6371f8253 100644 --- a/testing/ef_tests/Makefile +++ b/testing/ef_tests/Makefile @@ -1,6 +1,6 @@ # To download/extract nightly tests, run: # CONSENSUS_SPECS_TEST_VERSION=nightly make -CONSENSUS_SPECS_TEST_VERSION ?= v1.6.0-beta.1 +CONSENSUS_SPECS_TEST_VERSION ?= v1.7.0-alpha.1 REPO_NAME := consensus-spec-tests OUTPUT_DIR := ./$(REPO_NAME) diff --git a/testing/ef_tests/check_all_files_accessed.py b/testing/ef_tests/check_all_files_accessed.py index 1f70881a887..7787af64f08 100755 --- a/testing/ef_tests/check_all_files_accessed.py +++ b/testing/ef_tests/check_all_files_accessed.py @@ -64,6 +64,8 @@ # Ignore KZG tests that target internal kzg library functions "tests/.*/compute_verify_cell_kzg_proof_batch_challenge/.*", "tests/.*/compute_challenge/.*", + # We don't need these manifest files at the moment. + "tests/.*/manifest.yaml" ] diff --git a/testing/ef_tests/src/cases/compute_columns_for_custody_groups.rs b/testing/ef_tests/src/cases/compute_columns_for_custody_groups.rs index 16d3eaf7af6..e30f4c3ae1b 100644 --- a/testing/ef_tests/src/cases/compute_columns_for_custody_groups.rs +++ b/testing/ef_tests/src/cases/compute_columns_for_custody_groups.rs @@ -1,7 +1,7 @@ use super::*; use serde::Deserialize; use std::marker::PhantomData; -use types::data_column_custody_group::{CustodyIndex, compute_columns_for_custody_group}; +use types::data::{CustodyIndex, compute_columns_for_custody_group}; #[derive(Debug, Clone, Deserialize)] #[serde(bound = "E: EthSpec", deny_unknown_fields)] diff --git a/testing/ef_tests/src/cases/fork_choice.rs b/testing/ef_tests/src/cases/fork_choice.rs index 8e9d438a243..93a8805240a 100644 --- a/testing/ef_tests/src/cases/fork_choice.rs +++ b/testing/ef_tests/src/cases/fork_choice.rs @@ -297,6 +297,15 @@ impl Case for ForkChoiceTest { } fn result(&self, _case_index: usize, fork_name: ForkName) -> Result<(), Error> { + // TODO(gloas): We have not implemented this change to fork choice/proposer boost yet. + // https://github.com/sigp/lighthouse/issues/8689 + if self.description == "voting_source_beyond_two_epoch" + || self.description == "justified_update_not_realized_finality" + || self.description == "justified_update_always_if_better" + { + return Err(Error::SkippedKnownFailure); + } + let tester = Tester::new(self, testing_spec::(fork_name))?; for step in &self.steps { diff --git a/testing/ef_tests/src/cases/get_custody_groups.rs b/testing/ef_tests/src/cases/get_custody_groups.rs index 1c1294305f3..4221fa06e05 100644 --- a/testing/ef_tests/src/cases/get_custody_groups.rs +++ b/testing/ef_tests/src/cases/get_custody_groups.rs @@ -2,7 +2,7 @@ use super::*; use alloy_primitives::U256; use serde::Deserialize; use std::marker::PhantomData; -use types::data_column_custody_group::get_custody_groups; +use types::data::get_custody_groups; #[derive(Debug, Clone, Deserialize)] #[serde(bound = "E: EthSpec", deny_unknown_fields)] diff --git a/testing/ef_tests/src/cases/merkle_proof_validity.rs b/testing/ef_tests/src/cases/merkle_proof_validity.rs index 52f5333df1a..4aa9f980d40 100644 --- a/testing/ef_tests/src/cases/merkle_proof_validity.rs +++ b/testing/ef_tests/src/cases/merkle_proof_validity.rs @@ -6,7 +6,7 @@ use tree_hash::Hash256; use typenum::Unsigned; use types::{ BeaconBlockBody, BeaconBlockBodyCapella, BeaconBlockBodyDeneb, BeaconBlockBodyElectra, - BeaconBlockBodyFulu, BeaconBlockBodyGloas, BeaconState, FullPayload, light_client_update, + BeaconBlockBodyFulu, BeaconBlockBodyGloas, BeaconState, FullPayload, light_client, }; #[derive(Debug, Clone, Deserialize)] @@ -97,16 +97,16 @@ impl Case for BeaconStateMerkleProofValidity { state.update_tree_hash_cache().unwrap(); let proof = match self.merkle_proof.leaf_index { - light_client_update::CURRENT_SYNC_COMMITTEE_INDEX_ELECTRA - | light_client_update::CURRENT_SYNC_COMMITTEE_INDEX => { + light_client::consts::CURRENT_SYNC_COMMITTEE_INDEX_ELECTRA + | light_client::consts::CURRENT_SYNC_COMMITTEE_INDEX => { state.compute_current_sync_committee_proof() } - light_client_update::NEXT_SYNC_COMMITTEE_INDEX_ELECTRA - | light_client_update::NEXT_SYNC_COMMITTEE_INDEX => { + light_client::consts::NEXT_SYNC_COMMITTEE_INDEX_ELECTRA + | light_client::consts::NEXT_SYNC_COMMITTEE_INDEX => { state.compute_next_sync_committee_proof() } - light_client_update::FINALIZED_ROOT_INDEX_ELECTRA - | light_client_update::FINALIZED_ROOT_INDEX => state.compute_finalized_root_proof(), + light_client::consts::FINALIZED_ROOT_INDEX_ELECTRA + | light_client::consts::FINALIZED_ROOT_INDEX => state.compute_finalized_root_proof(), _ => { return Err(Error::FailedToParseTest( "Could not retrieve merkle proof, invalid index".to_string(), diff --git a/testing/ef_tests/src/handler.rs b/testing/ef_tests/src/handler.rs index a5b2ffada37..b974a17a804 100644 --- a/testing/ef_tests/src/handler.rs +++ b/testing/ef_tests/src/handler.rs @@ -387,8 +387,16 @@ where T::name().into() } + fn disabled_forks(&self) -> Vec { + // TODO(gloas): Can be removed once we enable Gloas on all tests + vec![] + } + fn is_enabled_for_fork(&self, fork_name: ForkName) -> bool { + // TODO(gloas): DataColumnSidecar tests are disabled until we update the DataColumnSidecar + // type. self.supported_forks.contains(&fork_name) + && !(fork_name == ForkName::Gloas && T::name() == "DataColumnSidecar") } } diff --git a/testing/ef_tests/src/type_name.rs b/testing/ef_tests/src/type_name.rs index 2d13a6daa12..6dd1df1d8d1 100644 --- a/testing/ef_tests/src/type_name.rs +++ b/testing/ef_tests/src/type_name.rs @@ -1,5 +1,5 @@ //! Mapping from types to canonical string identifiers used in testing. -use types::historical_summary::HistoricalSummary; +use types::state::HistoricalSummary; use types::*; pub trait TypeName { diff --git a/testing/ef_tests/tests/tests.rs b/testing/ef_tests/tests/tests.rs index 0cec69c97e5..b2f65db6f3e 100644 --- a/testing/ef_tests/tests/tests.rs +++ b/testing/ef_tests/tests/tests.rs @@ -239,7 +239,7 @@ macro_rules! ssz_static_test_no_run { #[cfg(feature = "fake_crypto")] mod ssz_static { use ef_tests::{Handler, SszStaticHandler, SszStaticTHCHandler, SszStaticWithSpecHandler}; - use types::historical_summary::HistoricalSummary; + use types::state::HistoricalSummary; use types::{ AttesterSlashingBase, AttesterSlashingElectra, ConsolidationRequest, DepositRequest, LightClientBootstrapAltair, PendingDeposit, PendingPartialWithdrawal, WithdrawalRequest, *, diff --git a/testing/execution_engine_integration/src/test_rig.rs b/testing/execution_engine_integration/src/test_rig.rs index 8c64c7cf378..24d75f5a110 100644 --- a/testing/execution_engine_integration/src/test_rig.rs +++ b/testing/execution_engine_integration/src/test_rig.rs @@ -21,7 +21,7 @@ use std::sync::Arc; use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH}; use task_executor::TaskExecutor; use tokio::time::sleep; -use types::payload::BlockProductionVersion; +use types::execution::BlockProductionVersion; use types::{ Address, ChainSpec, EthSpec, ExecutionBlockHash, ExecutionPayload, ExecutionPayloadHeader, ForkName, Hash256, MainnetEthSpec, Slot, Uint256, diff --git a/validator_client/src/lib.rs b/validator_client/src/lib.rs index fe6a93ae9dd..b3cd3425f3d 100644 --- a/validator_client/src/lib.rs +++ b/validator_client/src/lib.rs @@ -364,11 +364,22 @@ impl ProductionValidatorClient { context.eth2_config.spec.clone(), ); - // Perform some potentially long-running initialization tasks. - let (genesis_time, genesis_validators_root) = tokio::select! { - tuple = init_from_beacon_node::(&beacon_nodes, &proposer_nodes) => tuple?, - () = context.executor.exit() => return Err("Shutting down".to_string()) - }; + let (genesis_time, genesis_validators_root) = + if let Some(eth2_network_config) = context.eth2_network_config.as_ref() { + let time = eth2_network_config + .genesis_time::()? + .ok_or("no genesis time")?; + let root = eth2_network_config + .genesis_validators_root::()? + .ok_or("no genesis validators root")?; + (time, root) + } else { + // Perform some potentially long-running initialization tasks. + tokio::select! { + tuple = init_from_beacon_node::(&beacon_nodes, &proposer_nodes) => tuple?, + () = context.executor.exit() => return Err("Shutting down".to_string()), + } + }; // Update the metrics server. if let Some(ctx) = &validator_metrics_ctx { diff --git a/validator_client/validator_services/src/duties_service.rs b/validator_client/validator_services/src/duties_service.rs index c2378181ef0..3a619840a53 100644 --- a/validator_client/validator_services/src/duties_service.rs +++ b/validator_client/validator_services/src/duties_service.rs @@ -28,7 +28,10 @@ use std::sync::Arc; use std::sync::atomic::{AtomicBool, Ordering}; use std::time::Duration; use task_executor::TaskExecutor; -use tokio::{sync::mpsc::Sender, time::sleep}; +use tokio::{ + sync::{mpsc::Sender, watch}, + time::sleep, +}; use tracing::{debug, error, info, warn}; use types::{ChainSpec, Epoch, EthSpec, Hash256, SelectionProof, Slot}; use validator_metrics::{ATTESTATION_DUTY, get_int_gauge, set_int_gauge}; @@ -373,6 +376,9 @@ impl DutiesServiceBuilder { } pub fn build(self) -> Result, String> { + let (attesters_poll_tx, _) = watch::channel(Slot::default()); + let (sync_poll_tx, _) = watch::channel(Slot::default()); + Ok(DutiesService { attesters: Default::default(), proposers: Default::default(), @@ -394,6 +400,8 @@ impl DutiesServiceBuilder { enable_high_validator_count_metrics: self.enable_high_validator_count_metrics, selection_proof_config: self.attestation_selection_proof_config, disable_attesting: self.disable_attesting, + attesters_poll_tx, + sync_poll_tx, }) } } @@ -424,6 +432,10 @@ pub struct DutiesService { /// Pass the config for distributed or non-distributed mode. pub selection_proof_config: SelectionProofConfig, pub disable_attesting: bool, + /// Watch channel sender for signaling when attestation duty polling completes. + pub(crate) attesters_poll_tx: watch::Sender, + /// Watch channel sender for signaling when sync committee duty polling completes. + pub(crate) sync_poll_tx: watch::Sender, } impl DutiesService { @@ -527,6 +539,16 @@ impl DutiesService { self.enable_high_validator_count_metrics || self.total_validator_count() <= VALIDATOR_METRICS_MIN_COUNT } + + /// Subscribe to notifications when attestation duty polling completes. + pub fn subscribe_to_attesters_poll(&self) -> watch::Receiver { + self.attesters_poll_tx.subscribe() + } + + /// Subscribe to notifications when sync committee duty polling completes. + pub fn subscribe_to_sync_poll(&self) -> watch::Receiver { + self.sync_poll_tx.subscribe() + } } /// Start the service that periodically polls the beacon node for validator duties. This will start @@ -974,12 +996,19 @@ async fn poll_beacon_attesters_for_epoch, ) -> Result<(), Error> { + let current_slot = duties_service + .slot_clock + .now_or_genesis() + .unwrap_or_default(); + // No need to bother the BN if we don't have any validators. if local_indices.is_empty() { debug!( %epoch, "No validators, not downloading duties" ); + // Signal that sync committee duty polling is complete for this slot. + duties_service.attesters_poll_tx.send_replace(current_slot); return Ok(()); } @@ -1020,8 +1049,10 @@ async fn poll_beacon_attesters_for_epoch>() }; + // No validators have conflicting (epoch, dependent_root) values or missing duties for the epoch. if validators_to_update.is_empty() { - // No validators have conflicting (epoch, dependent_root) values or missing duties for the epoch. + // Signal that sync committee duty polling is complete for this slot. + duties_service.attesters_poll_tx.send_replace(current_slot); return Ok(()); } @@ -1065,10 +1096,6 @@ async fn poll_beacon_attesters_for_epoch( validators = total_validators, %epoch, %slot, - "Awaiting activation" + "All validators inactive" ); } } else { diff --git a/validator_client/validator_services/src/sync.rs b/validator_client/validator_services/src/sync.rs index 0f456a70507..c609662110e 100644 --- a/validator_client/validator_services/src/sync.rs +++ b/validator_client/validator_services/src/sync.rs @@ -285,6 +285,8 @@ pub async fn poll_sync_committee_duties(