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

EIP-3540: Unified Spec Tests #1127

Merged
merged 1 commit into from
Jan 3, 2023
Merged

EIP-3540: Unified Spec Tests #1127

merged 1 commit into from
Jan 3, 2023

Conversation

hugo-dc
Copy link
Member

@hugo-dc hugo-dc commented Dec 29, 2022

Contains tests in #1112 , updated based on latest EOF Unified Spec

@hugo-dc hugo-dc changed the title EOF Unified Spec Tests EIP-3540: Unified Spect Tests Dec 29, 2022
@hugo-dc hugo-dc changed the title EIP-3540: Unified Spect Tests EIP-3540: Unified Spec Tests Dec 29, 2022
@gumb0
Copy link
Member

gumb0 commented Dec 29, 2022

@winsvega Is it ok if we leave expectations with Shanghai fork name here?

@winsvega
Copy link
Collaborator

Yes, but also put a comment in info comment section with url to the geth/client generated the test and its branch and what eips are activated.

@winsvega
Copy link
Collaborator

Also checkout /src/README.md

There we put map of ids and test vector descriptions. The ids then can be found in tests (also in comments section)

@gumb0
Copy link
Member

gumb0 commented Dec 30, 2022

This still needs to move cases with CREATE/CREATE2 in EOF code with leagacy initcode to Invalid files, and refill it with implementation that fails such CREATEs.

nonce: 0
storage: {}
344f5374fce5edbc8e2a8697c15331677e6ebf0b:
balance: 0
# EOF code STATICCALLs legacy code
# code: ':yul { sstore(0, staticcall(100000, 0xd94f5374fce5edbc8e2a8697c15331677e6ebf0b, 0, 0, 0, 1)) sstore(1, mload(0)) sstore(2, 2) stop()}'
code: ':raw 0xEF000101003100600160006000600073d94f5374fce5edbc8e2a8697c15331677e6ebf0b620186a0fa600055600051600155600260025500'
code: ':raw 0xef000101000402000100310300000000000006600160006000600073d94f5374fce5edbc8e2a8697c15331677e6ebf0b620186a0fa600055600051600155600260025500'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ori is working on a script that will convert normal yul into eof code. But it is good to have it defined explicitly here for now

Copy link
Member

Choose a reason for hiding this comment

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

Solidity already compiles yul to eof in a branch, see #1103 (comment)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ori is working on a script that will convert normal yul into eof code. But it is good to have it defined explicitly here for now

I gave up on that idea (it was to convert bytecode, not yul). It's a lot harder than it appears, because of the way jumps changed and the way you need to track maxStackHeight.

@@ -498,7 +413,7 @@ EOF1_Calls:
- indexes:
data: ':label eof_staticcall_eof'
network:
- 'Merge+3540+3670'
- 'Shanghai'
result:
a94f5374fce5edbc8e2a8697c15331677e6ebf0b:
nonce: 1
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would be nice to have a little comment for the storage values below, what they intent to indicate.

Copy link
Member

@gumb0 gumb0 Jan 3, 2023

Choose a reason for hiding this comment

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

Where exacty would you like this? In every expectation in every filler? If we add a a comment in every expectation, it will be very repetitive. It's basically everywhere:

  • slot 0 - result of CALL/CREATE/CREATE2
  • slot 1 - always 1 when not OOG

@winsvega winsvega merged commit b63ca72 into ethereum:develop Jan 3, 2023
@gumb0 gumb0 deleted the eof branch January 3, 2023 15:24
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.

4 participants