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

feat(rpc): add impls for gasprice and max priority fee #2471

Merged
merged 1 commit into from
Apr 30, 2023

Conversation

mattsse
Copy link
Collaborator

@mattsse mattsse commented Apr 29, 2023

ref #2470

🤖 Generated by Copilot at d270c85

This pull request adds support for the EIP-1559 fee market and dynamic fee transactions to the RPC API, and refactors some of the block-related methods and types. It introduces a new eth_maxPriorityFeePerGas RPC method, and implements the gas_price and suggested_priority_fee methods for the EthFeesApi trait. It also splits the block method of the EthApi trait into header and block, and adds a rpc_block method that returns a full RPC block object. Additionally, it implements the From<SealedBlock> trait for the Block type, which simplifies the conversion of blocks from different sources.

adds impl of eth_gasPrice, ref: https://github.com/ethereum/go-ethereum/blob/8f373227ac481685148019b21ef9e1478d3ba609/internal/ethapi/api.go#L62-L72

and a shim for max priority fee which is implemented here

https://github.com/ethereum/go-ethereum/blob/8f373227ac481685148019b21ef9e1478d3ba609/eth/gasprice/gasprice.go#L144-L150

ref ethereum/pm#328 (comment)

@codecov-commenter
Copy link

codecov-commenter commented Apr 29, 2023

Codecov Report

Merging #2471 (81d225e) into main (ebf13ec) will increase coverage by 0.05%.
The diff coverage is 70.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main    #2471      +/-   ##
==========================================
+ Coverage   71.62%   71.67%   +0.05%     
==========================================
  Files         487      487              
  Lines       60520    60550      +30     
==========================================
+ Hits        43346    43401      +55     
+ Misses      17174    17149      -25     
Flag Coverage Δ
integration-tests 18.13% <70.00%> (+0.02%) ⬆️
unit-tests 66.61% <0.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
crates/primitives/src/block.rs 78.82% <0.00%> (-0.47%) ⬇️
crates/rpc/rpc-api/src/eth.rs 100.00% <ø> (ø)
crates/rpc/rpc/src/eth/api/block.rs 75.80% <50.00%> (-9.62%) ⬇️
crates/rpc/rpc/src/eth/api/fees.rs 88.48% <100.00%> (+0.98%) ⬆️
crates/rpc/rpc/src/eth/api/server.rs 98.15% <100.00%> (+0.01%) ⬆️

... and 6 files with indirect coverage changes

Copy link
Member

@gakonst gakonst left a comment

Choose a reason for hiding this comment

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

LGTM - we can do in follow-up, this unblocks fork testing with Foundry

@gakonst gakonst merged commit 48f5b31 into main Apr 30, 2023
@gakonst gakonst deleted the matt/add-price-impl branch April 30, 2023 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants