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(opcodes/eip5656/mcopy): add mCopy opcode, EIP-5656 #12

Draft
wants to merge 1 commit into
base: v20.0.0-exrp
Choose a base branch
from

Conversation

blewater
Copy link

@blewater blewater commented Feb 3, 2025

Description

This PR aims to add the MCOPY (0x5e) opcode to the EVM implementation in Evmos. The MCOPY opcode, introduced in Solidity 0.8.25, enables efficient memory copying within the EVM. This change ensures compatibility with contracts compiled using Solidity versions ^0.8.25 and resolves the issue where calls to functions utilizing MCOPY fail with an "opcode not defined" error.

The following changes have been implemented:

  • Added the MCOPY (0x5e) opcode to the EVM interpreter's opcode table.
  • Implemented the logic for the MCOPY operation, including memory copying.
  • Added a unit test to verify the MCOPY implementation.

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

  • I have tackled an existing issue (#53).
  • I have left instructions on how to review the changes:
    • Review the implementation of the MCOPY opcode in x/evm/core/vm/instructions.go.
    • Verify the unit test in x/evm/core/vm/instructions_test.go.
    • Test the changes by following the deployment process described in the issue #53 that uses MCOPY from the provided MCopyTest contract to the local node by launching: local-node.sh
  • I have targeted the correct branch by deducting the team's practices with this forked repo, rebasing latest work off v20.0.0-exrp

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.
  • I have confirmed all author checklist items have been addressed.
  • I have confirmed that this PR does not change production code outside the EVM module.
  • I have reviewed the content.
  • I have tested the instructions (deployed a contract using MCOPY and verified functionality).
  • I have confirmed all CI checks have passed.

@blewater
Copy link
Author

blewater commented Feb 3, 2025

Per xrplevm/node#53 test guidelines.

cast call 0xd990b46d17672700e285eaffa170b35c0beac33d "example()(bytes)" --rpc-url http://localhost:8545
0x12345600af151531

@GuillemGarciaDev
Copy link
Collaborator

Hello @blewater,

Thank you for your concern regarding this issue. We are aware that the current version of Evmos does not include the latest version of go-ethereum and, therefore, certain EIPs, such as EIP-5656, are not available. However, we have not yet specifically planned when we will update go-ethereum or which EIPs we intend to enable.

That being said, we will keep this PR as a draft to assess its inclusion at the appropriate time.

Thank you very much!

@GuillemGarciaDev GuillemGarciaDev marked this pull request as draft February 18, 2025 08:54
@blewater
Copy link
Author

Hello @blewater,

Thank you for your concern regarding this issue. We are aware that the current version of Evmos does not include the latest version of go-ethereum and, therefore, certain EIPs, such as EIP-5656, are not available. However, we have not yet specifically planned when we will update go-ethereum or which EIPs we intend to enable.

That being said, we will keep this PR as a draft to assess its inclusion at the appropriate time.

Thank you very much!

Hi @GuillemGarciaDev,
This PR is a fix to a community EVM compatibility issue raised #53 weeks back on the chain you're stewarding, and you didn't address it and demote the community contribution that is fixing it.
If you are not to handle simple community contributions or fixes, you should consider surrendering the repo's control to the Evmos team or community leaders who can instill confidence in builders that community contributions are respected and the EVMXRPL chain will stay on par with EVM standards.

@AdriaCarrera
Copy link

Thanks for raising your concerns, @blewater. We always appreciate feedback and contributions from the community.

If you are not to handle simple community contributions or fixes, you should consider surrendering the repo's control to the Evmos team or community leaders who can instill confidence in builders that community contributions are respected and the EVMXRPL chain will stay on par with EVM standards.

To clarify, the control of Evmos remains with the Evmos team. This repository is simply a fork that includes minor modifications to ensure compatibility with the XRPL EVM. Since the proposed changes impact the core of Evmos, they are beyond the scope of this fork and would need to be addressed upstream.

Additionally, if you aim to support Solidity 0.8.25, we must also implement several key EIPs to maintain compatibility, including:
EIP-1153: Transient storage opcodes
EIP-4788: Beacon block root in the EVM
EIP-4844: Shard Blob Transactions
EIP-7516: BLOBBASEFEE opcode
EIP-5656: MCOPY - Memory copying instruction
EIP-6780: SELFDESTRUCT only in same transaction

For further details, you can refer to the Solidity release notes here: https://soliditylang.org/blog/2024/01/26/solidity-0.8.24-release-announcement/

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