{"action":"created","comment":{"url":"https://api.github.com/repos/nearprotocol/nearcore/pulls/comments/237976828","pull_request_review_id":180406226,"id":237976828,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNzk3NjgyOA==","diff_hunk":"@@ -0,0 +1,111 @@\n+\\documentclass{article}\n+\\usepackage[landscape]{geometry}\n+\\usepackage[utf8]{inputenc}\n+\\usepackage{amsmath}\n+\\usepackage{amssymb}\n+\n+\\title{TxFlow Functional Form}\n+\\author{NearProtocol}\n+\\date{Last Updated November 27, 2018}\n+\n+\\begin{document}\n+\n+\\maketitle\n+\n+TxFlow algorithm is all about building a DAG of messages and recognizing when a certain message has some special properties. The properties of each message depend exclusively on its sub-DAG. We constantly iterate on the improvements of the algorithm in several languages that use different algorithmic approaches, e.g. Rust implementation tries to avoid DAG traversals by precomputing the needed information in each message, while Javascript aims for the simplicity of the implementation. While we do these iterations it easy to lose track of the actual algorithm in the implementation details. This notebook lists the predicates that formally define the properties of the messages and serves as the \\textbf{source of truth} for TxFlow.\n+\n+\\section*{Basic notation}\n+We say that message $c$ directly approves $p$ if $p$ contains the hash of $c$. We say that $c$ approves $p$, denoted as $p\\leftarrow c$ if there is $p'$ such that $c$ directly approves $p'$ and $p'$ approves $p$, i.e. it is a transitive closure. We also allow it to be reflexive so $c\\leftarrow c$ is always true.\n+\n+The domain of the message $c$ is all messages that it approves:\n+\\[\n+\\begin{aligned}\n+\\overline{D}(c) \\buildrel\\triangle\\over = \\{p|p\\leftarrow c\\} \\\\\n+D(c) \\buildrel\\triangle\\over = \\overline{D}(c)\\setminus\\{c\\}\n+\\end{aligned}\n+\\]\n+\n+When it matters we annotate the message with the witness that created it and its epoch:\n+\n+\\[m_w^e \\text{ -- message with epoch $e$, created by $w$;} \\]\n+\\[L(e) \\text{ -- a witness of epoch $e$;} \\]","path":"core/txflow/spec/main.tex","position":31,"original_position":31,"commit_id":"4c117f8722917add45a36017186ad1186ff5c68d","original_commit_id":"4c117f8722917add45a36017186ad1186ff5c68d","user":{"login":"mikhailOK","id":6912859,"node_id":"MDQ6VXNlcjY5MTI4NTk=","avatar_url":"https://avatars1.githubusercontent.com/u/6912859?v=4","gravatar_id":"","url":"https://api.github.com/users/mikhailOK","html_url":"https://github.com/mikhailOK","followers_url":"https://api.github.com/users/mikhailOK/followers","following_url":"https://api.github.com/users/mikhailOK/following{/other_user}","gists_url":"https://api.github.com/users/mikhailOK/gists{/gist_id}","starred_url":"https://api.github.com/users/mikhailOK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikhailOK/subscriptions","organizations_url":"https://api.github.com/users/mikhailOK/orgs","repos_url":"https://api.github.com/users/mikhailOK/repos","events_url":"https://api.github.com/users/mikhailOK/events{/privacy}","received_events_url":"https://api.github.com/users/mikhailOK/received_events","type":"User","site_admin":false},"body":"```suggestion\r\n\\[L(e) \\text{ -- the leader of epoch $e$;} \\]\r\n```","created_at":"2018-11-30T19:31:43Z","updated_at":"2018-11-30T19:36:00Z","html_url":"https://github.com/nearprotocol/nearcore/pull/111#discussion_r237976828","pull_request_url":"https://api.github.com/repos/nearprotocol/nearcore/pulls/111","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/nearprotocol/nearcore/pulls/comments/237976828"},"html":{"href":"https://github.com/nearprotocol/nearcore/pull/111#discussion_r237976828"},"pull_request":{"href":"https://api.github.com/repos/nearprotocol/nearcore/pulls/111"}}},"pull_request":{"url":"https://api.github.com/repos/nearprotocol/nearcore/pulls/111","id":234844351,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM0ODQ0MzUx","html_url":"https://github.com/nearprotocol/nearcore/pull/111","diff_url":"https://github.com/nearprotocol/nearcore/pull/111.diff","patch_url":"https://github.com/nearprotocol/nearcore/pull/111.patch","issue_url":"https://api.github.com/repos/nearprotocol/nearcore/issues/111","number":111,"state":"open","locked":false,"title":"Fixed TxFlowTask and added the fake network to test it","user":{"login":"nearmax","id":35039879,"node_id":"MDQ6VXNlcjM1MDM5ODc5","avatar_url":"https://avatars2.githubusercontent.com/u/35039879?v=4","gravatar_id":"","url":"https://api.github.com/users/nearmax","html_url":"https://github.com/nearmax","followers_url":"https://api.github.com/users/nearmax/followers","following_url":"https://api.github.com/users/nearmax/following{/other_user}","gists_url":"https://api.github.com/users/nearmax/gists{/gist_id}","starred_url":"https://api.github.com/users/nearmax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nearmax/subscriptions","organizations_url":"https://api.github.com/users/nearmax/orgs","repos_url":"https://api.github.com/users/nearmax/repos","events_url":"https://api.github.com/users/nearmax/events{/privacy}","received_events_url":"https://api.github.com/users/nearmax/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-11-30T01:38:50Z","updated_at":"2018-11-30T19:35:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c3b2cdfb6dd8217a03ee47a53f012df4b4b3467d","assignee":null,"assignees":[],"requested_reviewers":[{"login":"mfornet","id":28708963,"node_id":"MDQ6VXNlcjI4NzA4OTYz","avatar_url":"https://avatars0.githubusercontent.com/u/28708963?v=4","gravatar_id":"","url":"https://api.github.com/users/mfornet","html_url":"https://github.com/mfornet","followers_url":"https://api.github.com/users/mfornet/followers","following_url":"https://api.github.com/users/mfornet/following{/other_user}","gists_url":"https://api.github.com/users/mfornet/gists{/gist_id}","starred_url":"https://api.github.com/users/mfornet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfornet/subscriptions","organizations_url":"https://api.github.com/users/mfornet/orgs","repos_url":"https://api.github.com/users/mfornet/repos","events_url":"https://api.github.com/users/mfornet/events{/privacy}","received_events_url":"https://api.github.com/users/mfornet/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/nearprotocol/nearcore/pulls/111/commits","review_comments_url":"https://api.github.com/repos/nearprotocol/nearcore/pulls/111/comments","review_comment_url":"https://api.github.com/repos/nearprotocol/nearcore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nearprotocol/nearcore/issues/111/comments","statuses_url":"https://api.github.com/repos/nearprotocol/nearcore/statuses/4c117f8722917add45a36017186ad1186ff5c68d","head":{"label":"nearprotocol:txflow_async_tests","ref":"txflow_async_tests","sha":"4c117f8722917add45a36017186ad1186ff5c68d","user":{"login":"nearprotocol","id":42587064,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQyNTg3MDY0","avatar_url":"https://avatars2.githubusercontent.com/u/42587064?v=4","gravatar_id":"","url":"https://api.github.com/users/nearprotocol","html_url":"https://github.com/nearprotocol","followers_url":"https://api.github.com/users/nearprotocol/followers","following_url":"https://api.github.com/users/nearprotocol/following{/other_user}","gists_url":"https://api.github.com/users/nearprotocol/gists{/gist_id}","starred_url":"https://api.github.com/users/nearprotocol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nearprotocol/subscriptions","organizations_url":"https://api.github.com/users/nearprotocol/orgs","repos_url":"https://api.github.com/users/nearprotocol/repos","events_url":"https://api.github.com/users/nearprotocol/events{/privacy}","received_events_url":"https://api.github.com/users/nearprotocol/received_events","type":"Organization","site_admin":false},"repo":{"id":151331938,"node_id":"MDEwOlJlcG9zaXRvcnkxNTEzMzE5Mzg=","name":"nearcore","full_name":"nearprotocol/nearcore","private":false,"owner":{"login":"nearprotocol","id":42587064,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQyNTg3MDY0","avatar_url":"https://avatars2.githubusercontent.com/u/42587064?v=4","gravatar_id":"","url":"https://api.github.com/users/nearprotocol","html_url":"https://github.com/nearprotocol","followers_url":"https://api.github.com/users/nearprotocol/followers","following_url":"https://api.github.com/users/nearprotocol/following{/other_user}","gists_url":"https://api.github.com/users/nearprotocol/gists{/gist_id}","starred_url":"https://api.github.com/users/nearprotocol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nearprotocol/subscriptions","organizations_url":"https://api.github.com/users/nearprotocol/orgs","repos_url":"https://api.github.com/users/nearprotocol/repos","events_url":"https://api.github.com/users/nearprotocol/events{/privacy}","received_events_url":"https://api.github.com/users/nearprotocol/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/nearprotocol/nearcore","description":"Official NEAR Protocol client.","fork":false,"url":"https://api.github.com/repos/nearprotocol/nearcore","forks_url":"https://api.github.com/repos/nearprotocol/nearcore/forks","keys_url":"https://api.github.com/repos/nearprotocol/nearcore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nearprotocol/nearcore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nearprotocol/nearcore/teams","hooks_url":"https://api.github.com/repos/nearprotocol/nearcore/hooks","issue_events_url":"https://api.github.com/repos/nearprotocol/nearcore/issues/events{/number}","events_url":"https://api.github.com/repos/nearprotocol/nearcore/events","assignees_url":"https://api.github.com/repos/nearprotocol/nearcore/assignees{/user}","branches_url":"https://api.github.com/repos/nearprotocol/nearcore/branches{/branch}","tags_url":"https://api.github.com/repos/nearprotocol/nearcore/tags","blobs_url":"https://api.github.com/repos/nearprotocol/nearcore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nearprotocol/nearcore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nearprotocol/nearcore/git/refs{/sha}","trees_url":"https://api.github.com/repos/nearprotocol/nearcore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nearprotocol/nearcore/statuses/{sha}","languages_url":"https://api.github.com/repos/nearprotocol/nearcore/languages","stargazers_url":"https://api.github.com/repos/nearprotocol/nearcore/stargazers","contributors_url":"https://api.github.com/repos/nearprotocol/nearcore/contributors","subscribers_url":"https://api.github.com/repos/nearprotocol/nearcore/subscribers","subscription_url":"https://api.github.com/repos/nearprotocol/nearcore/subscription","commits_url":"https://api.github.com/repos/nearprotocol/nearcore/commits{/sha}","git_commits_url":"https://api.github.com/repos/nearprotocol/nearcore/git/commits{/sha}","comments_url":"https://api.github.com/repos/nearprotocol/nearcore/comments{/number}","issue_comment_url":"https://api.github.com/repos/nearprotocol/nearcore/issues/comments{/number}","contents_url":"https://api.github.com/repos/nearprotocol/nearcore/contents/{+path}","compare_url":"https://api.github.com/repos/nearprotocol/nearcore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nearprotocol/nearcore/merges","archive_url":"https://api.github.com/repos/nearprotocol/nearcore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nearprotocol/nearcore/downloads","issues_url":"https://api.github.com/repos/nearprotocol/nearcore/issues{/number}","pulls_url":"https://api.github.com/repos/nearprotocol/nearcore/pulls{/number}","milestones_url":"https://api.github.com/repos/nearprotocol/nearcore/milestones{/number}","notifications_url":"https://api.github.com/repos/nearprotocol/nearcore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nearprotocol/nearcore/labels{/name}","releases_url":"https://api.github.com/repos/nearprotocol/nearcore/releases{/id}","deployments_url":"https://api.github.com/repos/nearprotocol/nearcore/deployments","created_at":"2018-10-02T22:30:39Z","updated_at":"2018-11-30T16:26:23Z","pushed_at":"2018-11-30T12:41:48Z","git_url":"git://github.com/nearprotocol/nearcore.git","ssh_url":"git@github.com:nearprotocol/nearcore.git","clone_url":"https://github.com/nearprotocol/nearcore.git","svn_url":"https://github.com/nearprotocol/nearcore","homepage":"http://nearprotocol.com","size":1009,"stargazers_count":44,"watchers_count":44,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":29,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":2,"open_issues":29,"watchers":44,"default_branch":"master"}},"base":{"label":"nearprotocol:master","ref":"master","sha":"d02690688bb7aab0c26af0a2e38073606fff0dc8","user":{"login":"nearprotocol","id":42587064,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQyNTg3MDY0","avatar_url":"https://avatars2.githubusercontent.com/u/42587064?v=4","gravatar_id":"","url":"https://api.github.com/users/nearprotocol","html_url":"https://github.com/nearprotocol","followers_url":"https://api.github.com/users/nearprotocol/followers","following_url":"https://api.github.com/users/nearprotocol/following{/other_user}","gists_url":"https://api.github.com/users/nearprotocol/gists{/gist_id}","starred_url":"https://api.github.com/users/nearprotocol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nearprotocol/subscriptions","organizations_url":"https://api.github.com/users/nearprotocol/orgs","repos_url":"https://api.github.com/users/nearprotocol/repos","events_url":"https://api.github.com/users/nearprotocol/events{/privacy}","received_events_url":"https://api.github.com/users/nearprotocol/received_events","type":"Organization","site_admin":false},"repo":{"id":151331938,"node_id":"MDEwOlJlcG9zaXRvcnkxNTEzMzE5Mzg=","name":"nearcore","full_name":"nearprotocol/nearcore","private":false,"owner":{"login":"nearprotocol","id":42587064,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQyNTg3MDY0","avatar_url":"https://avatars2.githubusercontent.com/u/42587064?v=4","gravatar_id":"","url":"https://api.github.com/users/nearprotocol","html_url":"https://github.com/nearprotocol","followers_url":"https://api.github.com/users/nearprotocol/followers","following_url":"https://api.github.com/users/nearprotocol/following{/other_user}","gists_url":"https://api.github.com/users/nearprotocol/gists{/gist_id}","starred_url":"https://api.github.com/users/nearprotocol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nearprotocol/subscriptions","organizations_url":"https://api.github.com/users/nearprotocol/orgs","repos_url":"https://api.github.com/users/nearprotocol/repos","events_url":"https://api.github.com/users/nearprotocol/events{/privacy}","received_events_url":"https://api.github.com/users/nearprotocol/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/nearprotocol/nearcore","description":"Official NEAR Protocol client.","fork":false,"url":"https://api.github.com/repos/nearprotocol/nearcore","forks_url":"https://api.github.com/repos/nearprotocol/nearcore/forks","keys_url":"https://api.github.com/repos/nearprotocol/nearcore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nearprotocol/nearcore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nearprotocol/nearcore/teams","hooks_url":"https://api.github.com/repos/nearprotocol/nearcore/hooks","issue_events_url":"https://api.github.com/repos/nearprotocol/nearcore/issues/events{/number}","events_url":"https://api.github.com/repos/nearprotocol/nearcore/events","assignees_url":"https://api.github.com/repos/nearprotocol/nearcore/assignees{/user}","branches_url":"https://api.github.com/repos/nearprotocol/nearcore/branches{/branch}","tags_url":"https://api.github.com/repos/nearprotocol/nearcore/tags","blobs_url":"https://api.github.com/repos/nearprotocol/nearcore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nearprotocol/nearcore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nearprotocol/nearcore/git/refs{/sha}","trees_url":"https://api.github.com/repos/nearprotocol/nearcore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nearprotocol/nearcore/statuses/{sha}","languages_url":"https://api.github.com/repos/nearprotocol/nearcore/languages","stargazers_url":"https://api.github.com/repos/nearprotocol/nearcore/stargazers","contributors_url":"https://api.github.com/repos/nearprotocol/nearcore/contributors","subscribers_url":"https://api.github.com/repos/nearprotocol/nearcore/subscribers","subscription_url":"https://api.github.com/repos/nearprotocol/nearcore/subscription","commits_url":"https://api.github.com/repos/nearprotocol/nearcore/commits{/sha}","git_commits_url":"https://api.github.com/repos/nearprotocol/nearcore/git/commits{/sha}","comments_url":"https://api.github.com/repos/nearprotocol/nearcore/comments{/number}","issue_comment_url":"https://api.github.com/repos/nearprotocol/nearcore/issues/comments{/number}","contents_url":"https://api.github.com/repos/nearprotocol/nearcore/contents/{+path}","compare_url":"https://api.github.com/repos/nearprotocol/nearcore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nearprotocol/nearcore/merges","archive_url":"https://api.github.com/repos/nearprotocol/nearcore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nearprotocol/nearcore/downloads","issues_url":"https://api.github.com/repos/nearprotocol/nearcore/issues{/number}","pulls_url":"https://api.github.com/repos/nearprotocol/nearcore/pulls{/number}","milestones_url":"https://api.github.com/repos/nearprotocol/nearcore/milestones{/number}","notifications_url":"https://api.github.com/repos/nearprotocol/nearcore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nearprotocol/nearcore/labels{/name}","releases_url":"https://api.github.com/repos/nearprotocol/nearcore/releases{/id}","deployments_url":"https://api.github.com/repos/nearprotocol/nearcore/deployments","created_at":"2018-10-02T22:30:39Z","updated_at":"2018-11-30T16:26:23Z","pushed_at":"2018-11-30T12:41:48Z","git_url":"git://github.com/nearprotocol/nearcore.git","ssh_url":"git@github.com:nearprotocol/nearcore.git","clone_url":"https://github.com/nearprotocol/nearcore.git","svn_url":"https://github.com/nearprotocol/nearcore","homepage":"http://nearprotocol.com","size":1009,"stargazers_count":44,"watchers_count":44,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":29,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":2,"open_issues":29,"watchers":44,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nearprotocol/nearcore/pulls/111"},"html":{"href":"https://github.com/nearprotocol/nearcore/pull/111"},"issue":{"href":"https://api.github.com/repos/nearprotocol/nearcore/issues/111"},"comments":{"href":"https://api.github.com/repos/nearprotocol/nearcore/issues/111/comments"},"review_comments":{"href":"https://api.github.com/repos/nearprotocol/nearcore/pulls/111/comments"},"review_comment":{"href":"https://api.github.com/repos/nearprotocol/nearcore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nearprotocol/nearcore/pulls/111/commits"},"statuses":{"href":"https://api.github.com/repos/nearprotocol/nearcore/statuses/4c117f8722917add45a36017186ad1186ff5c68d"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"mikhailOK"}}