diff --git a/.gitignore b/.gitignore index 7a5ef4c..9d46417 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,8 @@ profile.json.gz workdir !/schema.json -!/dev-genesis.json \ No newline at end of file +!/dev-genesis.json + +# Ignore all shell scripts except for the `run_tests.sh` script +*.sh +!run_tests.sh \ No newline at end of file diff --git a/crates/core/src/differential_tests/driver.rs b/crates/core/src/differential_tests/driver.rs index 9c021d7..cffc74d 100644 --- a/crates/core/src/differential_tests/driver.rs +++ b/crates/core/src/differential_tests/driver.rs @@ -359,7 +359,11 @@ where Ok(()) } - #[instrument(level = "info", skip_all)] + #[instrument( + level = "info", + skip_all, + fields(block_number = tracing::field::Empty) + )] pub async fn execute_function_call( &mut self, _: &StepPath, @@ -373,6 +377,7 @@ where .handle_function_call_execution(step, deployment_receipts) .await .context("Failed to handle the function call execution")?; + tracing::Span::current().record("block_number", execution_receipt.block_number); let tracing_result = self .handle_function_call_call_frame_tracing(execution_receipt.transaction_hash) .await @@ -616,8 +621,8 @@ where } // Handling the calldata assertion - if let Some(ref expected_calldata) = assertion.return_data { - let expected = expected_calldata; + if let Some(ref expected_output) = assertion.return_data { + let expected = expected_output; let actual = &tracing_result.output.as_ref().unwrap_or_default(); if !expected .is_equivalent(actual, resolver.as_ref(), resolution_context) @@ -628,9 +633,9 @@ where ?receipt, ?expected, %actual, - "Calldata assertion failed" + "Output assertion failed" ); - anyhow::bail!("Calldata assertion failed - Expected {expected:?} but got {actual}",); + anyhow::bail!("Output assertion failed - Expected {expected:?} but got {actual}",); } } diff --git a/crates/format/src/steps.rs b/crates/format/src/steps.rs index 4b1526b..8ed1f21 100644 --- a/crates/format/src/steps.rs +++ b/crates/format/src/steps.rs @@ -706,6 +706,7 @@ impl Calldata { .await .context("Failed to resolve calldata item during equivalence check")?; let other = U256::from_be_slice(&other); + Ok(this == other) }) .buffered(0xFF) @@ -718,7 +719,7 @@ impl Calldata { } impl CalldataItem { - #[instrument(level = "info", skip_all, err)] + #[instrument(level = "info", skip_all, err(Debug))] async fn resolve( &self, resolver: &(impl ResolverApi + ?Sized), @@ -906,7 +907,7 @@ impl> CalldataToken { let block_hash = resolver .block_hash(desired_block_number.into()) .await - .context("Failed to resolve block hash for desired block number")?; + .context(format!("Failed to resolve the block hash of block number {desired_block_number}"))?; Ok(U256::from_be_bytes(block_hash.0)) } else if item == Self::BLOCK_NUMBER_VARIABLE { diff --git a/crates/node/src/node_implementations/substrate.rs b/crates/node/src/node_implementations/substrate.rs index 787e6a5..95e144e 100644 --- a/crates/node/src/node_implementations/substrate.rs +++ b/crates/node/src/node_implementations/substrate.rs @@ -251,6 +251,10 @@ impl SubstrateNode { .arg(format!("ws://127.0.0.1:{substrate_rpc_port}")) .arg("--rpc-max-connections") .arg(u32::MAX.to_string()) + .arg("--index-last-n-blocks") + .arg(1_000u32.to_string()) + .arg("--cache-size") + .arg(1_000u32.to_string()) .env("RUST_LOG", Self::PROXY_LOG_ENV) .stdout(stdout_file) .stderr(stderr_file);