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

imp(all): Add EVM, ERC-20, feemarket and precompiles from Evmos #37

Merged
merged 32 commits into from
Aug 23, 2024

Conversation

MalteHerrmann
Copy link
Collaborator

@MalteHerrmann MalteHerrmann commented Aug 13, 2024

This PR adds the EVM, ERC-20 and feemarket modules as well as the precompiles and test utilities. It was too much unnecessary work to untangle all of the individual dependencies only to rework those when porting the next module so all of these were moved on this PR.

There had to be some mandatory changes to the codebase though, when it comes to making the implementation available to use with other chains. I will mention the most important changes below here:

Summary by CodeRabbit

  • New Features

    • Added support for the Ethereum Virtual Machine (EVM) including new components like feemarket and precompiles, enhancing the blockchain functionality.
    • Introduced handling for IBC (Inter-Blockchain Communication), allowing cross-chain interactions and token transfers.
  • Documentation

    • Updated README file to clarify configuration options, including default token pairs and denomination changes.
  • Refactor

    • Restructured import paths for several packages to improve modularity and organization.
  • Bug Fixes

    • Improved error handling in various components for better clarity and consistency.
  • Tests

    • Enhanced test cases to utilize updated parameters and improve reliability, including the integration of new test-specific utilities.

Copy link

coderabbitai bot commented Aug 13, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

The recent changes involve a significant restructuring of the codebase, primarily focusing on the import paths and dependencies related to the Ethereum Virtual Machine (EVM) components. Additionally, modifications include the introduction of new functionalities for IBC (Inter-Blockchain Communication), updates to the genesis and fee management, and enhancements in the test suite to ensure better alignment with the new architecture.

Changes

Files Change Summary
CHANGELOG.md Added entry highlighting the integration of EVM, feemarket, and precompiles from evmOS, marking enhancements in project functionality.
ante/cosmos/eip712.go, ante/cosmos/reject_msgs.go, ante/evm/01_setup_ctx.go, ante/evm/04_validate.go, ante/evm/05_signature_verification.go, ante/evm/06_account_verification.go, ante/evm/07_can_transfer.go, ante/evm/09_increment_sequence.go, ante/evm/11_emit_event.go, ante/evm/fee_checker.go Changed import paths for evmtypes, indicating a shift in dependency from github.com/evmos/evmos/v19/... to github.com/evmos/os/x/....
ante/cosmos/authz_test.go, ante/cosmos/setup_test.go, ante/evm/04_validate_test.go, ante/evm/08_gas_consume_test.go, ante/evm/09_increment_sequence_test.go, ante/evm/10_gas_wanted_test.go, ante/evm/11_emit_event.go, ante/evm/fee_checker_test.go Modifications focused on updates to coin denomination handling in tests, with a shift to using testutil.ExampleAttoDenom for consistency.
example_chain/app.go, example_chain/genesis.go, example_chain/ante/handler_options.go, example_chain/ante/cosmos_handler.go Added IBC functionality, including new handlers and keeper integrations; modified genesis state management to include new default states for the EVM and ERC20 modules.
example_chain/constants.go, example_chain/precompiles.go, example_chain/testutil/integration.go Introduced constants and functions for managing token pairs and precompile mappings, enhancing the application’s capabilities.
example_chain/go.mod Updated dependencies, adding new libraries and removing obsolete ones to reflect changes in project architecture.
example_chain/token_pair.go Defined constants and variables related to the WEVMOS contract on mainnet, facilitating token interactions.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant EVM
    participant IBC
    participant Chain

    User->>+Chain: Send Transaction
    Chain->>+EVM: Process EVM Transaction
    EVM->>IBC: Check Cross-Chain Interaction
    IBC-->>-EVM: Return Status
    EVM-->>-Chain: Transaction Result
    Chain-->>-User: Response
Loading

🐰 "In the land of code where rabbits hop,
New features sprout, and functions crop.
With paths refined, and tests aligned,
EVM's magic we now find!
Hooray for changes, let’s all cheer,
For a brighter future, drawing near!"
🌟


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 Configuration 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.

ibc/testing/coordinator.go Dismissed Show dismissed Hide dismissed
precompiles/bech32/bech32.go Dismissed Show dismissed Hide dismissed
precompiles/bech32/bech32.go Dismissed Show dismissed Hide dismissed
precompiles/bech32/methods.go Dismissed Show dismissed Hide dismissed
precompiles/common/abi.go Dismissed Show dismissed Hide dismissed
precompiles/distribution/events.go Dismissed Show dismissed Hide dismissed
precompiles/distribution/types.go Fixed Show fixed Hide fixed
@github-actions github-actions bot added the types label Aug 13, 2024
precompiles/distribution/types.go Fixed Show resolved Hide resolved
x/evm/types/params.go Outdated Show resolved Hide resolved
example_chain/precompiles.go Show resolved Hide resolved
precompiles/distribution/types.go Fixed Show resolved Hide resolved
example_chain/genesis.go Outdated Show resolved Hide resolved
example_chain/testutil/eth_setup.go Show resolved Hide resolved
@MalteHerrmann MalteHerrmann marked this pull request as ready for review August 21, 2024 07:34
@MalteHerrmann MalteHerrmann requested a review from a team as a code owner August 21, 2024 07:34
@MalteHerrmann MalteHerrmann requested review from Vvaradinov and GAtom22 and removed request for a team August 21, 2024 07:34
@MalteHerrmann MalteHerrmann changed the title imp(all): Add EVM, feemarket and precompiles from Evmos imp(all): Add EVM, ERC-20, feemarket and precompiles from Evmos Aug 21, 2024
Copy link
Contributor

@GAtom22 GAtom22 left a comment

Choose a reason for hiding this comment

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

LGTM! Great work @MalteHerrmann!!
Left one nit comment

ante/cosmos/setup_test.go Outdated Show resolved Hide resolved
@MalteHerrmann MalteHerrmann merged commit c7da69b into main Aug 23, 2024
21 of 25 checks passed
@MalteHerrmann MalteHerrmann deleted the add-modules branch August 23, 2024 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants