{"action":"created","comment":{"url":"https://api.github.com/repos/lightningnetwork/lnd/pulls/comments/187657330","pull_request_review_id":119487863,"id":187657330,"diff_hunk":"@@ -310,8 +490,13 @@ func TestBasicGraphPathFinding(t *testing.T) {\n \t)\n \n \tpaymentAmt := lnwire.NewMSatFromSatoshis(100)\n-\ttarget := aliases[\"sophon\"]\n-\tpath, err := findPath(nil, graph, sourceNode, target, ignoredVertexes,\n+\ttarget := NewVertex(aliases[\"sophon\"])\n+\n+\tg, err := newMemChannelGraphFromDatabase(graph)","path":"routing/pathfind_test.go","position":null,"original_position":217,"commit_id":"4d16051f8d0391768d415b666cd8c58387d9b4c7","original_commit_id":"f9fd4780507a4892525ff34dcb3c1e5883fb8d8d","user":{"login":"nalinbhardwaj","id":6984346,"avatar_url":"https://avatars3.githubusercontent.com/u/6984346?v=4","gravatar_id":"","url":"https://api.github.com/users/nalinbhardwaj","html_url":"https://github.com/nalinbhardwaj","followers_url":"https://api.github.com/users/nalinbhardwaj/followers","following_url":"https://api.github.com/users/nalinbhardwaj/following{/other_user}","gists_url":"https://api.github.com/users/nalinbhardwaj/gists{/gist_id}","starred_url":"https://api.github.com/users/nalinbhardwaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nalinbhardwaj/subscriptions","organizations_url":"https://api.github.com/users/nalinbhardwaj/orgs","repos_url":"https://api.github.com/users/nalinbhardwaj/repos","events_url":"https://api.github.com/users/nalinbhardwaj/events{/privacy}","received_events_url":"https://api.github.com/users/nalinbhardwaj/received_events","type":"User","site_admin":false},"body":"> using both the DB and in-memory versions.\r\n\r\nSince the DB functions don't exactly match graphSource functions, I've made a wrapper for it `dbChannelGraph`, I think it's `ForEachChannel` should be improved(as mentioned elsewhere).","created_at":"2018-05-11T15:56:46Z","updated_at":"2018-05-11T15:56:46Z","html_url":"https://github.com/lightningnetwork/lnd/pull/417#discussion_r187657330","pull_request_url":"https://api.github.com/repos/lightningnetwork/lnd/pulls/417","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/lightningnetwork/lnd/pulls/comments/187657330"},"html":{"href":"https://github.com/lightningnetwork/lnd/pull/417#discussion_r187657330"},"pull_request":{"href":"https://api.github.com/repos/lightningnetwork/lnd/pulls/417"}},"in_reply_to_id":173656076},"pull_request":{"url":"https://api.github.com/repos/lightningnetwork/lnd/pulls/417","id":152849063,"html_url":"https://github.com/lightningnetwork/lnd/pull/417","diff_url":"https://github.com/lightningnetwork/lnd/pull/417.diff","patch_url":"https://github.com/lightningnetwork/lnd/pull/417.patch","issue_url":"https://api.github.com/repos/lightningnetwork/lnd/issues/417","number":417,"state":"open","locked":false,"title":"routing: Add in-memory graph with interface and diameter calculation","user":{"login":"nalinbhardwaj","id":6984346,"avatar_url":"https://avatars3.githubusercontent.com/u/6984346?v=4","gravatar_id":"","url":"https://api.github.com/users/nalinbhardwaj","html_url":"https://github.com/nalinbhardwaj","followers_url":"https://api.github.com/users/nalinbhardwaj/followers","following_url":"https://api.github.com/users/nalinbhardwaj/following{/other_user}","gists_url":"https://api.github.com/users/nalinbhardwaj/gists{/gist_id}","starred_url":"https://api.github.com/users/nalinbhardwaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nalinbhardwaj/subscriptions","organizations_url":"https://api.github.com/users/nalinbhardwaj/orgs","repos_url":"https://api.github.com/users/nalinbhardwaj/repos","events_url":"https://api.github.com/users/nalinbhardwaj/events{/privacy}","received_events_url":"https://api.github.com/users/nalinbhardwaj/received_events","type":"User","site_admin":false},"body":"Data handling changes:\r\n- _graphSource_: Creates new interface for pathfinding related functions which can be in-memory or on disk. Possibly needs to be merged with `routing.ChannelGraphSource`, but not sure.\r\n- _memChannelGraph_: In-memory instance of channeldb.ChannelGraph\r\n\r\nFunctional changes:\r\n- _findPath_: Optimizes to use in-memory graph, in turn this also optimises _findPaths_.\r\n- _findDiam_: Calculates graph diameter in O(N*(N+M)) where N = no. of nodes, M = no. of channels in the known graph using BFS.(the original purpose of PR). Currently, this is quite slow, 13-14 seconds on a generally slow machine. Caching is enabled so extra computation is minimised.\r\n\r\nTesting:\r\n- Introduces a large testnet file for benchmark testing of pathfinding algorithms. Largely a cherry pick of @halseth 's work in #379 \r\n    - [ ] **TODO**: Use file for findDiam benchmarking as well.\r\n\r\nRPC functionality:\r\n- Populates graph diameter field in GetNetworkInfo RPC call.\r\n\r\n- [ ] **TODO**: Comment the code? Not sure if it is enough ATM.\r\n\r\nCloses #180 and #645.\r\nPartially fixes #413, #536(duplicate of #645).\r\nRelates to #379.","created_at":"2017-11-15T18:19:06Z","updated_at":"2018-05-11T15:56:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"442c566f34cfff4d1e787b672bceb91185d2ba11","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":814603370,"url":"https://api.github.com/repos/lightningnetwork/lnd/labels/up%20for%20grabs","name":"up for grabs","color":"114389","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/lightningnetwork/lnd/pulls/417/commits","review_comments_url":"https://api.github.com/repos/lightningnetwork/lnd/pulls/417/comments","review_comment_url":"https://api.github.com/repos/lightningnetwork/lnd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lightningnetwork/lnd/issues/417/comments","statuses_url":"https://api.github.com/repos/lightningnetwork/lnd/statuses/4d16051f8d0391768d415b666cd8c58387d9b4c7","head":{"label":"nalinbhardwaj:graph-diameter","ref":"graph-diameter","sha":"4d16051f8d0391768d415b666cd8c58387d9b4c7","user":{"login":"nalinbhardwaj","id":6984346,"avatar_url":"https://avatars3.githubusercontent.com/u/6984346?v=4","gravatar_id":"","url":"https://api.github.com/users/nalinbhardwaj","html_url":"https://github.com/nalinbhardwaj","followers_url":"https://api.github.com/users/nalinbhardwaj/followers","following_url":"https://api.github.com/users/nalinbhardwaj/following{/other_user}","gists_url":"https://api.github.com/users/nalinbhardwaj/gists{/gist_id}","starred_url":"https://api.github.com/users/nalinbhardwaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nalinbhardwaj/subscriptions","organizations_url":"https://api.github.com/users/nalinbhardwaj/orgs","repos_url":"https://api.github.com/users/nalinbhardwaj/repos","events_url":"https://api.github.com/users/nalinbhardwaj/events{/privacy}","received_events_url":"https://api.github.com/users/nalinbhardwaj/received_events","type":"User","site_admin":false},"repo":{"id":110273910,"name":"lnd","full_name":"nalinbhardwaj/lnd","owner":{"login":"nalinbhardwaj","id":6984346,"avatar_url":"https://avatars3.githubusercontent.com/u/6984346?v=4","gravatar_id":"","url":"https://api.github.com/users/nalinbhardwaj","html_url":"https://github.com/nalinbhardwaj","followers_url":"https://api.github.com/users/nalinbhardwaj/followers","following_url":"https://api.github.com/users/nalinbhardwaj/following{/other_user}","gists_url":"https://api.github.com/users/nalinbhardwaj/gists{/gist_id}","starred_url":"https://api.github.com/users/nalinbhardwaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nalinbhardwaj/subscriptions","organizations_url":"https://api.github.com/users/nalinbhardwaj/orgs","repos_url":"https://api.github.com/users/nalinbhardwaj/repos","events_url":"https://api.github.com/users/nalinbhardwaj/events{/privacy}","received_events_url":"https://api.github.com/users/nalinbhardwaj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nalinbhardwaj/lnd","description":"Lightning Network Daemon ⚡️","fork":true,"url":"https://api.github.com/repos/nalinbhardwaj/lnd","forks_url":"https://api.github.com/repos/nalinbhardwaj/lnd/forks","keys_url":"https://api.github.com/repos/nalinbhardwaj/lnd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nalinbhardwaj/lnd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nalinbhardwaj/lnd/teams","hooks_url":"https://api.github.com/repos/nalinbhardwaj/lnd/hooks","issue_events_url":"https://api.github.com/repos/nalinbhardwaj/lnd/issues/events{/number}","events_url":"https://api.github.com/repos/nalinbhardwaj/lnd/events","assignees_url":"https://api.github.com/repos/nalinbhardwaj/lnd/assignees{/user}","branches_url":"https://api.github.com/repos/nalinbhardwaj/lnd/branches{/branch}","tags_url":"https://api.github.com/repos/nalinbhardwaj/lnd/tags","blobs_url":"https://api.github.com/repos/nalinbhardwaj/lnd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nalinbhardwaj/lnd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nalinbhardwaj/lnd/git/refs{/sha}","trees_url":"https://api.github.com/repos/nalinbhardwaj/lnd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nalinbhardwaj/lnd/statuses/{sha}","languages_url":"https://api.github.com/repos/nalinbhardwaj/lnd/languages","stargazers_url":"https://api.github.com/repos/nalinbhardwaj/lnd/stargazers","contributors_url":"https://api.github.com/repos/nalinbhardwaj/lnd/contributors","subscribers_url":"https://api.github.com/repos/nalinbhardwaj/lnd/subscribers","subscription_url":"https://api.github.com/repos/nalinbhardwaj/lnd/subscription","commits_url":"https://api.github.com/repos/nalinbhardwaj/lnd/commits{/sha}","git_commits_url":"https://api.github.com/repos/nalinbhardwaj/lnd/git/commits{/sha}","comments_url":"https://api.github.com/repos/nalinbhardwaj/lnd/comments{/number}","issue_comment_url":"https://api.github.com/repos/nalinbhardwaj/lnd/issues/comments{/number}","contents_url":"https://api.github.com/repos/nalinbhardwaj/lnd/contents/{+path}","compare_url":"https://api.github.com/repos/nalinbhardwaj/lnd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nalinbhardwaj/lnd/merges","archive_url":"https://api.github.com/repos/nalinbhardwaj/lnd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nalinbhardwaj/lnd/downloads","issues_url":"https://api.github.com/repos/nalinbhardwaj/lnd/issues{/number}","pulls_url":"https://api.github.com/repos/nalinbhardwaj/lnd/pulls{/number}","milestones_url":"https://api.github.com/repos/nalinbhardwaj/lnd/milestones{/number}","notifications_url":"https://api.github.com/repos/nalinbhardwaj/lnd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nalinbhardwaj/lnd/labels{/name}","releases_url":"https://api.github.com/repos/nalinbhardwaj/lnd/releases{/id}","deployments_url":"https://api.github.com/repos/nalinbhardwaj/lnd/deployments","created_at":"2017-11-10T17:25:27Z","updated_at":"2018-05-10T14:16:58Z","pushed_at":"2018-05-11T15:49:47Z","git_url":"git://github.com/nalinbhardwaj/lnd.git","ssh_url":"git@github.com:nalinbhardwaj/lnd.git","clone_url":"https://github.com/nalinbhardwaj/lnd.git","svn_url":"https://github.com/nalinbhardwaj/lnd","homepage":"","size":15380,"stargazers_count":0,"watchers_count":0,"language":"Go","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"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"lightningnetwork:master","ref":"master","sha":"b73eef12b36af3b98c90137bcc111a3405f781bf","user":{"login":"lightningnetwork","id":13424735,"avatar_url":"https://avatars0.githubusercontent.com/u/13424735?v=4","gravatar_id":"","url":"https://api.github.com/users/lightningnetwork","html_url":"https://github.com/lightningnetwork","followers_url":"https://api.github.com/users/lightningnetwork/followers","following_url":"https://api.github.com/users/lightningnetwork/following{/other_user}","gists_url":"https://api.github.com/users/lightningnetwork/gists{/gist_id}","starred_url":"https://api.github.com/users/lightningnetwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lightningnetwork/subscriptions","organizations_url":"https://api.github.com/users/lightningnetwork/orgs","repos_url":"https://api.github.com/users/lightningnetwork/repos","events_url":"https://api.github.com/users/lightningnetwork/events{/privacy}","received_events_url":"https://api.github.com/users/lightningnetwork/received_events","type":"Organization","site_admin":false},"repo":{"id":49765480,"name":"lnd","full_name":"lightningnetwork/lnd","owner":{"login":"lightningnetwork","id":13424735,"avatar_url":"https://avatars0.githubusercontent.com/u/13424735?v=4","gravatar_id":"","url":"https://api.github.com/users/lightningnetwork","html_url":"https://github.com/lightningnetwork","followers_url":"https://api.github.com/users/lightningnetwork/followers","following_url":"https://api.github.com/users/lightningnetwork/following{/other_user}","gists_url":"https://api.github.com/users/lightningnetwork/gists{/gist_id}","starred_url":"https://api.github.com/users/lightningnetwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lightningnetwork/subscriptions","organizations_url":"https://api.github.com/users/lightningnetwork/orgs","repos_url":"https://api.github.com/users/lightningnetwork/repos","events_url":"https://api.github.com/users/lightningnetwork/events{/privacy}","received_events_url":"https://api.github.com/users/lightningnetwork/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lightningnetwork/lnd","description":"Lightning Network Daemon ⚡️","fork":false,"url":"https://api.github.com/repos/lightningnetwork/lnd","forks_url":"https://api.github.com/repos/lightningnetwork/lnd/forks","keys_url":"https://api.github.com/repos/lightningnetwork/lnd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lightningnetwork/lnd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lightningnetwork/lnd/teams","hooks_url":"https://api.github.com/repos/lightningnetwork/lnd/hooks","issue_events_url":"https://api.github.com/repos/lightningnetwork/lnd/issues/events{/number}","events_url":"https://api.github.com/repos/lightningnetwork/lnd/events","assignees_url":"https://api.github.com/repos/lightningnetwork/lnd/assignees{/user}","branches_url":"https://api.github.com/repos/lightningnetwork/lnd/branches{/branch}","tags_url":"https://api.github.com/repos/lightningnetwork/lnd/tags","blobs_url":"https://api.github.com/repos/lightningnetwork/lnd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lightningnetwork/lnd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lightningnetwork/lnd/git/refs{/sha}","trees_url":"https://api.github.com/repos/lightningnetwork/lnd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lightningnetwork/lnd/statuses/{sha}","languages_url":"https://api.github.com/repos/lightningnetwork/lnd/languages","stargazers_url":"https://api.github.com/repos/lightningnetwork/lnd/stargazers","contributors_url":"https://api.github.com/repos/lightningnetwork/lnd/contributors","subscribers_url":"https://api.github.com/repos/lightningnetwork/lnd/subscribers","subscription_url":"https://api.github.com/repos/lightningnetwork/lnd/subscription","commits_url":"https://api.github.com/repos/lightningnetwork/lnd/commits{/sha}","git_commits_url":"https://api.github.com/repos/lightningnetwork/lnd/git/commits{/sha}","comments_url":"https://api.github.com/repos/lightningnetwork/lnd/comments{/number}","issue_comment_url":"https://api.github.com/repos/lightningnetwork/lnd/issues/comments{/number}","contents_url":"https://api.github.com/repos/lightningnetwork/lnd/contents/{+path}","compare_url":"https://api.github.com/repos/lightningnetwork/lnd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lightningnetwork/lnd/merges","archive_url":"https://api.github.com/repos/lightningnetwork/lnd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lightningnetwork/lnd/downloads","issues_url":"https://api.github.com/repos/lightningnetwork/lnd/issues{/number}","pulls_url":"https://api.github.com/repos/lightningnetwork/lnd/pulls{/number}","milestones_url":"https://api.github.com/repos/lightningnetwork/lnd/milestones{/number}","notifications_url":"https://api.github.com/repos/lightningnetwork/lnd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lightningnetwork/lnd/labels{/name}","releases_url":"https://api.github.com/repos/lightningnetwork/lnd/releases{/id}","deployments_url":"https://api.github.com/repos/lightningnetwork/lnd/deployments","created_at":"2016-01-16T08:19:33Z","updated_at":"2018-05-11T13:04:36Z","pushed_at":"2018-05-11T15:49:49Z","git_url":"git://github.com/lightningnetwork/lnd.git","ssh_url":"git@github.com:lightningnetwork/lnd.git","clone_url":"https://github.com/lightningnetwork/lnd.git","svn_url":"https://github.com/lightningnetwork/lnd","homepage":"","size":14682,"stargazers_count":2546,"watchers_count":2546,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":585,"mirror_url":null,"archived":false,"open_issues_count":178,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":585,"open_issues":178,"watchers":2546,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lightningnetwork/lnd/pulls/417"},"html":{"href":"https://github.com/lightningnetwork/lnd/pull/417"},"issue":{"href":"https://api.github.com/repos/lightningnetwork/lnd/issues/417"},"comments":{"href":"https://api.github.com/repos/lightningnetwork/lnd/issues/417/comments"},"review_comments":{"href":"https://api.github.com/repos/lightningnetwork/lnd/pulls/417/comments"},"review_comment":{"href":"https://api.github.com/repos/lightningnetwork/lnd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lightningnetwork/lnd/pulls/417/commits"},"statuses":{"href":"https://api.github.com/repos/lightningnetwork/lnd/statuses/4d16051f8d0391768d415b666cd8c58387d9b4c7"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"nalinbhardwaj"}}