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

Proposal B is problematic with regards to existing code: Calls to e.g. the identity precompile might be more expensive than before (meaning the call will consume more gas, not the call opcode itself), but there are existing contracts that always supply a very specific amount of gas for the identity precompile. #1

Open
Honisisco opened this issue Jul 29, 2023 · 0 comments

Comments

@Honisisco
Copy link
Owner

Proposal B is problematic with regards to existing code: Calls to e.g. the identity precompile might be more expensive than before (meaning the call will consume more gas, not the call opcode itself), but there are existing contracts that always supply a very specific amount of gas for the identity precompile.

In order to not break these contracts, we can alter the proposal so that the new rules only take effect if the specified size of the output area is MAX = 2**256 - 1 (alternative: MAX = 2**63-1). In summary:

If the size of the output area is different from MAX, the semantics of the EVM do not change, meaning that the memory is resized to accommodate both the input and the output area and the gas costs for that are paid as part of the costs for the CALL opcode.

If the size of the output area is equal to MAX, memory is resized to accommodate the input area only, the CALL opcode pays as before. At the point where the call returns, memory is resized again to fit the size of the actually returned data. The procedure is paid from the remaining gas of the call. If there is not enough gas, the call fails, memory is not resized and the return data is not written to memory (this is verify similar to the code deposit for a creation).

Originally posted by @chriseth in ethereum/EIPs#8 (comment)

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

No branches or pull requests

1 participant