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_feeHistory returns incorrect fields #1782

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

eth_feeHistory returns incorrect fields #1782

Rjected opened this issue Mar 15, 2023 · 6 comments
Assignees
Labels
A-rpc Related to the RPC implementation C-bug An unexpected or incorrect behavior

Comments

@Rjected
Copy link
Member

Rjected commented Mar 15, 2023

Describe the bug

The rpc-compat test eth_feeHistory fails:

  • The oldestBlock is returned as a hash when it is requested by number
  • The returned baseFeePerGas is incorrect
  • The reward field should exist
  • Two gasUsedRatios are returned when only one should be returned - the block_count parameter is 0x1
>>  {"jsonrpc":"2.0","id":1,"method":"eth_feeHistory","params":["0x1","0x2",[95,99]]}
<<  {"jsonrpc":"2.0","result":{"baseFeePerGas":["0x342770c0","0x2db08786"],"gasUsedRatio":[0.0042,0.0042],"oldestBlock":"0x898753d8fdd8d92c1907ca21e68c7970abd290c647a202091181deec3f30a0b2","reward":null},"id":1}
response differs from expected:
 {
   "id": 1,
   "jsonrpc": "2.0",
   "result": {
     "baseFeePerGas": [
-      0: "0x342770c0",
+      1: "0x2806be9d"
     ],
     "gasUsedRatio": [
-      0: 0.0042,
       1: 0.0042
     ],
-    "oldestBlock": "0x898753d8fdd8d92c1907ca21e68c7970abd290c647a202091181deec3f30a0b2",
+    "oldestBlock": "0x2",
-    "reward": null
+    "reward": [
+      : [
+        : "0x1",
+        : "0x1"
+      ]
+    ]
   }
 }

Steps to reproduce

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

Command to run the eth_feeHistory tests:

./hive --client reth --sim ethereum/rpc-compat --sim.limit "/eth_feeHistory"

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
@Rjected Rjected added A-rpc Related to the RPC implementation and removed S-needs-triage This issue needs to be labelled labels Mar 15, 2023
@sk1122
Copy link
Contributor

sk1122 commented Mar 28, 2023

can i pick this issue @mattsse?

have did some work already on this and got gasUsedRatio and baseFeePerGas working, now adding more checks like for rewardPercentile, we can't have more than 100, also calculating reward based on that

testing on the hive test suite

@mattsse
Copy link
Collaborator

mattsse commented Mar 28, 2023

@sk1122
Copy link
Contributor

sk1122 commented Mar 28, 2023

yes, using the same format, used camelCase here, because it was used in the test 😅

@mattsse
Copy link
Collaborator

mattsse commented Mar 31, 2023

hey @sk1122

This will become a blocker shortly. Are you still planning to work on it?

@sk1122
Copy link
Contributor

sk1122 commented Mar 31, 2023

I am working on it, completing rewards and writing test, will try complete it by Sunday(ist)

@mattsse
Copy link
Collaborator

mattsse commented Mar 31, 2023

awesome, ty!

@onbjerg onbjerg closed this as completed May 29, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in Reth Tracker May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rpc Related to the RPC implementation C-bug An unexpected or incorrect behavior
Projects
Archived in project
Development

No branches or pull requests

4 participants