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

Closed
wants to merge 10 commits into 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.)

…re now handled correctly

Signed-off-by: Simeon Nakov <simeon.nakov@limechain.tech>
@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

   26 files  +  6    355 suites  +105   53m 29s ⏱️ + 11m 3s
  641 tests + 88    626 ✅ + 94  5 💤 ±0  10 ❌  - 6 
1 177 runs  +375  1 152 ✅ +375  6 💤  - 1  19 ❌ +1 

For more details on these failures, see this check.

Results for commit 2f948a1. ± Comparison against base commit b0c09bf.

This pull request removes 1 and adds 89 tests. Note that renamed tests count towards both.
"before all" hook in "Debug API Test Suite" ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-3 RPC Server Acceptance Tests Debug API Test Suite "before all" hook in "Debug API Test Suite"
"before all" hook for "should execute "eth_getCode" for hts token" ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-2 RPC Server Acceptance Tests eth_getCode "before all" hook for "should execute "eth_getCode" for hts token"
@release Should execute eth_call on Ethers Web Socket Provider and handle valid requests correctly ‑ RPC Server Acceptance Tests Acceptance tests @web-socket-batch-1 eth_call Ethers Web Socket Provider @release Should execute eth_call on Ethers Web Socket Provider and handle valid requests correctly
@release Should execute eth_call on Standard Web Socket and handle valid requests correctly ‑ RPC Server Acceptance Tests Acceptance tests @web-socket-batch-1 eth_call Standard Web Socket @release Should execute eth_call on Standard Web Socket and handle valid requests correctly
@release Should execute eth_getBalance on Ethers Web Socket Provider and handle valid requests correctly ‑ RPC Server Acceptance Tests Acceptance tests @web-socket-batch-1 eth_getBalance Ethers Web Socket Provider @release Should execute eth_getBalance on Ethers Web Socket Provider and handle valid requests correctly
@release Should execute eth_getBalance on Standard Web Socket and handle valid requests correctly ‑ RPC Server Acceptance Tests Acceptance tests @web-socket-batch-1 eth_getBalance Standard Web Socket @release Should execute eth_getBalance on Standard Web Socket and handle valid requests correctly
@release Should execute eth_getBlockByHash on Ethers Web Socket Provider and handle valid requests correctly ‑ RPC Server Acceptance Tests Acceptance tests @web-socket-batch-1 eth_getBlockByHash Ethers Web Socket Provider @release Should execute eth_getBlockByHash on Ethers Web Socket Provider and handle valid requests correctly
@release Should execute eth_getBlockByHash on Standard Web Socket and handle valid requests correctly ‑ RPC Server Acceptance Tests Acceptance tests @web-socket-batch-1 eth_getBlockByHash Standard Web Socket @release Should execute eth_getBlockByHash on Standard Web Socket and handle valid requests correctly
@release Should execute eth_getBlockByNumber on Ethers Web Socket Provider and handle valid requests correctly ‑ RPC Server Acceptance Tests Acceptance tests @web-socket-batch-1 eth_getBlockByNumber Ethers Web Socket Provider @release Should execute eth_getBlockByNumber on Ethers Web Socket Provider and handle valid requests correctly
@release Should execute eth_getBlockByNumber on Standard Web Socket and handle valid requests correctly ‑ RPC Server Acceptance Tests Acceptance tests @web-socket-batch-1 eth_getBlockByNumber Standard Web Socket @release Should execute eth_getBlockByNumber on Standard Web Socket and handle valid requests correctly
@release should execute "eth_estimateGas" for contract call, using a standard websocket ‑ RPC Server Acceptance Tests Acceptance tests @web-socket-batch-1 eth_estimateGas @release should execute "eth_estimateGas" for contract call, using a standard websocket
…

♻️ This comment has been updated with latest results.

Signed-off-by: Simeon Nakov <simeon.nakov@limechain.tech>
@simzzz simzzz self-assigned this Apr 22, 2025
simzzz added 2 commits April 22, 2025 16:25
Signed-off-by: Simeon Nakov <simeon.nakov@limechain.tech>
Signed-off-by: Simeon Nakov <simeon.nakov@limechain.tech>
@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 <simeon.nakov@limechain.tech>
Signed-off-by: Simeon Nakov <simeon.nakov@limechain.tech>
Signed-off-by: Simeon Nakov <simeon.nakov@limechain.tech>
quiet-node
quiet-node previously approved these changes Apr 25, 2025
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

Signed-off-by: Simeon Nakov <simeon.nakov@limechain.tech>
Signed-off-by: Simeon Nakov <simeon.nakov@limechain.tech>
@lfdt-bot
Copy link

lfdt-bot commented May 15, 2025

⚠️ Snyk checks are incomplete.

⚠️ security/snyk check encountered an error. (View Details)

⚠️ license/snyk check encountered an error. (View Details)

@simzzz simzzz force-pushed the 3652-handle-bad-rlp-errors branch from 2f948a1 to e3a2efb Compare May 15, 2025 14:37
Signed-off-by: Simeon Nakov <simeon.nakov@limechain.tech>
@simzzz simzzz closed this May 15, 2025
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
5 participants