Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions crates/malachite-app/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
12 changes: 12 additions & 0 deletions crates/test/integration/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")?;
Expand Down Expand Up @@ -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();
Expand Down