reth icon indicating copy to clipboard operation
reth copied to clipboard

Impl From<ValidationApiError> for ErrorObject

Open mattsse opened this issue 6 months ago • 3 comments
trafficstars

Describe the feature

we currently always return this error as internal:

https://github.com/paradigmxyz/reth/blob/ae3ffb90e4c99dd16e8bf6c5a9749c2f0cf9ec68/crates/rpc/rpc/src/validation.rs#L444-L444

however this can fail if params are wrong

https://github.com/paradigmxyz/reth/blob/ae3ffb90e4c99dd16e8bf6c5a9749c2f0cf9ec68/crates/rpc/rpc/src/validation.rs#L527-L539

we need a more detailed conversion into jsonrpsee_types::error::ErrorObject<'static>

see also:

https://github.com/paradigmxyz/reth/blob/ae3ffb90e4c99dd16e8bf6c5a9749c2f0cf9ec68/crates/rpc/rpc-eth-types/src/error/mod.rs#L171-L172

TODO

  • impl from conversion for ErrorObject return invalid params for param related errors

Additional context

No response

mattsse avatar Apr 23 '25 12:04 mattsse