sei-protocol / sei-chain

Apache License 2.0
2.67k stars 797 forks source link

Add evm rpc endpoint eth_maxPriorityFeePerGas #1693

Closed yzang2019 closed 1 month ago

yzang2019 commented 1 month ago

Describe your changes and provide context

This PR add a new EVM rpc endpoint for eth_maxPriorityFeePerGas, we don't really have an exact same implementation for tip, but for now we can just return a suggested gas price using feeHist.Reward[0][0].ToInt()

Testing performed to validate your change

Added unit test

codecov-commenter commented 1 month ago

Codecov Report

Attention: Patch coverage is 41.66667% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 60.65%. Comparing base (c92dc5f) to head (434b061).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/sei-protocol/sei-chain/pull/1693/graphs/tree.svg?width=650&height=150&src=pr&token=DG7ZZJ3PVV&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol)](https://app.codecov.io/gh/sei-protocol/sei-chain/pull/1693?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol) ```diff @@ Coverage Diff @@ ## main #1693 +/- ## ========================================== - Coverage 60.81% 60.65% -0.16% ========================================== Files 368 368 Lines 26857 26869 +12 ========================================== - Hits 16332 16298 -34 - Misses 9411 9459 +48 + Partials 1114 1112 -2 ``` | [Files](https://app.codecov.io/gh/sei-protocol/sei-chain/pull/1693?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol) | Coverage Δ | | |---|---|---| | [evmrpc/info.go](https://app.codecov.io/gh/sei-protocol/sei-chain/pull/1693?src=pr&el=tree&filepath=evmrpc%2Finfo.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol#diff-ZXZtcnBjL2luZm8uZ28=) | `68.94% <41.66%> (-2.20%)` | :arrow_down: | ... and [4 files with indirect coverage changes](https://app.codecov.io/gh/sei-protocol/sei-chain/pull/1693/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sei-protocol)