{"action":"created","comment":{"url":"https://api.github.com/repos/libp2p/rust-libp2p/pulls/comments/208842957","pull_request_review_id":144734303,"id":208842957,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwODg0Mjk1Nw==","diff_hunk":"@@ -40,193 +40,541 @@\n //! `MuxedTransport` trait.\n \n use fnv::FnvHashMap;\n-use futures::future::{self, Either, FutureResult};\n-use futures::{Async, Future, Poll, Stream};\n+use futures::future::{self, FutureResult};\n use futures::stream::FuturesUnordered;\n-use futures::sync::mpsc;\n+use futures::{stream, task, Async, Future, Poll, Stream};\n use multiaddr::Multiaddr;\n use muxing::StreamMuxer;\n use parking_lot::Mutex;\n-use std::io::{self, Error as IoError};\n-use std::sync::Arc;\n+use std::collections::hash_map::Entry;\n+use std::io::{Error as IoError, ErrorKind as IoErrorKind, Read, Write};\n+use std::ops::{Deref, DerefMut};\n+use std::sync::{atomic::AtomicUsize, atomic::AtomicBool, atomic::Ordering, Arc};\n use tokio_io::{AsyncRead, AsyncWrite};\n use transport::{MuxedTransport, Transport, UpgradedNode};\n use upgrade::ConnectionUpgrade;\n+use std::clone::Clone;\n \n /// Allows reusing the same muxed connection multiple times.\n ///\n /// Can be created from an `UpgradedNode` through the `From` trait.\n ///\n-/// Implements the `Transport` trait.\n+/// Implements the `Transport` trait\n #[derive(Clone)]\n pub struct ConnectionReuse<T, C>\n where\n     T: Transport,\n-    T::Output: AsyncRead + AsyncWrite,\n+    C: ConnectionUpgrade<T::Output, T::MultiaddrFuture> + Clone,\n+    C::Output: StreamMuxer + Clone,\n+{\n+    /// Struct shared between most of the `ConnectionReuse` infrastructure.\n+    manager: Arc<ConnectionsManager<T, C>>,\n+}\n+\n+/// Keeps an internal counter, for every new number issued\n+/// will increase its internal state.\n+#[derive(Default)]\n+struct Counter {\n+    inner: AtomicUsize,\n+}\n+\n+impl Counter {\n+    /// Returns the next counter, increasing the internal state\n+    pub fn next(&self) -> usize {\n+        self.inner.fetch_add(1, Ordering::Relaxed)\n+    }\n+}\n+\n+enum PeerState<M>\n+where\n+    M: StreamMuxer + Clone,\n+{\n+    /// Connection is active and can be used to open substreams.\n+    Active {\n+        /// The muxer to open new substreams.\n+        muxer: M,\n+        /// Id of the listener that created this connection, or `None` if it was opened by a\n+        /// dialer.\n+        listener_id: Option<usize>,\n+        /// whether this connection was closed\n+        closed: Arc<AtomicBool>\n+    },\n+\n+    /// Connection is pending.\n+    // TODO: stronger Future type\n+    Pending {\n+        /// Future that produces the muxer.\n+        future: Box<Future<Item = (M, Multiaddr), Error = IoError>>,\n+        /// All the tasks to notify when `future` resolves.\n+        notify: Vec<(usize, task::Task)>,\n+    },\n+\n+    /// An earlier connection attempt errored.\n+    Errored(IoError),\n+}\n+\n+/// Struct shared between most of the `ConnectionReuse` infrastructure.\n+/// Knows about all connections and their current state, allows one to poll for\n+/// incoming and outbound connections, while managing all state-transitions that\n+/// might occur automatically.\n+// #[derive(Clone)]\n+struct ConnectionsManager<T, C>\n+where\n+    T: Transport,\n     C: ConnectionUpgrade<T::Output, T::MultiaddrFuture>,\n-    C::Output: StreamMuxer,\n+    C::Output: StreamMuxer + Clone,\n {\n-    // Underlying transport and connection upgrade for when we need to dial or listen.\n-    inner: UpgradedNode<T, C>,\n+    /// Underlying transport and connection upgrade, used when we need to dial or listen.\n+    transport: UpgradedNode<T, C>,\n+\n+    /// All the connections that were opened, whether successful and/or active or not.\n+    // TODO: this will grow forever\n+    connections: Mutex<FnvHashMap<Multiaddr, PeerState<C::Output>>>,\n \n-    // Struct shared between most of the `ConnectionReuse` infrastructure.\n-    shared: Arc<Mutex<Shared<C::Output>>>,\n+    /// Tasks to notify when one or more new elements were added to `connections`.\n+    notify_on_new_connec: Mutex<Vec<(usize, task::Task)>>,","path":"core/src/connection_reuse.rs","position":114,"original_position":114,"commit_id":"dc029ed17f8e5b12e360e514416140b5bf453a3d","original_commit_id":"dc029ed17f8e5b12e360e514416140b5bf453a3d","user":{"login":"gnunicorn","id":40496,"node_id":"MDQ6VXNlcjQwNDk2","avatar_url":"https://avatars1.githubusercontent.com/u/40496?v=4","gravatar_id":"","url":"https://api.github.com/users/gnunicorn","html_url":"https://github.com/gnunicorn","followers_url":"https://api.github.com/users/gnunicorn/followers","following_url":"https://api.github.com/users/gnunicorn/following{/other_user}","gists_url":"https://api.github.com/users/gnunicorn/gists{/gist_id}","starred_url":"https://api.github.com/users/gnunicorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnunicorn/subscriptions","organizations_url":"https://api.github.com/users/gnunicorn/orgs","repos_url":"https://api.github.com/users/gnunicorn/repos","events_url":"https://api.github.com/users/gnunicorn/events{/privacy}","received_events_url":"https://api.github.com/users/gnunicorn/received_events","type":"User","site_admin":false},"body":"@twittner oh, yes, what a stupid mistake - I had an iterator in there first and never replaced that `return`. I have to run these tests again.\r\n\r\nwhy are you doing a `v[i] = (id, \"value\");` if you found it though?","created_at":"2018-08-09T08:19:09Z","updated_at":"2018-08-09T08:19:09Z","html_url":"https://github.com/libp2p/rust-libp2p/pull/387#discussion_r208842957","pull_request_url":"https://api.github.com/repos/libp2p/rust-libp2p/pulls/387","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/libp2p/rust-libp2p/pulls/comments/208842957"},"html":{"href":"https://github.com/libp2p/rust-libp2p/pull/387#discussion_r208842957"},"pull_request":{"href":"https://api.github.com/repos/libp2p/rust-libp2p/pulls/387"}},"in_reply_to_id":208497898},"pull_request":{"url":"https://api.github.com/repos/libp2p/rust-libp2p/pulls/387","id":205773649,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1NzczNjQ5","html_url":"https://github.com/libp2p/rust-libp2p/pull/387","diff_url":"https://github.com/libp2p/rust-libp2p/pull/387.diff","patch_url":"https://github.com/libp2p/rust-libp2p/pull/387.patch","issue_url":"https://api.github.com/repos/libp2p/rust-libp2p/issues/387","number":387,"state":"open","locked":false,"title":"Rewrite ConnectionReuse","user":{"login":"gnunicorn","id":40496,"node_id":"MDQ6VXNlcjQwNDk2","avatar_url":"https://avatars1.githubusercontent.com/u/40496?v=4","gravatar_id":"","url":"https://api.github.com/users/gnunicorn","html_url":"https://github.com/gnunicorn","followers_url":"https://api.github.com/users/gnunicorn/followers","following_url":"https://api.github.com/users/gnunicorn/following{/other_user}","gists_url":"https://api.github.com/users/gnunicorn/gists{/gist_id}","starred_url":"https://api.github.com/users/gnunicorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnunicorn/subscriptions","organizations_url":"https://api.github.com/users/gnunicorn/orgs","repos_url":"https://api.github.com/users/gnunicorn/repos","events_url":"https://api.github.com/users/gnunicorn/events{/privacy}","received_events_url":"https://api.github.com/users/gnunicorn/received_events","type":"User","site_admin":false},"body":"based upon #355 but has a centralised `ConnectionManager`, which encapsulates  and manages all state transitions in a few central places and ensures everyone is notified as needed if those occur. Which means:\r\n\r\n - [x] No one outside of it knows about the `PeerState`-Enum whatsoever\r\n - [x] Everyone just references the `Arc` not the `Mutex`, the Managers manages all locking\r\n - [x] Independent locks for `connections` and `counters`\r\n - [x] More specific locks around the `connections` with less code and more explicit transitions, making it easier to reason about the code \r\n - [x] Ensures `Counters` are increased properly (rather than relying on external parties to do that)\r\n - [x] No `Poisoned`-State possible anymore (and removed alltogether)\r\n - [x] Remove `connection_id`-system and consequently all referencing of `ConnectionManager` in Streams, replace with shared `closed`-state to stop streams early\r\n - [x] Add `reset_connection` on `ConnectionReuseSubstream` to allow a substream to state that a connection is to be considered closed (primarily for the `Ping`-protocol) and doesn't continue producing\r\n - [x] which all allowed removing many unnecessary fields of `PeerState`\r\n\r\nFurther more:\r\n  - [x] remove substream-referencing of `ConnectionManager` alltogether, massivley reduxoing\r\n  - [x] [Performance] Replaced `FnvHashMap<usize, task::Task>`, with a faster `Vec<(usize, task::Task)>`\r\n  - [x] [Fix] When an incoming connection replaced a pending state, we didn't inform all listeners, we now close all streams\r\n - [x] [Fix] reliably ensure we aren't keeping around/use old potentially stale connections, fixes a leak and potential DoS-Attack-Window.\r\n\r\n ","created_at":"2018-08-02T15:25:13Z","updated_at":"2018-08-09T08:19:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b3b33846421b29382868f4e5d9b418b348b32224","assignee":{"login":"gnunicorn","id":40496,"node_id":"MDQ6VXNlcjQwNDk2","avatar_url":"https://avatars1.githubusercontent.com/u/40496?v=4","gravatar_id":"","url":"https://api.github.com/users/gnunicorn","html_url":"https://github.com/gnunicorn","followers_url":"https://api.github.com/users/gnunicorn/followers","following_url":"https://api.github.com/users/gnunicorn/following{/other_user}","gists_url":"https://api.github.com/users/gnunicorn/gists{/gist_id}","starred_url":"https://api.github.com/users/gnunicorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnunicorn/subscriptions","organizations_url":"https://api.github.com/users/gnunicorn/orgs","repos_url":"https://api.github.com/users/gnunicorn/repos","events_url":"https://api.github.com/users/gnunicorn/events{/privacy}","received_events_url":"https://api.github.com/users/gnunicorn/received_events","type":"User","site_admin":false},"assignees":[{"login":"gnunicorn","id":40496,"node_id":"MDQ6VXNlcjQwNDk2","avatar_url":"https://avatars1.githubusercontent.com/u/40496?v=4","gravatar_id":"","url":"https://api.github.com/users/gnunicorn","html_url":"https://github.com/gnunicorn","followers_url":"https://api.github.com/users/gnunicorn/followers","following_url":"https://api.github.com/users/gnunicorn/following{/other_user}","gists_url":"https://api.github.com/users/gnunicorn/gists{/gist_id}","starred_url":"https://api.github.com/users/gnunicorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnunicorn/subscriptions","organizations_url":"https://api.github.com/users/gnunicorn/orgs","repos_url":"https://api.github.com/users/gnunicorn/repos","events_url":"https://api.github.com/users/gnunicorn/events{/privacy}","received_events_url":"https://api.github.com/users/gnunicorn/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"tomaka","id":1412254,"node_id":"MDQ6VXNlcjE0MTIyNTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1412254?v=4","gravatar_id":"","url":"https://api.github.com/users/tomaka","html_url":"https://github.com/tomaka","followers_url":"https://api.github.com/users/tomaka/followers","following_url":"https://api.github.com/users/tomaka/following{/other_user}","gists_url":"https://api.github.com/users/tomaka/gists{/gist_id}","starred_url":"https://api.github.com/users/tomaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomaka/subscriptions","organizations_url":"https://api.github.com/users/tomaka/orgs","repos_url":"https://api.github.com/users/tomaka/repos","events_url":"https://api.github.com/users/tomaka/events{/privacy}","received_events_url":"https://api.github.com/users/tomaka/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":920184021,"node_id":"MDU6TGFiZWw5MjAxODQwMjE=","url":"https://api.github.com/repos/libp2p/rust-libp2p/labels/in%20progress","name":"in progress","color":"ededed","default":false},{"id":1003551815,"node_id":"MDU6TGFiZWwxMDAzNTUxODE1","url":"https://api.github.com/repos/libp2p/rust-libp2p/labels/pr-needs-review","name":"pr-needs-review","color":"96f2a2","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/libp2p/rust-libp2p/pulls/387/commits","review_comments_url":"https://api.github.com/repos/libp2p/rust-libp2p/pulls/387/comments","review_comment_url":"https://api.github.com/repos/libp2p/rust-libp2p/pulls/comments{/number}","comments_url":"https://api.github.com/repos/libp2p/rust-libp2p/issues/387/comments","statuses_url":"https://api.github.com/repos/libp2p/rust-libp2p/statuses/dc029ed17f8e5b12e360e514416140b5bf453a3d","head":{"label":"gnunicorn:connec-reuse-rewrite","ref":"connec-reuse-rewrite","sha":"dc029ed17f8e5b12e360e514416140b5bf453a3d","user":{"login":"gnunicorn","id":40496,"node_id":"MDQ6VXNlcjQwNDk2","avatar_url":"https://avatars1.githubusercontent.com/u/40496?v=4","gravatar_id":"","url":"https://api.github.com/users/gnunicorn","html_url":"https://github.com/gnunicorn","followers_url":"https://api.github.com/users/gnunicorn/followers","following_url":"https://api.github.com/users/gnunicorn/following{/other_user}","gists_url":"https://api.github.com/users/gnunicorn/gists{/gist_id}","starred_url":"https://api.github.com/users/gnunicorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnunicorn/subscriptions","organizations_url":"https://api.github.com/users/gnunicorn/orgs","repos_url":"https://api.github.com/users/gnunicorn/repos","events_url":"https://api.github.com/users/gnunicorn/events{/privacy}","received_events_url":"https://api.github.com/users/gnunicorn/received_events","type":"User","site_admin":false},"repo":{"id":142000606,"node_id":"MDEwOlJlcG9zaXRvcnkxNDIwMDA2MDY=","name":"rust-libp2p","full_name":"gnunicorn/rust-libp2p","owner":{"login":"gnunicorn","id":40496,"node_id":"MDQ6VXNlcjQwNDk2","avatar_url":"https://avatars1.githubusercontent.com/u/40496?v=4","gravatar_id":"","url":"https://api.github.com/users/gnunicorn","html_url":"https://github.com/gnunicorn","followers_url":"https://api.github.com/users/gnunicorn/followers","following_url":"https://api.github.com/users/gnunicorn/following{/other_user}","gists_url":"https://api.github.com/users/gnunicorn/gists{/gist_id}","starred_url":"https://api.github.com/users/gnunicorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnunicorn/subscriptions","organizations_url":"https://api.github.com/users/gnunicorn/orgs","repos_url":"https://api.github.com/users/gnunicorn/repos","events_url":"https://api.github.com/users/gnunicorn/events{/privacy}","received_events_url":"https://api.github.com/users/gnunicorn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gnunicorn/rust-libp2p","description":"The Rust Implementation of libp2p networking stack. ","fork":true,"url":"https://api.github.com/repos/gnunicorn/rust-libp2p","forks_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/forks","keys_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/teams","hooks_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/hooks","issue_events_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/issues/events{/number}","events_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/events","assignees_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/assignees{/user}","branches_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/branches{/branch}","tags_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/tags","blobs_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/git/refs{/sha}","trees_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/statuses/{sha}","languages_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/languages","stargazers_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/stargazers","contributors_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/contributors","subscribers_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/subscribers","subscription_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/subscription","commits_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/commits{/sha}","git_commits_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/git/commits{/sha}","comments_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/comments{/number}","issue_comment_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/issues/comments{/number}","contents_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/contents/{+path}","compare_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/merges","archive_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/downloads","issues_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/issues{/number}","pulls_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/pulls{/number}","milestones_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/milestones{/number}","notifications_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/labels{/name}","releases_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/releases{/id}","deployments_url":"https://api.github.com/repos/gnunicorn/rust-libp2p/deployments","created_at":"2018-07-23T10:42:58Z","updated_at":"2018-07-23T10:43:00Z","pushed_at":"2018-08-06T08:49:01Z","git_url":"git://github.com/gnunicorn/rust-libp2p.git","ssh_url":"git@github.com:gnunicorn/rust-libp2p.git","clone_url":"https://github.com/gnunicorn/rust-libp2p.git","svn_url":"https://github.com/gnunicorn/rust-libp2p","homepage":"https://libp2p.io","size":1420,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"libp2p:master","ref":"master","sha":"1110907d78aa43500e10bc03cf247b94d98fe8f0","user":{"login":"libp2p","id":14838238,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0ODM4MjM4","avatar_url":"https://avatars3.githubusercontent.com/u/14838238?v=4","gravatar_id":"","url":"https://api.github.com/users/libp2p","html_url":"https://github.com/libp2p","followers_url":"https://api.github.com/users/libp2p/followers","following_url":"https://api.github.com/users/libp2p/following{/other_user}","gists_url":"https://api.github.com/users/libp2p/gists{/gist_id}","starred_url":"https://api.github.com/users/libp2p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libp2p/subscriptions","organizations_url":"https://api.github.com/users/libp2p/orgs","repos_url":"https://api.github.com/users/libp2p/repos","events_url":"https://api.github.com/users/libp2p/events{/privacy}","received_events_url":"https://api.github.com/users/libp2p/received_events","type":"Organization","site_admin":false},"repo":{"id":86106381,"node_id":"MDEwOlJlcG9zaXRvcnk4NjEwNjM4MQ==","name":"rust-libp2p","full_name":"libp2p/rust-libp2p","owner":{"login":"libp2p","id":14838238,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0ODM4MjM4","avatar_url":"https://avatars3.githubusercontent.com/u/14838238?v=4","gravatar_id":"","url":"https://api.github.com/users/libp2p","html_url":"https://github.com/libp2p","followers_url":"https://api.github.com/users/libp2p/followers","following_url":"https://api.github.com/users/libp2p/following{/other_user}","gists_url":"https://api.github.com/users/libp2p/gists{/gist_id}","starred_url":"https://api.github.com/users/libp2p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libp2p/subscriptions","organizations_url":"https://api.github.com/users/libp2p/orgs","repos_url":"https://api.github.com/users/libp2p/repos","events_url":"https://api.github.com/users/libp2p/events{/privacy}","received_events_url":"https://api.github.com/users/libp2p/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/libp2p/rust-libp2p","description":"The Rust Implementation of libp2p networking stack. ","fork":false,"url":"https://api.github.com/repos/libp2p/rust-libp2p","forks_url":"https://api.github.com/repos/libp2p/rust-libp2p/forks","keys_url":"https://api.github.com/repos/libp2p/rust-libp2p/keys{/key_id}","collaborators_url":"https://api.github.com/repos/libp2p/rust-libp2p/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/libp2p/rust-libp2p/teams","hooks_url":"https://api.github.com/repos/libp2p/rust-libp2p/hooks","issue_events_url":"https://api.github.com/repos/libp2p/rust-libp2p/issues/events{/number}","events_url":"https://api.github.com/repos/libp2p/rust-libp2p/events","assignees_url":"https://api.github.com/repos/libp2p/rust-libp2p/assignees{/user}","branches_url":"https://api.github.com/repos/libp2p/rust-libp2p/branches{/branch}","tags_url":"https://api.github.com/repos/libp2p/rust-libp2p/tags","blobs_url":"https://api.github.com/repos/libp2p/rust-libp2p/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/libp2p/rust-libp2p/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/libp2p/rust-libp2p/git/refs{/sha}","trees_url":"https://api.github.com/repos/libp2p/rust-libp2p/git/trees{/sha}","statuses_url":"https://api.github.com/repos/libp2p/rust-libp2p/statuses/{sha}","languages_url":"https://api.github.com/repos/libp2p/rust-libp2p/languages","stargazers_url":"https://api.github.com/repos/libp2p/rust-libp2p/stargazers","contributors_url":"https://api.github.com/repos/libp2p/rust-libp2p/contributors","subscribers_url":"https://api.github.com/repos/libp2p/rust-libp2p/subscribers","subscription_url":"https://api.github.com/repos/libp2p/rust-libp2p/subscription","commits_url":"https://api.github.com/repos/libp2p/rust-libp2p/commits{/sha}","git_commits_url":"https://api.github.com/repos/libp2p/rust-libp2p/git/commits{/sha}","comments_url":"https://api.github.com/repos/libp2p/rust-libp2p/comments{/number}","issue_comment_url":"https://api.github.com/repos/libp2p/rust-libp2p/issues/comments{/number}","contents_url":"https://api.github.com/repos/libp2p/rust-libp2p/contents/{+path}","compare_url":"https://api.github.com/repos/libp2p/rust-libp2p/compare/{base}...{head}","merges_url":"https://api.github.com/repos/libp2p/rust-libp2p/merges","archive_url":"https://api.github.com/repos/libp2p/rust-libp2p/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/libp2p/rust-libp2p/downloads","issues_url":"https://api.github.com/repos/libp2p/rust-libp2p/issues{/number}","pulls_url":"https://api.github.com/repos/libp2p/rust-libp2p/pulls{/number}","milestones_url":"https://api.github.com/repos/libp2p/rust-libp2p/milestones{/number}","notifications_url":"https://api.github.com/repos/libp2p/rust-libp2p/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/libp2p/rust-libp2p/labels{/name}","releases_url":"https://api.github.com/repos/libp2p/rust-libp2p/releases{/id}","deployments_url":"https://api.github.com/repos/libp2p/rust-libp2p/deployments","created_at":"2017-03-24T20:05:11Z","updated_at":"2018-08-09T00:25:37Z","pushed_at":"2018-08-08T17:06:18Z","git_url":"git://github.com/libp2p/rust-libp2p.git","ssh_url":"git@github.com:libp2p/rust-libp2p.git","clone_url":"https://github.com/libp2p/rust-libp2p.git","svn_url":"https://github.com/libp2p/rust-libp2p","homepage":"https://libp2p.io","size":1359,"stargazers_count":362,"watchers_count":362,"language":"Rust","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":45,"mirror_url":null,"archived":false,"open_issues_count":97,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":45,"open_issues":97,"watchers":362,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/libp2p/rust-libp2p/pulls/387"},"html":{"href":"https://github.com/libp2p/rust-libp2p/pull/387"},"issue":{"href":"https://api.github.com/repos/libp2p/rust-libp2p/issues/387"},"comments":{"href":"https://api.github.com/repos/libp2p/rust-libp2p/issues/387/comments"},"review_comments":{"href":"https://api.github.com/repos/libp2p/rust-libp2p/pulls/387/comments"},"review_comment":{"href":"https://api.github.com/repos/libp2p/rust-libp2p/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/libp2p/rust-libp2p/pulls/387/commits"},"statuses":{"href":"https://api.github.com/repos/libp2p/rust-libp2p/statuses/dc029ed17f8e5b12e360e514416140b5bf453a3d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"gnunicorn"}}