diff --git a/crates/malachite-app/src/node.rs b/crates/malachite-app/src/node.rs index 3698853..402c5d6 100644 --- a/crates/malachite-app/src/node.rs +++ b/crates/malachite-app/src/node.rs @@ -849,11 +849,13 @@ impl App { #[cfg(not(feature = "byzantine"))] let ctx = ArcContext::new(); - // Initialize the application state with the resolved spec and genesis block - // NOTE: ArcContext is not always Copy, depending on whether - // `byzantine` feature is enabled, so we clone it here to avoid a conditional compilation warning. - #[allow(clippy::redundant_clone)] - let mut state = State::builder(ctx.clone()) + #[cfg(feature = "byzantine")] + let state_ctx = ctx.clone(); + #[cfg(not(feature = "byzantine"))] + let state_ctx = ctx; + + // Initialize the application state with the resolved spec and genesis block. + let mut state = State::builder(state_ctx) .identity(identity.consensus.clone()) .store(store.clone()) .config(self.config.clone()) diff --git a/crates/test/integration/src/runner.rs b/crates/test/integration/src/runner.rs index d5d3d4a..2087ff1 100644 --- a/crates/test/integration/src/runner.rs +++ b/crates/test/integration/src/runner.rs @@ -679,6 +679,8 @@ fn build_node_execution_config( // Use the synchronous state-root path to avoid debug-only panics from // Reth proof worker pools that are unrelated to lifecycle behavior. config.engine.legacy_state_root_task_enabled = true; + // These scenarios do not exercise precompile caching, whose memory is multiplied per node. + config.engine.precompile_cache_disabled = true; let reth_port_offset = u16::try_from(test_id * 100 + node_id.as_usize() * 10) .wrap_err("Reth port offset overflow")?; @@ -776,6 +778,16 @@ mod tests { } } + #[test] + fn execution_config_disables_precompile_cache() { + let temp_dir = TempDir::new().expect("temp dir"); + let ipc = IpcPaths::new(temp_dir.path()); + let config = build_node_execution_config(0, NodeId::new(0), &ipc, LOCAL_DEV.clone()) + .expect("node config"); + + assert!(config.engine.precompile_cache_disabled); + } + #[tokio::test] async fn consensus_bridge_uses_existing_handle_event_bus() { let handle = test_handle();