{"action":"created","issue":{"url":"https://api.github.com/repos/ethereum/go-ethereum/issues/3152","repository_url":"https://api.github.com/repos/ethereum/go-ethereum","labels_url":"https://api.github.com/repos/ethereum/go-ethereum/issues/3152/labels{/name}","comments_url":"https://api.github.com/repos/ethereum/go-ethereum/issues/3152/comments","events_url":"https://api.github.com/repos/ethereum/go-ethereum/issues/3152/events","html_url":"https://github.com/ethereum/go-ethereum/issues/3152","id":183551392,"number":3152,"title":"estimateGas always yields 1 eth when method throws an exception","user":{"login":"juliosan","id":19347324,"avatar_url":"https://avatars.githubusercontent.com/u/19347324?v=3","gravatar_id":"","url":"https://api.github.com/users/juliosan","html_url":"https://github.com/juliosan","followers_url":"https://api.github.com/users/juliosan/followers","following_url":"https://api.github.com/users/juliosan/following{/other_user}","gists_url":"https://api.github.com/users/juliosan/gists{/gist_id}","starred_url":"https://api.github.com/users/juliosan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juliosan/subscriptions","organizations_url":"https://api.github.com/users/juliosan/orgs","repos_url":"https://api.github.com/users/juliosan/repos","events_url":"https://api.github.com/users/juliosan/events{/privacy}","received_events_url":"https://api.github.com/users/juliosan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-17T23:07:49Z","updated_at":"2016-10-18T07:12:17Z","closed_at":null,"body":"#### System information\r\n\r\nGeth version: 1.5.0-unstable-89ba380b\r\nOS & Version: OSX\r\n\r\n#### Expected behaviour\r\n- estimateGas should return the actual amount of gas used when calling a method. However this is not the case when the method throws an exception\r\n\r\n#### Actual behaviour\r\n- estimateGas always returns 50000000 units of gas when the method call throws an exception. At a gas price of 20000000000, estimateGas always yields 1 eth, which is unrealistic. One would expect to get the actual gas consumption, which is not zero when the method is called and throws an exception \r\n\r\n#### Steps to reproduce the behaviour\r\n- Create a method in a contract that throws. Call estimateGas and evaluate result.\r\nHint: 50000000 seems to be the initialization value for gas-related variables in geth's implementation: https://github.com/ethereum/go-ethereum/blob/master/eth/api.go\r\nSeems that the exception throwing interrupts the gas estimation process\r\n\r\n#### Backtrace\r\n\r\n````\r\n[backtrace]\r\n````\r\n"},"comment":{"url":"https://api.github.com/repos/ethereum/go-ethereum/issues/comments/254425546","html_url":"https://github.com/ethereum/go-ethereum/issues/3152#issuecomment-254425546","issue_url":"https://api.github.com/repos/ethereum/go-ethereum/issues/3152","id":254425546,"user":{"login":"karalabe","id":129561,"avatar_url":"https://avatars.githubusercontent.com/u/129561?v=3","gravatar_id":"","url":"https://api.github.com/users/karalabe","html_url":"https://github.com/karalabe","followers_url":"https://api.github.com/users/karalabe/followers","following_url":"https://api.github.com/users/karalabe/following{/other_user}","gists_url":"https://api.github.com/users/karalabe/gists{/gist_id}","starred_url":"https://api.github.com/users/karalabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karalabe/subscriptions","organizations_url":"https://api.github.com/users/karalabe/orgs","repos_url":"https://api.github.com/users/karalabe/repos","events_url":"https://api.github.com/users/karalabe/events{/privacy}","received_events_url":"https://api.github.com/users/karalabe/received_events","type":"User","site_admin":false},"created_at":"2016-10-18T07:12:17Z","updated_at":"2016-10-18T07:12:17Z","body":"A `throw` always consumes all available gas. That's how the EVM works. 50M is an arbitrary upper limit, but it can be anything, a `throw` will still consume it all."}}
{"actor":{"display_login":"karalabe"}}