-
Notifications
You must be signed in to change notification settings - Fork 19
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
fix memory cost for call operation #41
fix memory cost for call operation #41
Conversation
5ebbe73
to
a73ec3b
Compare
lib/evm/gas.ex
Outdated
machine_state | ||
) do | ||
memory_expansion_cost(machine_state, out_offset, out_length) | ||
out_memory = memory_expansion_cost(machine_state, out_offset, out_length) |
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.
nitpick: how about out_memory_cost
?
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.
yep, good call
lib/evm/gas.ex
Outdated
out_memory = memory_expansion_cost(machine_state, out_offset, out_length) | ||
in_memory = memory_expansion_cost(machine_state, in_offset, in_length) | ||
|
||
if out_memory > in_memory, do: out_memory, else: in_memory |
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.
would max(out_memory, in_memory)
work?
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.
👍
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.
Left a couple comments if you want but looks good to me 🌴
…tion fix memory cost for call operation
…tion fix memory cost for call operation
#34