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_getStorage successfully parses index that is too long #1784

Closed
1 task done
Tracked by #1579
Rjected opened this issue Mar 15, 2023 · 6 comments
Closed
1 task done
Tracked by #1579

eth_getStorage successfully parses index that is too long #1784

Rjected opened this issue Mar 15, 2023 · 6 comments
Labels
C-bug An unexpected or incorrect behavior S-stale This issue/PR is stale and will close with no further activity

Comments

@Rjected
Copy link
Member

Rjected commented Mar 15, 2023

Describe the bug

The eth_getStorage/get-invalid-key-too-large test in the rpc-compat test suite currently fails:

>>  {"jsonrpc":"2.0","id":12,"method":"eth_getStorageAt","params":["0xaa00000000000000000000000000000000000000","0x00000000000000000000000000000000000000000000000000000000000000000","latest"]}
<<  {"jsonrpc":"2.0","result":"0x0000000000000000000000000000000000000000000000000000000000000000","id":12}
response differs from expected:
 {
   "id": 12,
   "jsonrpc": "2.0",
-  "result": "0x0000000000000000000000000000000000000000000000000000000000000000"
+  "error": {
+    "code": -32000,
+    "message": "hex string of odd length"
+  }
 }

This is because we successfully parse 0x00000000000000000000000000000000000000000000000000000000000000000, which is 67 characters long, or 65 characters excluding the 0x. Instead, this should be disallowed in U256 deserialization, and we should return the error hex string of odd length with code -32000.

Steps to reproduce

Run the steps in #851, building the docker image from the branch dan/hive-ci.

The command to run the eth_getStorageAt/get-invalid-key-too-large test:

./hive --client reth --sim ethereum/rpc-compat --sim.limit "/eth_getStorage/get-storage-invalid-key-too-large"

Node logs

No response

Platform(s)

No response

What version/commit are you on?

No response

Code of Conduct

  • I agree to follow the Code of Conduct
@Rjected Rjected added C-bug An unexpected or incorrect behavior S-needs-triage This issue needs to be labelled labels Mar 15, 2023
@mattsse
Copy link
Collaborator

mattsse commented Mar 15, 2023

this is actually a U256::deserialize bug, right?

@Rjected
Copy link
Member Author

Rjected commented Mar 16, 2023

this is actually a U256::deserialize bug, right?

Yeah, will open an issue and track there

@Rjected
Copy link
Member Author

Rjected commented Mar 31, 2023

@Rjected Rjected closed this as completed Mar 31, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in Reth Tracker Mar 31, 2023
@DaniPopes DaniPopes removed the S-needs-triage This issue needs to be labelled label Apr 24, 2024
@Rjected Rjected reopened this Jun 27, 2024
@github-project-automation github-project-automation bot moved this from Done to In Progress in Reth Tracker Jun 27, 2024
@mattsse
Copy link
Collaborator

mattsse commented Jun 28, 2024

recmo/uint#389

Copy link
Contributor

github-actions bot commented Aug 2, 2024

This issue is stale because it has been open for 21 days with no activity.

@github-actions github-actions bot added the S-stale This issue/PR is stale and will close with no further activity label Aug 2, 2024
Copy link
Contributor

github-actions bot commented Aug 9, 2024

This issue was closed because it has been inactive for 7 days since being marked as stale.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug An unexpected or incorrect behavior S-stale This issue/PR is stale and will close with no further activity
Projects
Archived in project
Development

No branches or pull requests

3 participants