Skip to content

fix: eth_sendRawTransaction now handles malformed RLP data correctly #3714

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

simzzz
Copy link
Contributor

@simzzz simzzz commented Apr 22, 2025

Description:
In this PR, the eth_sendRawTransaction logic now handles malformed RLP data correctly by checking for INVALID_ARGUMENT error and returning a predifined error and 400 status code.

Related issue(s):

Fixes #3652

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@simzzz simzzz requested review from a team as code owners April 22, 2025 11:43
@simzzz simzzz requested a review from quiet-node April 22, 2025 11:43
Copy link

github-actions bot commented Apr 22, 2025

Test Results

   24 files  +  4    317 suites  +62   52m 16s ⏱️ + 11m 27s
  633 tests +  4    616 ✅  -   5  4 💤 ±0  13 ❌ + 9 
1 058 runs  +243  1 029 ✅ +222  4 💤 ±0  25 ❌ +21 

For more details on these failures, see this check.

Results for commit faa0fea. ± Comparison against base commit b882f71.

♻️ This comment has been updated with latest results.

Signed-off-by: Simeon Nakov <[email protected]>
@simzzz simzzz self-assigned this Apr 22, 2025
@simzzz simzzz added this to the 0.68.0 milestone Apr 22, 2025
@simzzz simzzz added the bug Something isn't working label Apr 22, 2025
simzzz added 2 commits April 23, 2025 12:25
Signed-off-by: Simeon Nakov <[email protected]>
Signed-off-by: Simeon Nakov <[email protected]>
@@ -195,6 +195,18 @@ describe('@ethSendRawTransaction eth_sendRawTransaction spec', async function ()
);
});

it('should return a predefined INVALID_ARGUMENTS when transaction has invalid format', async function () {
const invalidTx =
'0xf8748201280585800e8dfc0085800e8dfc00832dc6c094aca85ef7e1fce27079bbf99b60fcf6fd19b99b248502540be40080c001a0210446cfb671c3174392410d52fa3cd58723d8417e40cc67c6225b8f7e3ff693a02674b392846c59f783ea96655d39560956dd987051972064a5d853cea0b6f6d711';
Copy link
Contributor

Choose a reason for hiding this comment

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

May we add a comment on exactly how is this tx invalid

Copy link
Contributor

@quiet-node quiet-node left a comment

Choose a reason for hiding this comment

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

Nice one! Thanks for the good work! LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix eth_sendRawTransaction 500 error when handling malformed RLP payloads
3 participants