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-5450: State Tests #1163

Merged
merged 14 commits into from
Apr 18, 2023
Merged

EIP-5450: State Tests #1163

merged 14 commits into from
Apr 18, 2023

Conversation

hugo-dc
Copy link
Member

@hugo-dc hugo-dc commented Feb 17, 2023

EOF Code Validation

  • EOF1V5450_0001 (Valid) Code with branches having the same stack height
  • EOF1V5450_0002 (Valid) Jump table
  • EOF1V5450_0003 (Valid) Infinite loop
  • EOF1V5450_0004 (Valid) Infinite loop using RJUMPV
  • EOF1V5450_0005 (Valid) CALLF branches with the same total of outputs
  • EOF1V5450_0006 (Valid) CALLF inputs
  • EOF1V5450_0007 (Valid) Validate input for all instructions requiring stack input
  • EOF1V5450_0092 (Valid) Containing terminating opcode RETURN at the end
  • EOF1V5450_0093 (Valid) Containing terminating opcode REVERT at the end
  • EOF1V5450_0094 (Valid) Loop ending with unconditional RJUMP (a)
  • EOF1V5450_0095 (Valid) Loop ending with unconditional RJUMP (b)
  • EOF1V5450_0096 (Valid) Functions ending with RETF
  • EOF1V5450_0097 (Valid) Stack is not required to be empty on terminating instruction RETURN
  • EOF1V5450_0098 (Valid) Stack is not required to be empty on terminating instruction REVERT
  • EOF1V5450_0099 (Valid) RETF returning maximum number of outputs (127)
  • EOF1I5450_0001 (Invalid) Stack height mismatch for different paths (a)
  • EOF1I5450_0002 (Invalid) Stack height mismatch for different paths (b)
  • EOF1I5450_0003 (Invalid) Calls returning different number of outputs
  • EOF1I5450_0004 (Invalid) Pushing loop
  • EOF1I5450_0005 (Invalid) Popping loop
  • EOF1I5450_0006 (Invalid) Jump table with different stack heights
  • EOF1I5450_0007 (Invalid) Stack underflow for all instructions requiring stack input
  • EOF1I5450_0092 (Invalid) Calling function without enough stack items: Function 0 calls Function 1 without enough parameters
  • EOF1I5450_0093 (Invalid) Calling function without enough stack items: Function 1 calls Function 2 with enough parameters
  • EOF1I5450_0094 (Invalid) Calling function without enough stack items: Function 0 calls Function 1 without enought parameters, Function 1 calls Function 2 without enough parameers
  • EOF1I5450_0095 (Invalid) Stack Overflow: Function pushing more than 1024 items to the stack
  • EOF1I5450_0096 (Invalid) Stack Overflow: Function 1 when called by Function 0 pushes more than 1024 items to the stack
  • EOF1I5450_0097 (Invalid) Function ending with non-terminating instruction (a)
  • EOF1I5450_0098 (Invalid) Function ending with non-terminating instruction (b)
  • EOF1I5450_0099 (Invalid) Function ending with non-terminating instruction (c)
  • EOF1I5450_0100 (Invalid) Function containing unreachable code after RETURN
  • EOF1I5450_0101 (Invalid) Function containing unreachable code after REVERT
  • EOF1I5450_0102 (Invalid) Unreachable code after RJUMP
  • EOF1I5450_0103 (Invalid) Unreachable code after infinite loop

CALLF Execution

  • Valid functions reaching max stack size (1024)

@hugo-dc hugo-dc force-pushed the eip-5450 branch 3 times, most recently from ecceb10 to b6b685f Compare February 18, 2023 06:44
@winsvega
Copy link
Collaborator

please look at EOFTests its a whole new suite to develop the tests for EOF code.
basically its just a state test format but simplified to focus only on EOF code deployment

@hugo-dc
Copy link
Member Author

hugo-dc commented Mar 1, 2023

@winsvega I have moved the validation tests to a new file using the validation format.

@winsvega
Copy link
Collaborator

winsvega commented Mar 1, 2023

Just a question. Do we need eof code validation exception checks?
So that you can specify that this eof is invalid because of EOF header field has incorrect byte to verify that client t8n return expected error code?

@winsvega
Copy link
Collaborator

winsvega commented Mar 1, 2023

Btw. Put the test vectors both in the test and /src/Readme.md

@hugo-dc
Copy link
Member Author

hugo-dc commented Mar 2, 2023

Just a question. Do we need eof code validation exception checks? So that you can specify that this eof is invalid because of EOF header field has incorrect byte to verify that client t8n return expected error code?

Yes, that would be very helpful to really validate the invalid test are failing for the expected reason. Had an issue before when the test was failing but it was due to a malformed EOF code instead of a different reason I was testing.

@hugo-dc hugo-dc force-pushed the eip-5450 branch 2 times, most recently from 91ced64 to c8d47d2 Compare April 18, 2023 03:50
Copy link
Collaborator

@winsvega winsvega left a comment

Choose a reason for hiding this comment

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

needs rebase on develop.

@winsvega winsvega merged commit 242d0f3 into ethereum:develop Apr 18, 2023
@gumb0 gumb0 deleted the eip-5450 branch April 18, 2023 16:50
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.

2 participants