rust-ethereum / evm

Pure Rust implementation of Ethereum Virtual Machine
Apache License 2.0
1.16k stars 355 forks source link

feat: support memory copying instruction (EIP-5656) #279

Closed Agusrodri closed 3 months ago

Agusrodri commented 4 months ago

This PR adds an adaptation to EIP-5656 which introduces the MCOPY opcode.

By using this new instruction, it is possible to copy parts of the memory in a cheaper and easier way, everything done with one opcode.

Note

All the Cancun ethereum-tests related to MCOPY pass with this implementation.

RomarQ commented 3 months ago

We could add a new flag eip_5656_enabled to the config for reverting when MCOPY is used in forks that should not support it.

Similar change for eip-1153 https://github.com/rust-ethereum/evm/pull/278/commits/b8bfe595de0c351c18a17546e6b9475d093fba99

Agusrodri commented 3 months ago

We could add a new flag eip_5656_enabled to the config for reverting when MCOPY is used in forks that should not support it.

Similar change for eip-1153 b8bfe59

Done in 3f15f922d23df2f7453c626de5ccdc9c3094c270 :)

koushiro commented 3 months ago

@Agusrodri please resolve the conflicts

RomarQ commented 3 months ago

@Agusrodri please resolve the conflicts

Done :+1: