From 2ce6b51269708a1c28c69a3241028522ebc153df Mon Sep 17 00:00:00 2001 From: Michael Sproul Date: Fri, 19 Dec 2025 15:02:09 +1100 Subject: [PATCH 1/6] Refine cargo-deny rules (#8602) A few `cargo-deny` tweaks with @macladson Co-authored-by: Mac L Co-Authored-By: Michael Sproul Co-Authored-By: Mac L --- Makefile | 2 +- deny.toml | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 4426b941aa..9d08c3ebe1 100644 --- a/Makefile +++ b/Makefile @@ -333,7 +333,7 @@ install-deny: cargo install --force cargo-deny --version 0.18.2 deny-CI: - cargo deny check bans sources --hide-inclusion-graph + cargo deny check bans sources # Runs `cargo vendor` to make sure dependencies can be vendored for packaging, reproducibility and archival purpose. vendor: diff --git a/deny.toml b/deny.toml index 677396c0c3..398a173dfa 100644 --- a/deny.toml +++ b/deny.toml @@ -2,16 +2,16 @@ # See https://embarkstudios.github.io/cargo-deny/ [bans] -# Warn when multiple versions of the same crate are detected -multiple-versions = "warn" +# Allow multiple versions by default. Change this to "warn" to see all multiple versions. +multiple-versions = "allow" deny = [ - # Legacy Ethereum crates that have been replaced with alloy - { crate = "ethers", reason = "use alloy instead" }, - { crate = "ethereum-types", reason = "use alloy-primitives instead" }, - # Replaced by quick-protobuf + { crate = "ethers", reason = "legacy Ethereum crate, use alloy instead" }, + { crate = "ethereum-types", reason = "legacy Ethereum crate, use alloy-primitives instead" }, { crate = "protobuf", reason = "use quick-protobuf instead" }, - # Prevent duplicate versions of reqwest - heavy crate with build scripts - { crate = "reqwest", deny-multiple-versions = true, reason = "prevent duplicate versions" }, + { crate = "derivative", reason = "use educe or derive_more instead" }, + { crate = "ark-ff", reason = "present in Cargo.lock but not needed by Lighthouse" }, + { crate = "strum", deny-multiple-versions = true, reason = "takes a long time to compile" }, + { crate = "reqwest", deny-multiple-versions = true, reason = "takes a long time to compile" } ] [sources] From 008dec125840ca6b6e914d6447e5a797dc30836e Mon Sep 17 00:00:00 2001 From: Mac L Date: Thu, 1 Jan 2026 08:50:01 +0400 Subject: [PATCH 2/6] Update `procfs` (#8608) #8547 This is a low hanging fruit dependency update to remove one of the duplicate versions of `rustix` Co-Authored-By: Mac L --- Cargo.lock | 133 +++++-------------------------- common/health_metrics/Cargo.toml | 2 +- 2 files changed, 19 insertions(+), 116 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6ed7bfd0b6..c7e87c9f6c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4063,12 +4063,6 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - [[package]] name = "hermit-abi" version = "0.5.2" @@ -4729,17 +4723,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi 0.3.9", - "libc", - "windows-sys 0.48.0", -] - [[package]] name = "ipconfig" version = "0.3.2" @@ -4774,7 +4757,7 @@ version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" dependencies = [ - "hermit-abi 0.5.2", + "hermit-abi", "libc", "windows-sys 0.61.2", ] @@ -5595,12 +5578,6 @@ dependencies = [ "regex", ] -[[package]] -name = "linux-raw-sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" - [[package]] name = "linux-raw-sys" version = "0.4.15" @@ -6441,7 +6418,7 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" dependencies = [ - "hermit-abi 0.5.2", + "hermit-abi", "libc", ] @@ -6913,7 +6890,7 @@ checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218" dependencies = [ "cfg-if", "concurrent-queue", - "hermit-abi 0.5.2", + "hermit-abi", "pin-project-lite", "rustix 1.1.2", "windows-sys 0.61.2", @@ -7069,17 +7046,23 @@ dependencies = [ [[package]] name = "procfs" -version = "0.15.1" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "943ca7f9f29bab5844ecd8fdb3992c5969b6622bb9609b9502fef9b4310e3f1f" +checksum = "25485360a54d6861439d60facef26de713b1e126bf015ec8f98239467a2b82f7" dependencies = [ - "bitflags 1.3.2", - "byteorder", - "chrono", - "flate2", + "bitflags 2.10.0", + "procfs-core", + "rustix 1.1.2", +] + +[[package]] +name = "procfs-core" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6401bf7b6af22f78b563665d15a22e9aef27775b79b149a66ca022468a4e405" +dependencies = [ + "bitflags 2.10.0", "hex", - "lazy_static", - "rustix 0.36.17", ] [[package]] @@ -7779,20 +7762,6 @@ dependencies = [ "nom", ] -[[package]] -name = "rustix" -version = "0.36.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305efbd14fde4139eb501df5f136994bb520b033fa9fbdce287507dc23b8c7ed" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.1.4", - "windows-sys 0.45.0", -] - [[package]] name = "rustix" version = "0.38.44" @@ -7803,7 +7772,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.4.15", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -10350,15 +10319,6 @@ dependencies = [ "windows-link", ] -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -10404,21 +10364,6 @@ dependencies = [ "windows-link", ] -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-targets" version = "0.48.5" @@ -10467,12 +10412,6 @@ dependencies = [ "windows_x86_64_msvc 0.53.1", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -10491,12 +10430,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -10515,12 +10448,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -10551,12 +10478,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -10575,12 +10496,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -10599,12 +10514,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -10623,12 +10532,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - [[package]] name = "windows_x86_64_msvc" version = "0.48.5" diff --git a/common/health_metrics/Cargo.toml b/common/health_metrics/Cargo.toml index 816d4ec68c..66063dc0fe 100644 --- a/common/health_metrics/Cargo.toml +++ b/common/health_metrics/Cargo.toml @@ -8,5 +8,5 @@ eth2 = { workspace = true, features = ["lighthouse"] } metrics = { workspace = true } [target.'cfg(target_os = "linux")'.dependencies] -procfs = "0.15.1" +procfs = { version = "0.18", default-features = false } psutil = "3.3.0" From 6dab3c9a611743ab6ce226d7df7b76ec213536f4 Mon Sep 17 00:00:00 2001 From: Shane K Moore <41407272+shane-moore@users.noreply.github.com> Date: Wed, 31 Dec 2025 20:50:03 -0800 Subject: [PATCH 3/6] update ruint dependency (#8617) I was resolving CI issues for my gloas block production [PR ](https://github.com/sigp/lighthouse/pull/8313), and noticed the `make audit-CI` [check](https://github.com/sigp/lighthouse/actions/runs/20588442102/job/59129268003) was failing due to: ``` Crate: ruint Version: 1.17.0 Title: Unsoundness of safe `reciprocal_mg10` Date: 2025-12-22 ID: RUSTSEC-2025-0137 URL: https://rustsec.org/advisories/RUSTSEC-2025-0137 Solution: Upgrade to >=1.17.1 ``` Using the latest stable rust, `1.92.0`, I ran `cargo update ruint` -> `cargo check` -> `make audit-CI`, which passed Co-Authored-By: shane-moore --- Cargo.lock | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c7e87c9f6c..3a054973ed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -698,7 +698,7 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -709,7 +709,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -3132,7 +3132,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -4759,7 +4759,7 @@ checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" dependencies = [ "hermit-abi", "libc", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -6346,7 +6346,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -7653,9 +7653,9 @@ dependencies = [ [[package]] name = "ruint" -version = "1.17.0" +version = "1.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a68df0380e5c9d20ce49534f292a36a7514ae21350726efe1865bdb1fa91d278" +checksum = "c141e807189ad38a07276942c6623032d3753c8859c146104ac2e4d68865945a" dependencies = [ "alloy-rlp", "arbitrary", @@ -7785,7 +7785,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.11.0", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -8865,7 +8865,7 @@ dependencies = [ "getrandom 0.3.4", "once_cell", "rustix 1.1.2", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -10210,7 +10210,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.48.0", ] [[package]] From 9b3d7e3a549e5ee5d587cf5363b494cfbeac0e77 Mon Sep 17 00:00:00 2001 From: Abhivansh <31AbhivanshJ@gmail.com> Date: Fri, 2 Jan 2026 05:37:40 +0530 Subject: [PATCH 4/6] refactor: remove `service_name` (#8606) Which issue # does this PR address? #8586 Please list or describe the changes introduced by this PR. Remove `service_name` from `TaskExecutor` Co-Authored-By: Abhivansh <31abhivanshj@gmail.com> --- beacon_node/client/src/builder.rs | 19 ++++++------ .../lighthouse_network/tests/common.rs | 16 ++-------- beacon_node/network/src/service/tests.rs | 15 ++------- common/task_executor/src/lib.rs | 18 ----------- common/task_executor/src/test_utils.rs | 2 +- lighthouse/environment/src/lib.rs | 30 ------------------ .../src/test_rig.rs | 7 +---- testing/simulator/src/basic_sim.rs | 1 - testing/simulator/src/fallback_sim.rs | 7 +---- testing/simulator/src/local_network.rs | 31 ++++--------------- testing/web3signer_tests/src/lib.rs | 7 +---- validator_client/src/lib.rs | 7 ++--- 12 files changed, 26 insertions(+), 134 deletions(-) diff --git a/beacon_node/client/src/builder.rs b/beacon_node/client/src/builder.rs index c48021e45d..694c6fb356 100644 --- a/beacon_node/client/src/builder.rs +++ b/beacon_node/client/src/builder.rs @@ -168,7 +168,7 @@ where let store = store.ok_or("beacon_chain_start_method requires a store")?; let runtime_context = runtime_context.ok_or("beacon_chain_start_method requires a runtime context")?; - let context = runtime_context.service_context("beacon".into()); + let context = runtime_context.clone(); let spec = chain_spec.ok_or("beacon_chain_start_method requires a chain spec")?; let event_handler = if self.http_api_config.enabled { Some(ServerSentEventHandler::new( @@ -179,7 +179,7 @@ where }; let execution_layer = if let Some(config) = config.execution_layer.clone() { - let context = runtime_context.service_context("exec".into()); + let context = runtime_context.clone(); let execution_layer = ExecutionLayer::from_config(config, context.executor.clone()) .map_err(|e| format!("unable to start execution layer endpoints: {:?}", e))?; Some(execution_layer) @@ -517,7 +517,7 @@ where .runtime_context .as_ref() .ok_or("node timer requires a runtime_context")? - .service_context("node_timer".into()); + .clone(); let beacon_chain = self .beacon_chain .clone() @@ -557,7 +557,7 @@ where .runtime_context .as_ref() .ok_or("slasher requires a runtime_context")? - .service_context("slasher_service_ctxt".into()); + .clone(); SlasherService::new(beacon_chain, network_senders.network_send()).run(&context.executor) } @@ -568,7 +568,7 @@ where .runtime_context .as_ref() .ok_or("monitoring_client requires a runtime_context")? - .service_context("monitoring_client".into()); + .clone(); let monitoring_client = MonitoringHttpClient::new(config)?; monitoring_client.auto_update( context.executor, @@ -583,7 +583,7 @@ where .runtime_context .as_ref() .ok_or("slot_notifier requires a runtime_context")? - .service_context("slot_notifier".into()); + .clone(); let beacon_chain = self .beacon_chain .clone() @@ -692,7 +692,7 @@ where if let Some(beacon_chain) = self.beacon_chain.as_ref() { if let Some(network_globals) = &self.network_globals { - let beacon_processor_context = runtime_context.service_context("bproc".into()); + let beacon_processor_context = runtime_context.clone(); BeaconProcessor { network_globals: network_globals.clone(), executor: beacon_processor_context.executor.clone(), @@ -715,7 +715,7 @@ where )?; } - let state_advance_context = runtime_context.service_context("state_advance".into()); + let state_advance_context = runtime_context.clone(); spawn_state_advance_timer(state_advance_context.executor, beacon_chain.clone()); if let Some(execution_layer) = beacon_chain.execution_layer.as_ref() { @@ -767,8 +767,7 @@ where // Spawn service to publish light_client updates at some interval into the slot. if let Some(light_client_server_rv) = self.light_client_server_rv { let inner_chain = beacon_chain.clone(); - let light_client_update_context = - runtime_context.service_context("lc_update".to_string()); + let light_client_update_context = runtime_context.clone(); light_client_update_context.executor.spawn( async move { compute_light_client_updates( diff --git a/beacon_node/lighthouse_network/tests/common.rs b/beacon_node/lighthouse_network/tests/common.rs index 412ee5aca5..67fe569b72 100644 --- a/beacon_node/lighthouse_network/tests/common.rs +++ b/beacon_node/lighthouse_network/tests/common.rs @@ -118,7 +118,6 @@ pub async fn build_libp2p_instance( boot_nodes: Vec, fork_name: ForkName, chain_spec: Arc, - service_name: String, disable_peer_scoring: bool, inbound_rate_limiter: Option, ) -> Libp2pInstance { @@ -127,7 +126,7 @@ pub async fn build_libp2p_instance( let (signal, exit) = async_channel::bounded(1); let (shutdown_tx, _) = futures::channel::mpsc::channel(1); - let executor = task_executor::TaskExecutor::new(rt, exit, shutdown_tx, service_name); + let executor = task_executor::TaskExecutor::new(rt, exit, shutdown_tx); let custody_group_count = chain_spec.custody_requirement; let libp2p_context = lighthouse_network::Context { config, @@ -177,7 +176,6 @@ pub async fn build_node_pair( vec![], fork_name, spec.clone(), - "sender".to_string(), disable_peer_scoring, inbound_rate_limiter.clone(), ) @@ -187,7 +185,6 @@ pub async fn build_node_pair( vec![], fork_name, spec.clone(), - "receiver".to_string(), disable_peer_scoring, inbound_rate_limiter, ) @@ -266,16 +263,7 @@ pub async fn build_linear( let mut nodes = Vec::with_capacity(n); for _ in 0..n { nodes.push( - build_libp2p_instance( - rt.clone(), - vec![], - fork_name, - spec.clone(), - "linear".to_string(), - false, - None, - ) - .await, + build_libp2p_instance(rt.clone(), vec![], fork_name, spec.clone(), false, None).await, ); } diff --git a/beacon_node/network/src/service/tests.rs b/beacon_node/network/src/service/tests.rs index 8ff1e0488d..5fabab19ea 100644 --- a/beacon_node/network/src/service/tests.rs +++ b/beacon_node/network/src/service/tests.rs @@ -39,12 +39,7 @@ fn test_dht_persistence() { let (signal, exit) = async_channel::bounded(1); let (shutdown_tx, _) = futures::channel::mpsc::channel(1); - let executor = task_executor::TaskExecutor::new( - Arc::downgrade(&runtime), - exit, - shutdown_tx, - "test-dht-persistence".to_string(), - ); + let executor = task_executor::TaskExecutor::new(Arc::downgrade(&runtime), exit, shutdown_tx); let mut config = NetworkConfig::default(); config.set_ipv4_listening_address(std::net::Ipv4Addr::UNSPECIFIED, 21212, 21212, 21213); @@ -115,12 +110,8 @@ fn test_removing_topic_weight_on_old_topics() { let (mut network_service, network_globals, _network_senders) = runtime.block_on(async { let (_, exit) = async_channel::bounded(1); let (shutdown_tx, _) = futures::channel::mpsc::channel(1); - let executor = task_executor::TaskExecutor::new( - Arc::downgrade(&runtime), - exit, - shutdown_tx, - "test-removing-topic-weight-on-old-topics".to_string(), - ); + let executor = + task_executor::TaskExecutor::new(Arc::downgrade(&runtime), exit, shutdown_tx); let mut config = NetworkConfig::default(); config.set_ipv4_listening_address(std::net::Ipv4Addr::UNSPECIFIED, 21214, 21214, 21215); diff --git a/common/task_executor/src/lib.rs b/common/task_executor/src/lib.rs index 0b8e9f8eba..d3d862f96c 100644 --- a/common/task_executor/src/lib.rs +++ b/common/task_executor/src/lib.rs @@ -83,11 +83,6 @@ pub struct TaskExecutor { /// The task must provide a reason for shutting down. signal_tx: Sender, - /// The name of the service for inclusion in the logger output. - // FIXME(sproul): delete? - #[allow(dead_code)] - service_name: String, - rayon_pool_provider: Arc, } @@ -103,28 +98,15 @@ impl TaskExecutor { handle: T, exit: async_channel::Receiver<()>, signal_tx: Sender, - service_name: String, ) -> Self { Self { handle_provider: handle.into(), exit, signal_tx, - service_name, rayon_pool_provider: Arc::new(RayonPoolProvider::default()), } } - /// Clones the task executor adding a service name. - pub fn clone_with_name(&self, service_name: String) -> Self { - TaskExecutor { - handle_provider: self.handle_provider.clone(), - exit: self.exit.clone(), - signal_tx: self.signal_tx.clone(), - service_name, - rayon_pool_provider: self.rayon_pool_provider.clone(), - } - } - /// A convenience wrapper for `Self::spawn` which ignores a `Result` as long as both `Ok`/`Err` /// are of type `()`. /// diff --git a/common/task_executor/src/test_utils.rs b/common/task_executor/src/test_utils.rs index 698152f6c1..1d259b152c 100644 --- a/common/task_executor/src/test_utils.rs +++ b/common/task_executor/src/test_utils.rs @@ -37,7 +37,7 @@ impl Default for TestRuntime { (Some(runtime), handle) }; - let task_executor = TaskExecutor::new(handle, exit, shutdown_tx, "test".to_string()); + let task_executor = TaskExecutor::new(handle, exit, shutdown_tx); Self { runtime, diff --git a/lighthouse/environment/src/lib.rs b/lighthouse/environment/src/lib.rs index 13a5a7a803..6694c673ed 100644 --- a/lighthouse/environment/src/lib.rs +++ b/lighthouse/environment/src/lib.rs @@ -109,19 +109,6 @@ pub struct RuntimeContext { } impl RuntimeContext { - /// Returns a sub-context of this context. - /// - /// The generated service will have the `service_name` in all it's logs. - pub fn service_context(&self, service_name: String) -> Self { - Self { - executor: self.executor.clone_with_name(service_name), - eth_spec_instance: self.eth_spec_instance.clone(), - eth2_config: self.eth2_config.clone(), - eth2_network_config: self.eth2_network_config.clone(), - sse_logging_components: self.sse_logging_components.clone(), - } - } - /// Returns the `eth2_config` for this service. pub fn eth2_config(&self) -> &Eth2Config { &self.eth2_config @@ -349,23 +336,6 @@ impl Environment { Arc::downgrade(self.runtime()), self.exit.clone(), self.signal_tx.clone(), - "core".to_string(), - ), - eth_spec_instance: self.eth_spec_instance.clone(), - eth2_config: self.eth2_config.clone(), - eth2_network_config: self.eth2_network_config.clone(), - sse_logging_components: self.sse_logging_components.clone(), - } - } - - /// Returns a `Context` where the `service_name` is added to the logger output. - pub fn service_context(&self, service_name: String) -> RuntimeContext { - RuntimeContext { - executor: TaskExecutor::new( - Arc::downgrade(self.runtime()), - self.exit.clone(), - self.signal_tx.clone(), - service_name, ), eth_spec_instance: self.eth_spec_instance.clone(), eth2_config: self.eth2_config.clone(), diff --git a/testing/execution_engine_integration/src/test_rig.rs b/testing/execution_engine_integration/src/test_rig.rs index 8413da4c5e..8c64c7cf37 100644 --- a/testing/execution_engine_integration/src/test_rig.rs +++ b/testing/execution_engine_integration/src/test_rig.rs @@ -120,12 +120,7 @@ impl TestRig { ); let (runtime_shutdown, exit) = async_channel::bounded(1); let (shutdown_tx, _) = futures::channel::mpsc::channel(1); - let executor = TaskExecutor::new( - Arc::downgrade(&runtime), - exit, - shutdown_tx, - "test".to_string(), - ); + let executor = TaskExecutor::new(Arc::downgrade(&runtime), exit, shutdown_tx); let mut spec = TEST_FORK.make_genesis_spec(MainnetEthSpec::default_spec()); spec.terminal_total_difficulty = Uint256::ZERO; diff --git a/testing/simulator/src/basic_sim.rs b/testing/simulator/src/basic_sim.rs index 23ec70ae5d..13bfcb5fc3 100644 --- a/testing/simulator/src/basic_sim.rs +++ b/testing/simulator/src/basic_sim.rs @@ -253,7 +253,6 @@ pub fn run_basic_sim(matches: &ArgMatches) -> Result<(), String> { network_1 .add_validator_client_with_fallbacks( validator_config, - i, beacon_nodes, files, ) diff --git a/testing/simulator/src/fallback_sim.rs b/testing/simulator/src/fallback_sim.rs index 6e0db52d75..3d9a60abc7 100644 --- a/testing/simulator/src/fallback_sim.rs +++ b/testing/simulator/src/fallback_sim.rs @@ -249,12 +249,7 @@ pub fn run_fallback_sim(matches: &ArgMatches) -> Result<(), String> { Some(SUGGESTED_FEE_RECIPIENT.into()); println!("Adding validator client {}", i); network_1 - .add_validator_client_with_fallbacks( - validator_config, - i, - beacon_nodes, - files, - ) + .add_validator_client_with_fallbacks(validator_config, beacon_nodes, files) .await .expect("should add validator"); }, diff --git a/testing/simulator/src/local_network.rs b/testing/simulator/src/local_network.rs index bd22a21511..58d7e1372f 100644 --- a/testing/simulator/src/local_network.rs +++ b/testing/simulator/src/local_network.rs @@ -206,10 +206,7 @@ impl LocalNetwork { beacon_config.network.enr_tcp4_port = Some(BOOTNODE_PORT.try_into().expect("non zero")); beacon_config.network.discv5_config.table_filter = |_| true; - let execution_node = LocalExecutionNode::new( - self.context.service_context("boot_node_el".into()), - mock_execution_config, - ); + let execution_node = LocalExecutionNode::new(self.context.clone(), mock_execution_config); beacon_config.execution_layer = Some(execution_layer::Config { execution_endpoint: Some(SensitiveUrl::parse(&execution_node.server.url()).unwrap()), @@ -218,11 +215,7 @@ impl LocalNetwork { ..Default::default() }); - let beacon_node = LocalBeaconNode::production( - self.context.service_context("boot_node".into()), - beacon_config, - ) - .await?; + let beacon_node = LocalBeaconNode::production(self.context.clone(), beacon_config).await?; Ok((beacon_node, execution_node)) } @@ -252,10 +245,7 @@ impl LocalNetwork { mock_execution_config.server_config.listen_port = EXECUTION_PORT + count; // Construct execution node. - let execution_node = LocalExecutionNode::new( - self.context.service_context(format!("node_{}_el", count)), - mock_execution_config, - ); + let execution_node = LocalExecutionNode::new(self.context.clone(), mock_execution_config); // Pair the beacon node and execution node. beacon_config.execution_layer = Some(execution_layer::Config { @@ -266,11 +256,7 @@ impl LocalNetwork { }); // Construct beacon node using the config, - let beacon_node = LocalBeaconNode::production( - self.context.service_context(format!("node_{}", count)), - beacon_config, - ) - .await?; + let beacon_node = LocalBeaconNode::production(self.context.clone(), beacon_config).await?; Ok((beacon_node, execution_node)) } @@ -343,9 +329,7 @@ impl LocalNetwork { beacon_node: usize, validator_files: ValidatorFiles, ) -> Result<(), String> { - let context = self - .context - .service_context(format!("validator_{}", beacon_node)); + let context = self.context.clone(); let self_1 = self.clone(); let socket_addr = { let read_lock = self.beacon_nodes.read(); @@ -401,13 +385,10 @@ impl LocalNetwork { pub async fn add_validator_client_with_fallbacks( &self, mut validator_config: ValidatorConfig, - validator_index: usize, beacon_nodes: Vec, validator_files: ValidatorFiles, ) -> Result<(), String> { - let context = self - .context - .service_context(format!("validator_{}", validator_index)); + let context = self.context.clone(); let self_1 = self.clone(); let mut beacon_node_urls = vec![]; for beacon_node in beacon_nodes { diff --git a/testing/web3signer_tests/src/lib.rs b/testing/web3signer_tests/src/lib.rs index 541f9b2b4a..b37321617b 100644 --- a/testing/web3signer_tests/src/lib.rs +++ b/testing/web3signer_tests/src/lib.rs @@ -345,12 +345,7 @@ mod tests { ); let (runtime_shutdown, exit) = async_channel::bounded(1); let (shutdown_tx, _) = futures::channel::mpsc::channel(1); - let executor = TaskExecutor::new( - Arc::downgrade(&runtime), - exit, - shutdown_tx, - "test".to_string(), - ); + let executor = TaskExecutor::new(Arc::downgrade(&runtime), exit, shutdown_tx); let slashing_db_path = validator_dir.path().join(SLASHING_PROTECTION_FILENAME); let slashing_protection = SlashingDatabase::open_or_create(&slashing_db_path).unwrap(); diff --git a/validator_client/src/lib.rs b/validator_client/src/lib.rs index 23541cf6e2..fe6a93ae9d 100644 --- a/validator_client/src/lib.rs +++ b/validator_client/src/lib.rs @@ -54,8 +54,6 @@ const RETRY_DELAY: Duration = Duration::from_secs(2); /// The time between polls when waiting for genesis. const WAITING_FOR_GENESIS_POLL_TIME: Duration = Duration::from_secs(12); -const DOPPELGANGER_SERVICE_NAME: &str = "doppelganger"; - /// Compute attestation selection proofs this many slots before they are required. /// /// At start-up selection proofs will be computed with less lookahead out of necessity. @@ -608,8 +606,7 @@ impl ProductionValidatorClient { if let Some(doppelganger_service) = self.doppelganger_service.clone() { DoppelgangerService::start_update_service( doppelganger_service, - self.context - .service_context(DOPPELGANGER_SERVICE_NAME.into()), + self.context.clone(), self.validator_store.clone(), self.duties_service.beacon_nodes.clone(), self.duties_service.slot_clock.clone(), @@ -619,7 +616,7 @@ impl ProductionValidatorClient { info!("Doppelganger protection disabled.") } - let context = self.context.service_context("notifier".into()); + let context = self.context.clone(); spawn_notifier( self.duties_service.clone(), context.executor, From ea811d66c29991bdb7ce4b9944c94a14f82a186a Mon Sep 17 00:00:00 2001 From: kevaundray Date: Mon, 5 Jan 2026 06:11:58 +0000 Subject: [PATCH 5/6] perf: remove allocations from merkle tree proof verification logic (#8614) This PR does two small things: - Removes the allocations that were happening on each loop - Makes it more explicit that the bit in the index is only being used to specify the order of the inputs for the hash function Co-Authored-By: Kevaundray Wedderburn --- consensus/merkle_proof/src/lib.rs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/consensus/merkle_proof/src/lib.rs b/consensus/merkle_proof/src/lib.rs index 494c73d05c..9952975e86 100644 --- a/consensus/merkle_proof/src/lib.rs +++ b/consensus/merkle_proof/src/lib.rs @@ -1,4 +1,4 @@ -use ethereum_hashing::{ZERO_HASHES, hash, hash32_concat}; +use ethereum_hashing::{ZERO_HASHES, hash32_concat}; use safe_arith::ArithError; use std::sync::LazyLock; @@ -382,20 +382,19 @@ pub fn verify_merkle_proof( pub fn merkle_root_from_branch(leaf: H256, branch: &[H256], depth: usize, index: usize) -> H256 { assert_eq!(branch.len(), depth, "proof length should equal depth"); - let mut merkle_root = leaf.as_slice().to_vec(); + let mut merkle_root = leaf.0; - for (i, leaf) in branch.iter().enumerate().take(depth) { + for (i, branch_node) in branch.iter().enumerate().take(depth) { let ith_bit = (index >> i) & 0x01; - if ith_bit == 1 { - merkle_root = hash32_concat(leaf.as_slice(), &merkle_root)[..].to_vec(); + let (left, right) = if ith_bit == 1 { + (branch_node.as_slice(), merkle_root.as_slice()) } else { - let mut input = merkle_root; - input.extend_from_slice(leaf.as_slice()); - merkle_root = hash(&input); - } + (merkle_root.as_slice(), branch_node.as_slice()) + }; + merkle_root = hash32_concat(left, right); } - H256::from_slice(&merkle_root) + H256::from(merkle_root) } impl From for MerkleTreeError { From ea3a3da1a4d0227479b859113a2871f0389ae011 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20David=20Ram=C3=ADrez=20Chiquillo?= Date: Mon, 5 Jan 2026 01:16:52 -0500 Subject: [PATCH 6/6] fix: improve error for insufficient blob data columns (#8595) Closes #8569 Updates the HTTP API error when the node cannot reconstruct blobs due to "Insufficient data columns". Changes the response from 500 Internal Server Error to 400 Bad Request and adds a hint to run with --supernode or --semi-supernode. Co-Authored-By: Andrurachi --- beacon_node/http_api/src/block_id.rs | 5 +++-- beacon_node/http_api/tests/tests.rs | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/beacon_node/http_api/src/block_id.rs b/beacon_node/http_api/src/block_id.rs index ea8b47f91e..6a0cdc33a0 100644 --- a/beacon_node/http_api/src/block_id.rs +++ b/beacon_node/http_api/src/block_id.rs @@ -483,8 +483,9 @@ impl BlockId { }, ) } else { - Err(warp_utils::reject::custom_server_error(format!( - "Insufficient data columns to reconstruct blobs: required {num_required_columns}, but only {num_found_column_keys} were found." + Err(warp_utils::reject::custom_bad_request(format!( + "Insufficient data columns to reconstruct blobs: required {num_required_columns}, but only {num_found_column_keys} were found. \ + You may need to run the beacon node with --supernode or --semi-supernode." ))) } } diff --git a/beacon_node/http_api/tests/tests.rs b/beacon_node/http_api/tests/tests.rs index ed7abead18..72e2186959 100644 --- a/beacon_node/http_api/tests/tests.rs +++ b/beacon_node/http_api/tests/tests.rs @@ -1970,8 +1970,8 @@ impl ApiTester { .await { Ok(result) => panic!("Full node are unable to return blobs post-Fulu: {result:?}"), - // Post-Fulu, full nodes don't store blobs and return error 500 - Err(e) => assert_eq!(e.status().unwrap(), 500), + // Post-Fulu, full nodes don't store blobs and return error 400 (Bad Request) + Err(e) => assert_eq!(e.status().unwrap(), 400), }; self