-
Notifications
You must be signed in to change notification settings - Fork 137
feat(tests): eip-7883 & eip-7823 modexp cases #1579
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
base: main
Are you sure you want to change the base?
Conversation
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.
Just a couple of comments, I didn't fully review yet.
Test cases for [EIP-7883: ModExp Gas Cost Increase](https://eips.ethereum.org/EIPS/eip-7883). | ||
""" | ||
|
||
MODEXP_GAS_INCREASE_FORK_NAME = "Osaka" |
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 we must also test Prague to validate the gas consumption change.
ret_offset=0, | ||
ret_size=0x80, |
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.
This could be left as zero and we can use the RETURNDATA* opcodes instead, because sometimes the call fails and we still compare our expected output against the arguments that were used as inputs.
@pytest.fixture | ||
def gas_measure_contract(pre: Alloc): | ||
"""Deploys a simple contract to call ModExp and store its success.""" | ||
# TODO: fix the gas accounting |
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 tricky part is where to insert the Op.GAS
since you also want to store the call return, so you could do Op.GAS + call + Op.GAS
and then use swaps to move the stack, subtract the gas measurements, and save into storage.
You can use the traces to see exactly where each value is in the stack when the code runs.
64a691b
to
f3996c0
Compare
ποΈ Description
Adds tests cases for the 2 modexp EIPs CFI'd in Fusaka: 7883/7823.
Still a WIP.
π Related Issues
N/A
β Checklist