Skip to content
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

eth_getRawTransactionByHash wrong TX encoding #8256

Open
mralj opened this issue Feb 24, 2025 · 0 comments · May be fixed by #8259
Open

eth_getRawTransactionByHash wrong TX encoding #8256

mralj opened this issue Feb 24, 2025 · 0 comments · May be fixed by #8259

Comments

@mralj
Copy link
Contributor

mralj commented Feb 24, 2025

Description

I think there is bug in implementation of the eth_getRawTransactionByHash RPC call.
The reason I think this is because when this is called from rbuilder, TX cannot be parsed and errors with Failed to decode transaction, error: unexpected string

Steps to Reproduce
In order to replicate the behavior, please provide a detailed list of steps:

  1. This is output of one of the transactions: b8b702f8b40183adcb6a84773594008517bfac7c008303291894a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4880b844a9059cbb0000000000000000000000003c5fd3564bbaec0fc9383b5c13a6eb20926a800000000000000000000000000000000000000000000000000000000000015752a0c080a058a58bd8771dea6375c0ad0420c5321a2e15de402044f67874ddccfefa091ee6a06cea78cba171430e4a3d051381301516105ded783fb1a156a2944666ec3facbb
  2. I went to this website, tried to decode TX from above and also got an error (like in rbuilder), that's why I think the issue is on our side
  3. Error: Failed to parse raw transaction hex: Unable to cast object of type 'Nethereum.RLP.RLPItem' to type 'Nethereum.RLP.RLPCollection'.

Expected behaviour
The TX shoul've been parsed, this is that very same TX: link

Additional context
As far as I can tell, t his only happens with EIP-2718 Typed TXs, the Legacy ones are OK.
Here is output of Legacy TX:

f9014b8218e184504a4cba831e84809468b3465833fb72a70ecdf485e0e4c7bd8665fc4580b8e404e45aaf000000000000000000000000bdf43ecadc5cef51b7d1772f722e40596bc1788b000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000000bb8000000000000000000000000a9ab8d5b5aab8e3215c6d0a5dcbce123299f1e7b000000000000000000000000000000000000000000000518d4f6fa3446ce000000000000000000000000000000000000000000000000000000000001949c3941000000000000000000000000000000000000000000000000000000000000000026a0fafdafb3c614c7feb1accecead542acf28efa69673276d6e2435d09bc389d657a01e8130c326f08f1707aa8973a87cc72edc857f5c956bccb70d30a1ea4b665c43

This doesn't error on rbuilder and it is also successfully parsed by this site.

I have tried playing with different RlpBehaviors but that didn't help :)
To parse the TX rbuilder uses alloy-rs here is how they parse this .

Logs
Please include any relevant logs that may help identify the issue.

@MarekM25 MarekM25 linked a pull request Feb 24, 2025 that will close this issue
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant