{"action":"created","comment":{"url":"https://api.github.com/repos/NebulousLabs/Sia/pulls/comments/37444050","id":37444050,"diff_hunk":"@@ -5,21 +5,25 @@ import (\n )\n \n const (\n-\tAcceptTermsResponse = \"accept\"\n-\tHostDir             = \"host\"\n+\tAcceptResponse = \"accept\"\n+\tHostDir        = \"host\"\n )\n \n-// ContractTerms are the parameters agreed upon by a client and a host when\n-// forming a FileContract.\n-type ContractTerms struct {\n-\tFileSize           uint64                // How large the file is.\n-\tDuration           types.BlockHeight     // How long the file is to be stored.\n-\tDurationStart      types.BlockHeight     // The block height that the storing starts (typically required to start immediately, unless it's a chained contract).\n-\tWindowSize         types.BlockHeight     // How long the host has to submit a proof of storage.\n-\tPrice              types.Currency        // Client contribution towards payout each window\n-\tCollateral         types.Currency        // Host contribution towards payout each window\n-\tValidProofOutputs  []types.SiacoinOutput // Where money goes if the storage proof is successful.\n-\tMissedProofOutputs []types.SiacoinOutput // Where the money goes if the storage proof fails.\n+// RPC identifiers\n+var (\n+\t// Each identifier has a version number at the end, which will be\n+\t// incremented whenever the protocol changes.\n+\tRPCSettings = types.Specifier{'S', 'e', 't', 't', 'i', 'n', 'g', 's', 0}","path":"modules/host.go","position":25,"original_position":25,"commit_id":"2cc5b62be595ace6d6c9308cd0407ff2a2d7bd68","original_commit_id":"2cc5b62be595ace6d6c9308cd0407ff2a2d7bd68","user":{"login":"lukechampine","id":3344749,"avatar_url":"https://avatars.githubusercontent.com/u/3344749?v=3","gravatar_id":"","url":"https://api.github.com/users/lukechampine","html_url":"https://github.com/lukechampine","followers_url":"https://api.github.com/users/lukechampine/followers","following_url":"https://api.github.com/users/lukechampine/following{/other_user}","gists_url":"https://api.github.com/users/lukechampine/gists{/gist_id}","starred_url":"https://api.github.com/users/lukechampine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukechampine/subscriptions","organizations_url":"https://api.github.com/users/lukechampine/orgs","repos_url":"https://api.github.com/users/lukechampine/repos","events_url":"https://api.github.com/users/lukechampine/events{/privacy}","received_events_url":"https://api.github.com/users/lukechampine/received_events","type":"User","site_admin":false},"body":"Otherwise, when you change the protocol, you have to pick a new identifier. You can't (easily) reuse the old one, because you won't know which protocol your peer wants to speak.","created_at":"2015-08-19T17:42:17Z","updated_at":"2015-08-19T17:42:17Z","html_url":"https://github.com/NebulousLabs/Sia/pull/726#discussion_r37444050","pull_request_url":"https://api.github.com/repos/NebulousLabs/Sia/pulls/726","_links":{"self":{"href":"https://api.github.com/repos/NebulousLabs/Sia/pulls/comments/37444050"},"html":{"href":"https://github.com/NebulousLabs/Sia/pull/726#discussion_r37444050"},"pull_request":{"href":"https://api.github.com/repos/NebulousLabs/Sia/pulls/726"}}},"pull_request":{"url":"https://api.github.com/repos/NebulousLabs/Sia/pulls/726","id":42778237,"html_url":"https://github.com/NebulousLabs/Sia/pull/726","diff_url":"https://github.com/NebulousLabs/Sia/pull/726.diff","patch_url":"https://github.com/NebulousLabs/Sia/pull/726.patch","issue_url":"https://api.github.com/repos/NebulousLabs/Sia/issues/726","number":726,"state":"open","locked":false,"title":"Host + Renter overhaul","user":{"login":"lukechampine","id":3344749,"avatar_url":"https://avatars.githubusercontent.com/u/3344749?v=3","gravatar_id":"","url":"https://api.github.com/users/lukechampine","html_url":"https://github.com/lukechampine","followers_url":"https://api.github.com/users/lukechampine/followers","following_url":"https://api.github.com/users/lukechampine/following{/other_user}","gists_url":"https://api.github.com/users/lukechampine/gists{/gist_id}","starred_url":"https://api.github.com/users/lukechampine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukechampine/subscriptions","organizations_url":"https://api.github.com/users/lukechampine/orgs","repos_url":"https://api.github.com/users/lukechampine/repos","events_url":"https://api.github.com/users/lukechampine/events{/privacy}","received_events_url":"https://api.github.com/users/lukechampine/received_events","type":"User","site_admin":false},"body":"At long last, we have erasure coding, parallel uploads and downloads, and file contract revisions. But I'm not terribly proud of some of this code; a lot of it is a bit shaky, and needs thorough review (especially contract negotiation + revision -- I'm pretty confident I'm not doing signatures correctly, because I can't figure out where to supply the secret keys).\r\n\r\nDefinitely missing from this PR:\r\n- Host + renter API updates, as described in #723\r\n- Compatibility is broken for .sia files, as well as host+renter persistence files and host RPCs. At the very least, hosts should be able to provide old files and submit old proofs, and renters should be able to retrieve old files. This may be tricky and/or ugly. We should find out what users are willing to put up with.\r\n- Revisions are never submitted to the blockchain. Both the host and renter need to submit the revision before WindowStart, and or immediately in the event of negotiation failure (maybe?).\r\n- The host and renter probably need to save some information (to disk) that they currently aren't. I'm fairly sure the renter needs to save the unlock conditions for each file contract, but there may be others.\r\n\r\nFinally, the upload and download algorithms need more work. The upload algorithm is (I believe) close to optimal in terms of speed, but may impact redundancy. The download algorithm is still terrible; I haven't come up with anything satisfactory yet. To make things easier, I've included commented-out statistics in `TestErasureUpload` and `TestErasureDownload`, so you can get immediate feedback on any modifications you make to the upload and download algorithms. Also, the `testHost` object should be modified to disconnect (either randomly or at a specific time) so that we can ensure such disconnects won't break uploads or downloads.\r\n\r\nI think that's it. We're almost there, fellas. Just needs some polishing and testing, and then the real fun begins...\r\n\r\nfixes #159 and fixes #642.","created_at":"2015-08-19T05:32:00Z","updated_at":"2015-08-19T17:42:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1094d347c0d51122a776ac3ca11040d65aa1a83b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/NebulousLabs/Sia/pulls/726/commits","review_comments_url":"https://api.github.com/repos/NebulousLabs/Sia/pulls/726/comments","review_comment_url":"https://api.github.com/repos/NebulousLabs/Sia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NebulousLabs/Sia/issues/726/comments","statuses_url":"https://api.github.com/repos/NebulousLabs/Sia/statuses/2cc5b62be595ace6d6c9308cd0407ff2a2d7bd68","head":{"label":"NebulousLabs:renter","ref":"renter","sha":"2cc5b62be595ace6d6c9308cd0407ff2a2d7bd68","user":{"login":"NebulousLabs","id":7471422,"avatar_url":"https://avatars.githubusercontent.com/u/7471422?v=3","gravatar_id":"","url":"https://api.github.com/users/NebulousLabs","html_url":"https://github.com/NebulousLabs","followers_url":"https://api.github.com/users/NebulousLabs/followers","following_url":"https://api.github.com/users/NebulousLabs/following{/other_user}","gists_url":"https://api.github.com/users/NebulousLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/NebulousLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NebulousLabs/subscriptions","organizations_url":"https://api.github.com/users/NebulousLabs/orgs","repos_url":"https://api.github.com/users/NebulousLabs/repos","events_url":"https://api.github.com/users/NebulousLabs/events{/privacy}","received_events_url":"https://api.github.com/users/NebulousLabs/received_events","type":"Organization","site_admin":false},"repo":{"id":25370072,"name":"Sia","full_name":"NebulousLabs/Sia","owner":{"login":"NebulousLabs","id":7471422,"avatar_url":"https://avatars.githubusercontent.com/u/7471422?v=3","gravatar_id":"","url":"https://api.github.com/users/NebulousLabs","html_url":"https://github.com/NebulousLabs","followers_url":"https://api.github.com/users/NebulousLabs/followers","following_url":"https://api.github.com/users/NebulousLabs/following{/other_user}","gists_url":"https://api.github.com/users/NebulousLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/NebulousLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NebulousLabs/subscriptions","organizations_url":"https://api.github.com/users/NebulousLabs/orgs","repos_url":"https://api.github.com/users/NebulousLabs/repos","events_url":"https://api.github.com/users/NebulousLabs/events{/privacy}","received_events_url":"https://api.github.com/users/NebulousLabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NebulousLabs/Sia","description":"Blockchain-based marketplace for file storage","fork":false,"url":"https://api.github.com/repos/NebulousLabs/Sia","forks_url":"https://api.github.com/repos/NebulousLabs/Sia/forks","keys_url":"https://api.github.com/repos/NebulousLabs/Sia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NebulousLabs/Sia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NebulousLabs/Sia/teams","hooks_url":"https://api.github.com/repos/NebulousLabs/Sia/hooks","issue_events_url":"https://api.github.com/repos/NebulousLabs/Sia/issues/events{/number}","events_url":"https://api.github.com/repos/NebulousLabs/Sia/events","assignees_url":"https://api.github.com/repos/NebulousLabs/Sia/assignees{/user}","branches_url":"https://api.github.com/repos/NebulousLabs/Sia/branches{/branch}","tags_url":"https://api.github.com/repos/NebulousLabs/Sia/tags","blobs_url":"https://api.github.com/repos/NebulousLabs/Sia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NebulousLabs/Sia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NebulousLabs/Sia/git/refs{/sha}","trees_url":"https://api.github.com/repos/NebulousLabs/Sia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NebulousLabs/Sia/statuses/{sha}","languages_url":"https://api.github.com/repos/NebulousLabs/Sia/languages","stargazers_url":"https://api.github.com/repos/NebulousLabs/Sia/stargazers","contributors_url":"https://api.github.com/repos/NebulousLabs/Sia/contributors","subscribers_url":"https://api.github.com/repos/NebulousLabs/Sia/subscribers","subscription_url":"https://api.github.com/repos/NebulousLabs/Sia/subscription","commits_url":"https://api.github.com/repos/NebulousLabs/Sia/commits{/sha}","git_commits_url":"https://api.github.com/repos/NebulousLabs/Sia/git/commits{/sha}","comments_url":"https://api.github.com/repos/NebulousLabs/Sia/comments{/number}","issue_comment_url":"https://api.github.com/repos/NebulousLabs/Sia/issues/comments{/number}","contents_url":"https://api.github.com/repos/NebulousLabs/Sia/contents/{+path}","compare_url":"https://api.github.com/repos/NebulousLabs/Sia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NebulousLabs/Sia/merges","archive_url":"https://api.github.com/repos/NebulousLabs/Sia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NebulousLabs/Sia/downloads","issues_url":"https://api.github.com/repos/NebulousLabs/Sia/issues{/number}","pulls_url":"https://api.github.com/repos/NebulousLabs/Sia/pulls{/number}","milestones_url":"https://api.github.com/repos/NebulousLabs/Sia/milestones{/number}","notifications_url":"https://api.github.com/repos/NebulousLabs/Sia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NebulousLabs/Sia/labels{/name}","releases_url":"https://api.github.com/repos/NebulousLabs/Sia/releases{/id}","created_at":"2014-10-17T17:50:25Z","updated_at":"2015-08-12T00:32:25Z","pushed_at":"2015-08-19T17:10:06Z","git_url":"git://github.com/NebulousLabs/Sia.git","ssh_url":"git@github.com:NebulousLabs/Sia.git","clone_url":"https://github.com/NebulousLabs/Sia.git","svn_url":"https://github.com/NebulousLabs/Sia","homepage":"http://siacoin.com","size":30668,"stargazers_count":78,"watchers_count":78,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":41,"forks":12,"open_issues":41,"watchers":78,"default_branch":"master"}},"base":{"label":"NebulousLabs:master","ref":"master","sha":"333c4ec8b95540bfc059a6ef7227ae9db1c59b25","user":{"login":"NebulousLabs","id":7471422,"avatar_url":"https://avatars.githubusercontent.com/u/7471422?v=3","gravatar_id":"","url":"https://api.github.com/users/NebulousLabs","html_url":"https://github.com/NebulousLabs","followers_url":"https://api.github.com/users/NebulousLabs/followers","following_url":"https://api.github.com/users/NebulousLabs/following{/other_user}","gists_url":"https://api.github.com/users/NebulousLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/NebulousLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NebulousLabs/subscriptions","organizations_url":"https://api.github.com/users/NebulousLabs/orgs","repos_url":"https://api.github.com/users/NebulousLabs/repos","events_url":"https://api.github.com/users/NebulousLabs/events{/privacy}","received_events_url":"https://api.github.com/users/NebulousLabs/received_events","type":"Organization","site_admin":false},"repo":{"id":25370072,"name":"Sia","full_name":"NebulousLabs/Sia","owner":{"login":"NebulousLabs","id":7471422,"avatar_url":"https://avatars.githubusercontent.com/u/7471422?v=3","gravatar_id":"","url":"https://api.github.com/users/NebulousLabs","html_url":"https://github.com/NebulousLabs","followers_url":"https://api.github.com/users/NebulousLabs/followers","following_url":"https://api.github.com/users/NebulousLabs/following{/other_user}","gists_url":"https://api.github.com/users/NebulousLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/NebulousLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NebulousLabs/subscriptions","organizations_url":"https://api.github.com/users/NebulousLabs/orgs","repos_url":"https://api.github.com/users/NebulousLabs/repos","events_url":"https://api.github.com/users/NebulousLabs/events{/privacy}","received_events_url":"https://api.github.com/users/NebulousLabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NebulousLabs/Sia","description":"Blockchain-based marketplace for file storage","fork":false,"url":"https://api.github.com/repos/NebulousLabs/Sia","forks_url":"https://api.github.com/repos/NebulousLabs/Sia/forks","keys_url":"https://api.github.com/repos/NebulousLabs/Sia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NebulousLabs/Sia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NebulousLabs/Sia/teams","hooks_url":"https://api.github.com/repos/NebulousLabs/Sia/hooks","issue_events_url":"https://api.github.com/repos/NebulousLabs/Sia/issues/events{/number}","events_url":"https://api.github.com/repos/NebulousLabs/Sia/events","assignees_url":"https://api.github.com/repos/NebulousLabs/Sia/assignees{/user}","branches_url":"https://api.github.com/repos/NebulousLabs/Sia/branches{/branch}","tags_url":"https://api.github.com/repos/NebulousLabs/Sia/tags","blobs_url":"https://api.github.com/repos/NebulousLabs/Sia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NebulousLabs/Sia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NebulousLabs/Sia/git/refs{/sha}","trees_url":"https://api.github.com/repos/NebulousLabs/Sia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NebulousLabs/Sia/statuses/{sha}","languages_url":"https://api.github.com/repos/NebulousLabs/Sia/languages","stargazers_url":"https://api.github.com/repos/NebulousLabs/Sia/stargazers","contributors_url":"https://api.github.com/repos/NebulousLabs/Sia/contributors","subscribers_url":"https://api.github.com/repos/NebulousLabs/Sia/subscribers","subscription_url":"https://api.github.com/repos/NebulousLabs/Sia/subscription","commits_url":"https://api.github.com/repos/NebulousLabs/Sia/commits{/sha}","git_commits_url":"https://api.github.com/repos/NebulousLabs/Sia/git/commits{/sha}","comments_url":"https://api.github.com/repos/NebulousLabs/Sia/comments{/number}","issue_comment_url":"https://api.github.com/repos/NebulousLabs/Sia/issues/comments{/number}","contents_url":"https://api.github.com/repos/NebulousLabs/Sia/contents/{+path}","compare_url":"https://api.github.com/repos/NebulousLabs/Sia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NebulousLabs/Sia/merges","archive_url":"https://api.github.com/repos/NebulousLabs/Sia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NebulousLabs/Sia/downloads","issues_url":"https://api.github.com/repos/NebulousLabs/Sia/issues{/number}","pulls_url":"https://api.github.com/repos/NebulousLabs/Sia/pulls{/number}","milestones_url":"https://api.github.com/repos/NebulousLabs/Sia/milestones{/number}","notifications_url":"https://api.github.com/repos/NebulousLabs/Sia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NebulousLabs/Sia/labels{/name}","releases_url":"https://api.github.com/repos/NebulousLabs/Sia/releases{/id}","created_at":"2014-10-17T17:50:25Z","updated_at":"2015-08-12T00:32:25Z","pushed_at":"2015-08-19T17:10:06Z","git_url":"git://github.com/NebulousLabs/Sia.git","ssh_url":"git@github.com:NebulousLabs/Sia.git","clone_url":"https://github.com/NebulousLabs/Sia.git","svn_url":"https://github.com/NebulousLabs/Sia","homepage":"http://siacoin.com","size":30668,"stargazers_count":78,"watchers_count":78,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":41,"forks":12,"open_issues":41,"watchers":78,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NebulousLabs/Sia/pulls/726"},"html":{"href":"https://github.com/NebulousLabs/Sia/pull/726"},"issue":{"href":"https://api.github.com/repos/NebulousLabs/Sia/issues/726"},"comments":{"href":"https://api.github.com/repos/NebulousLabs/Sia/issues/726/comments"},"review_comments":{"href":"https://api.github.com/repos/NebulousLabs/Sia/pulls/726/comments"},"review_comment":{"href":"https://api.github.com/repos/NebulousLabs/Sia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NebulousLabs/Sia/pulls/726/commits"},"statuses":{"href":"https://api.github.com/repos/NebulousLabs/Sia/statuses/2cc5b62be595ace6d6c9308cd0407ff2a2d7bd68"}}}}