-
Notifications
You must be signed in to change notification settings - Fork 47
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
limit code size EIP170 #350
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.
Small comment, but LGTM otherwise
{:error, {params.state, 0, SubState.empty()}} | ||
|
||
# EIP170 https://github.com/ethereum/EIPs/blob/master/EIPS/eip-170.md | ||
byte_size(output) > 24_577 -> |
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.
What do you think about extracting this condition to a function that is more self-explanatory?
# in the `cond` block
eip_170_byte_size?(output) ->
# then further below
def eip_170_byte_size?(output), do: byte_size(output) > 24_577
# or even better, add docs
@doc """
This is implemented because of EIP170
See more at https://github.com/ethereum/EIPs/blob/master/EIPS/eip-170.md
"""
def eip_170_byte_size?(output), do: byte_size(output) > 24_577
What do you think?
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.
yes, good idea. btw it looks like this change affects previous tests so I'll rewrite it using EVM.Configuration
https://github.com/ethereum/EIPs/blob/master/EIPS/eip-170.md