Compare commits

...

1 Commits

Author SHA1 Message Date
Omar Abdulla 81829e9e1f Supply the revert reason in the logs 2025-11-02 20:52:12 +03:00
3 changed files with 19 additions and 5 deletions
+4 -1
View File
@@ -598,7 +598,10 @@ where
let expected = !assertion.exception;
let actual = receipt.status();
if actual != expected {
let revert_reason = tracing_result.revert_reason.as_ref();
let revert_reason = tracing_result
.revert_reason
.as_ref()
.or(tracing_result.error.as_ref());
tracing::error!(
expected,
actual,
+11 -3
View File
@@ -1,5 +1,6 @@
use std::{collections::HashMap, fmt::Display, str::FromStr};
use alloy::hex::ToHexExt;
use alloy::primitives::{FixedBytes, utils::parse_units};
use alloy::{
eips::BlockNumberOrTag,
@@ -686,8 +687,8 @@ impl Calldata {
Calldata::Compound(items) => {
stream::iter(items.iter().zip(other.chunks(32)))
.map(|(this, other)| async move {
// The matterlabs format supports wildcards and therefore we
// also need to support them.
// The MatterLabs format supports wildcards and therefore we also need to
// support them.
if this.as_ref() == "*" {
return Ok::<_, anyhow::Error>(true);
}
@@ -768,7 +769,14 @@ impl CalldataItem {
match stack.as_slice() {
// Empty stack means that we got an empty compound calldata which we resolve to zero.
[] => Ok(U256::ZERO),
[CalldataToken::Item(item)] => Ok(*item),
[CalldataToken::Item(item)] => {
tracing::debug!(
original_item = ?self,
resolved_item = item.to_be_bytes::<32>().encode_hex(),
"Resolution Done"
);
Ok(*item)
}
_ => Err(anyhow::anyhow!(
"Invalid calldata arithmetic operation - Invalid stack"
)),
@@ -62,7 +62,10 @@ where
) -> TransportResult<Self::Fillable> {
match self.inner.prepare(provider, tx).await {
Ok(fill) => Ok(Some(fill)),
Err(_) => Ok(None),
Err(err) => {
tracing::debug!(error = ?err, "Gas Provider Estimation Failed, using fallback");
Ok(None)
}
}
}