{"action":"created","issue":{"url":"https://api.github.com/repos/ethereum/EIPs/issues/8","labels_url":"https://api.github.com/repos/ethereum/EIPs/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/ethereum/EIPs/issues/8/comments","events_url":"https://api.github.com/repos/ethereum/EIPs/issues/8/events","html_url":"https://github.com/ethereum/EIPs/issues/8","id":117130125,"number":8,"title":"Gas costs for return values","user":{"login":"chriseth","id":9073706,"avatar_url":"https://avatars.githubusercontent.com/u/9073706?v=3","gravatar_id":"","url":"https://api.github.com/users/chriseth","html_url":"https://github.com/chriseth","followers_url":"https://api.github.com/users/chriseth/followers","following_url":"https://api.github.com/users/chriseth/following{/other_user}","gists_url":"https://api.github.com/users/chriseth/gists{/gist_id}","starred_url":"https://api.github.com/users/chriseth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriseth/subscriptions","organizations_url":"https://api.github.com/users/chriseth/orgs","repos_url":"https://api.github.com/users/chriseth/repos","events_url":"https://api.github.com/users/chriseth/events{/privacy}","received_events_url":"https://api.github.com/users/chriseth/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-11-16T14:01:58Z","updated_at":"2015-11-20T14:30:38Z","closed_at":null,"body":"## Proposal\r\n\r\nChange memory gas costs for return values of a call to be applied depending on the size of the written memory area, not the reserved memory area.\r\n\r\n## Current Situation\r\n\r\nIn a call, the caller has to provide an area where the returned data from a call is written to. Only reserving it already changes gas costs for memory.\r\n\r\n## Advantage\r\n\r\nThis makes it possible to read a return value whose size is not known to the caller prior to the call: The caller just reserves a huge amount of memory.\r\n\r\n## Possible Extension\r\n\r\nThe `CALL` opcode (and its friends) may even return the actual size of memory written to, so that the data can be used (e.g. forwarded) even if nothing is known about its structure.\r\n\r\n## Implementation\r\n\r\nThe implementation might be a bit tricky: The `CALL` opcode has to be charged some gas upfront, then the call is performed without allocating memory for the return value. At the point, the return value is available, gas costs are computed and if some gas is still available, memory is allocated and written to."},"comment":{"url":"https://api.github.com/repos/ethereum/EIPs/issues/comments/158415884","html_url":"https://github.com/ethereum/EIPs/issues/8#issuecomment-158415884","issue_url":"https://api.github.com/repos/ethereum/EIPs/issues/8","id":158415884,"user":{"login":"janx","id":5958,"avatar_url":"https://avatars.githubusercontent.com/u/5958?v=3","gravatar_id":"","url":"https://api.github.com/users/janx","html_url":"https://github.com/janx","followers_url":"https://api.github.com/users/janx/followers","following_url":"https://api.github.com/users/janx/following{/other_user}","gists_url":"https://api.github.com/users/janx/gists{/gist_id}","starred_url":"https://api.github.com/users/janx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janx/subscriptions","organizations_url":"https://api.github.com/users/janx/orgs","repos_url":"https://api.github.com/users/janx/repos","events_url":"https://api.github.com/users/janx/events{/privacy}","received_events_url":"https://api.github.com/users/janx/received_events","type":"User","site_admin":false},"created_at":"2015-11-20T14:30:38Z","updated_at":"2015-11-20T14:30:38Z","body":"+1"}}