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

Remove SHL, SHR and SAR from default EVM #4633

Merged
merged 1 commit into from
Nov 12, 2022

Conversation

diega
Copy link
Contributor

@diega diega commented Nov 8, 2022

PR description

This PR removes the opcodes SHL, SHR and SAR from the base EVM b/c those were added in EIP-145 and shouldn't be available since Genesis.

Fixed Issue(s)

Spotted by @winsvega during the execution of LegacyTests. E.g.

$ ./retesteth -t LegacyTests/Constantinople/BCGeneralStateTests/stShift -- --singletest shr11_d0g0v0 --clients besu --singlenet Byzantium --nodes 127.0.0.1:8545

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if
    updates are required.

Changelog

Signed-off-by: Diego López León dieguitoll@gmail.com

@diega diega added the mainnet label Nov 8, 2022
@diega diega requested a review from shemnon November 8, 2022 17:23
Copy link
Contributor

@shemnon shemnon left a comment

Choose a reason for hiding this comment

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

Good Catch, we should remove this from the switch or place a guard around the result.

Can we keep the static operation methods in the operation classes? When EVM lands I will want to re-add it with a guard such as seen here for push0

@shemnon
Copy link
Contributor

shemnon commented Nov 8, 2022

I assume this was missed because legacy forks are not checked in checkin reference tests?

@diega diega force-pushed the constantinople_opcodes branch from cb1e9d7 to 7ab17e5 Compare November 8, 2022 17:37
@diega
Copy link
Contributor Author

diega commented Nov 8, 2022

Yes, hopefully we could run the whole suite from the retesteth sometime soon.

I reintroduced the static methods, but what do you mean by "remove this from the switch or place a guard around the result"? Didn't I remove those from the proper switch?

@winsvega
Copy link

winsvega commented Nov 8, 2022

Besu runs almost all tests. It appears to be that some failures are due to the geth t8n version. Minor theoretical issues.

@shemnon
Copy link
Contributor

shemnon commented Nov 8, 2022

The linked code shows how I handle activation of Push0 to keep it in the switch. So they would look something like

          case 0x1b: // SHL
            result =
                enableConstantinople
                    ? ShlOperation.staticOperation(frame)
                    : InvalidOperation.INVALID_RESULT;

But some of the framework supporting that is tied up in my EOF branch.

@diega
Copy link
Contributor Author

diega commented Nov 9, 2022

@shemnon gotcha. Probably this is a discussion for the other PR about EOF, but I think I like the current resolution of operations from a registry and to keep it agnostic of fork names

@shemnon shemnon mentioned this pull request Nov 11, 2022
These opcodes were introduced in [EIP-145](https://eips.ethereum.org/EIPS/eip-145)

Signed-off-by: Diego López León <dieguitoll@gmail.com>
Signed-off-by: Diego López León <dieguitoll@gmail.com>
@garyschulte garyschulte force-pushed the constantinople_opcodes branch from 7ab17e5 to 9766f48 Compare November 12, 2022 07:18
@garyschulte garyschulte enabled auto-merge (squash) November 12, 2022 07:19
@garyschulte garyschulte merged commit e2b1994 into hyperledger:main Nov 12, 2022
wcgcyx pushed a commit to wcgcyx/besu that referenced this pull request Nov 16, 2022
These opcodes were introduced in [EIP-145](https://eips.ethereum.org/EIPS/eip-145)

Signed-off-by: Diego López León <dieguitoll@gmail.com>
Signed-off-by: wcgcyx <wcgcyx@gmail.com>
@diega diega deleted the constantinople_opcodes branch November 18, 2022 23:48
macfarla pushed a commit to jflo/besu that referenced this pull request Jan 10, 2023
These opcodes were introduced in [EIP-145](https://eips.ethereum.org/EIPS/eip-145)

Signed-off-by: Diego López León <dieguitoll@gmail.com>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
eum602 pushed a commit to lacchain/besu that referenced this pull request Nov 3, 2023
These opcodes were introduced in [EIP-145](https://eips.ethereum.org/EIPS/eip-145)

Signed-off-by: Diego López León <dieguitoll@gmail.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.

4 participants