{"action":"created","issue":{"url":"https://api.github.com/repos/ethereum/EIPs/issues/119","repository_url":"https://api.github.com/repos/ethereum/EIPs","labels_url":"https://api.github.com/repos/ethereum/EIPs/issues/119/labels{/name}","comments_url":"https://api.github.com/repos/ethereum/EIPs/issues/119/comments","events_url":"https://api.github.com/repos/ethereum/EIPs/issues/119/events","html_url":"https://github.com/ethereum/EIPs/issues/119","id":161277539,"number":119,"title":"New Opcode: SSTORE_COUNT","user":{"login":"pirapira","id":44281,"avatar_url":"https://avatars.githubusercontent.com/u/44281?v=3","gravatar_id":"","url":"https://api.github.com/users/pirapira","html_url":"https://github.com/pirapira","followers_url":"https://api.github.com/users/pirapira/followers","following_url":"https://api.github.com/users/pirapira/following{/other_user}","gists_url":"https://api.github.com/users/pirapira/gists{/gist_id}","starred_url":"https://api.github.com/users/pirapira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pirapira/subscriptions","organizations_url":"https://api.github.com/users/pirapira/orgs","repos_url":"https://api.github.com/users/pirapira/repos","events_url":"https://api.github.com/users/pirapira/events{/privacy}","received_events_url":"https://api.github.com/users/pirapira/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-06-20T19:44:20Z","updated_at":"2016-08-27T04:45:48Z","closed_at":null,"body":"Opcode `0x3d` will be assigned a mnemonic `SSTORE_COUNT`.  This instruction pushes the number of `SSTORE` executions by the currently executing account so far during the current transaction.  The instruction takes no arguments.\r\n\r\nThe SSTORE counter is shared by all recursive invocations of an account.  The counter is reset for each transaction.  The gas cost of `SSTORE_COUNT` should be G_step as other `0x30s` instructions.\r\n\r\n### USAGE\r\n\r\nA contract can call this instruction twice to check if its storage has possibly changed.  For instance, a contract can use this instruction before and after a call, to see if its storage has not been altered in a recursive-call to itself.  The contract can use `SSTORE_COUNT` optionally together with `BALANCE` to make sure that its state is the same as before.\r\n\r\nThe SSTORE counter is separate for each account, preventing side-channel information leakage.\r\n\r\n### SCHEDULE\r\n\r\nThis is relatively easy to implement, so we can aim at: `METROPOLIS_FORK_NUM`.\r\n\r\n### ALTERNATIVE\r\n\r\nAn instruction returning `storageRoot` can serve the same purpose but is computationally more expensive."},"comment":{"url":"https://api.github.com/repos/ethereum/EIPs/issues/comments/242895834","html_url":"https://github.com/ethereum/EIPs/issues/119#issuecomment-242895834","issue_url":"https://api.github.com/repos/ethereum/EIPs/issues/119","id":242895834,"user":{"login":"vbuterin","id":2230894,"avatar_url":"https://avatars.githubusercontent.com/u/2230894?v=3","gravatar_id":"","url":"https://api.github.com/users/vbuterin","html_url":"https://github.com/vbuterin","followers_url":"https://api.github.com/users/vbuterin/followers","following_url":"https://api.github.com/users/vbuterin/following{/other_user}","gists_url":"https://api.github.com/users/vbuterin/gists{/gist_id}","starred_url":"https://api.github.com/users/vbuterin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vbuterin/subscriptions","organizations_url":"https://api.github.com/users/vbuterin/orgs","repos_url":"https://api.github.com/users/vbuterin/repos","events_url":"https://api.github.com/users/vbuterin/events{/privacy}","received_events_url":"https://api.github.com/users/vbuterin/received_events","type":"User","site_admin":false},"created_at":"2016-08-27T04:45:48Z","updated_at":"2016-08-27T04:45:48Z","body":"> On the other hand, if we give the EVM access to the storage root, any change in the storage trie structure would be a breaking change for the EVM.\r\n\r\nIt would also make caching much more difficult."}}
{"actor":{"display_login":"vbuterin"}}