{"action":"created","comment":{"url":"https://api.github.com/repos/dedis/cothority/pulls/comments/235029249","pull_request_review_id":176799608,"id":235029249,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNTAyOTI0OQ==","diff_hunk":"@@ -1360,22 +1349,76 @@ func (s *Service) startBFT(proto string, origRoster, newRoster *onet.Roster, msg\n \t}\n }\n \n-// PropagateSkipBlock will save a new SkipBlock\n-func (s *Service) propagateSkipBlock(msg network.Message) {\n-\tsbs, ok := msg.(*PropagateSkipBlocks)\n+// PropagateGenesisHandler will save a new SkipBlock\n+func (s *Service) propagateGenesisHandler(msg network.Message) {\n+\tpg, ok := msg.(*PropagateGenesis)\n \tif !ok {\n \t\tlog.Error(\"Couldn't convert to slice of SkipBlocks\")\n \t\treturn\n \t}\n-\tfor _, sb := range sbs.SkipBlocks {\n-\t\tif !s.blockIsFriendly(sb) {\n-\t\t\tlog.Lvlf2(\"%s: block is not friendly: %x\", s.ServerIdentity(), sb.Hash)\n+\n+\ts.db.Store(pg.Genesis)\n+\n+\tif !pg.Genesis.ParentBlockID.IsNull() {\n+\t\tsb := s.db.GetByID(pg.Genesis.ParentBlockID)\n+\t\tif sb == nil {\n+\t\t\tlog.Lvl3(\"Unknown parent block. Conode could be out of sync.\")\n \t\t\treturn\n \t\t}\n+\n+\t\tsb.ChildSL = append(sb.ChildSL, pg.Genesis.Hash)\n+\t\ts.db.Store(sb)\n \t}\n-\t_, err := s.db.StoreBlocks(sbs.SkipBlocks)\n-\tif err != nil {\n-\t\tlog.Error(err)\n+}\n+\n+// PropagateForwardLinkHandler will update the latest block with\n+// the new forward link and the new block when given\n+func (s *Service) propagateForwardLinkHandler(msg network.Message) {\n+\tpfl, ok := msg.(*PropagateForwardLink)\n+\tif !ok {\n+\t\tlog.Error(\"Couldn't convert to slice of ForwardLinks\")\n+\t\treturn\n+\t}\n+\n+\t// Get the block to update the list of FLs\n+\tsb := s.db.GetByID(pfl.ForwardLink.From)\n+\tif sb == nil {\n+\t\t// Happen when the roster has changed\n+\t\terr := s.SyncChain(pfl.Roster, pfl.ForwardLink.From)\n+\t\tif err != nil {\n+\t\t\tlog.Error(err)\n+\t\t\treturn\n+\t\t}\n+\n+\t\tsb = s.db.GetByID(pfl.ForwardLink.From)\n+\t\tif sb == nil {\n+\t\t\tlog.Error(\"Couldn't get the block to attach the forward link\")\n+\t\t\treturn\n+\t\t}\n+\t}\n+\n+\t// Because of the sync, the forward link could already be added\n+\t// but we need to catch the case where the height is much above\n+\t// the current one which means we missed previous propagation\n+\tif len(sb.ForwardLink) <= pfl.Height {","path":"skipchain/skipchain.go","position":251,"original_position":251,"commit_id":"4b859d431181348362cb75f1baeb89d12e5cb721","original_commit_id":"4b859d431181348362cb75f1baeb89d12e5cb721","user":{"login":"Gilthoniel","id":3636503,"node_id":"MDQ6VXNlcjM2MzY1MDM=","avatar_url":"https://avatars0.githubusercontent.com/u/3636503?v=4","gravatar_id":"","url":"https://api.github.com/users/Gilthoniel","html_url":"https://github.com/Gilthoniel","followers_url":"https://api.github.com/users/Gilthoniel/followers","following_url":"https://api.github.com/users/Gilthoniel/following{/other_user}","gists_url":"https://api.github.com/users/Gilthoniel/gists{/gist_id}","starred_url":"https://api.github.com/users/Gilthoniel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gilthoniel/subscriptions","organizations_url":"https://api.github.com/users/Gilthoniel/orgs","repos_url":"https://api.github.com/users/Gilthoniel/repos","events_url":"https://api.github.com/users/Gilthoniel/events{/privacy}","received_events_url":"https://api.github.com/users/Gilthoniel/received_events","type":"User","site_admin":false},"body":"I had errors after I changed the propagation test which are actually not errors. As the comment says, if you don't have the previous block and then try to sync, you might end up with the block already updated by another member of the cothority. In my case the leader was sending the block with the forward link already updated.","created_at":"2018-11-20T14:44:24Z","updated_at":"2018-11-20T14:44:24Z","html_url":"https://github.com/dedis/cothority/pull/1580#discussion_r235029249","pull_request_url":"https://api.github.com/repos/dedis/cothority/pulls/1580","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/dedis/cothority/pulls/comments/235029249"},"html":{"href":"https://github.com/dedis/cothority/pull/1580#discussion_r235029249"},"pull_request":{"href":"https://api.github.com/repos/dedis/cothority/pulls/1580"}},"in_reply_to_id":234944280},"pull_request":{"url":"https://api.github.com/repos/dedis/cothority/pulls/1580","id":231108318,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMxMTA4MzE4","html_url":"https://github.com/dedis/cothority/pull/1580","diff_url":"https://github.com/dedis/cothority/pull/1580.diff","patch_url":"https://github.com/dedis/cothority/pull/1580.patch","issue_url":"https://api.github.com/repos/dedis/cothority/issues/1580","number":1580,"state":"open","locked":false,"title":"Skipchain propagation optimization","user":{"login":"Gilthoniel","id":3636503,"node_id":"MDQ6VXNlcjM2MzY1MDM=","avatar_url":"https://avatars0.githubusercontent.com/u/3636503?v=4","gravatar_id":"","url":"https://api.github.com/users/Gilthoniel","html_url":"https://github.com/Gilthoniel","followers_url":"https://api.github.com/users/Gilthoniel/followers","following_url":"https://api.github.com/users/Gilthoniel/following{/other_user}","gists_url":"https://api.github.com/users/Gilthoniel/gists{/gist_id}","starred_url":"https://api.github.com/users/Gilthoniel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gilthoniel/subscriptions","organizations_url":"https://api.github.com/users/Gilthoniel/orgs","repos_url":"https://api.github.com/users/Gilthoniel/repos","events_url":"https://api.github.com/users/Gilthoniel/events{/privacy}","received_events_url":"https://api.github.com/users/Gilthoniel/received_events","type":"User","site_admin":false},"body":"This changes the way the skipchain is propagating new block and\r\nforward links so that it sends minimal information and let conodes\r\nask for missing data.\r\n\r\nFixes #1395 #1213 #1201","created_at":"2018-11-15T08:34:06Z","updated_at":"2018-11-20T14:44:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"47d394806a6d9f409832e9fe97bbf7c1da22961d","assignee":{"login":"Gilthoniel","id":3636503,"node_id":"MDQ6VXNlcjM2MzY1MDM=","avatar_url":"https://avatars0.githubusercontent.com/u/3636503?v=4","gravatar_id":"","url":"https://api.github.com/users/Gilthoniel","html_url":"https://github.com/Gilthoniel","followers_url":"https://api.github.com/users/Gilthoniel/followers","following_url":"https://api.github.com/users/Gilthoniel/following{/other_user}","gists_url":"https://api.github.com/users/Gilthoniel/gists{/gist_id}","starred_url":"https://api.github.com/users/Gilthoniel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gilthoniel/subscriptions","organizations_url":"https://api.github.com/users/Gilthoniel/orgs","repos_url":"https://api.github.com/users/Gilthoniel/repos","events_url":"https://api.github.com/users/Gilthoniel/events{/privacy}","received_events_url":"https://api.github.com/users/Gilthoniel/received_events","type":"User","site_admin":false},"assignees":[{"login":"Gilthoniel","id":3636503,"node_id":"MDQ6VXNlcjM2MzY1MDM=","avatar_url":"https://avatars0.githubusercontent.com/u/3636503?v=4","gravatar_id":"","url":"https://api.github.com/users/Gilthoniel","html_url":"https://github.com/Gilthoniel","followers_url":"https://api.github.com/users/Gilthoniel/followers","following_url":"https://api.github.com/users/Gilthoniel/following{/other_user}","gists_url":"https://api.github.com/users/Gilthoniel/gists{/gist_id}","starred_url":"https://api.github.com/users/Gilthoniel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gilthoniel/subscriptions","organizations_url":"https://api.github.com/users/Gilthoniel/orgs","repos_url":"https://api.github.com/users/Gilthoniel/repos","events_url":"https://api.github.com/users/Gilthoniel/events{/privacy}","received_events_url":"https://api.github.com/users/Gilthoniel/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dedis/cothority/pulls/1580/commits","review_comments_url":"https://api.github.com/repos/dedis/cothority/pulls/1580/comments","review_comment_url":"https://api.github.com/repos/dedis/cothority/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dedis/cothority/issues/1580/comments","statuses_url":"https://api.github.com/repos/dedis/cothority/statuses/4b859d431181348362cb75f1baeb89d12e5cb721","head":{"label":"dedis:skipchain_propagation_1395","ref":"skipchain_propagation_1395","sha":"4b859d431181348362cb75f1baeb89d12e5cb721","user":{"login":"dedis","id":3638331,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2MzgzMzE=","avatar_url":"https://avatars2.githubusercontent.com/u/3638331?v=4","gravatar_id":"","url":"https://api.github.com/users/dedis","html_url":"https://github.com/dedis","followers_url":"https://api.github.com/users/dedis/followers","following_url":"https://api.github.com/users/dedis/following{/other_user}","gists_url":"https://api.github.com/users/dedis/gists{/gist_id}","starred_url":"https://api.github.com/users/dedis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dedis/subscriptions","organizations_url":"https://api.github.com/users/dedis/orgs","repos_url":"https://api.github.com/users/dedis/repos","events_url":"https://api.github.com/users/dedis/events{/privacy}","received_events_url":"https://api.github.com/users/dedis/received_events","type":"Organization","site_admin":false},"repo":{"id":41791684,"node_id":"MDEwOlJlcG9zaXRvcnk0MTc5MTY4NA==","name":"cothority","full_name":"dedis/cothority","private":false,"owner":{"login":"dedis","id":3638331,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2MzgzMzE=","avatar_url":"https://avatars2.githubusercontent.com/u/3638331?v=4","gravatar_id":"","url":"https://api.github.com/users/dedis","html_url":"https://github.com/dedis","followers_url":"https://api.github.com/users/dedis/followers","following_url":"https://api.github.com/users/dedis/following{/other_user}","gists_url":"https://api.github.com/users/dedis/gists{/gist_id}","starred_url":"https://api.github.com/users/dedis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dedis/subscriptions","organizations_url":"https://api.github.com/users/dedis/orgs","repos_url":"https://api.github.com/users/dedis/repos","events_url":"https://api.github.com/users/dedis/events{/privacy}","received_events_url":"https://api.github.com/users/dedis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/dedis/cothority","description":"Scalable collective authority","fork":false,"url":"https://api.github.com/repos/dedis/cothority","forks_url":"https://api.github.com/repos/dedis/cothority/forks","keys_url":"https://api.github.com/repos/dedis/cothority/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dedis/cothority/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dedis/cothority/teams","hooks_url":"https://api.github.com/repos/dedis/cothority/hooks","issue_events_url":"https://api.github.com/repos/dedis/cothority/issues/events{/number}","events_url":"https://api.github.com/repos/dedis/cothority/events","assignees_url":"https://api.github.com/repos/dedis/cothority/assignees{/user}","branches_url":"https://api.github.com/repos/dedis/cothority/branches{/branch}","tags_url":"https://api.github.com/repos/dedis/cothority/tags","blobs_url":"https://api.github.com/repos/dedis/cothority/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dedis/cothority/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dedis/cothority/git/refs{/sha}","trees_url":"https://api.github.com/repos/dedis/cothority/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dedis/cothority/statuses/{sha}","languages_url":"https://api.github.com/repos/dedis/cothority/languages","stargazers_url":"https://api.github.com/repos/dedis/cothority/stargazers","contributors_url":"https://api.github.com/repos/dedis/cothority/contributors","subscribers_url":"https://api.github.com/repos/dedis/cothority/subscribers","subscription_url":"https://api.github.com/repos/dedis/cothority/subscription","commits_url":"https://api.github.com/repos/dedis/cothority/commits{/sha}","git_commits_url":"https://api.github.com/repos/dedis/cothority/git/commits{/sha}","comments_url":"https://api.github.com/repos/dedis/cothority/comments{/number}","issue_comment_url":"https://api.github.com/repos/dedis/cothority/issues/comments{/number}","contents_url":"https://api.github.com/repos/dedis/cothority/contents/{+path}","compare_url":"https://api.github.com/repos/dedis/cothority/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dedis/cothority/merges","archive_url":"https://api.github.com/repos/dedis/cothority/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dedis/cothority/downloads","issues_url":"https://api.github.com/repos/dedis/cothority/issues{/number}","pulls_url":"https://api.github.com/repos/dedis/cothority/pulls{/number}","milestones_url":"https://api.github.com/repos/dedis/cothority/milestones{/number}","notifications_url":"https://api.github.com/repos/dedis/cothority/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dedis/cothority/labels{/name}","releases_url":"https://api.github.com/repos/dedis/cothority/releases{/id}","deployments_url":"https://api.github.com/repos/dedis/cothority/deployments","created_at":"2015-09-02T09:13:57Z","updated_at":"2018-11-20T14:01:41Z","pushed_at":"2018-11-20T14:01:38Z","git_url":"git://github.com/dedis/cothority.git","ssh_url":"git@github.com:dedis/cothority.git","clone_url":"https://github.com/dedis/cothority.git","svn_url":"https://github.com/dedis/cothority","homepage":"","size":85189,"stargazers_count":267,"watchers_count":267,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":65,"mirror_url":null,"archived":false,"open_issues_count":100,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":65,"open_issues":100,"watchers":267,"default_branch":"master"}},"base":{"label":"dedis:master","ref":"master","sha":"40a87e5eaf8af1641bf53f387bdc13319582221a","user":{"login":"dedis","id":3638331,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2MzgzMzE=","avatar_url":"https://avatars2.githubusercontent.com/u/3638331?v=4","gravatar_id":"","url":"https://api.github.com/users/dedis","html_url":"https://github.com/dedis","followers_url":"https://api.github.com/users/dedis/followers","following_url":"https://api.github.com/users/dedis/following{/other_user}","gists_url":"https://api.github.com/users/dedis/gists{/gist_id}","starred_url":"https://api.github.com/users/dedis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dedis/subscriptions","organizations_url":"https://api.github.com/users/dedis/orgs","repos_url":"https://api.github.com/users/dedis/repos","events_url":"https://api.github.com/users/dedis/events{/privacy}","received_events_url":"https://api.github.com/users/dedis/received_events","type":"Organization","site_admin":false},"repo":{"id":41791684,"node_id":"MDEwOlJlcG9zaXRvcnk0MTc5MTY4NA==","name":"cothority","full_name":"dedis/cothority","private":false,"owner":{"login":"dedis","id":3638331,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2MzgzMzE=","avatar_url":"https://avatars2.githubusercontent.com/u/3638331?v=4","gravatar_id":"","url":"https://api.github.com/users/dedis","html_url":"https://github.com/dedis","followers_url":"https://api.github.com/users/dedis/followers","following_url":"https://api.github.com/users/dedis/following{/other_user}","gists_url":"https://api.github.com/users/dedis/gists{/gist_id}","starred_url":"https://api.github.com/users/dedis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dedis/subscriptions","organizations_url":"https://api.github.com/users/dedis/orgs","repos_url":"https://api.github.com/users/dedis/repos","events_url":"https://api.github.com/users/dedis/events{/privacy}","received_events_url":"https://api.github.com/users/dedis/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/dedis/cothority","description":"Scalable collective authority","fork":false,"url":"https://api.github.com/repos/dedis/cothority","forks_url":"https://api.github.com/repos/dedis/cothority/forks","keys_url":"https://api.github.com/repos/dedis/cothority/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dedis/cothority/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dedis/cothority/teams","hooks_url":"https://api.github.com/repos/dedis/cothority/hooks","issue_events_url":"https://api.github.com/repos/dedis/cothority/issues/events{/number}","events_url":"https://api.github.com/repos/dedis/cothority/events","assignees_url":"https://api.github.com/repos/dedis/cothority/assignees{/user}","branches_url":"https://api.github.com/repos/dedis/cothority/branches{/branch}","tags_url":"https://api.github.com/repos/dedis/cothority/tags","blobs_url":"https://api.github.com/repos/dedis/cothority/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dedis/cothority/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dedis/cothority/git/refs{/sha}","trees_url":"https://api.github.com/repos/dedis/cothority/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dedis/cothority/statuses/{sha}","languages_url":"https://api.github.com/repos/dedis/cothority/languages","stargazers_url":"https://api.github.com/repos/dedis/cothority/stargazers","contributors_url":"https://api.github.com/repos/dedis/cothority/contributors","subscribers_url":"https://api.github.com/repos/dedis/cothority/subscribers","subscription_url":"https://api.github.com/repos/dedis/cothority/subscription","commits_url":"https://api.github.com/repos/dedis/cothority/commits{/sha}","git_commits_url":"https://api.github.com/repos/dedis/cothority/git/commits{/sha}","comments_url":"https://api.github.com/repos/dedis/cothority/comments{/number}","issue_comment_url":"https://api.github.com/repos/dedis/cothority/issues/comments{/number}","contents_url":"https://api.github.com/repos/dedis/cothority/contents/{+path}","compare_url":"https://api.github.com/repos/dedis/cothority/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dedis/cothority/merges","archive_url":"https://api.github.com/repos/dedis/cothority/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dedis/cothority/downloads","issues_url":"https://api.github.com/repos/dedis/cothority/issues{/number}","pulls_url":"https://api.github.com/repos/dedis/cothority/pulls{/number}","milestones_url":"https://api.github.com/repos/dedis/cothority/milestones{/number}","notifications_url":"https://api.github.com/repos/dedis/cothority/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dedis/cothority/labels{/name}","releases_url":"https://api.github.com/repos/dedis/cothority/releases{/id}","deployments_url":"https://api.github.com/repos/dedis/cothority/deployments","created_at":"2015-09-02T09:13:57Z","updated_at":"2018-11-20T14:01:41Z","pushed_at":"2018-11-20T14:01:38Z","git_url":"git://github.com/dedis/cothority.git","ssh_url":"git@github.com:dedis/cothority.git","clone_url":"https://github.com/dedis/cothority.git","svn_url":"https://github.com/dedis/cothority","homepage":"","size":85189,"stargazers_count":267,"watchers_count":267,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":65,"mirror_url":null,"archived":false,"open_issues_count":100,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":65,"open_issues":100,"watchers":267,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dedis/cothority/pulls/1580"},"html":{"href":"https://github.com/dedis/cothority/pull/1580"},"issue":{"href":"https://api.github.com/repos/dedis/cothority/issues/1580"},"comments":{"href":"https://api.github.com/repos/dedis/cothority/issues/1580/comments"},"review_comments":{"href":"https://api.github.com/repos/dedis/cothority/pulls/1580/comments"},"review_comment":{"href":"https://api.github.com/repos/dedis/cothority/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dedis/cothority/pulls/1580/commits"},"statuses":{"href":"https://api.github.com/repos/dedis/cothority/statuses/4b859d431181348362cb75f1baeb89d12e5cb721"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Gilthoniel"}}