{"action":"created","issue":{"url":"https://api.github.com/repos/ethereum/libethereum/issues/330","repository_url":"https://api.github.com/repos/ethereum/libethereum","labels_url":"https://api.github.com/repos/ethereum/libethereum/issues/330/labels{/name}","comments_url":"https://api.github.com/repos/ethereum/libethereum/issues/330/comments","events_url":"https://api.github.com/repos/ethereum/libethereum/issues/330/events","html_url":"https://github.com/ethereum/libethereum/pull/330","id":168042108,"number":330,"title":"fix calculating incorrect gasLimit from genesis","user":{"login":"winsvega","id":4492341,"avatar_url":"https://avatars.githubusercontent.com/u/4492341?v=3","gravatar_id":"","url":"https://api.github.com/users/winsvega","html_url":"https://github.com/winsvega","followers_url":"https://api.github.com/users/winsvega/followers","following_url":"https://api.github.com/users/winsvega/following{/other_user}","gists_url":"https://api.github.com/users/winsvega/gists{/gist_id}","starred_url":"https://api.github.com/users/winsvega/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/winsvega/subscriptions","organizations_url":"https://api.github.com/users/winsvega/orgs","repos_url":"https://api.github.com/users/winsvega/repos","events_url":"https://api.github.com/users/winsvega/events{/privacy}","received_events_url":"https://api.github.com/users/winsvega/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ethereum/libethereum/labels/gotissues","name":"gotissues","color":"fbca04"},{"url":"https://api.github.com/repos/ethereum/libethereum/labels/needs%20review","name":"needs review","color":"d4c5f9"}],"state":"open","locked":false,"assignee":{"login":"winsvega","id":4492341,"avatar_url":"https://avatars.githubusercontent.com/u/4492341?v=3","gravatar_id":"","url":"https://api.github.com/users/winsvega","html_url":"https://github.com/winsvega","followers_url":"https://api.github.com/users/winsvega/followers","following_url":"https://api.github.com/users/winsvega/following{/other_user}","gists_url":"https://api.github.com/users/winsvega/gists{/gist_id}","starred_url":"https://api.github.com/users/winsvega/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/winsvega/subscriptions","organizations_url":"https://api.github.com/users/winsvega/orgs","repos_url":"https://api.github.com/users/winsvega/repos","events_url":"https://api.github.com/users/winsvega/events{/privacy}","received_events_url":"https://api.github.com/users/winsvega/received_events","type":"User","site_admin":false},"assignees":[{"login":"winsvega","id":4492341,"avatar_url":"https://avatars.githubusercontent.com/u/4492341?v=3","gravatar_id":"","url":"https://api.github.com/users/winsvega","html_url":"https://github.com/winsvega","followers_url":"https://api.github.com/users/winsvega/followers","following_url":"https://api.github.com/users/winsvega/following{/other_user}","gists_url":"https://api.github.com/users/winsvega/gists{/gist_id}","starred_url":"https://api.github.com/users/winsvega/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/winsvega/subscriptions","organizations_url":"https://api.github.com/users/winsvega/orgs","repos_url":"https://api.github.com/users/winsvega/repos","events_url":"https://api.github.com/users/winsvega/events{/privacy}","received_events_url":"https://api.github.com/users/winsvega/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2016-07-28T08:37:36Z","updated_at":"2016-07-28T12:40:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ethereum/libethereum/pulls/330","html_url":"https://github.com/ethereum/libethereum/pull/330","diff_url":"https://github.com/ethereum/libethereum/pull/330.diff","patch_url":"https://github.com/ethereum/libethereum/pull/330.patch"},"body":"fixing mining transactions on a testchain\r\nconnects to https://github.com/ethereum/libethereum/pull/330"},"comment":{"url":"https://api.github.com/repos/ethereum/libethereum/issues/comments/235882615","html_url":"https://github.com/ethereum/libethereum/pull/330#issuecomment-235882615","issue_url":"https://api.github.com/repos/ethereum/libethereum/issues/330","id":235882615,"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},"created_at":"2016-07-28T12:40:24Z","updated_at":"2016-07-28T12:40:24Z","body":"From the structure, it seems that this should be made differently. The check at the beginning is a shortcut that is taken if the state already exists. So I think something like the following should also work and might be better:\r\n\r\n```\r\n\th256 r = BlockHeader(m_params.genesisBlock()).stateRoot();\r\n\tBlock ret(*this, _db, BaseState::Empty);\r\n\tif (!_db.exists(r)) {\r\n\t    ret.noteChain(*this);\r\n\t    dev::eth::commit(m_params.genesisState, ret.mutableState().m_state);\t// bit horrible. maybe consider a better way of constructing it?\r\n\t    ret.mutableState().db().commit();\t\t\t\t\t\t\t\t\t\t// have to use this db() since it's the one that has been altered with the above commit.\r\n\t    if (ret.mutableState().rootHash() != r)\r\n\t    {\r\n            ...\r\n\t    }\r\n        }\r\n\tret.m_previousBlock = BlockHeader(m_params.genesisBlock());\r\n\tret.resetCurrent();\r\n\treturn ret;\r\n```"}}
{"actor":{"display_login":"chriseth"}}