{"action":"created","comment":{"url":"https://api.github.com/repos/ethereum/go-ethereum/pulls/comments/45597887","id":45597887,"diff_hunk":"@@ -164,7 +165,7 @@ func (b *BlockGen) OffsetTime(seconds int64) {\n // values. Inserting them into BlockChain requires use of FakePow or\n // a similar non-validating proof of work implementation.\n func GenerateChain(parent *types.Block, db ethdb.Database, n int, gen func(int, *BlockGen)) ([]*types.Block, []types.Receipts) {\n-\tstatedb, err := state.New(parent.Root(), db)\n+\tstatedb, err := state.New(parent.Root(), access.NewDbChainAccess(db))","path":"core/chain_makers.go","position":13,"original_position":13,"commit_id":"0ceb181030af1ebb7749991b90b9d33014fdbea1","original_commit_id":"0ceb181030af1ebb7749991b90b9d33014fdbea1","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},"body":"Don't create a new access layer every time you want to generate a chain. Pass it as a parameter instead of the `db ethdb.Database`. Maybe @fjl has an input on this? But IMHO if we replace the databases with accessor objects, then they should be fully replaced from their point of creation and not just wrapped at the last minute (would be very very wasteful memory wise to have a lot of small wraps deep in the code).","created_at":"2015-11-23T12:29:14Z","updated_at":"2015-11-23T12:29:14Z","html_url":"https://github.com/ethereum/go-ethereum/pull/1989#discussion_r45597887","pull_request_url":"https://api.github.com/repos/ethereum/go-ethereum/pulls/1989","_links":{"self":{"href":"https://api.github.com/repos/ethereum/go-ethereum/pulls/comments/45597887"},"html":{"href":"https://github.com/ethereum/go-ethereum/pull/1989#discussion_r45597887"},"pull_request":{"href":"https://api.github.com/repos/ethereum/go-ethereum/pulls/1989"}}},"pull_request":{"url":"https://api.github.com/repos/ethereum/go-ethereum/pulls/1989","id":50984038,"html_url":"https://github.com/ethereum/go-ethereum/pull/1989","diff_url":"https://github.com/ethereum/go-ethereum/pull/1989.diff","patch_url":"https://github.com/ethereum/go-ethereum/pull/1989.patch","issue_url":"https://api.github.com/repos/ethereum/go-ethereum/issues/1989","number":1989,"state":"open","locked":false,"title":"light client core","user":{"login":"zsfelfoldi","id":9884311,"avatar_url":"https://avatars.githubusercontent.com/u/9884311?v=3","gravatar_id":"","url":"https://api.github.com/users/zsfelfoldi","html_url":"https://github.com/zsfelfoldi","followers_url":"https://api.github.com/users/zsfelfoldi/followers","following_url":"https://api.github.com/users/zsfelfoldi/following{/other_user}","gists_url":"https://api.github.com/users/zsfelfoldi/gists{/gist_id}","starred_url":"https://api.github.com/users/zsfelfoldi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zsfelfoldi/subscriptions","organizations_url":"https://api.github.com/users/zsfelfoldi/orgs","repos_url":"https://api.github.com/users/zsfelfoldi/repos","events_url":"https://api.github.com/users/zsfelfoldi/events{/privacy}","received_events_url":"https://api.github.com/users/zsfelfoldi/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-17T18:21:24Z","updated_at":"2015-11-23T12:29:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1101763a495cf2066991e455becc79db18c46529","assignee":{"login":"zsfelfoldi","id":9884311,"avatar_url":"https://avatars.githubusercontent.com/u/9884311?v=3","gravatar_id":"","url":"https://api.github.com/users/zsfelfoldi","html_url":"https://github.com/zsfelfoldi","followers_url":"https://api.github.com/users/zsfelfoldi/followers","following_url":"https://api.github.com/users/zsfelfoldi/following{/other_user}","gists_url":"https://api.github.com/users/zsfelfoldi/gists{/gist_id}","starred_url":"https://api.github.com/users/zsfelfoldi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zsfelfoldi/subscriptions","organizations_url":"https://api.github.com/users/zsfelfoldi/orgs","repos_url":"https://api.github.com/users/zsfelfoldi/repos","events_url":"https://api.github.com/users/zsfelfoldi/events{/privacy}","received_events_url":"https://api.github.com/users/zsfelfoldi/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/ethereum/go-ethereum/pulls/1989/commits","review_comments_url":"https://api.github.com/repos/ethereum/go-ethereum/pulls/1989/comments","review_comment_url":"https://api.github.com/repos/ethereum/go-ethereum/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ethereum/go-ethereum/issues/1989/comments","statuses_url":"https://api.github.com/repos/ethereum/go-ethereum/statuses/0ceb181030af1ebb7749991b90b9d33014fdbea1","head":{"label":"zsfelfoldi:light-core","ref":"light-core","sha":"0ceb181030af1ebb7749991b90b9d33014fdbea1","user":{"login":"zsfelfoldi","id":9884311,"avatar_url":"https://avatars.githubusercontent.com/u/9884311?v=3","gravatar_id":"","url":"https://api.github.com/users/zsfelfoldi","html_url":"https://github.com/zsfelfoldi","followers_url":"https://api.github.com/users/zsfelfoldi/followers","following_url":"https://api.github.com/users/zsfelfoldi/following{/other_user}","gists_url":"https://api.github.com/users/zsfelfoldi/gists{/gist_id}","starred_url":"https://api.github.com/users/zsfelfoldi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zsfelfoldi/subscriptions","organizations_url":"https://api.github.com/users/zsfelfoldi/orgs","repos_url":"https://api.github.com/users/zsfelfoldi/repos","events_url":"https://api.github.com/users/zsfelfoldi/events{/privacy}","received_events_url":"https://api.github.com/users/zsfelfoldi/received_events","type":"User","site_admin":false},"repo":{"id":35270492,"name":"go-ethereum","full_name":"zsfelfoldi/go-ethereum","owner":{"login":"zsfelfoldi","id":9884311,"avatar_url":"https://avatars.githubusercontent.com/u/9884311?v=3","gravatar_id":"","url":"https://api.github.com/users/zsfelfoldi","html_url":"https://github.com/zsfelfoldi","followers_url":"https://api.github.com/users/zsfelfoldi/followers","following_url":"https://api.github.com/users/zsfelfoldi/following{/other_user}","gists_url":"https://api.github.com/users/zsfelfoldi/gists{/gist_id}","starred_url":"https://api.github.com/users/zsfelfoldi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zsfelfoldi/subscriptions","organizations_url":"https://api.github.com/users/zsfelfoldi/orgs","repos_url":"https://api.github.com/users/zsfelfoldi/repos","events_url":"https://api.github.com/users/zsfelfoldi/events{/privacy}","received_events_url":"https://api.github.com/users/zsfelfoldi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zsfelfoldi/go-ethereum","description":"Jeffrey Wilcke's Go implementation of the Ethereum y/w paper","fork":true,"url":"https://api.github.com/repos/zsfelfoldi/go-ethereum","forks_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/forks","keys_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/teams","hooks_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/hooks","issue_events_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/issues/events{/number}","events_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/events","assignees_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/assignees{/user}","branches_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/branches{/branch}","tags_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/tags","blobs_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/git/refs{/sha}","trees_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/statuses/{sha}","languages_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/languages","stargazers_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/stargazers","contributors_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/contributors","subscribers_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/subscribers","subscription_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/subscription","commits_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/commits{/sha}","git_commits_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/git/commits{/sha}","comments_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/comments{/number}","issue_comment_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/issues/comments{/number}","contents_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/contents/{+path}","compare_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/merges","archive_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/downloads","issues_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/issues{/number}","pulls_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/pulls{/number}","milestones_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/milestones{/number}","notifications_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/labels{/name}","releases_url":"https://api.github.com/repos/zsfelfoldi/go-ethereum/releases{/id}","created_at":"2015-05-08T09:23:28Z","updated_at":"2015-09-03T16:27:26Z","pushed_at":"2015-11-21T00:26:24Z","git_url":"git://github.com/zsfelfoldi/go-ethereum.git","ssh_url":"git@github.com:zsfelfoldi/go-ethereum.git","clone_url":"https://github.com/zsfelfoldi/go-ethereum.git","svn_url":"https://github.com/zsfelfoldi/go-ethereum","homepage":"","size":53601,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"develop"}},"base":{"label":"ethereum:develop","ref":"develop","sha":"23f42d9463e55fe86100b86c2ab0b7c95f181f91","user":{"login":"ethereum","id":6250754,"avatar_url":"https://avatars.githubusercontent.com/u/6250754?v=3","gravatar_id":"","url":"https://api.github.com/users/ethereum","html_url":"https://github.com/ethereum","followers_url":"https://api.github.com/users/ethereum/followers","following_url":"https://api.github.com/users/ethereum/following{/other_user}","gists_url":"https://api.github.com/users/ethereum/gists{/gist_id}","starred_url":"https://api.github.com/users/ethereum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethereum/subscriptions","organizations_url":"https://api.github.com/users/ethereum/orgs","repos_url":"https://api.github.com/users/ethereum/repos","events_url":"https://api.github.com/users/ethereum/events{/privacy}","received_events_url":"https://api.github.com/users/ethereum/received_events","type":"Organization","site_admin":false},"repo":{"id":15452919,"name":"go-ethereum","full_name":"ethereum/go-ethereum","owner":{"login":"ethereum","id":6250754,"avatar_url":"https://avatars.githubusercontent.com/u/6250754?v=3","gravatar_id":"","url":"https://api.github.com/users/ethereum","html_url":"https://github.com/ethereum","followers_url":"https://api.github.com/users/ethereum/followers","following_url":"https://api.github.com/users/ethereum/following{/other_user}","gists_url":"https://api.github.com/users/ethereum/gists{/gist_id}","starred_url":"https://api.github.com/users/ethereum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethereum/subscriptions","organizations_url":"https://api.github.com/users/ethereum/orgs","repos_url":"https://api.github.com/users/ethereum/repos","events_url":"https://api.github.com/users/ethereum/events{/privacy}","received_events_url":"https://api.github.com/users/ethereum/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ethereum/go-ethereum","description":"Official golang implementation of the Ethereum protocol","fork":false,"url":"https://api.github.com/repos/ethereum/go-ethereum","forks_url":"https://api.github.com/repos/ethereum/go-ethereum/forks","keys_url":"https://api.github.com/repos/ethereum/go-ethereum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ethereum/go-ethereum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ethereum/go-ethereum/teams","hooks_url":"https://api.github.com/repos/ethereum/go-ethereum/hooks","issue_events_url":"https://api.github.com/repos/ethereum/go-ethereum/issues/events{/number}","events_url":"https://api.github.com/repos/ethereum/go-ethereum/events","assignees_url":"https://api.github.com/repos/ethereum/go-ethereum/assignees{/user}","branches_url":"https://api.github.com/repos/ethereum/go-ethereum/branches{/branch}","tags_url":"https://api.github.com/repos/ethereum/go-ethereum/tags","blobs_url":"https://api.github.com/repos/ethereum/go-ethereum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ethereum/go-ethereum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ethereum/go-ethereum/git/refs{/sha}","trees_url":"https://api.github.com/repos/ethereum/go-ethereum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ethereum/go-ethereum/statuses/{sha}","languages_url":"https://api.github.com/repos/ethereum/go-ethereum/languages","stargazers_url":"https://api.github.com/repos/ethereum/go-ethereum/stargazers","contributors_url":"https://api.github.com/repos/ethereum/go-ethereum/contributors","subscribers_url":"https://api.github.com/repos/ethereum/go-ethereum/subscribers","subscription_url":"https://api.github.com/repos/ethereum/go-ethereum/subscription","commits_url":"https://api.github.com/repos/ethereum/go-ethereum/commits{/sha}","git_commits_url":"https://api.github.com/repos/ethereum/go-ethereum/git/commits{/sha}","comments_url":"https://api.github.com/repos/ethereum/go-ethereum/comments{/number}","issue_comment_url":"https://api.github.com/repos/ethereum/go-ethereum/issues/comments{/number}","contents_url":"https://api.github.com/repos/ethereum/go-ethereum/contents/{+path}","compare_url":"https://api.github.com/repos/ethereum/go-ethereum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ethereum/go-ethereum/merges","archive_url":"https://api.github.com/repos/ethereum/go-ethereum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ethereum/go-ethereum/downloads","issues_url":"https://api.github.com/repos/ethereum/go-ethereum/issues{/number}","pulls_url":"https://api.github.com/repos/ethereum/go-ethereum/pulls{/number}","milestones_url":"https://api.github.com/repos/ethereum/go-ethereum/milestones{/number}","notifications_url":"https://api.github.com/repos/ethereum/go-ethereum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ethereum/go-ethereum/labels{/name}","releases_url":"https://api.github.com/repos/ethereum/go-ethereum/releases{/id}","created_at":"2013-12-26T13:05:46Z","updated_at":"2015-11-22T23:03:50Z","pushed_at":"2015-11-23T11:51:01Z","git_url":"git://github.com/ethereum/go-ethereum.git","ssh_url":"git@github.com:ethereum/go-ethereum.git","clone_url":"https://github.com/ethereum/go-ethereum.git","svn_url":"https://github.com/ethereum/go-ethereum","homepage":"http://ethereum.github.io/go-ethereum/","size":63671,"stargazers_count":738,"watchers_count":738,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":249,"mirror_url":null,"open_issues_count":126,"forks":249,"open_issues":126,"watchers":738,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ethereum/go-ethereum/pulls/1989"},"html":{"href":"https://github.com/ethereum/go-ethereum/pull/1989"},"issue":{"href":"https://api.github.com/repos/ethereum/go-ethereum/issues/1989"},"comments":{"href":"https://api.github.com/repos/ethereum/go-ethereum/issues/1989/comments"},"review_comments":{"href":"https://api.github.com/repos/ethereum/go-ethereum/pulls/1989/comments"},"review_comment":{"href":"https://api.github.com/repos/ethereum/go-ethereum/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ethereum/go-ethereum/pulls/1989/commits"},"statuses":{"href":"https://api.github.com/repos/ethereum/go-ethereum/statuses/0ceb181030af1ebb7749991b90b9d33014fdbea1"}}}}