Skip to content

Conversation

jsvisa
Copy link
Contributor

@jsvisa jsvisa commented Sep 21, 2025

Geth will convert the empty bytes to null, and omit it in the response, I think we should align with it, the empty nulls seems meanless.

Below is the differ of the tx: https://etherscan.io/tx/0x337749b7c19859b2d773868b60e82a06ae008db9a80d41db76d7020d976a72e7

left is geth, right is reth

image

Copy link
Contributor

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty,

smol doc nit and q

@jsvisa
Copy link
Contributor Author

jsvisa commented Sep 21, 2025

Copied the revert/error handling from geth's, PTAL.

BTW, also changed the panic message in alloy-rs/core#1015

}
}
}
GenericRevertReason::RawString(err) => err,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we only need to add the empty check here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think raw string should also be omitted, changed into a simplify way

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why should this be omitted here?

can we only add the empty check, I dont see a reason to change this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattsse, actually it was for another case, for this tx https://etherscan.io/tx/0x801eaaf69510d9a5fe9b8e8f2c9000f120d82b47ded984ee0fc875839684bc5e

reth will return as the raw string(not panic, or error), so abi decode will decode it as raw string, but geth only outputs for the panic or error:

https://github.com/alloy-rs/core/blob/175183bfb37e8806debb93f26b4a65fc77397697/crates/sol-types/src/types/interface/mod.rs#L466-L479

        // If that fails, try to decode as a regular string.
        if let Ok(decoded_string) = core::str::from_utf8(out) {
            return Some(decoded_string.to_string().into());
        }

output:

image

sorry for the mixin issue

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but why would we not include the raw string error?

}
}
}
GenericRevertReason::RawString(err) => err,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why should this be omitted here?

can we only add the empty check, I dont see a reason to change this

Copy link
Contributor

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, makes sense then

@jsvisa
Copy link
Contributor Author

jsvisa commented Sep 23, 2025

hold on, waiting for alloy/core to be merged first, then we can use the as_geth_str

}
}
}
GenericRevertReason::RawString(err) => err,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but why would we not include the raw string error?

Some(reason)
}
}
GenericRevertReason::RawString(err) => err,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, can we do this separately?

this doesnt make much sense to me to not do this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants