From 3bce1b1545a596180ddf1953051021d38b74adcb Mon Sep 17 00:00:00 2001 From: Omar Abdulla Date: Wed, 16 Jul 2025 19:08:22 +0300 Subject: [PATCH] Log certain errors better --- crates/core/src/driver/mod.rs | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/crates/core/src/driver/mod.rs b/crates/core/src/driver/mod.rs index 36ef0e4..fe5e088 100644 --- a/crates/core/src/driver/mod.rs +++ b/crates/core/src/driver/mod.rs @@ -219,7 +219,17 @@ where continue; }; - let nonce = node.fetch_add_nonce(input.caller)?; + let nonce = match node.fetch_add_nonce(input.caller) { + Ok(nonce) => nonce, + Err(error) => { + tracing::error!( + caller = ?input.caller, + ?error, + "Failed to get the nonce for the caller" + ); + return Err(error); + } + }; tracing::debug!( "Calculated nonce {}, for contract {}, having address {} on node: {}", @@ -232,6 +242,17 @@ where // We are using alloy for building and submitting the transactions and it will // automatically fill in all of the missing fields from the provider that we // are using. + let code = match alloy::hex::decode(&code) { + Ok(code) => code, + Err(error) => { + tracing::error!( + code, + ?error, + "Failed to hex-decode the code of the contract. (This could possibly mean that it contains '_' and therefore it requires linking to be performed)" + ); + return Err(error.into()); + } + }; let code = alloy::hex::decode(&code)?; let tx = TransactionRequest::default() .nonce(nonce)