[Feature] Simplify conversion from TransactionReceipt
for RLP-encoding
#1939
Labels
enhancement
New feature or request
TransactionReceipt
for RLP-encoding
#1939
Component
network, json-rpc
Describe the feature you would like
It would be beneficial to have a more straightforward way to RLP-encode a
TransactionReceipt
or to easily convert it into aReceiptEnvelope
, which already implements the necessary encoding traits. Currently, the only process I could find requires manually converting internal structures likealloy_rpc_types::Log
toalloy_primitives::Log
, which is very cumbersome and error-prone.Here's an example of the current workaround:
While I understand that issues #623 and #854 aim to provide a more generic solution, a simple utility method or trait implementation in the interim would significantly improve developer experience and potentially save time for those facing similar use cases.
Context:
A primary motivation for this request is the need to validate receipts returned for a block. While calculating the transaction root is straightforward using the existing features (as shown below), verifying the receipt root for a generic
Provider
connected to aNetwork
does not currently appear to be possible at all, and even forEthereum
it requires the manual conversion outlined above.Ideally, a similar approach should be possible for validating receipt roots. A utility or trait to simplify the conversion from
TransactionReceipt
to a readily RLP-encodable format would enable this functionality until the aforementioned issues are resolved.Additional context
No response
The text was updated successfully, but these errors were encountered: