{"action":"created","comment":{"url":"https://api.github.com/repos/bigchaindb/BEPs/pulls/comments/197051038","pull_request_review_id":130708448,"id":197051038,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NzA1MTAzOA==","diff_hunk":"@@ -0,0 +1,91 @@\n+```\n+shortname: [19/UPSERT-VALIDATORS]\n+name: Dynamically add/update/remove validators at runtime\n+type: standard\n+Status: raw\n+editor: Vanshdeep Singh <vanshdeep@bigchaindb.com>\n+```\n+\n+## Description\n+\n+The current [BEP 3](https://github.com/bigchaindb/BEPs/blob/master/3/README.md) spec for adding new validators requires that the node administrators coordinate when dynamically adding a new validator i.e. all the node operators have to simultaneously execute `upsert-validator` in order to ensure that the validator is added on all the nodes. A lack of coordination can result in a situation wherein only a part of the network updates their validator set which could eventually lead to a network hangup. Furthermore, for a sufficiently large network the coordination itself can become a tedious task.\n+Another major issue with the current implementation is that a new dynamically added validator (`V_i`) cannot be propagated to any new dynamically added validators added after `V_i` i.e. consider the following scenario,\n+\n+\n+- Given a 4 node network wherein the `genesis.json` file contains each of the four nodes `{N1,N2,N3,N4}` a validator.\n+- When a new node `N5` is to be dynamically added, each node executes `upsert-validator` on their respective nodes (including `N5`) and adds `N5`.\n+- When another new node `N6` needs to be added then each of the nodes in the network `{N1,N2,N3,N4,N5}` execute `upsert-validator` to add the new node `N6`.\n+- At this point the node `N6` won't see `N5` as a validator because the `genesis.json` would only contain `{N1,N2,N3,N4}` as validators.\n+- Since `N5` was added dynamically and `upsert-validator` only mutates the local validator set of a given node it implies that in order for the `N6` to see `N5` as a validator it would have to execute `upsert-validator N5_PUB_KEY N5_POWER` on its own node at the exact block height (when syncing with the network) when `N5` was previously added by the network.\n+\n+\n+From the above description it is evident that propagating dynamically added validators is a major hassle with huge possibility of errors.\n+\n+\n+## Technical details\n+\n+To solve the aforementioned issue, following change to the behaviour of `upsert-validator` is being proposed. We use the transaction election process (TEP) proposed in [BEP 18](https://github.com/bigchaindb/BEPs/pull/44) to automate and synchronize the operation on the validator set.\n+\n+Consider a network of 4 nodes `{A,B,C,D}` if now if a node A wishes to add a new node `E` to the network then following steps should be followed,\n+\n+1. Node `A` executes\n+\n+```\n+$ bigchaindb upsert-validator E_PUBKEY E_POWER E_NODE_ID --private-key /home/user/.tendermint/config/priv_validator.json\n+<election_id>\n+```\n+\n+The above command `POST`s a [`VALIDATOR_ELECTION`][spec_validator_election] transaction and returns the `election_id`.\n+\n+NOTE:\n+- The `VALIDATOR_ELECTION` transaction is signed using the private key generated and stored by Node `A`'s' Tendermint in `priv_validator.json`.","path":"19/README.md","position":41,"original_position":41,"commit_id":"ad17dfa31831a28ba733e481a244846171f901c9","original_commit_id":"ad17dfa31831a28ba733e481a244846171f901c9","user":{"login":"vrde","id":134680,"node_id":"MDQ6VXNlcjEzNDY4MA==","avatar_url":"https://avatars1.githubusercontent.com/u/134680?v=4","gravatar_id":"","url":"https://api.github.com/users/vrde","html_url":"https://github.com/vrde","followers_url":"https://api.github.com/users/vrde/followers","following_url":"https://api.github.com/users/vrde/following{/other_user}","gists_url":"https://api.github.com/users/vrde/gists{/gist_id}","starred_url":"https://api.github.com/users/vrde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vrde/subscriptions","organizations_url":"https://api.github.com/users/vrde/orgs","repos_url":"https://api.github.com/users/vrde/repos","events_url":"https://api.github.com/users/vrde/events{/privacy}","received_events_url":"https://api.github.com/users/vrde/received_events","type":"User","site_admin":false},"body":"What about:\r\n> The `VALIDATOR_ELECTION` transaction is signed with the private key of the Validator proposing the election. The private key is generated by Tendermint, and stored in the `priv_validator.json` in the Tendermint home.","created_at":"2018-06-21T08:32:12Z","updated_at":"2018-06-21T08:54:41Z","html_url":"https://github.com/bigchaindb/BEPs/pull/45#discussion_r197051038","pull_request_url":"https://api.github.com/repos/bigchaindb/BEPs/pulls/45","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/bigchaindb/BEPs/pulls/comments/197051038"},"html":{"href":"https://github.com/bigchaindb/BEPs/pull/45#discussion_r197051038"},"pull_request":{"href":"https://api.github.com/repos/bigchaindb/BEPs/pulls/45"}}},"pull_request":{"url":"https://api.github.com/repos/bigchaindb/BEPs/pulls/45","id":189912075,"node_id":"MDExOlB1bGxSZXF1ZXN0MTg5OTEyMDc1","html_url":"https://github.com/bigchaindb/BEPs/pull/45","diff_url":"https://github.com/bigchaindb/BEPs/pull/45.diff","patch_url":"https://github.com/bigchaindb/BEPs/pull/45.patch","issue_url":"https://api.github.com/repos/bigchaindb/BEPs/issues/45","number":45,"state":"open","locked":false,"title":"Problem: Upsert validator approach is error prone (BEP-19)","user":{"login":"kansi","id":4709940,"node_id":"MDQ6VXNlcjQ3MDk5NDA=","avatar_url":"https://avatars2.githubusercontent.com/u/4709940?v=4","gravatar_id":"","url":"https://api.github.com/users/kansi","html_url":"https://github.com/kansi","followers_url":"https://api.github.com/users/kansi/followers","following_url":"https://api.github.com/users/kansi/following{/other_user}","gists_url":"https://api.github.com/users/kansi/gists{/gist_id}","starred_url":"https://api.github.com/users/kansi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kansi/subscriptions","organizations_url":"https://api.github.com/users/kansi/orgs","repos_url":"https://api.github.com/users/kansi/repos","events_url":"https://api.github.com/users/kansi/events{/privacy}","received_events_url":"https://api.github.com/users/kansi/received_events","type":"User","site_admin":false},"body":"Solution: Propose an alternate approach","created_at":"2018-05-23T09:34:21Z","updated_at":"2018-06-21T08:54:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1f5df25d7792f094c7cc6c4aa946bc7703805b76","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/bigchaindb/BEPs/pulls/45/commits","review_comments_url":"https://api.github.com/repos/bigchaindb/BEPs/pulls/45/comments","review_comment_url":"https://api.github.com/repos/bigchaindb/BEPs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bigchaindb/BEPs/issues/45/comments","statuses_url":"https://api.github.com/repos/bigchaindb/BEPs/statuses/ad17dfa31831a28ba733e481a244846171f901c9","head":{"label":"kansi:bep/3/new_version","ref":"bep/3/new_version","sha":"ad17dfa31831a28ba733e481a244846171f901c9","user":{"login":"kansi","id":4709940,"node_id":"MDQ6VXNlcjQ3MDk5NDA=","avatar_url":"https://avatars2.githubusercontent.com/u/4709940?v=4","gravatar_id":"","url":"https://api.github.com/users/kansi","html_url":"https://github.com/kansi","followers_url":"https://api.github.com/users/kansi/followers","following_url":"https://api.github.com/users/kansi/following{/other_user}","gists_url":"https://api.github.com/users/kansi/gists{/gist_id}","starred_url":"https://api.github.com/users/kansi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kansi/subscriptions","organizations_url":"https://api.github.com/users/kansi/orgs","repos_url":"https://api.github.com/users/kansi/repos","events_url":"https://api.github.com/users/kansi/events{/privacy}","received_events_url":"https://api.github.com/users/kansi/received_events","type":"User","site_admin":false},"repo":{"id":124105848,"node_id":"MDEwOlJlcG9zaXRvcnkxMjQxMDU4NDg=","name":"BEPs","full_name":"kansi/BEPs","owner":{"login":"kansi","id":4709940,"node_id":"MDQ6VXNlcjQ3MDk5NDA=","avatar_url":"https://avatars2.githubusercontent.com/u/4709940?v=4","gravatar_id":"","url":"https://api.github.com/users/kansi","html_url":"https://github.com/kansi","followers_url":"https://api.github.com/users/kansi/followers","following_url":"https://api.github.com/users/kansi/following{/other_user}","gists_url":"https://api.github.com/users/kansi/gists{/gist_id}","starred_url":"https://api.github.com/users/kansi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kansi/subscriptions","organizations_url":"https://api.github.com/users/kansi/orgs","repos_url":"https://api.github.com/users/kansi/repos","events_url":"https://api.github.com/users/kansi/events{/privacy}","received_events_url":"https://api.github.com/users/kansi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kansi/BEPs","description":" BigchainDB Enhancement Proposals","fork":true,"url":"https://api.github.com/repos/kansi/BEPs","forks_url":"https://api.github.com/repos/kansi/BEPs/forks","keys_url":"https://api.github.com/repos/kansi/BEPs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kansi/BEPs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kansi/BEPs/teams","hooks_url":"https://api.github.com/repos/kansi/BEPs/hooks","issue_events_url":"https://api.github.com/repos/kansi/BEPs/issues/events{/number}","events_url":"https://api.github.com/repos/kansi/BEPs/events","assignees_url":"https://api.github.com/repos/kansi/BEPs/assignees{/user}","branches_url":"https://api.github.com/repos/kansi/BEPs/branches{/branch}","tags_url":"https://api.github.com/repos/kansi/BEPs/tags","blobs_url":"https://api.github.com/repos/kansi/BEPs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kansi/BEPs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kansi/BEPs/git/refs{/sha}","trees_url":"https://api.github.com/repos/kansi/BEPs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kansi/BEPs/statuses/{sha}","languages_url":"https://api.github.com/repos/kansi/BEPs/languages","stargazers_url":"https://api.github.com/repos/kansi/BEPs/stargazers","contributors_url":"https://api.github.com/repos/kansi/BEPs/contributors","subscribers_url":"https://api.github.com/repos/kansi/BEPs/subscribers","subscription_url":"https://api.github.com/repos/kansi/BEPs/subscription","commits_url":"https://api.github.com/repos/kansi/BEPs/commits{/sha}","git_commits_url":"https://api.github.com/repos/kansi/BEPs/git/commits{/sha}","comments_url":"https://api.github.com/repos/kansi/BEPs/comments{/number}","issue_comment_url":"https://api.github.com/repos/kansi/BEPs/issues/comments{/number}","contents_url":"https://api.github.com/repos/kansi/BEPs/contents/{+path}","compare_url":"https://api.github.com/repos/kansi/BEPs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kansi/BEPs/merges","archive_url":"https://api.github.com/repos/kansi/BEPs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kansi/BEPs/downloads","issues_url":"https://api.github.com/repos/kansi/BEPs/issues{/number}","pulls_url":"https://api.github.com/repos/kansi/BEPs/pulls{/number}","milestones_url":"https://api.github.com/repos/kansi/BEPs/milestones{/number}","notifications_url":"https://api.github.com/repos/kansi/BEPs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kansi/BEPs/labels{/name}","releases_url":"https://api.github.com/repos/kansi/BEPs/releases{/id}","deployments_url":"https://api.github.com/repos/kansi/BEPs/deployments","created_at":"2018-03-06T16:25:23Z","updated_at":"2018-02-28T15:35:03Z","pushed_at":"2018-06-20T11:14:25Z","git_url":"git://github.com/kansi/BEPs.git","ssh_url":"git@github.com:kansi/BEPs.git","clone_url":"https://github.com/kansi/BEPs.git","svn_url":"https://github.com/kansi/BEPs","homepage":"","size":191,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"bigchaindb:master","ref":"master","sha":"4b61a5714636b7c77adc15b65946a169919529f1","user":{"login":"bigchaindb","id":17097586,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3MDk3NTg2","avatar_url":"https://avatars0.githubusercontent.com/u/17097586?v=4","gravatar_id":"","url":"https://api.github.com/users/bigchaindb","html_url":"https://github.com/bigchaindb","followers_url":"https://api.github.com/users/bigchaindb/followers","following_url":"https://api.github.com/users/bigchaindb/following{/other_user}","gists_url":"https://api.github.com/users/bigchaindb/gists{/gist_id}","starred_url":"https://api.github.com/users/bigchaindb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bigchaindb/subscriptions","organizations_url":"https://api.github.com/users/bigchaindb/orgs","repos_url":"https://api.github.com/users/bigchaindb/repos","events_url":"https://api.github.com/users/bigchaindb/events{/privacy}","received_events_url":"https://api.github.com/users/bigchaindb/received_events","type":"Organization","site_admin":false},"repo":{"id":120627608,"node_id":"MDEwOlJlcG9zaXRvcnkxMjA2Mjc2MDg=","name":"BEPs","full_name":"bigchaindb/BEPs","owner":{"login":"bigchaindb","id":17097586,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3MDk3NTg2","avatar_url":"https://avatars0.githubusercontent.com/u/17097586?v=4","gravatar_id":"","url":"https://api.github.com/users/bigchaindb","html_url":"https://github.com/bigchaindb","followers_url":"https://api.github.com/users/bigchaindb/followers","following_url":"https://api.github.com/users/bigchaindb/following{/other_user}","gists_url":"https://api.github.com/users/bigchaindb/gists{/gist_id}","starred_url":"https://api.github.com/users/bigchaindb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bigchaindb/subscriptions","organizations_url":"https://api.github.com/users/bigchaindb/orgs","repos_url":"https://api.github.com/users/bigchaindb/repos","events_url":"https://api.github.com/users/bigchaindb/events{/privacy}","received_events_url":"https://api.github.com/users/bigchaindb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bigchaindb/BEPs","description":" BigchainDB Enhancement Proposals","fork":false,"url":"https://api.github.com/repos/bigchaindb/BEPs","forks_url":"https://api.github.com/repos/bigchaindb/BEPs/forks","keys_url":"https://api.github.com/repos/bigchaindb/BEPs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bigchaindb/BEPs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bigchaindb/BEPs/teams","hooks_url":"https://api.github.com/repos/bigchaindb/BEPs/hooks","issue_events_url":"https://api.github.com/repos/bigchaindb/BEPs/issues/events{/number}","events_url":"https://api.github.com/repos/bigchaindb/BEPs/events","assignees_url":"https://api.github.com/repos/bigchaindb/BEPs/assignees{/user}","branches_url":"https://api.github.com/repos/bigchaindb/BEPs/branches{/branch}","tags_url":"https://api.github.com/repos/bigchaindb/BEPs/tags","blobs_url":"https://api.github.com/repos/bigchaindb/BEPs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bigchaindb/BEPs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bigchaindb/BEPs/git/refs{/sha}","trees_url":"https://api.github.com/repos/bigchaindb/BEPs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bigchaindb/BEPs/statuses/{sha}","languages_url":"https://api.github.com/repos/bigchaindb/BEPs/languages","stargazers_url":"https://api.github.com/repos/bigchaindb/BEPs/stargazers","contributors_url":"https://api.github.com/repos/bigchaindb/BEPs/contributors","subscribers_url":"https://api.github.com/repos/bigchaindb/BEPs/subscribers","subscription_url":"https://api.github.com/repos/bigchaindb/BEPs/subscription","commits_url":"https://api.github.com/repos/bigchaindb/BEPs/commits{/sha}","git_commits_url":"https://api.github.com/repos/bigchaindb/BEPs/git/commits{/sha}","comments_url":"https://api.github.com/repos/bigchaindb/BEPs/comments{/number}","issue_comment_url":"https://api.github.com/repos/bigchaindb/BEPs/issues/comments{/number}","contents_url":"https://api.github.com/repos/bigchaindb/BEPs/contents/{+path}","compare_url":"https://api.github.com/repos/bigchaindb/BEPs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bigchaindb/BEPs/merges","archive_url":"https://api.github.com/repos/bigchaindb/BEPs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bigchaindb/BEPs/downloads","issues_url":"https://api.github.com/repos/bigchaindb/BEPs/issues{/number}","pulls_url":"https://api.github.com/repos/bigchaindb/BEPs/pulls{/number}","milestones_url":"https://api.github.com/repos/bigchaindb/BEPs/milestones{/number}","notifications_url":"https://api.github.com/repos/bigchaindb/BEPs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bigchaindb/BEPs/labels{/name}","releases_url":"https://api.github.com/repos/bigchaindb/BEPs/releases{/id}","deployments_url":"https://api.github.com/repos/bigchaindb/BEPs/deployments","created_at":"2018-02-07T14:45:22Z","updated_at":"2018-06-20T16:01:38Z","pushed_at":"2018-06-20T16:01:35Z","git_url":"git://github.com/bigchaindb/BEPs.git","ssh_url":"git@github.com:bigchaindb/BEPs.git","clone_url":"https://github.com/bigchaindb/BEPs.git","svn_url":"https://github.com/bigchaindb/BEPs","homepage":"","size":737,"stargazers_count":11,"watchers_count":11,"language":"Shell","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":11,"mirror_url":null,"archived":false,"open_issues_count":10,"license":null,"forks":11,"open_issues":10,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bigchaindb/BEPs/pulls/45"},"html":{"href":"https://github.com/bigchaindb/BEPs/pull/45"},"issue":{"href":"https://api.github.com/repos/bigchaindb/BEPs/issues/45"},"comments":{"href":"https://api.github.com/repos/bigchaindb/BEPs/issues/45/comments"},"review_comments":{"href":"https://api.github.com/repos/bigchaindb/BEPs/pulls/45/comments"},"review_comment":{"href":"https://api.github.com/repos/bigchaindb/BEPs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bigchaindb/BEPs/pulls/45/commits"},"statuses":{"href":"https://api.github.com/repos/bigchaindb/BEPs/statuses/ad17dfa31831a28ba733e481a244846171f901c9"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"vrde"}}