{"action":"created","issue":{"url":"https://api.github.com/repos/paritytech/substrate/issues/1211","repository_url":"https://api.github.com/repos/paritytech/substrate","labels_url":"https://api.github.com/repos/paritytech/substrate/issues/1211/labels{/name}","comments_url":"https://api.github.com/repos/paritytech/substrate/issues/1211/comments","events_url":"https://api.github.com/repos/paritytech/substrate/issues/1211/events","html_url":"https://github.com/paritytech/substrate/issues/1211","id":387494134,"node_id":"MDU6SXNzdWUzODc0OTQxMzQ=","number":1211,"title":"endless tries to connect to yourself","user":{"login":"algys","id":22330612,"node_id":"MDQ6VXNlcjIyMzMwNjEy","avatar_url":"https://avatars3.githubusercontent.com/u/22330612?v=4","gravatar_id":"","url":"https://api.github.com/users/algys","html_url":"https://github.com/algys","followers_url":"https://api.github.com/users/algys/followers","following_url":"https://api.github.com/users/algys/following{/other_user}","gists_url":"https://api.github.com/users/algys/gists{/gist_id}","starred_url":"https://api.github.com/users/algys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/algys/subscriptions","organizations_url":"https://api.github.com/users/algys/orgs","repos_url":"https://api.github.com/users/algys/repos","events_url":"https://api.github.com/users/algys/events{/privacy}","received_events_url":"https://api.github.com/users/algys/received_events","type":"User","site_admin":false},"labels":[{"id":746560634,"node_id":"MDU6TGFiZWw3NDY1NjA2MzQ=","url":"https://api.github.com/repos/paritytech/substrate/labels/F7-footprint","name":"F7-footprint","color":"34C302","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/paritytech/substrate/milestones/5","html_url":"https://github.com/paritytech/substrate/milestone/5","labels_url":"https://api.github.com/repos/paritytech/substrate/milestones/5/labels","id":3623516,"node_id":"MDk6TWlsZXN0b25lMzYyMzUxNg==","number":5,"title":"As-and-when","description":"","creator":{"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},"open_issues":33,"closed_issues":7,"state":"open","created_at":"2018-09-05T07:50:53Z","updated_at":"2018-12-04T22:32:07Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2018-12-04T21:47:16Z","updated_at":"2018-12-05T10:35:36Z","closed_at":null,"author_association":"NONE","body":"If the node receives a network address pointing to itself(e.g. `\"/ip4/127.0.0.1/tcp/30333/p2p/QmZEFcNvWmqjx8r8R2mSnXtQsShgRVG1R2MH9tWNbvxHDr\"`), then occurs endless connection attempts.\r\n\r\nPotentially, this can cause unnecessary load on the node and a cutting down of performance.\r\n\r\nSimple way to reproduce:\r\n - add `\"/ip4/127.0.0.1/tcp/30333/p2p/QmZEFcNvWmqjx8r8R2mSnXtQsShgRVG1R2MH9tWNbvxHDr\"` to boot nodes in config \r\n- run node `RUST_LOG=debug cargo run -- --dev --chain local`\r\n\r\nThen in the logs you can see repeated connection attempts:\r\n`libp2p_core::upgrade::apply  Successfully applied negotiated protocol`\r\n\r\nand lines about fails:\r\n`sub-libp2p  Rejected connection to/from ourself: Listener { listen_addr: \"/ip4/0.0.0.0/tcp/30333\", send_back_addr: \"/ip4/127.0.0.1/tcp/36242\" }`"},"comment":{"url":"https://api.github.com/repos/paritytech/substrate/issues/comments/444438766","html_url":"https://github.com/paritytech/substrate/issues/1211#issuecomment-444438766","issue_url":"https://api.github.com/repos/paritytech/substrate/issues/1211","id":444438766,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NDQzODc2Ng==","user":{"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},"created_at":"2018-12-05T10:35:36Z","updated_at":"2018-12-05T10:35:36Z","author_association":"MEMBER","body":"> Potentially, this can cause unnecessary load on the node and a cutting down of performance.\r\n\r\nWhat is supposed to happen right now (although I haven't tested) is that when we try to connect to ourself, the connection is rejected and a delay of 2 seconds is put in place. Two seconds later we try again and fail. Then 4 seconds later. Then 8 seconds later. This happens until the reputation of the node falls to 0, after which the delay is something like two hours.\r\n\r\nOn a long-running node, we will briefly try to connect to ourselves every two hours and get immediately rejected, which I think is ok.\r\n\r\nHowever this is mostly the protection-against-spoofing system in action, and there is indeed the underlying problem which is that nodes report `127.0.0.1` as their IP address. The fact that we are generic over the concept of a multiaddress makes everything a bit difficult in this regard.\r\n"}}
{"actor":{"display_login":"tomaka"}}