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

Disable EOF CALL opcodes in legacy #7544

Merged
merged 8 commits into from
Aug 30, 2024

Conversation

shemnon
Copy link
Contributor

@shemnon shemnon commented Aug 29, 2024

PR description

When the EOF call opcodes are added to the EVM, ensure legacy cannot it.

Fixed Issue(s)

Thanks for sending a pull request! Have you done the following?

  • Checked out our contribution guidelines?
  • Considered documentation and added the doc-change-required label to this PR if updates are required.
  • Considered the changelog and included an update if required.
  • For database changes (e.g. KeyValueSegmentIdentifier) considered compatibility and performed forwards and backwards compatibility tests

Locally, you can run these tests to catch failures early:

  • unit tests: ./gradlew build
  • acceptance tests: ./gradlew acceptanceTest
  • integration tests: ./gradlew integrationTest
  • reference tests: ./gradlew ethereum:referenceTests:referenceTests

When the EOF call opcodes are added to the EVM, ensure legacy cannot it.

Signed-off-by: Danno Ferrin <danno@numisight.com>
Signed-off-by: Danno Ferrin <danno@numisight.com>
Signed-off-by: Danno Ferrin <danno@numisight.com>
Signed-off-by: Danno Ferrin <danno@numisight.com>
@@ -95,6 +95,11 @@ public long gasAvailableForChildCall(final MessageFrame frame) {

@Override
public OperationResult execute(final MessageFrame frame, final EVM evm) {
Code callingCode = frame.getCode();
if (callingCode.getEofVersion() == 0) {
return InvalidOperation.INVALID_RESULT;
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be good to add some tests showing that an INVALID_RESULT is returned for legacy with EXTCALL, EXTDELEGATECALL and EXTSTATICCALL

Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://github.com/ethereum/execution-spec-tests/pull/768/files

Tests all legacy-invalid opcodes, not just EXT*CREATE.

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM, we can pull in the latest execution-spec tests when they get published 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

f19e242 also should address @jframe's concern

Signed-off-by: Danno Ferrin <danno@numisight.com>
@shemnon shemnon requested a review from jframe August 30, 2024 13:58
Copy link
Contributor

@garyschulte garyschulte left a comment

Choose a reason for hiding this comment

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

🚢

@shemnon shemnon enabled auto-merge (squash) August 30, 2024 18:38
@shemnon shemnon merged commit ca8563c into hyperledger:main Aug 30, 2024
40 checks passed
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