{"action":"created","comment":{"url":"https://api.github.com/repos/poanetwork/hbbft/pulls/comments/241479032","pull_request_review_id":184762232,"id":241479032,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MTQ3OTAzMg==","diff_hunk":"@@ -249,6 +250,9 @@ where\n }\n \n /// A distributed algorithm that defines a message flow.\n+///\n+/// Many algorithms require an RNG which must be supplied on each call. It is up to the caller to\n+/// ensure that these source supply random numbers suitable for cryptographic applications.","path":"src/traits.rs","position":14,"original_position":14,"commit_id":"b38459bd4ab0d1a2ec848adae893c7067b48cc3d","original_commit_id":"b38459bd4ab0d1a2ec848adae893c7067b48cc3d","user":{"login":"vkomenda","id":5529505,"node_id":"MDQ6VXNlcjU1Mjk1MDU=","avatar_url":"https://avatars3.githubusercontent.com/u/5529505?v=4","gravatar_id":"","url":"https://api.github.com/users/vkomenda","html_url":"https://github.com/vkomenda","followers_url":"https://api.github.com/users/vkomenda/followers","following_url":"https://api.github.com/users/vkomenda/following{/other_user}","gists_url":"https://api.github.com/users/vkomenda/gists{/gist_id}","starred_url":"https://api.github.com/users/vkomenda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkomenda/subscriptions","organizations_url":"https://api.github.com/users/vkomenda/orgs","repos_url":"https://api.github.com/users/vkomenda/repos","events_url":"https://api.github.com/users/vkomenda/events{/privacy}","received_events_url":"https://api.github.com/users/vkomenda/received_events","type":"User","site_admin":false},"body":"I believe \"to ensure that this RNG is cryptographically secure\".","created_at":"2018-12-13T16:50:36Z","updated_at":"2018-12-13T16:50:37Z","html_url":"https://github.com/poanetwork/hbbft/pull/357#discussion_r241479032","pull_request_url":"https://api.github.com/repos/poanetwork/hbbft/pulls/357","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/poanetwork/hbbft/pulls/comments/241479032"},"html":{"href":"https://github.com/poanetwork/hbbft/pull/357#discussion_r241479032"},"pull_request":{"href":"https://api.github.com/repos/poanetwork/hbbft/pulls/357"}},"in_reply_to_id":241398968},"pull_request":{"url":"https://api.github.com/repos/poanetwork/hbbft/pulls/357","id":236285511,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM2Mjg1NTEx","html_url":"https://github.com/poanetwork/hbbft/pull/357","diff_url":"https://github.com/poanetwork/hbbft/pull/357.diff","patch_url":"https://github.com/poanetwork/hbbft/pull/357.patch","issue_url":"https://api.github.com/repos/poanetwork/hbbft/issues/357","number":357,"state":"open","locked":false,"title":"OsRng / external RNG Refactoring","user":{"login":"mbr","id":110577,"node_id":"MDQ6VXNlcjExMDU3Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/110577?v=4","gravatar_id":"","url":"https://api.github.com/users/mbr","html_url":"https://github.com/mbr","followers_url":"https://api.github.com/users/mbr/followers","following_url":"https://api.github.com/users/mbr/following{/other_user}","gists_url":"https://api.github.com/users/mbr/gists{/gist_id}","starred_url":"https://api.github.com/users/mbr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbr/subscriptions","organizations_url":"https://api.github.com/users/mbr/orgs","repos_url":"https://api.github.com/users/mbr/repos","events_url":"https://api.github.com/users/mbr/events{/privacy}","received_events_url":"https://api.github.com/users/mbr/received_events","type":"User","site_admin":false},"body":"This is a WIP PR, as the tests won't pass (I have not updated them yet). I want feedback on these changes first, before I undertake updating and refactoring all the tests.\r\n\r\nHere's the issue: Someone noticed that the default RNG for both `HoneyBadger` and `DynamicHoneyBadger` was the suboptimal `thread_rng()` (see Issue #356).\r\n\r\nWe cannot simply put in an `OsRng` and call it a day, since Hydrabadger uses tokio, which requires all of our algorithms to be send and sync. Our boxed RNG model has to go (I mentioned this a month back, but we kinda put off this refactoring until now, since it was not apparent what the gain was). There already was a plan to make all RNGs to be passed in from the outside, now we just had to accelerate that schedule.\r\n\r\nThe first commit shows what does not work, namely just plopping in `OsRng` - which is not `Send+Sync`. It still changes all the tests to use `OsRng`, because why not (makes grepping for `thread_rng` really convenient).\r\n\r\nThe second commit takes care of adding an extra `rng: &mut R` parameter to all relevant methods but cuts off at the boundary to `DistAlgorithm`.\r\n\r\nThe third commit takes the final step and changes the `DistAlgorithm` interface.\r\n\r\nOne open question is whether the change in `epoch_state.rs:78` is allowed; the function used to call `handle_input`, but now calls `propose` instead, which works out the same, but removes a layer of abstraction. The rationale behind this is to avoid introducing a chain of completely unnecessary `R: Rng` parameters in that area. Any feedback @afck ?\r\n\r\nThe PR is rather long and messy, it's a fairly unpleasant refactoring. Still, I am grateful for early feedback.","created_at":"2018-12-05T18:56:14Z","updated_at":"2018-12-13T16:50:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ab168e782fbe2ff65507970db12f2d5f0a2702b1","assignee":{"login":"afck","id":7894725,"node_id":"MDQ6VXNlcjc4OTQ3MjU=","avatar_url":"https://avatars0.githubusercontent.com/u/7894725?v=4","gravatar_id":"","url":"https://api.github.com/users/afck","html_url":"https://github.com/afck","followers_url":"https://api.github.com/users/afck/followers","following_url":"https://api.github.com/users/afck/following{/other_user}","gists_url":"https://api.github.com/users/afck/gists{/gist_id}","starred_url":"https://api.github.com/users/afck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afck/subscriptions","organizations_url":"https://api.github.com/users/afck/orgs","repos_url":"https://api.github.com/users/afck/repos","events_url":"https://api.github.com/users/afck/events{/privacy}","received_events_url":"https://api.github.com/users/afck/received_events","type":"User","site_admin":false},"assignees":[{"login":"afck","id":7894725,"node_id":"MDQ6VXNlcjc4OTQ3MjU=","avatar_url":"https://avatars0.githubusercontent.com/u/7894725?v=4","gravatar_id":"","url":"https://api.github.com/users/afck","html_url":"https://github.com/afck","followers_url":"https://api.github.com/users/afck/followers","following_url":"https://api.github.com/users/afck/following{/other_user}","gists_url":"https://api.github.com/users/afck/gists{/gist_id}","starred_url":"https://api.github.com/users/afck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afck/subscriptions","organizations_url":"https://api.github.com/users/afck/orgs","repos_url":"https://api.github.com/users/afck/repos","events_url":"https://api.github.com/users/afck/events{/privacy}","received_events_url":"https://api.github.com/users/afck/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/poanetwork/hbbft/pulls/357/commits","review_comments_url":"https://api.github.com/repos/poanetwork/hbbft/pulls/357/comments","review_comment_url":"https://api.github.com/repos/poanetwork/hbbft/pulls/comments{/number}","comments_url":"https://api.github.com/repos/poanetwork/hbbft/issues/357/comments","statuses_url":"https://api.github.com/repos/poanetwork/hbbft/statuses/b38459bd4ab0d1a2ec848adae893c7067b48cc3d","head":{"label":"poanetwork:mbr-osrng","ref":"mbr-osrng","sha":"b38459bd4ab0d1a2ec848adae893c7067b48cc3d","user":{"login":"poanetwork","id":28943015,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4OTQzMDE1","avatar_url":"https://avatars2.githubusercontent.com/u/28943015?v=4","gravatar_id":"","url":"https://api.github.com/users/poanetwork","html_url":"https://github.com/poanetwork","followers_url":"https://api.github.com/users/poanetwork/followers","following_url":"https://api.github.com/users/poanetwork/following{/other_user}","gists_url":"https://api.github.com/users/poanetwork/gists{/gist_id}","starred_url":"https://api.github.com/users/poanetwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poanetwork/subscriptions","organizations_url":"https://api.github.com/users/poanetwork/orgs","repos_url":"https://api.github.com/users/poanetwork/repos","events_url":"https://api.github.com/users/poanetwork/events{/privacy}","received_events_url":"https://api.github.com/users/poanetwork/received_events","type":"Organization","site_admin":false},"repo":{"id":125307734,"node_id":"MDEwOlJlcG9zaXRvcnkxMjUzMDc3MzQ=","name":"hbbft","full_name":"poanetwork/hbbft","private":false,"owner":{"login":"poanetwork","id":28943015,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4OTQzMDE1","avatar_url":"https://avatars2.githubusercontent.com/u/28943015?v=4","gravatar_id":"","url":"https://api.github.com/users/poanetwork","html_url":"https://github.com/poanetwork","followers_url":"https://api.github.com/users/poanetwork/followers","following_url":"https://api.github.com/users/poanetwork/following{/other_user}","gists_url":"https://api.github.com/users/poanetwork/gists{/gist_id}","starred_url":"https://api.github.com/users/poanetwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poanetwork/subscriptions","organizations_url":"https://api.github.com/users/poanetwork/orgs","repos_url":"https://api.github.com/users/poanetwork/repos","events_url":"https://api.github.com/users/poanetwork/events{/privacy}","received_events_url":"https://api.github.com/users/poanetwork/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/poanetwork/hbbft","description":" An implementation of the paper \"Honey Badger of BFT Protocols\" in Rust. This is a modular library of consensus.","fork":false,"url":"https://api.github.com/repos/poanetwork/hbbft","forks_url":"https://api.github.com/repos/poanetwork/hbbft/forks","keys_url":"https://api.github.com/repos/poanetwork/hbbft/keys{/key_id}","collaborators_url":"https://api.github.com/repos/poanetwork/hbbft/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/poanetwork/hbbft/teams","hooks_url":"https://api.github.com/repos/poanetwork/hbbft/hooks","issue_events_url":"https://api.github.com/repos/poanetwork/hbbft/issues/events{/number}","events_url":"https://api.github.com/repos/poanetwork/hbbft/events","assignees_url":"https://api.github.com/repos/poanetwork/hbbft/assignees{/user}","branches_url":"https://api.github.com/repos/poanetwork/hbbft/branches{/branch}","tags_url":"https://api.github.com/repos/poanetwork/hbbft/tags","blobs_url":"https://api.github.com/repos/poanetwork/hbbft/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/poanetwork/hbbft/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/poanetwork/hbbft/git/refs{/sha}","trees_url":"https://api.github.com/repos/poanetwork/hbbft/git/trees{/sha}","statuses_url":"https://api.github.com/repos/poanetwork/hbbft/statuses/{sha}","languages_url":"https://api.github.com/repos/poanetwork/hbbft/languages","stargazers_url":"https://api.github.com/repos/poanetwork/hbbft/stargazers","contributors_url":"https://api.github.com/repos/poanetwork/hbbft/contributors","subscribers_url":"https://api.github.com/repos/poanetwork/hbbft/subscribers","subscription_url":"https://api.github.com/repos/poanetwork/hbbft/subscription","commits_url":"https://api.github.com/repos/poanetwork/hbbft/commits{/sha}","git_commits_url":"https://api.github.com/repos/poanetwork/hbbft/git/commits{/sha}","comments_url":"https://api.github.com/repos/poanetwork/hbbft/comments{/number}","issue_comment_url":"https://api.github.com/repos/poanetwork/hbbft/issues/comments{/number}","contents_url":"https://api.github.com/repos/poanetwork/hbbft/contents/{+path}","compare_url":"https://api.github.com/repos/poanetwork/hbbft/compare/{base}...{head}","merges_url":"https://api.github.com/repos/poanetwork/hbbft/merges","archive_url":"https://api.github.com/repos/poanetwork/hbbft/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/poanetwork/hbbft/downloads","issues_url":"https://api.github.com/repos/poanetwork/hbbft/issues{/number}","pulls_url":"https://api.github.com/repos/poanetwork/hbbft/pulls{/number}","milestones_url":"https://api.github.com/repos/poanetwork/hbbft/milestones{/number}","notifications_url":"https://api.github.com/repos/poanetwork/hbbft/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/poanetwork/hbbft/labels{/name}","releases_url":"https://api.github.com/repos/poanetwork/hbbft/releases{/id}","deployments_url":"https://api.github.com/repos/poanetwork/hbbft/deployments","created_at":"2018-03-15T03:32:34Z","updated_at":"2018-12-12T12:39:55Z","pushed_at":"2018-12-13T14:37:56Z","git_url":"git://github.com/poanetwork/hbbft.git","ssh_url":"git@github.com:poanetwork/hbbft.git","clone_url":"https://github.com/poanetwork/hbbft.git","svn_url":"https://github.com/poanetwork/hbbft","homepage":"","size":2112,"stargazers_count":123,"watchers_count":123,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":32,"mirror_url":null,"archived":false,"open_issues_count":35,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":32,"open_issues":35,"watchers":123,"default_branch":"master"}},"base":{"label":"poanetwork:master","ref":"master","sha":"1c7fc60db9a1b5562ccfcbc29155f4fda8d1530f","user":{"login":"poanetwork","id":28943015,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4OTQzMDE1","avatar_url":"https://avatars2.githubusercontent.com/u/28943015?v=4","gravatar_id":"","url":"https://api.github.com/users/poanetwork","html_url":"https://github.com/poanetwork","followers_url":"https://api.github.com/users/poanetwork/followers","following_url":"https://api.github.com/users/poanetwork/following{/other_user}","gists_url":"https://api.github.com/users/poanetwork/gists{/gist_id}","starred_url":"https://api.github.com/users/poanetwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poanetwork/subscriptions","organizations_url":"https://api.github.com/users/poanetwork/orgs","repos_url":"https://api.github.com/users/poanetwork/repos","events_url":"https://api.github.com/users/poanetwork/events{/privacy}","received_events_url":"https://api.github.com/users/poanetwork/received_events","type":"Organization","site_admin":false},"repo":{"id":125307734,"node_id":"MDEwOlJlcG9zaXRvcnkxMjUzMDc3MzQ=","name":"hbbft","full_name":"poanetwork/hbbft","private":false,"owner":{"login":"poanetwork","id":28943015,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4OTQzMDE1","avatar_url":"https://avatars2.githubusercontent.com/u/28943015?v=4","gravatar_id":"","url":"https://api.github.com/users/poanetwork","html_url":"https://github.com/poanetwork","followers_url":"https://api.github.com/users/poanetwork/followers","following_url":"https://api.github.com/users/poanetwork/following{/other_user}","gists_url":"https://api.github.com/users/poanetwork/gists{/gist_id}","starred_url":"https://api.github.com/users/poanetwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poanetwork/subscriptions","organizations_url":"https://api.github.com/users/poanetwork/orgs","repos_url":"https://api.github.com/users/poanetwork/repos","events_url":"https://api.github.com/users/poanetwork/events{/privacy}","received_events_url":"https://api.github.com/users/poanetwork/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/poanetwork/hbbft","description":" An implementation of the paper \"Honey Badger of BFT Protocols\" in Rust. This is a modular library of consensus.","fork":false,"url":"https://api.github.com/repos/poanetwork/hbbft","forks_url":"https://api.github.com/repos/poanetwork/hbbft/forks","keys_url":"https://api.github.com/repos/poanetwork/hbbft/keys{/key_id}","collaborators_url":"https://api.github.com/repos/poanetwork/hbbft/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/poanetwork/hbbft/teams","hooks_url":"https://api.github.com/repos/poanetwork/hbbft/hooks","issue_events_url":"https://api.github.com/repos/poanetwork/hbbft/issues/events{/number}","events_url":"https://api.github.com/repos/poanetwork/hbbft/events","assignees_url":"https://api.github.com/repos/poanetwork/hbbft/assignees{/user}","branches_url":"https://api.github.com/repos/poanetwork/hbbft/branches{/branch}","tags_url":"https://api.github.com/repos/poanetwork/hbbft/tags","blobs_url":"https://api.github.com/repos/poanetwork/hbbft/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/poanetwork/hbbft/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/poanetwork/hbbft/git/refs{/sha}","trees_url":"https://api.github.com/repos/poanetwork/hbbft/git/trees{/sha}","statuses_url":"https://api.github.com/repos/poanetwork/hbbft/statuses/{sha}","languages_url":"https://api.github.com/repos/poanetwork/hbbft/languages","stargazers_url":"https://api.github.com/repos/poanetwork/hbbft/stargazers","contributors_url":"https://api.github.com/repos/poanetwork/hbbft/contributors","subscribers_url":"https://api.github.com/repos/poanetwork/hbbft/subscribers","subscription_url":"https://api.github.com/repos/poanetwork/hbbft/subscription","commits_url":"https://api.github.com/repos/poanetwork/hbbft/commits{/sha}","git_commits_url":"https://api.github.com/repos/poanetwork/hbbft/git/commits{/sha}","comments_url":"https://api.github.com/repos/poanetwork/hbbft/comments{/number}","issue_comment_url":"https://api.github.com/repos/poanetwork/hbbft/issues/comments{/number}","contents_url":"https://api.github.com/repos/poanetwork/hbbft/contents/{+path}","compare_url":"https://api.github.com/repos/poanetwork/hbbft/compare/{base}...{head}","merges_url":"https://api.github.com/repos/poanetwork/hbbft/merges","archive_url":"https://api.github.com/repos/poanetwork/hbbft/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/poanetwork/hbbft/downloads","issues_url":"https://api.github.com/repos/poanetwork/hbbft/issues{/number}","pulls_url":"https://api.github.com/repos/poanetwork/hbbft/pulls{/number}","milestones_url":"https://api.github.com/repos/poanetwork/hbbft/milestones{/number}","notifications_url":"https://api.github.com/repos/poanetwork/hbbft/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/poanetwork/hbbft/labels{/name}","releases_url":"https://api.github.com/repos/poanetwork/hbbft/releases{/id}","deployments_url":"https://api.github.com/repos/poanetwork/hbbft/deployments","created_at":"2018-03-15T03:32:34Z","updated_at":"2018-12-12T12:39:55Z","pushed_at":"2018-12-13T14:37:56Z","git_url":"git://github.com/poanetwork/hbbft.git","ssh_url":"git@github.com:poanetwork/hbbft.git","clone_url":"https://github.com/poanetwork/hbbft.git","svn_url":"https://github.com/poanetwork/hbbft","homepage":"","size":2112,"stargazers_count":123,"watchers_count":123,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":32,"mirror_url":null,"archived":false,"open_issues_count":35,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":32,"open_issues":35,"watchers":123,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/poanetwork/hbbft/pulls/357"},"html":{"href":"https://github.com/poanetwork/hbbft/pull/357"},"issue":{"href":"https://api.github.com/repos/poanetwork/hbbft/issues/357"},"comments":{"href":"https://api.github.com/repos/poanetwork/hbbft/issues/357/comments"},"review_comments":{"href":"https://api.github.com/repos/poanetwork/hbbft/pulls/357/comments"},"review_comment":{"href":"https://api.github.com/repos/poanetwork/hbbft/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/poanetwork/hbbft/pulls/357/commits"},"statuses":{"href":"https://api.github.com/repos/poanetwork/hbbft/statuses/b38459bd4ab0d1a2ec848adae893c7067b48cc3d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"vkomenda"}}