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

[EVM-696] eth_FeeHistory #1669

Merged
merged 17 commits into from
Jul 4, 2023
Merged

[EVM-696] eth_FeeHistory #1669

merged 17 commits into from
Jul 4, 2023

Conversation

owenwahlgren
Copy link
Contributor

Description

Implementation of EIP1559 eth_feeHistory into the new gasprice package
Example call:
curl http://localhost:10002/ -X POST -H "Content-Type: application/json" --data '{"method":"eth_feeHistory","params":[4, 5, [25, 75]],"id":1,"jsonrpc":"2.0"}'

Response:
{"jsonrpc":"2.0","id":1,"result":{"OldestBlock":"0x1","BaseFeePerGas":["0x34d670c0","0x2e3ba2a8","0x2e3ba2a8"],"GasUsedRatio":["0x0","0x0"],"Reward":[["0x0","0x0"],["0x0","0x0"]]}}

Changes include

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)

Checklist

  • I have assigned this PR to myself
  • I have added at least 1 reviewer
  • I have added the relevant labels
  • I have updated the official documentation
  • I have added sufficient documentation in code

Testing

  • I have tested this code with the official test suite
  • I have tested this code manually

@github-actions
Copy link

github-actions bot commented Jun 26, 2023

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@owenwahlgren
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@vcastellm vcastellm requested a review from a team June 27, 2023 07:30
@goran-ethernal
Copy link
Collaborator

Left some comments. Please take a look at Lint errors it reported as well. It looks good.

@vcastellm
Copy link
Contributor

@owenwahlgren please check linting issues

gasprice/gasprice.go Outdated Show resolved Hide resolved
@owahlgren
Copy link
Contributor

thanks for the help :)
my mock for GetBlockByNumber was incorrect hence the failing test :/
--- PASS: TestGasHelper_FeeHistory (0.00s) --- PASS: TestGasHelper_FeeHistory/Block_does_not_exist (0.00s) --- PASS: TestGasHelper_FeeHistory/Invalid_rewardPercentile (0.03s) --- PASS: TestGasHelper_FeeHistory/Block_Range_<_1 (0.04s)

Copy link
Collaborator

@goran-ethernal goran-ethernal left a comment

Choose a reason for hiding this comment

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

gasprice/gasprice.go Outdated Show resolved Hide resolved
gasprice/feehistory.go Outdated Show resolved Hide resolved
jsonrpc/eth_endpoint.go Outdated Show resolved Hide resolved
@vcastellm
Copy link
Contributor

One linting issue pending

@igorcrevar
Copy link
Contributor

LGTM, Just fix lint errors

@vcastellm vcastellm merged commit 7c05311 into 0xPolygon:develop Jul 4, 2023
6 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jul 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants