{"action":"created","comment":{"url":"https://api.github.com/repos/paritytech/substrate/pulls/comments/219508789","pull_request_review_id":157705152,"id":219508789,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxOTUwODc4OQ==","diff_hunk":"@@ -0,0 +1,157 @@\n+// Copyright 2018 Parity Technologies (UK) Ltd.\n+// This file is part of Substrate.\n+\n+// Substrate is free software: you can redistribute it and/or modify\n+// it under the terms of the GNU General Public License as published by\n+// the Free Software Foundation, either version 3 of the License, or\n+// (at your option) any later version.\n+\n+// Substrate is distributed in the hope that it will be useful,\n+// but WITHOUT ANY WARRANTY; without even the implied warranty of\n+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+// GNU General Public License for more details.\n+\n+// You should have received a copy of the GNU General Public License\n+// along with Substrate.  If not, see <http://www.gnu.org/licenses/>.\n+\n+use std::{\n+\tcollections::{HashMap, HashSet},\n+\thash,\n+};\n+\n+use sr_primitives::transaction_validity::{\n+\tTransactionTag as Tag,\n+};\n+\n+use pool::Transaction;\n+\n+#[derive(Debug)]\n+pub struct WaitingTransaction<Hash> {\n+\tpub transaction: Transaction<Hash>,\n+\tpub missing_tags: HashSet<Tag>,\n+}\n+\n+impl<Hash> WaitingTransaction<Hash> {\n+\tpub fn new(transaction: Transaction<Hash>, provided: &HashMap<Tag, Hash>) -> Self {\n+\t\tlet missing_tags = transaction.requires\n+\t\t\t.iter()\n+\t\t\t.filter(|tag| !provided.contains_key(&**tag))\n+\t\t\t.cloned()\n+\t\t\t.collect();\n+\n+\t\tWaitingTransaction {\n+\t\t\ttransaction,\n+\t\t\tmissing_tags,\n+\t\t}\n+\t}\n+\n+\tpub fn satisfy_tag(&mut self, tag: &Tag) {\n+\t\tself.missing_tags.remove(tag);\n+\t}\n+\n+\tpub fn is_ready(&self) -> bool {\n+\t\tself.missing_tags.is_empty()\n+\t}\n+}\n+\n+#[derive(Debug)]\n+pub struct FutureTransactions<Hash: hash::Hash + Eq> {","path":"core/transaction-graph/src/future.rs","position":58,"original_position":58,"commit_id":"e9d3553b0cc7b1816193fce9e3bd75c60db89a4a","original_commit_id":"e9d3553b0cc7b1816193fce9e3bd75c60db89a4a","user":{"login":"gavofyork","id":138296,"node_id":"MDQ6VXNlcjEzODI5Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/138296?v=4","gravatar_id":"","url":"https://api.github.com/users/gavofyork","html_url":"https://github.com/gavofyork","followers_url":"https://api.github.com/users/gavofyork/followers","following_url":"https://api.github.com/users/gavofyork/following{/other_user}","gists_url":"https://api.github.com/users/gavofyork/gists{/gist_id}","starred_url":"https://api.github.com/users/gavofyork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gavofyork/subscriptions","organizations_url":"https://api.github.com/users/gavofyork/orgs","repos_url":"https://api.github.com/users/gavofyork/repos","events_url":"https://api.github.com/users/gavofyork/events{/privacy}","received_events_url":"https://api.github.com/users/gavofyork/received_events","type":"User","site_admin":false},"body":"docs","created_at":"2018-09-21T14:03:55Z","updated_at":"2018-09-21T14:03:55Z","html_url":"https://github.com/paritytech/substrate/pull/787#discussion_r219508789","pull_request_url":"https://api.github.com/repos/paritytech/substrate/pulls/787","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/paritytech/substrate/pulls/comments/219508789"},"html":{"href":"https://github.com/paritytech/substrate/pull/787#discussion_r219508789"},"pull_request":{"href":"https://api.github.com/repos/paritytech/substrate/pulls/787"}}},"pull_request":{"url":"https://api.github.com/repos/paritytech/substrate/pulls/787","id":217292887,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE3MjkyODg3","html_url":"https://github.com/paritytech/substrate/pull/787","diff_url":"https://github.com/paritytech/substrate/pull/787.diff","patch_url":"https://github.com/paritytech/substrate/pull/787.patch","issue_url":"https://api.github.com/repos/paritytech/substrate/issues/787","number":787,"state":"open","locked":false,"title":"Transactions dependency graph","user":{"login":"tomusdrw","id":581548,"node_id":"MDQ6VXNlcjU4MTU0OA==","avatar_url":"https://avatars1.githubusercontent.com/u/581548?v=4","gravatar_id":"","url":"https://api.github.com/users/tomusdrw","html_url":"https://github.com/tomusdrw","followers_url":"https://api.github.com/users/tomusdrw/followers","following_url":"https://api.github.com/users/tomusdrw/following{/other_user}","gists_url":"https://api.github.com/users/tomusdrw/gists{/gist_id}","starred_url":"https://api.github.com/users/tomusdrw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomusdrw/subscriptions","organizations_url":"https://api.github.com/users/tomusdrw/orgs","repos_url":"https://api.github.com/users/tomusdrw/repos","events_url":"https://api.github.com/users/tomusdrw/events{/privacy}","received_events_url":"https://api.github.com/users/tomusdrw/received_events","type":"User","site_admin":false},"body":"A pool of transactions based only on dependencies between them and priorities.\r\nFirst part of #728 \r\n\r\nPR introduces new crate, that is not yet connected to the rest of the code. The idea is that new transactions can be imported to the pool after we call `validate_transaction` in runtime and get `TransactionValidity` (introduced in #741 )\r\nEvery time a block is imported we are going to call `prune_tags` providing all tags that has been satisfied by transactions in that block. The method should work correctly even if we didn't know about some of the transactions, or we didn't receive `prune_tags` for some earlier blocks.\r\n\r\nStuff that's still left:\r\n- [ ] Replacing existing pool\r\n- [ ] Longevity handling (remove obsolete transactions periodically)\r\n- [ ] Banning / Future-rotation (once rejected (as invalid) should not be accepted for some time)\r\n- [ ] Multi-threading (getting ready transactions should not block the pool)","created_at":"2018-09-21T13:57:37Z","updated_at":"2018-09-21T14:03:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fce55fa7b4120e6abd64d029e02412fe76159b05","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":746560607,"node_id":"MDU6TGFiZWw3NDY1NjA2MDc=","url":"https://api.github.com/repos/paritytech/substrate/labels/A0-pleasereview","name":"A0-pleasereview","color":"666666","default":false},{"id":746560668,"node_id":"MDU6TGFiZWw3NDY1NjA2Njg=","url":"https://api.github.com/repos/paritytech/substrate/labels/M4-core","name":"M4-core","color":"F5FCE6","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/paritytech/substrate/pulls/787/commits","review_comments_url":"https://api.github.com/repos/paritytech/substrate/pulls/787/comments","review_comment_url":"https://api.github.com/repos/paritytech/substrate/pulls/comments{/number}","comments_url":"https://api.github.com/repos/paritytech/substrate/issues/787/comments","statuses_url":"https://api.github.com/repos/paritytech/substrate/statuses/e9d3553b0cc7b1816193fce9e3bd75c60db89a4a","head":{"label":"paritytech:td-graph","ref":"td-graph","sha":"e9d3553b0cc7b1816193fce9e3bd75c60db89a4a","user":{"login":"paritytech","id":14176906,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTc2OTA2","avatar_url":"https://avatars2.githubusercontent.com/u/14176906?v=4","gravatar_id":"","url":"https://api.github.com/users/paritytech","html_url":"https://github.com/paritytech","followers_url":"https://api.github.com/users/paritytech/followers","following_url":"https://api.github.com/users/paritytech/following{/other_user}","gists_url":"https://api.github.com/users/paritytech/gists{/gist_id}","starred_url":"https://api.github.com/users/paritytech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paritytech/subscriptions","organizations_url":"https://api.github.com/users/paritytech/orgs","repos_url":"https://api.github.com/users/paritytech/repos","events_url":"https://api.github.com/users/paritytech/events{/privacy}","received_events_url":"https://api.github.com/users/paritytech/received_events","type":"Organization","site_admin":false},"repo":{"id":109872620,"node_id":"MDEwOlJlcG9zaXRvcnkxMDk4NzI2MjA=","name":"substrate","full_name":"paritytech/substrate","private":false,"owner":{"login":"paritytech","id":14176906,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTc2OTA2","avatar_url":"https://avatars2.githubusercontent.com/u/14176906?v=4","gravatar_id":"","url":"https://api.github.com/users/paritytech","html_url":"https://github.com/paritytech","followers_url":"https://api.github.com/users/paritytech/followers","following_url":"https://api.github.com/users/paritytech/following{/other_user}","gists_url":"https://api.github.com/users/paritytech/gists{/gist_id}","starred_url":"https://api.github.com/users/paritytech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paritytech/subscriptions","organizations_url":"https://api.github.com/users/paritytech/orgs","repos_url":"https://api.github.com/users/paritytech/repos","events_url":"https://api.github.com/users/paritytech/events{/privacy}","received_events_url":"https://api.github.com/users/paritytech/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/paritytech/substrate","description":"Substrate: The platform for blockchain innovators","fork":false,"url":"https://api.github.com/repos/paritytech/substrate","forks_url":"https://api.github.com/repos/paritytech/substrate/forks","keys_url":"https://api.github.com/repos/paritytech/substrate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paritytech/substrate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paritytech/substrate/teams","hooks_url":"https://api.github.com/repos/paritytech/substrate/hooks","issue_events_url":"https://api.github.com/repos/paritytech/substrate/issues/events{/number}","events_url":"https://api.github.com/repos/paritytech/substrate/events","assignees_url":"https://api.github.com/repos/paritytech/substrate/assignees{/user}","branches_url":"https://api.github.com/repos/paritytech/substrate/branches{/branch}","tags_url":"https://api.github.com/repos/paritytech/substrate/tags","blobs_url":"https://api.github.com/repos/paritytech/substrate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paritytech/substrate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paritytech/substrate/git/refs{/sha}","trees_url":"https://api.github.com/repos/paritytech/substrate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paritytech/substrate/statuses/{sha}","languages_url":"https://api.github.com/repos/paritytech/substrate/languages","stargazers_url":"https://api.github.com/repos/paritytech/substrate/stargazers","contributors_url":"https://api.github.com/repos/paritytech/substrate/contributors","subscribers_url":"https://api.github.com/repos/paritytech/substrate/subscribers","subscription_url":"https://api.github.com/repos/paritytech/substrate/subscription","commits_url":"https://api.github.com/repos/paritytech/substrate/commits{/sha}","git_commits_url":"https://api.github.com/repos/paritytech/substrate/git/commits{/sha}","comments_url":"https://api.github.com/repos/paritytech/substrate/comments{/number}","issue_comment_url":"https://api.github.com/repos/paritytech/substrate/issues/comments{/number}","contents_url":"https://api.github.com/repos/paritytech/substrate/contents/{+path}","compare_url":"https://api.github.com/repos/paritytech/substrate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paritytech/substrate/merges","archive_url":"https://api.github.com/repos/paritytech/substrate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paritytech/substrate/downloads","issues_url":"https://api.github.com/repos/paritytech/substrate/issues{/number}","pulls_url":"https://api.github.com/repos/paritytech/substrate/pulls{/number}","milestones_url":"https://api.github.com/repos/paritytech/substrate/milestones{/number}","notifications_url":"https://api.github.com/repos/paritytech/substrate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paritytech/substrate/labels{/name}","releases_url":"https://api.github.com/repos/paritytech/substrate/releases{/id}","deployments_url":"https://api.github.com/repos/paritytech/substrate/deployments","created_at":"2017-11-07T18:08:53Z","updated_at":"2018-09-21T13:56:25Z","pushed_at":"2018-09-21T13:57:37Z","git_url":"git://github.com/paritytech/substrate.git","ssh_url":"git@github.com:paritytech/substrate.git","clone_url":"https://github.com/paritytech/substrate.git","svn_url":"https://github.com/paritytech/substrate","homepage":"","size":43082,"stargazers_count":388,"watchers_count":388,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":83,"mirror_url":null,"archived":false,"open_issues_count":68,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":83,"open_issues":68,"watchers":388,"default_branch":"master"}},"base":{"label":"paritytech:master","ref":"master","sha":"3cb5d8896d9898b3acafeb0fdbdc225996d2d961","user":{"login":"paritytech","id":14176906,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTc2OTA2","avatar_url":"https://avatars2.githubusercontent.com/u/14176906?v=4","gravatar_id":"","url":"https://api.github.com/users/paritytech","html_url":"https://github.com/paritytech","followers_url":"https://api.github.com/users/paritytech/followers","following_url":"https://api.github.com/users/paritytech/following{/other_user}","gists_url":"https://api.github.com/users/paritytech/gists{/gist_id}","starred_url":"https://api.github.com/users/paritytech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paritytech/subscriptions","organizations_url":"https://api.github.com/users/paritytech/orgs","repos_url":"https://api.github.com/users/paritytech/repos","events_url":"https://api.github.com/users/paritytech/events{/privacy}","received_events_url":"https://api.github.com/users/paritytech/received_events","type":"Organization","site_admin":false},"repo":{"id":109872620,"node_id":"MDEwOlJlcG9zaXRvcnkxMDk4NzI2MjA=","name":"substrate","full_name":"paritytech/substrate","private":false,"owner":{"login":"paritytech","id":14176906,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTc2OTA2","avatar_url":"https://avatars2.githubusercontent.com/u/14176906?v=4","gravatar_id":"","url":"https://api.github.com/users/paritytech","html_url":"https://github.com/paritytech","followers_url":"https://api.github.com/users/paritytech/followers","following_url":"https://api.github.com/users/paritytech/following{/other_user}","gists_url":"https://api.github.com/users/paritytech/gists{/gist_id}","starred_url":"https://api.github.com/users/paritytech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paritytech/subscriptions","organizations_url":"https://api.github.com/users/paritytech/orgs","repos_url":"https://api.github.com/users/paritytech/repos","events_url":"https://api.github.com/users/paritytech/events{/privacy}","received_events_url":"https://api.github.com/users/paritytech/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/paritytech/substrate","description":"Substrate: The platform for blockchain innovators","fork":false,"url":"https://api.github.com/repos/paritytech/substrate","forks_url":"https://api.github.com/repos/paritytech/substrate/forks","keys_url":"https://api.github.com/repos/paritytech/substrate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paritytech/substrate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paritytech/substrate/teams","hooks_url":"https://api.github.com/repos/paritytech/substrate/hooks","issue_events_url":"https://api.github.com/repos/paritytech/substrate/issues/events{/number}","events_url":"https://api.github.com/repos/paritytech/substrate/events","assignees_url":"https://api.github.com/repos/paritytech/substrate/assignees{/user}","branches_url":"https://api.github.com/repos/paritytech/substrate/branches{/branch}","tags_url":"https://api.github.com/repos/paritytech/substrate/tags","blobs_url":"https://api.github.com/repos/paritytech/substrate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paritytech/substrate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paritytech/substrate/git/refs{/sha}","trees_url":"https://api.github.com/repos/paritytech/substrate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paritytech/substrate/statuses/{sha}","languages_url":"https://api.github.com/repos/paritytech/substrate/languages","stargazers_url":"https://api.github.com/repos/paritytech/substrate/stargazers","contributors_url":"https://api.github.com/repos/paritytech/substrate/contributors","subscribers_url":"https://api.github.com/repos/paritytech/substrate/subscribers","subscription_url":"https://api.github.com/repos/paritytech/substrate/subscription","commits_url":"https://api.github.com/repos/paritytech/substrate/commits{/sha}","git_commits_url":"https://api.github.com/repos/paritytech/substrate/git/commits{/sha}","comments_url":"https://api.github.com/repos/paritytech/substrate/comments{/number}","issue_comment_url":"https://api.github.com/repos/paritytech/substrate/issues/comments{/number}","contents_url":"https://api.github.com/repos/paritytech/substrate/contents/{+path}","compare_url":"https://api.github.com/repos/paritytech/substrate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paritytech/substrate/merges","archive_url":"https://api.github.com/repos/paritytech/substrate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paritytech/substrate/downloads","issues_url":"https://api.github.com/repos/paritytech/substrate/issues{/number}","pulls_url":"https://api.github.com/repos/paritytech/substrate/pulls{/number}","milestones_url":"https://api.github.com/repos/paritytech/substrate/milestones{/number}","notifications_url":"https://api.github.com/repos/paritytech/substrate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paritytech/substrate/labels{/name}","releases_url":"https://api.github.com/repos/paritytech/substrate/releases{/id}","deployments_url":"https://api.github.com/repos/paritytech/substrate/deployments","created_at":"2017-11-07T18:08:53Z","updated_at":"2018-09-21T13:56:25Z","pushed_at":"2018-09-21T13:57:37Z","git_url":"git://github.com/paritytech/substrate.git","ssh_url":"git@github.com:paritytech/substrate.git","clone_url":"https://github.com/paritytech/substrate.git","svn_url":"https://github.com/paritytech/substrate","homepage":"","size":43082,"stargazers_count":388,"watchers_count":388,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":83,"mirror_url":null,"archived":false,"open_issues_count":68,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":83,"open_issues":68,"watchers":388,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/paritytech/substrate/pulls/787"},"html":{"href":"https://github.com/paritytech/substrate/pull/787"},"issue":{"href":"https://api.github.com/repos/paritytech/substrate/issues/787"},"comments":{"href":"https://api.github.com/repos/paritytech/substrate/issues/787/comments"},"review_comments":{"href":"https://api.github.com/repos/paritytech/substrate/pulls/787/comments"},"review_comment":{"href":"https://api.github.com/repos/paritytech/substrate/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/paritytech/substrate/pulls/787/commits"},"statuses":{"href":"https://api.github.com/repos/paritytech/substrate/statuses/e9d3553b0cc7b1816193fce9e3bd75c60db89a4a"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"gavofyork"}}