Skip to content

fix(erc20): validation considering EIP-55 (#2696) #2913

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

Merged
merged 2 commits into from
Oct 4, 2024

Conversation

GAtom22
Copy link
Contributor

@GAtom22 GAtom22 commented Oct 4, 2024

  • fix(erc20): validation considering EIP-55

  • add changelog entry

  • fix chlog

  • update var name

Description

Closes: #XXXX


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • tackled an existing issue or discussed with a team member
  • left instructions on how to review the changes
  • targeted the correct branch (see PR Targeting)

Reviewers Checklist

All items are required.
Please add a note if the item is not applicable
and please add your handle next to the items reviewed
if you only reviewed selected items.

I have...

  • added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • confirmed all author checklist items have been addressed
  • confirmed that this PR does not change production code
  • reviewed content
  • tested instructions (if applicable)
  • confirmed all CI checks have passed

Summary by CodeRabbit

  • Improvements

    • Updated Cosmos-SDK and IBC-Go versions for enhanced performance and stability.
    • Performance improvements for eth_headerByHash and fixes for community pool issues.
    • Enhanced transaction handling with new fee scaling and adjustments for balance methods.
    • Refactored precompile checks for better encapsulation and readability.
  • Bug Fixes

    • Resolved issues with staking rewards and validator address errors in testnet initialization.

* fix(erc20): validation considering EIP-55

* add changelog entry

* fix chlog

* update var name
Copy link
Contributor

coderabbitai bot commented Oct 4, 2024

Walkthrough

The changes in this pull request primarily involve updates to the CHANGELOG.md file, detailing significant modifications to the Cosmos-SDK and IBC-Go versions, along with various improvements and fixes. Key changes include the removal of automatic staking rewards withdrawal for insufficient funds, updates to precompile handling, and refactoring of several components to enhance performance and maintainability. Additionally, the keeper package in precompiles.go was modified to improve the logic for checking ERC20 precompile availability.

Changes

File Change Summary
CHANGELOG.md Updated to include new entries under "Unreleased" for "State Machine Breaking" and "Improvements" categories, detailing multiple updates to Cosmos-SDK and IBC-Go versions, performance improvements, and refactoring.
x/erc20/keeper/precompiles.go Modified IsAvailableERC20Precompile method to enhance encapsulation by replacing slices.Contains with calls to params.IsNativePrecompile and params.IsDynamicPrecompile. Functionality remains unchanged.

Possibly related PRs

  • update chlog #2840: This PR is related as it also involves the removal of the EthAccount type and its replacement with BaseAccount, which is a significant change noted in the main PR's summary.

Suggested reviewers

  • hanchon
  • Vvaradinov
  • fedekunze
  • 0xstepit

🐇 In a world of code and chains,
We hop along, through joys and pains.
With precompiles refined and bright,
Our changes bring a new delight.
So let us cheer, with a joyful thump,
For every fix and every jump! 🎉


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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

@GAtom22 GAtom22 marked this pull request as ready for review October 4, 2024 14:14
@GAtom22 GAtom22 requested a review from a team as a code owner October 4, 2024 14:14
@GAtom22 GAtom22 requested review from hanchon and Vvaradinov and removed request for a team October 4, 2024 14:14
@GAtom22
Copy link
Contributor Author

GAtom22 commented Oct 4, 2024

https://github.com/Mergifyio backport rama/release-v20

Copy link
Contributor

mergify bot commented Oct 4, 2024

backport rama/release-v20

✅ Backports have been created

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

🧹 Outside diff range and nitpick comments (3)
CHANGELOG.md (3)

52-52: Significant changes in the upcoming release

The "Unreleased" section contains numerous important updates, including state machine breaking changes and improvements. It's crucial to carefully review these changes, especially the state machine breaking ones, as they may require special handling during the upgrade process.

Consider adding a note at the beginning of the "Unreleased" section to highlight any specific upgrade considerations or prerequisites for node operators and developers.


Line range hint 54-65: Well-documented state machine breaking changes

The state machine breaking changes are clearly documented, providing a good overview of the updates to various modules and dependencies. This level of detail is helpful for developers and node operators preparing for the upgrade.

For complex changes, such as the new governance precompile or the refactoring to use sdk.BaseDenom, consider adding brief explanations of the impact or reasons for these changes. This additional context could help users better understand the motivations behind the updates.

🧰 Tools
🪛 Markdownlint

51-51: Expected: 120; Actual: 175
Line length

(MD013, line-length)


Line range hint 67-86: Comprehensive list of improvements

The "Improvements" subsection provides a thorough list of enhancements, bug fixes, and new features across various modules and components. These changes appear to significantly improve the overall functionality and performance of the system.

Given the extent of these improvements, it would be beneficial to ensure that all related documentation, user guides, and API references are updated to reflect these changes. Consider adding a task or note to review and update the project's documentation in line with these improvements.

🧰 Tools
🪛 Markdownlint

51-51: Expected: 120; Actual: 175
Line length

(MD013, line-length)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between d5ae153 and f39291e.

📒 Files selected for processing (2)
  • CHANGELOG.md (1 hunks)
  • x/erc20/keeper/precompiles.go (1 hunks)
🔇 Additional comments (3)
x/erc20/keeper/precompiles.go (2)

51-52: LGTM: Improved implementation of IsAvailableERC20Precompile

The changes to the IsAvailableERC20Precompile method look good. By delegating the checks to params.IsNativePrecompile and params.IsDynamicPrecompile, the code becomes more modular and easier to maintain. This change aligns well with the principle of separation of concerns.


51-52: Clarification needed: EIP-55 validation implementation

The PR objectives mention implementing validation changes in accordance with EIP-55 (Ethereum address formatting). However, the changes in this file don't seem to directly address EIP-55 validation. Could you please clarify where the EIP-55 validation is implemented, or if it's planned to be implemented in a different part of the codebase?

To help verify the implementation of EIP-55 validation, you can run the following script:

CHANGELOG.md (1)

Line range hint 1-86: Overall approval with minor suggestions

The CHANGELOG.md file is well-structured and follows the Keep a Changelog format, providing valuable information about the changes in each release. The categorization of changes into "State Machine Breaking" and "Improvements" helps users quickly identify the impact of each update.

To further enhance the changelog:

  1. Consider adding links to relevant issues or pull requests for each change, allowing users to easily find more context if needed.
  2. For major changes or new features, a brief example or use case could be helpful to illustrate the impact or benefits.
  3. Ensure consistency in the level of detail provided for each entry across all sections.

These minor improvements could make the changelog even more informative and user-friendly.

🧰 Tools
🪛 Markdownlint

51-51: Expected: 120; Actual: 175
Line length

(MD013, line-length)

@GAtom22 GAtom22 enabled auto-merge (squash) October 4, 2024 14:28
@hanchon
Copy link
Contributor

hanchon commented Oct 4, 2024

Thanks Tom!

@GAtom22 GAtom22 merged commit 82e0ff4 into main Oct 4, 2024
50 of 52 checks passed
@GAtom22 GAtom22 deleted the GAtom22/reapply-eip-155 branch October 4, 2024 14:48
mergify bot pushed a commit that referenced this pull request Oct 4, 2024
* fix(erc20): validation considering EIP-55 (#2696)

* fix(erc20): validation considering EIP-55

* add changelog entry

* fix chlog

* update var name

* add changelog entry

(cherry picked from commit 82e0ff4)

# Conflicts:
#	CHANGELOG.md
GAtom22 added a commit that referenced this pull request Oct 4, 2024
…2915)

* fix(erc20): validation considering EIP-55 (#2696) (#2913)

* fix(erc20): validation considering EIP-55 (#2696)

* fix(erc20): validation considering EIP-55

* add changelog entry

* fix chlog

* update var name

* add changelog entry

(cherry picked from commit 82e0ff4)

# Conflicts:
#	CHANGELOG.md

* fix chlog

---------

Co-authored-by: Tom <54514587+GAtom22@users.noreply.github.com>
Co-authored-by: tom <tomasguerraalda@hotmail.com>
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.

4 participants