-
Notifications
You must be signed in to change notification settings - Fork 72
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(test) Stack validation in CALLF #889
base: main
Are you sure you want to change the base?
Conversation
Add a test to cover cases where stack would not overflow but CALLF stack reservation rules would cause a revert. Signed-off-by: Danno Ferrin <[email protected]>
Signed-off-by: Danno Ferrin <[email protected]>
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.
LGTM, minor comments. Do we need to also update eof_tracker.md
? I'm not sure but maybe Max stack size (1024) in CALLF-ed function
was covering this case, please double check though, I didn't analyze it
gas_price=10, | ||
protected=False, |
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.
gas_price and protected can be left out
pytest.param(1020, 1, 3, False, id="1020"), | ||
pytest.param(1021, 1, 3, True, id="1021"), |
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.
pytest.param(1020, 1, 3, False, id="1020"), | |
pytest.param(1021, 1, 3, True, id="1021"), | |
pytest.param(1020, 1, 3, False, id="success"), | |
pytest.param(1021, 1, 3, True, id="failure"), |
if we just have these two now (do I understand correctly, the intention is that 1022
would not validate anymore? Or are there other combinations of params which would validate and make sense to test?
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.
The essential test is pass below, and fail above. I was considering messing with the input/output levels, but determined it was not essential to the test. I took input and output of the params, and just have stack size and wether we expect failure. Seemed to communicate intent better than embedding what a failure is into the text code.
Signed-off-by: Danno Ferrin <[email protected]>
Signed-off-by: Danno Ferrin <[email protected]>
Added another tests to check CALLF when stack is at max ("rule #4") - by EIP this should revert, but there are ways it would succeed without the check, so we need to do one of those ways and then test it. |
Signed-off-by: Danno Ferrin <[email protected]>
ποΈ Description
Add a test to cover cases where stack would not overflow but CALLF stack
reservation rules would cause a revert.
π Related Issues
β Checklist
mkdocs serve
locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.