{"action":"created","comment":{"url":"https://api.github.com/repos/input-output-hk/etc-client/pulls/comments/105006699","pull_request_review_id":25866124,"id":105006699,"diff_hunk":"@@ -175,22 +176,38 @@ class FastSyncController(\n     handshakedPeers -= peer\n   }\n \n-  class SyncingHandler(targetBlock: BlockHeader) {\n+  class SyncingHandler(targetBlock: BlockHeader, syncStateStorage: FastSyncStateStorage) {\n \n     private val blockHeadersHandlerName = \"block-headers-request-handler\"\n \n-    private var nonMptNodesQueue: Set[HashType] = Set.empty\n-    private var mptNodesQueue: Set[HashType] = Set.empty\n+    private val initialSyncState: SyncState = if (continueAfterRestart)\n+      syncStateStorage.getSyncState().getOrElse(SyncState.empty)\n+    else\n+      SyncState.empty\n \n-    private var blockBodiesQueue: Set[ByteString] = Set.empty\n-    private var receiptsQueue: Set[ByteString] = Set.empty\n \n-    private var downloadedNodesCount: Int = 0\n+    private var mptNodesQueue: Set[HashType] = initialSyncState.mptNodesQueue\n+    private var nonMptNodesQueue: Set[HashType] = initialSyncState.nonMptNodesQueue\n+    private var blockBodiesQueue: Set[ByteString] = initialSyncState.blockBodiesQueue\n+    private var receiptsQueue: Set[ByteString] = initialSyncState.receiptsQueue\n+    private var downloadedNodesCount: Int = initialSyncState.downloadedNodesCount\n \n     private var assignedHandlers: Map[ActorRef, ActorRef] = Map.empty\n-\n     private var bestBlockHeaderNumber: BigInt = appStateStorage.getBestBlockNumber()","path":"src/main/scala/io/iohk/ethereum/blockchain/sync/FastSyncController.scala","position":85,"original_position":85,"commit_id":"9303a6bdccb2d128424f9375362cf7fec45c7bc1","original_commit_id":"9303a6bdccb2d128424f9375362cf7fec45c7bc1","user":{"login":"LukasGasior1","id":5664242,"avatar_url":"https://avatars2.githubusercontent.com/u/5664242?v=3","gravatar_id":"","url":"https://api.github.com/users/LukasGasior1","html_url":"https://github.com/LukasGasior1","followers_url":"https://api.github.com/users/LukasGasior1/followers","following_url":"https://api.github.com/users/LukasGasior1/following{/other_user}","gists_url":"https://api.github.com/users/LukasGasior1/gists{/gist_id}","starred_url":"https://api.github.com/users/LukasGasior1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LukasGasior1/subscriptions","organizations_url":"https://api.github.com/users/LukasGasior1/orgs","repos_url":"https://api.github.com/users/LukasGasior1/repos","events_url":"https://api.github.com/users/LukasGasior1/events{/privacy}","received_events_url":"https://api.github.com/users/LukasGasior1/received_events","type":"User","site_admin":false},"body":"we should also keep that in sync state (as discussed on slack)","created_at":"2017-03-08T19:50:32Z","updated_at":"2017-03-08T20:04:24Z","html_url":"https://github.com/input-output-hk/etc-client/pull/81#discussion_r105006699","pull_request_url":"https://api.github.com/repos/input-output-hk/etc-client/pulls/81","_links":{"self":{"href":"https://api.github.com/repos/input-output-hk/etc-client/pulls/comments/105006699"},"html":{"href":"https://github.com/input-output-hk/etc-client/pull/81#discussion_r105006699"},"pull_request":{"href":"https://api.github.com/repos/input-output-hk/etc-client/pulls/81"}}},"pull_request":{"url":"https://api.github.com/repos/input-output-hk/etc-client/pulls/81","id":109752919,"html_url":"https://github.com/input-output-hk/etc-client/pull/81","diff_url":"https://github.com/input-output-hk/etc-client/pull/81.diff","patch_url":"https://github.com/input-output-hk/etc-client/pull/81.patch","issue_url":"https://api.github.com/repos/input-output-hk/etc-client/issues/81","number":81,"state":"open","locked":false,"title":"[EC-117] Resume fast sync after restart","user":{"login":"whysoserious","id":1097302,"avatar_url":"https://avatars3.githubusercontent.com/u/1097302?v=3","gravatar_id":"","url":"https://api.github.com/users/whysoserious","html_url":"https://github.com/whysoserious","followers_url":"https://api.github.com/users/whysoserious/followers","following_url":"https://api.github.com/users/whysoserious/following{/other_user}","gists_url":"https://api.github.com/users/whysoserious/gists{/gist_id}","starred_url":"https://api.github.com/users/whysoserious/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whysoserious/subscriptions","organizations_url":"https://api.github.com/users/whysoserious/orgs","repos_url":"https://api.github.com/users/whysoserious/repos","events_url":"https://api.github.com/users/whysoserious/events{/privacy}","received_events_url":"https://api.github.com/users/whysoserious/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-03-08T18:16:04Z","updated_at":"2017-03-08T20:04:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d92dbabd674ce1084e197d7d245d10ad1a0acdad","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/input-output-hk/etc-client/pulls/81/commits","review_comments_url":"https://api.github.com/repos/input-output-hk/etc-client/pulls/81/comments","review_comment_url":"https://api.github.com/repos/input-output-hk/etc-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/input-output-hk/etc-client/issues/81/comments","statuses_url":"https://api.github.com/repos/input-output-hk/etc-client/statuses/9303a6bdccb2d128424f9375362cf7fec45c7bc1","head":{"label":"input-output-hk:feature/resumeStateDownload","ref":"feature/resumeStateDownload","sha":"9303a6bdccb2d128424f9375362cf7fec45c7bc1","user":{"login":"input-output-hk","id":12909177,"avatar_url":"https://avatars0.githubusercontent.com/u/12909177?v=3","gravatar_id":"","url":"https://api.github.com/users/input-output-hk","html_url":"https://github.com/input-output-hk","followers_url":"https://api.github.com/users/input-output-hk/followers","following_url":"https://api.github.com/users/input-output-hk/following{/other_user}","gists_url":"https://api.github.com/users/input-output-hk/gists{/gist_id}","starred_url":"https://api.github.com/users/input-output-hk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/input-output-hk/subscriptions","organizations_url":"https://api.github.com/users/input-output-hk/orgs","repos_url":"https://api.github.com/users/input-output-hk/repos","events_url":"https://api.github.com/users/input-output-hk/events{/privacy}","received_events_url":"https://api.github.com/users/input-output-hk/received_events","type":"Organization","site_admin":false},"repo":{"id":76256113,"name":"etc-client","full_name":"input-output-hk/etc-client","owner":{"login":"input-output-hk","id":12909177,"avatar_url":"https://avatars0.githubusercontent.com/u/12909177?v=3","gravatar_id":"","url":"https://api.github.com/users/input-output-hk","html_url":"https://github.com/input-output-hk","followers_url":"https://api.github.com/users/input-output-hk/followers","following_url":"https://api.github.com/users/input-output-hk/following{/other_user}","gists_url":"https://api.github.com/users/input-output-hk/gists{/gist_id}","starred_url":"https://api.github.com/users/input-output-hk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/input-output-hk/subscriptions","organizations_url":"https://api.github.com/users/input-output-hk/orgs","repos_url":"https://api.github.com/users/input-output-hk/repos","events_url":"https://api.github.com/users/input-output-hk/events{/privacy}","received_events_url":"https://api.github.com/users/input-output-hk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/input-output-hk/etc-client","description":"A Scala based client for Ethereum Classic. ","fork":false,"url":"https://api.github.com/repos/input-output-hk/etc-client","forks_url":"https://api.github.com/repos/input-output-hk/etc-client/forks","keys_url":"https://api.github.com/repos/input-output-hk/etc-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/input-output-hk/etc-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/input-output-hk/etc-client/teams","hooks_url":"https://api.github.com/repos/input-output-hk/etc-client/hooks","issue_events_url":"https://api.github.com/repos/input-output-hk/etc-client/issues/events{/number}","events_url":"https://api.github.com/repos/input-output-hk/etc-client/events","assignees_url":"https://api.github.com/repos/input-output-hk/etc-client/assignees{/user}","branches_url":"https://api.github.com/repos/input-output-hk/etc-client/branches{/branch}","tags_url":"https://api.github.com/repos/input-output-hk/etc-client/tags","blobs_url":"https://api.github.com/repos/input-output-hk/etc-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/input-output-hk/etc-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/input-output-hk/etc-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/input-output-hk/etc-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/input-output-hk/etc-client/statuses/{sha}","languages_url":"https://api.github.com/repos/input-output-hk/etc-client/languages","stargazers_url":"https://api.github.com/repos/input-output-hk/etc-client/stargazers","contributors_url":"https://api.github.com/repos/input-output-hk/etc-client/contributors","subscribers_url":"https://api.github.com/repos/input-output-hk/etc-client/subscribers","subscription_url":"https://api.github.com/repos/input-output-hk/etc-client/subscription","commits_url":"https://api.github.com/repos/input-output-hk/etc-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/input-output-hk/etc-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/input-output-hk/etc-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/input-output-hk/etc-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/input-output-hk/etc-client/contents/{+path}","compare_url":"https://api.github.com/repos/input-output-hk/etc-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/input-output-hk/etc-client/merges","archive_url":"https://api.github.com/repos/input-output-hk/etc-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/input-output-hk/etc-client/downloads","issues_url":"https://api.github.com/repos/input-output-hk/etc-client/issues{/number}","pulls_url":"https://api.github.com/repos/input-output-hk/etc-client/pulls{/number}","milestones_url":"https://api.github.com/repos/input-output-hk/etc-client/milestones{/number}","notifications_url":"https://api.github.com/repos/input-output-hk/etc-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/input-output-hk/etc-client/labels{/name}","releases_url":"https://api.github.com/repos/input-output-hk/etc-client/releases{/id}","deployments_url":"https://api.github.com/repos/input-output-hk/etc-client/deployments","created_at":"2016-12-12T12:51:31Z","updated_at":"2017-03-08T11:06:32Z","pushed_at":"2017-03-08T19:52:05Z","git_url":"git://github.com/input-output-hk/etc-client.git","ssh_url":"git@github.com:input-output-hk/etc-client.git","clone_url":"https://github.com/input-output-hk/etc-client.git","svn_url":"https://github.com/input-output-hk/etc-client","homepage":null,"size":2185,"stargazers_count":4,"watchers_count":4,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":15,"forks":0,"open_issues":15,"watchers":4,"default_branch":"master"}},"base":{"label":"input-output-hk:phase/3/blockSync","ref":"phase/3/blockSync","sha":"de2b6f5455c99f6015a0357e18a60c2083a79377","user":{"login":"input-output-hk","id":12909177,"avatar_url":"https://avatars0.githubusercontent.com/u/12909177?v=3","gravatar_id":"","url":"https://api.github.com/users/input-output-hk","html_url":"https://github.com/input-output-hk","followers_url":"https://api.github.com/users/input-output-hk/followers","following_url":"https://api.github.com/users/input-output-hk/following{/other_user}","gists_url":"https://api.github.com/users/input-output-hk/gists{/gist_id}","starred_url":"https://api.github.com/users/input-output-hk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/input-output-hk/subscriptions","organizations_url":"https://api.github.com/users/input-output-hk/orgs","repos_url":"https://api.github.com/users/input-output-hk/repos","events_url":"https://api.github.com/users/input-output-hk/events{/privacy}","received_events_url":"https://api.github.com/users/input-output-hk/received_events","type":"Organization","site_admin":false},"repo":{"id":76256113,"name":"etc-client","full_name":"input-output-hk/etc-client","owner":{"login":"input-output-hk","id":12909177,"avatar_url":"https://avatars0.githubusercontent.com/u/12909177?v=3","gravatar_id":"","url":"https://api.github.com/users/input-output-hk","html_url":"https://github.com/input-output-hk","followers_url":"https://api.github.com/users/input-output-hk/followers","following_url":"https://api.github.com/users/input-output-hk/following{/other_user}","gists_url":"https://api.github.com/users/input-output-hk/gists{/gist_id}","starred_url":"https://api.github.com/users/input-output-hk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/input-output-hk/subscriptions","organizations_url":"https://api.github.com/users/input-output-hk/orgs","repos_url":"https://api.github.com/users/input-output-hk/repos","events_url":"https://api.github.com/users/input-output-hk/events{/privacy}","received_events_url":"https://api.github.com/users/input-output-hk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/input-output-hk/etc-client","description":"A Scala based client for Ethereum Classic. ","fork":false,"url":"https://api.github.com/repos/input-output-hk/etc-client","forks_url":"https://api.github.com/repos/input-output-hk/etc-client/forks","keys_url":"https://api.github.com/repos/input-output-hk/etc-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/input-output-hk/etc-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/input-output-hk/etc-client/teams","hooks_url":"https://api.github.com/repos/input-output-hk/etc-client/hooks","issue_events_url":"https://api.github.com/repos/input-output-hk/etc-client/issues/events{/number}","events_url":"https://api.github.com/repos/input-output-hk/etc-client/events","assignees_url":"https://api.github.com/repos/input-output-hk/etc-client/assignees{/user}","branches_url":"https://api.github.com/repos/input-output-hk/etc-client/branches{/branch}","tags_url":"https://api.github.com/repos/input-output-hk/etc-client/tags","blobs_url":"https://api.github.com/repos/input-output-hk/etc-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/input-output-hk/etc-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/input-output-hk/etc-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/input-output-hk/etc-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/input-output-hk/etc-client/statuses/{sha}","languages_url":"https://api.github.com/repos/input-output-hk/etc-client/languages","stargazers_url":"https://api.github.com/repos/input-output-hk/etc-client/stargazers","contributors_url":"https://api.github.com/repos/input-output-hk/etc-client/contributors","subscribers_url":"https://api.github.com/repos/input-output-hk/etc-client/subscribers","subscription_url":"https://api.github.com/repos/input-output-hk/etc-client/subscription","commits_url":"https://api.github.com/repos/input-output-hk/etc-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/input-output-hk/etc-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/input-output-hk/etc-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/input-output-hk/etc-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/input-output-hk/etc-client/contents/{+path}","compare_url":"https://api.github.com/repos/input-output-hk/etc-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/input-output-hk/etc-client/merges","archive_url":"https://api.github.com/repos/input-output-hk/etc-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/input-output-hk/etc-client/downloads","issues_url":"https://api.github.com/repos/input-output-hk/etc-client/issues{/number}","pulls_url":"https://api.github.com/repos/input-output-hk/etc-client/pulls{/number}","milestones_url":"https://api.github.com/repos/input-output-hk/etc-client/milestones{/number}","notifications_url":"https://api.github.com/repos/input-output-hk/etc-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/input-output-hk/etc-client/labels{/name}","releases_url":"https://api.github.com/repos/input-output-hk/etc-client/releases{/id}","deployments_url":"https://api.github.com/repos/input-output-hk/etc-client/deployments","created_at":"2016-12-12T12:51:31Z","updated_at":"2017-03-08T11:06:32Z","pushed_at":"2017-03-08T19:52:05Z","git_url":"git://github.com/input-output-hk/etc-client.git","ssh_url":"git@github.com:input-output-hk/etc-client.git","clone_url":"https://github.com/input-output-hk/etc-client.git","svn_url":"https://github.com/input-output-hk/etc-client","homepage":null,"size":2185,"stargazers_count":4,"watchers_count":4,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":15,"forks":0,"open_issues":15,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/input-output-hk/etc-client/pulls/81"},"html":{"href":"https://github.com/input-output-hk/etc-client/pull/81"},"issue":{"href":"https://api.github.com/repos/input-output-hk/etc-client/issues/81"},"comments":{"href":"https://api.github.com/repos/input-output-hk/etc-client/issues/81/comments"},"review_comments":{"href":"https://api.github.com/repos/input-output-hk/etc-client/pulls/81/comments"},"review_comment":{"href":"https://api.github.com/repos/input-output-hk/etc-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/input-output-hk/etc-client/pulls/81/commits"},"statuses":{"href":"https://api.github.com/repos/input-output-hk/etc-client/statuses/9303a6bdccb2d128424f9375362cf7fec45c7bc1"}}}}
{"actor":{"display_login":"LukasGasior1"}}