{"action":"created","issue":{"url":"https://api.github.com/repos/JoinColony/colonyNetwork/issues/282","repository_url":"https://api.github.com/repos/JoinColony/colonyNetwork","labels_url":"https://api.github.com/repos/JoinColony/colonyNetwork/issues/282/labels{/name}","comments_url":"https://api.github.com/repos/JoinColony/colonyNetwork/issues/282/comments","events_url":"https://api.github.com/repos/JoinColony/colonyNetwork/issues/282/events","html_url":"https://github.com/JoinColony/colonyNetwork/issues/282","id":341489355,"node_id":"MDU6SXNzdWUzNDE0ODkzNTU=","number":282,"title":"Fix parent reputation updates","user":{"login":"kronosapiens","id":1874062,"node_id":"MDQ6VXNlcjE4NzQwNjI=","avatar_url":"https://avatars1.githubusercontent.com/u/1874062?v=4","gravatar_id":"","url":"https://api.github.com/users/kronosapiens","html_url":"https://github.com/kronosapiens","followers_url":"https://api.github.com/users/kronosapiens/followers","following_url":"https://api.github.com/users/kronosapiens/following{/other_user}","gists_url":"https://api.github.com/users/kronosapiens/gists{/gist_id}","starred_url":"https://api.github.com/users/kronosapiens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kronosapiens/subscriptions","organizations_url":"https://api.github.com/users/kronosapiens/orgs","repos_url":"https://api.github.com/users/kronosapiens/repos","events_url":"https://api.github.com/users/kronosapiens/events{/privacy}","received_events_url":"https://api.github.com/users/kronosapiens/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-16T11:56:32Z","updated_at":"2018-07-16T12:29:59Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"## Summary\r\n<!--- Concise overview of the issue. -->\r\n\r\nOkay, so, during a dispute over a parent reputation update, the 'correct' skill ID is looked up by this line: https://github.com/JoinColony/colonyNetwork/blob/develop/contracts/ReputationMiningCycle.sol#L609\r\n\r\nThis line looks very similar to the (correct) line for child skill updates. However, the array that reads from only contains parents that are powers of two away from the skill in question ( https://github.com/JoinColony/colonyNetwork/blob/develop/contracts/ColonyNetwork.sol#L199 ).\r\n\r\nThe difference only manifests when you have four generations of skills, which none of the tests do yet, and the client is wrong in the same way, so such a test would pass currently, but not all the required skills would be present int he reputation tree.\r\n\r\nThe easiest fix would seem to be to implement a function on colonyNetwork that returns the nth parent of a skill, if present, rather than the nth entry in the parents array. A loop over the binary representation of 'n' seems like the easiest way, moving up the tree based on which bits are '1', but I'd be open to other suggests.\r\n\r\nIt is possible that function should replace getParentSkillId, rather than be implemented alongside it. If the knock-on consequences weren't too big, I think that would avoid us getting tripped up by this in the future.\r\n\r\nAt the minimum, a test should be included that demonstrates that when a skill is updated, *all* of its parents are if it has at least three parents, and a test that shows when a parent that is not a 2^n parent is disputed, the dispute resolves correctly."},"comment":{"url":"https://api.github.com/repos/JoinColony/colonyNetwork/issues/comments/405231648","html_url":"https://github.com/JoinColony/colonyNetwork/issues/282#issuecomment-405231648","issue_url":"https://api.github.com/repos/JoinColony/colonyNetwork/issues/282","id":405231648,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNTIzMTY0OA==","user":{"login":"kronosapiens","id":1874062,"node_id":"MDQ6VXNlcjE4NzQwNjI=","avatar_url":"https://avatars1.githubusercontent.com/u/1874062?v=4","gravatar_id":"","url":"https://api.github.com/users/kronosapiens","html_url":"https://github.com/kronosapiens","followers_url":"https://api.github.com/users/kronosapiens/followers","following_url":"https://api.github.com/users/kronosapiens/following{/other_user}","gists_url":"https://api.github.com/users/kronosapiens/gists{/gist_id}","starred_url":"https://api.github.com/users/kronosapiens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kronosapiens/subscriptions","organizations_url":"https://api.github.com/users/kronosapiens/orgs","repos_url":"https://api.github.com/users/kronosapiens/repos","events_url":"https://api.github.com/users/kronosapiens/events{/privacy}","received_events_url":"https://api.github.com/users/kronosapiens/received_events","type":"User","site_admin":false},"created_at":"2018-07-16T12:29:59Z","updated_at":"2018-07-16T12:29:59Z","author_association":"CONTRIBUTOR","body":"Ah I was going to work on it, but if you'd like to then feel free!"}}
{"actor":{"display_login":"kronosapiens"}}