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

chore(evm): wiped deprecated evm apis: miner, personal #1958

Merged
merged 4 commits into from
Jul 8, 2024
Merged

Conversation

onikonychev
Copy link
Contributor

@onikonychev onikonychev commented Jul 5, 2024

Summary by CodeRabbit

  • New Features

    • Added a FeeHistory function for fee estimation based on block range.
  • Refactor

    • Removed deprecated Proof of Work-related APIs including miner and personal.
    • Eliminated methods and namespaces related to Proof of Work such as SetEtherbase, SetGasPrice, and Coinbase.
  • Tests

    • Updated test cases to reflect the removal of Proof of Work APIs and added tests for gas tip cap suggestions.
  • Chores

    • Cleaned up codebase by removing unused imports and functions related to deprecated APIs.

@onikonychev onikonychev requested a review from a team as a code owner July 5, 2024 16:21
Copy link
Contributor

coderabbitai bot commented Jul 5, 2024

Walkthrough

The changes primarily focus on eliminating deprecated and unused Ethereum JSON-RPC APIs and Proof of Work (PoW) functionalities. This involves removing several methods related to miner operations and personal account management from various backend components and refactoring test cases. This cleanup reflects a shift towards post-merge Ethereum (Proof of Stake) and modernizing the codebase by discarding outdated APIs and practices.

Changes

File Change Summary
CHANGELOG.md Documented the new chore task for removing deprecated EVM APIs: miner, personal.
app/server/config/server_config.go Removed "miner" namespace from the available JSON-RPC API namespaces.
eth/rpc/backend/backend.go Removed multiple methods from EVMBackend interface: SetEtherbase, SetGasPrice, etc.
eth/rpc/backend/chain_info.go Deleted GetCoinbase function; added FeeHistory function.
eth/rpc/backend/chain_info_test.go Removed TestGetCoinbase; added TestSuggestGasTipCap.
eth/rpc/backend/node_info.go Removed SetEtherbase, SetGasPrice functions; refactored related logic.
eth/rpc/backend/node_info_test.go Deleted TestSetGasPrice, TestSetEtherbase; modified TestListAccounts, TestSyncing.
eth/rpc/rpcapi/apis.go Removed EthereumNamespaces function and NamespaceMiner implementation.
eth/rpc/rpcapi/eth_api.go Removed PoW related methods from IEthAPI: Hashrate, Mining, Coinbase, Sign.
x/evm/keeper/msg_server.go Updated to remove coinbase address explanation; adjusted for post-merge Ethereum (Proof of Stake).

Poem

In code's vast realm, a shift we see,
Old miners and methods, let them be.
Proof of Stake now takes the stage,
A refined, modern, Ethereum age.
APIs streamlined, clean and bright,
Progress shines in digital light.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Jul 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.32%. Comparing base (1b758bb) to head (fb7bdde).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1958      +/-   ##
==========================================
+ Coverage   64.83%   65.32%   +0.48%     
==========================================
  Files         253      251       -2     
  Lines       16065    15790     -275     
==========================================
- Hits        10416    10315     -101     
+ Misses       4892     4729     -163     
+ Partials      757      746      -11     
Files Coverage Δ
eth/rpc/backend/backend.go 75.00% <ø> (ø)
eth/rpc/backend/chain_info.go 81.44% <ø> (-0.54%) ⬇️
eth/rpc/backend/node_info.go 63.82% <ø> (+18.04%) ⬆️
eth/rpc/rpcapi/apis.go 89.55% <ø> (+6.57%) ⬆️
eth/rpc/rpcapi/eth_api.go 28.22% <ø> (+2.52%) ⬆️
x/evm/keeper/msg_server.go 61.27% <ø> (ø)

... and 2 files with indirect coverage changes

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1b758bb and 8d632f1.

Files selected for processing (6)
  • CHANGELOG.md (1 hunks)
  • app/server/config/server_config.go (1 hunks)
  • eth/rpc/backend/backend.go (1 hunks)
  • eth/rpc/backend/node_info.go (3 hunks)
  • eth/rpc/backend/node_info_test.go (3 hunks)
  • eth/rpc/rpcapi/apis.go (2 hunks)
Files skipped from review due to trivial changes (2)
  • app/server/config/server_config.go
  • eth/rpc/backend/backend.go
Additional comments not posted (6)
eth/rpc/rpcapi/apis.go (3)

29-38: LGTM! Initialization of NamespaceEth is correct.

The initialization of NamespaceEth with NewImplEthAPI and filtersapi.NewImplFiltersAPI looks correct.


Line range hint 39-47: LGTM! Initialization of NamespacePersonal is correct.

The initialization of NamespacePersonal with NewImplPersonalAPI looks correct.


Line range hint 48-56: LGTM! Initialization of NamespaceDebug is correct.

The initialization of NamespaceDebug with debugapi.NewImplDebugAPI looks correct.

eth/rpc/backend/node_info_test.go (2)

Line range hint 26-43: LGTM! Modifications to TestListAccounts are correct.

The modifications to TestListAccounts to include logic related to setting gas prices and etherbase addresses look correct.


Line range hint 48-73: LGTM! Modifications to TestSyncing are correct.

The modifications to TestSyncing to incorporate related functionality from removed tests look correct.

CHANGELOG.md (1)

79-79: LGTM!

The change is correctly documented in the "State Machine Breaking" section.

@onikonychev onikonychev changed the title chore(evm): wiped miner api chore(evm): wiped deprecated evm apis: miner, personal Jul 5, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 8d632f1 and fb7bdde.

Files selected for processing (10)
  • CHANGELOG.md (1 hunks)
  • app/server/config/server_config.go (2 hunks)
  • eth/rpc/backend/backend.go (3 hunks)
  • eth/rpc/backend/chain_info.go (1 hunks)
  • eth/rpc/backend/chain_info_test.go (1 hunks)
  • eth/rpc/backend/node_info.go (2 hunks)
  • eth/rpc/backend/node_info_test.go (3 hunks)
  • eth/rpc/rpcapi/apis.go (3 hunks)
  • eth/rpc/rpcapi/eth_api.go (4 hunks)
  • x/evm/keeper/msg_server.go (1 hunks)
Files skipped from review due to trivial changes (2)
  • eth/rpc/backend/chain_info_test.go
  • x/evm/keeper/msg_server.go
Files skipped from review as they are similar to previous changes (5)
  • CHANGELOG.md
  • app/server/config/server_config.go
  • eth/rpc/backend/backend.go
  • eth/rpc/backend/node_info.go
  • eth/rpc/rpcapi/apis.go
Additional comments not posted (17)
eth/rpc/backend/node_info_test.go (3)

Line range hint 8-33:
LGTM!

The test cases for TestRPCMinGasPrice are well-structured and cover the expected scenarios.


Line range hint 35-54:
LGTM!

The test case for TestAccounts is well-structured and covers the expected scenario.


Line range hint 56-101:
LGTM!

The test cases for TestSyncing are well-structured and cover the expected scenarios.

eth/rpc/backend/chain_info.go (6)

Line range hint 14-26:
LGTM!

The ChainID function logic is correct and handles errors appropriately.


Line range hint 28-36:
LGTM!

The ChainConfig function logic is correct and handles errors appropriately.


Line range hint 38-50:
LGTM!

The BaseFee function logic is correct and handles errors appropriately.


Line range hint 52-56:
LGTM!

The CurrentHeader function logic is correct and handles errors appropriately.


Line range hint 58-76:
LGTM!

The PendingTransactions function logic is correct and handles errors appropriately.


Line range hint 78-149:
LGTM!

The FeeHistory function logic is correct and handles errors appropriately. It is a new addition to the file.

eth/rpc/rpcapi/eth_api.go (8)

Line range hint 34-51:
LGTM!

The functions BlockNumber, GetBlockByNumber, and GetBlockByHash are well-structured and handle errors appropriately.


Line range hint 53-83:
LGTM!

The functions related to reading transactions are well-structured and handle errors appropriately.


Line range hint 85-95:
LGTM!

The functions related to writing transactions are well-structured and handle errors appropriately.


Line range hint 97-128:
LGTM!

The functions related to account information are well-structured and handle errors appropriately.


Line range hint 130-142:
LGTM!

The Call function is well-structured and handles errors appropriately.


Line range hint 144-176:
LGTM!

The functions related to chain information are well-structured and handle errors appropriately.


Line range hint 178-198:
LGTM!

The functions related to uncles are well-structured and handle errors appropriately.


Line range hint 200-298:
LGTM!

The other functions are well-structured and handle errors appropriately.

@onikonychev onikonychev enabled auto-merge (squash) July 5, 2024 18:48
@onikonychev onikonychev merged commit 2a6c81a into main Jul 8, 2024
16 checks passed
@onikonychev onikonychev deleted the on/cleanup branch July 8, 2024 00:06
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.

2 participants