Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Fix: Change VMOperation's op field type to ensure future proof #1902

Closed
mouseless0x opened this issue Nov 28, 2022 · 0 comments
Closed

Fix: Change VMOperation's op field type to ensure future proof #1902

mouseless0x opened this issue Nov 28, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@mouseless0x
Copy link

Version
ethers 1.0.0

Description
The pull request #1858 addressing issue #1857 was implemented using a unstable design pattern that will cause issues in the future. A better approach would be to make the op field in VMOperation of type String instead of the newly introduced enum OpCode.

Making this change solves the following potential issues:

Warning
Currently, opcode 0x20 on enum ethers::core::types::OpCode is named SHA3 which causes any rpc call with VmTrace enabled on a geth node or updated erigon node to panic as it can't deserialize and map KECCAK256 to SHA3

  • If opcodes are added or if existing opcodes are renamed (e.g. eip-4758), ethers::core::types::OpCode will need to be updated to reflect this. Otherwise existing applications will panic whenever a VmTrace is requested as it won't be able to deserialize and parse the new opcodes from the trace.
@mouseless0x mouseless0x added the bug Something isn't working label Nov 28, 2022
mouseless0x pushed a commit to mouseless0x/ethers-rs that referenced this issue Nov 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant