{"action":"created","issue":{"url":"https://api.github.com/repos/ChainSafeSystems/lodestar_chain/issues/62","repository_url":"https://api.github.com/repos/ChainSafeSystems/lodestar_chain","labels_url":"https://api.github.com/repos/ChainSafeSystems/lodestar_chain/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/ChainSafeSystems/lodestar_chain/issues/62/comments","events_url":"https://api.github.com/repos/ChainSafeSystems/lodestar_chain/issues/62/events","html_url":"https://github.com/ChainSafeSystems/lodestar_chain/pull/62","id":392441608,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM5NzEyNjg4","number":62,"title":"Add getNewShuffling helper function","user":{"login":"wemeetagain","id":1348242,"node_id":"MDQ6VXNlcjEzNDgyNDI=","avatar_url":"https://avatars2.githubusercontent.com/u/1348242?v=4","gravatar_id":"","url":"https://api.github.com/users/wemeetagain","html_url":"https://github.com/wemeetagain","followers_url":"https://api.github.com/users/wemeetagain/followers","following_url":"https://api.github.com/users/wemeetagain/following{/other_user}","gists_url":"https://api.github.com/users/wemeetagain/gists{/gist_id}","starred_url":"https://api.github.com/users/wemeetagain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wemeetagain/subscriptions","organizations_url":"https://api.github.com/users/wemeetagain/orgs","repos_url":"https://api.github.com/users/wemeetagain/repos","events_url":"https://api.github.com/users/wemeetagain/events{/privacy}","received_events_url":"https://api.github.com/users/wemeetagain/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-12-19T05:00:35Z","updated_at":"2018-12-19T19:20:46Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/ChainSafeSystems/lodestar_chain/pulls/62","html_url":"https://github.com/ChainSafeSystems/lodestar_chain/pull/62","diff_url":"https://github.com/ChainSafeSystems/lodestar_chain/pull/62.diff","patch_url":"https://github.com/ChainSafeSystems/lodestar_chain/pull/62.patch"},"body":"- Use `Buffer` for `hash32` type - Previously, we'd defined `hash32` to be of type `number`. I'm assuming that was just a stand-in. Here we use a `Buffer`, so we can reuse the `ethereumjs-util` packaged code.\r\n- Change the typescript compiler built-in type declarations to include newer APIs - useful especially for allowing newer `Array` methods (eg: `find`, `includes`, etc.)\r\n- Add `get_new_shuffling` utility function from the [spec](https://github.com/ethereum/eth2.0-specs/blob/master/specs/core/0_beacon-chain.md#get_new_shuffling)\r\n- Add basic sanity test"},"comment":{"url":"https://api.github.com/repos/ChainSafeSystems/lodestar_chain/issues/comments/448713361","html_url":"https://github.com/ChainSafeSystems/lodestar_chain/pull/62#issuecomment-448713361","issue_url":"https://api.github.com/repos/ChainSafeSystems/lodestar_chain/issues/62","id":448713361,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0ODcxMzM2MQ==","user":{"login":"noot","id":36753753,"node_id":"MDQ6VXNlcjM2NzUzNzUz","avatar_url":"https://avatars3.githubusercontent.com/u/36753753?v=4","gravatar_id":"","url":"https://api.github.com/users/noot","html_url":"https://github.com/noot","followers_url":"https://api.github.com/users/noot/followers","following_url":"https://api.github.com/users/noot/following{/other_user}","gists_url":"https://api.github.com/users/noot/gists{/gist_id}","starred_url":"https://api.github.com/users/noot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noot/subscriptions","organizations_url":"https://api.github.com/users/noot/orgs","repos_url":"https://api.github.com/users/noot/repos","events_url":"https://api.github.com/users/noot/events{/privacy}","received_events_url":"https://api.github.com/users/noot/received_events","type":"User","site_admin":false},"created_at":"2018-12-19T19:20:45Z","updated_at":"2018-12-19T19:20:45Z","author_association":"MEMBER","body":"@wemeetagain thanks for the PR! I've discussed with @GregTheGreek and we think the best course of action is to represent the `hash32` type as a hex-formatted string eg. `seed = 0x1234abcd` \r\nThis way, we can use `sample_from_source = parseInt(seed.slice(pos, pos+6), 16)` to grab 3 bytes of the string and parse it as base16 to an int. I use `seed.slice(pos, pos+6)` since each hex character represents half a byte, and we need 3 bytes of the seed for each iteration per the spec, thus 6 characters total.\r\n\r\nLet me know if this makes sense! I can write this out in code form soon."}}
{"actor":{"display_login":"noot"}}