Skip to content
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

Merged

Conversation

ayrat555
Copy link
Member

@ayrat555 ayrat555 commented Apr 24, 2018

#34

@ayrat555 ayrat555 force-pushed the fix_memory_cost_for_cost_operation branch from 5ebbe73 to a73ec3b Compare April 24, 2018 11:03
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)
Copy link
Member

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?

Copy link
Member Author

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
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

@masonforest masonforest left a 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 🌴

@ayrat555 ayrat555 merged commit 75e0397 into exthereum:master Apr 24, 2018
@ayrat555 ayrat555 deleted the fix_memory_cost_for_cost_operation branch April 24, 2018 11:57
masonforest pushed a commit that referenced this pull request Apr 25, 2018
masonforest pushed a commit that referenced this pull request Apr 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants