-
Notifications
You must be signed in to change notification settings - Fork 117
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
new(tests): EOF validation RETF stack overflow #1341
base: main
Are you sure you want to change the base?
Conversation
max_stack_height=2, | ||
), | ||
], | ||
expected_bytecode="ef000101000802000200040003040000000080000200020002e30001005f5fe4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marioevz
the expected_bytecode was a temporary feature, this will require huge efforts of maintenance as eof format changes. consider disabling expected_bytecode verification in most of the EOF tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Just a few comments, and I echo Dimitry's comment that expected_bytecode
could be removed, specially when we already have PRs like #1339 where adding more tests that use this field would result in more rework.
sections=[ | ||
Section.Code(code=Op.CALLF[1] + Op.STOP, max_stack_height=5), | ||
Section.Code( | ||
code=Op.PUSH0 + Op.PUSH1[0] + Op.RJUMPI[2] + Op.PUSH0 * 2 + Op.RETF, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think both branches underflow in this case, it would be nice to see:
Case where it only underflows in the jump branch(Edit: covered in case below)- Case where it only underflows in the no-jump branch (no-jump pops from the stack for example).
sections=[ | ||
Section.Code(code=Op.CALLF[1] + Op.STOP, max_stack_height=1), | ||
Section.Code( | ||
code=Op.PUSH0 + Op.PUSH1[0] + Op.RJUMPI[2] + Op.PUSH0 * 2 + Op.RETF, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code=Op.PUSH0 + Op.PUSH1[0] + Op.RJUMPI[2] + Op.PUSH0 * 2 + Op.RETF, | |
code=Op.PUSH0 + Op.PUSH1[0] + Op.RJUMPI[1] + Op.PUSH0 + Op.RETF, |
We should also include the case where it overflows by one stack item only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also similar comment to one in the previous test function, we should add a variant where it overflows in the jumping branch, for example:
Op.PUSH0 + Op.PUSH1[0] * 2 + Op.RJUMPI[1] + Op.POP + Op.RETF
ποΈ Description
π Related Issues
β Checklist
mkdocs serve
locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.