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

core/vm: implement EIP-5656, mcopy instruction #26181

Merged
merged 8 commits into from
Jul 11, 2023

Conversation

charles-cooper
Copy link
Contributor

first attempt at implementing the MCOPY instruction.

I don't actually know Go, so I mostly adopted the opCallDataCopy implementation.

@charles-cooper
Copy link
Contributor Author

mentioning: ethereum/EIPs#5656

core/vm/memory_table.go Outdated Show resolved Hide resolved
core/vm/gas_table.go Outdated Show resolved Hide resolved
core/vm/jump_table.go Outdated Show resolved Hide resolved
core/vm/eips.go Outdated Show resolved Hide resolved
core/vm/eips.go Outdated Show resolved Hide resolved
core/vm/gas_table.go Outdated Show resolved Hide resolved
Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

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

LGTM, but please also add the unit-tests from the EIP: https://eips.ethereum.org/EIPS/eip-5656#test-cases

core/vm/memory_table.go Outdated Show resolved Hide resolved
core/vm/eips.go Outdated Show resolved Hide resolved
core/vm/eips.go Show resolved Hide resolved
core/vm/eips.go Outdated Show resolved Hide resolved
core/vm/eips.go Outdated Show resolved Hide resolved
core/vm/eips.go Outdated Show resolved Hide resolved
@holiman
Copy link
Contributor

holiman commented Jun 8, 2023

I don't actually know Go, so I mostly adopted the opCallDataCopy implementation.

You got pretty far for not knowing go, but I can take from you on adding the testcases if you want.

@charles-cooper
Copy link
Contributor Author

charles-cooper commented Jun 8, 2023

thanks! also updated the opcode location per ethereum/EIPs#7155 in 3fb5a5d

@charles-cooper
Copy link
Contributor Author

@holiman anything else needed from me at this time?

@holiman
Copy link
Contributor

holiman commented Jul 6, 2023

This PR now passes this test:https://github.com/ipsilon/tests/blob/2379e3335868f9c1c68dcf2eed0b404121369126/EIPTests/StateTests/stEIP5656-MCOPY/MCOPY_memory_hash.json , via go run ./cmd/evm/ statetest ~/Downloads/MCOPY_memory_hash.json.

@holiman holiman changed the title feat: implement mcopy instruction per EIP 5656 core/vm: implement EIP-5656, mcopy instruction Jul 6, 2023
@holiman holiman added the cancun label Jul 6, 2023
@holiman holiman added this to the 1.12.1 milestone Jul 7, 2023
Copy link
Member

@lightclient lightclient left a comment

Choose a reason for hiding this comment

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

LGTM - was also able to verify the PR is passing a few of the Ipsilon test cases.

@holiman holiman merged commit 5c9cbc2 into ethereum:master Jul 11, 2023
yperbasis added a commit to erigontech/erigon that referenced this pull request Jul 13, 2023
Cherry pick ethereum/go-ethereum#26181

Co-authored-by: Charles Cooper <cooper.charles.m@gmail.com>
AskAlexSharov pushed a commit to erigontech/erigon that referenced this pull request Sep 6, 2023
Cherry pick ethereum/go-ethereum#26181

Co-authored-by: Charles Cooper <cooper.charles.m@gmail.com>
devopsbo3 pushed a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
Implements [EIP 5656](https://eips.ethereum.org/EIPS/eip-5656), MCOPY instruction, and enables it for Cancun. 

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
devopsbo3 added a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
devopsbo3 added a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
NazariiDenha pushed a commit to scroll-tech/go-ethereum that referenced this pull request Apr 9, 2024
Implements [EIP 5656](https://eips.ethereum.org/EIPS/eip-5656), MCOPY instruction, and enables it for Cancun.

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
Thegaram added a commit to scroll-tech/go-ethereum that referenced this pull request Apr 24, 2024
* core/vm: implement EIP-5656, mcopy instruction (ethereum#26181)

Implements [EIP 5656](https://eips.ethereum.org/EIPS/eip-5656), MCOPY instruction, and enables it for Cancun.

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>

* update version

* goimports

---------

Co-authored-by: Charles Cooper <cooper.charles.m@gmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Péter Garamvölgyi <peter@scroll.io>
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants