diff --git a/Makefile b/Makefile index d94c2df2613..e6420a4c984 100644 --- a/Makefile +++ b/Makefile @@ -207,6 +207,7 @@ lint: cargo clippy --workspace --tests $(EXTRA_CLIPPY_OPTS) --features "$(TEST_FEATURES)" -- \ -D clippy::fn_to_numeric_cast_any \ -D clippy::manual_let_else \ + -D clippy::large_stack_frames \ -D warnings \ -A clippy::derive_partial_eq_without_eq \ -A clippy::upper-case-acronyms \ diff --git a/beacon_node/beacon_chain/src/kzg_utils.rs b/beacon_node/beacon_chain/src/kzg_utils.rs index 55c1ee9e980..c2355e6f4f2 100644 --- a/beacon_node/beacon_chain/src/kzg_utils.rs +++ b/beacon_node/beacon_chain/src/kzg_utils.rs @@ -17,6 +17,10 @@ fn ssz_blob_to_crypto_blob(blob: &Blob) -> Result(blob: &Blob) -> Result, KzgError> { + ssz_blob_to_crypto_blob::(blob).map(Box::new) +} + /// Converts a cell ssz List object to an array to be used with the kzg /// crypto library. fn ssz_cell_to_crypto_cell(cell: &Cell) -> Result { @@ -34,7 +38,7 @@ pub fn validate_blob( kzg_proof: KzgProof, ) -> Result<(), KzgError> { let _timer = crate::metrics::start_timer(&crate::metrics::KZG_VERIFICATION_SINGLE_TIMES); - let kzg_blob = ssz_blob_to_crypto_blob::(blob)?; + let kzg_blob = ssz_blob_to_crypto_blob_boxed::(blob)?; kzg.verify_blob_kzg_proof(&kzg_blob, kzg_commitment, kzg_proof) } @@ -104,7 +108,7 @@ pub fn compute_blob_kzg_proof( blob: &Blob, kzg_commitment: KzgCommitment, ) -> Result { - let kzg_blob = ssz_blob_to_crypto_blob::(blob)?; + let kzg_blob = ssz_blob_to_crypto_blob_boxed::(blob)?; kzg.compute_blob_kzg_proof(&kzg_blob, kzg_commitment) } @@ -113,7 +117,7 @@ pub fn blob_to_kzg_commitment( kzg: &Kzg, blob: &Blob, ) -> Result { - let kzg_blob = ssz_blob_to_crypto_blob::(blob)?; + let kzg_blob = ssz_blob_to_crypto_blob_boxed::(blob)?; kzg.blob_to_kzg_commitment(&kzg_blob) } @@ -124,7 +128,7 @@ pub fn compute_kzg_proof( z: Hash256, ) -> Result<(KzgProof, Hash256), KzgError> { let z = z.0.into(); - let kzg_blob = ssz_blob_to_crypto_blob::(blob)?; + let kzg_blob = ssz_blob_to_crypto_blob_boxed::(blob)?; kzg.compute_kzg_proof(&kzg_blob, &z) .map(|(proof, z)| (proof, Hash256::from_slice(&z.to_vec()))) } diff --git a/beacon_node/execution_layer/src/test_utils/execution_block_generator.rs b/beacon_node/execution_layer/src/test_utils/execution_block_generator.rs index 041b31e2b08..8a30800fa7a 100644 --- a/beacon_node/execution_layer/src/test_utils/execution_block_generator.rs +++ b/beacon_node/execution_layer/src/test_utils/execution_block_generator.rs @@ -954,6 +954,7 @@ mod test { let kzg = load_kzg()?; let (kzg_commitment, kzg_proof, blob) = load_test_blobs_bundle::()?; let kzg_blob = kzg::Blob::from_bytes(blob.as_ref()) + .map(Box::new) .map_err(|e| format!("Error converting blob to kzg blob: {e:?}"))?; kzg.verify_blob_kzg_proof(&kzg_blob, kzg_commitment, kzg_proof) .map_err(|e| format!("Invalid blobs bundle: {e:?}")) diff --git a/beacon_node/src/cli.rs b/beacon_node/src/cli.rs index 67bc9d7d407..1e9611fd1eb 100644 --- a/beacon_node/src/cli.rs +++ b/beacon_node/src/cli.rs @@ -4,6 +4,7 @@ use clap::{builder::ArgPredicate, crate_version, Arg, ArgAction, ArgGroup, Comma use clap_utils::{get_color_style, FLAG_HEADER}; use strum::VariantNames; +#[allow(clippy::large_stack_frames)] pub fn cli_app() -> Command { Command::new("beacon_node") .display_order(0) diff --git a/testing/simulator/src/basic_sim.rs b/testing/simulator/src/basic_sim.rs index 46196ba2b10..16badaffc2d 100644 --- a/testing/simulator/src/basic_sim.rs +++ b/testing/simulator/src/basic_sim.rs @@ -26,6 +26,7 @@ const DENEB_FORK_EPOCH: u64 = 2; const SUGGESTED_FEE_RECIPIENT: [u8; 20] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]; +#[allow(clippy::large_stack_frames)] pub fn run_basic_sim(matches: &ArgMatches) -> Result<(), String> { let node_count = matches .get_one::("nodes") diff --git a/testing/state_transition_vectors/src/macros.rs b/testing/state_transition_vectors/src/macros.rs index 5dafbf549a0..a7f87b1c26e 100644 --- a/testing/state_transition_vectors/src/macros.rs +++ b/testing/state_transition_vectors/src/macros.rs @@ -4,6 +4,7 @@ /// - `mod tests`: runs all the test vectors locally. macro_rules! vectors_and_tests { ($($name: ident, $test: expr),*) => { + #[allow(clippy::large_stack_frames)] pub async fn vectors() -> Vec { let mut vec = vec![]; diff --git a/watch/tests/tests.rs b/watch/tests/tests.rs index 5461508edd8..e21cf151b11 100644 --- a/watch/tests/tests.rs +++ b/watch/tests/tests.rs @@ -852,6 +852,7 @@ async fn chain_grows() { #[cfg(unix)] #[tokio::test] +#[allow(clippy::large_stack_frames)] async fn chain_grows_with_metadata() { let builder = TesterBuilder::new().await; @@ -959,6 +960,7 @@ async fn chain_grows_with_metadata() { #[cfg(unix)] #[tokio::test] +#[allow(clippy::large_stack_frames)] async fn chain_grows_with_metadata_and_multiple_skip_slots() { let builder = TesterBuilder::new().await;