-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: handle unknown selector error #4811
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
crates/edr_provider/src/error.rs
Outdated
_ => unreachable!( | ||
"Since we are not validating, no other error can occur: {decode_error:?}" | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@agostbiro you're more familiar with this code. Can we logically rule out that none of the other error variants can occur?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on my prior reading of the code for alloy_sol_types::GenericContractError::abi_decode
when the validate
argument is false, only alloy_sol_types::Error::TypeCheckFail
error occurs, but the code is pretty complex and apparently alloy_sol_types::Error::UnknownSelector
can occur as well. So it's probably safer to add a fallback where we just convert the error to string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in 3e86c0d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick fixes @Wodann ! I left some comments
crates/edr_provider/src/error.rs
Outdated
_ => unreachable!( | ||
"Since we are not validating, no other error can occur: {decode_error:?}" | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on my prior reading of the code for alloy_sol_types::GenericContractError::abi_decode
when the validate
argument is false, only alloy_sol_types::Error::TypeCheckFail
error occurs, but the code is pretty complex and apparently alloy_sol_types::Error::UnknownSelector
can occur as well. So it's probably safer to add a fallback where we just convert the error to string.
Fixes NomicFoundation/edr#281