Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[planetary] Not seeing local peers or system pubs in connected peers list #1248

Open
mplorentz opened this issue Mar 6, 2023 · 4 comments
Open
Assignees
Labels
bug Something isn't working
Milestone

Comments

@mplorentz
Copy link
Member

I've been using the scuttlego build for almost a week now and I generally only see rooms or a single pub (the gardening pub) in the connected peers list. Before scuttlego I would usually see some of the system pubs, some room peers, and my other accounts on the local LAN in the connected peers list. I'm not sure if I'm not actually syncing with these peers or if there is something else preventing them from being shown in the sidebar.

Let's investigate the problem and then discuss what solutions might be or if they are necessary.

@boreq boreq modified the milestones: Release 2.0.0, Release 2.0.1 Mar 6, 2023
@boreq boreq added the bug Something isn't working label Mar 7, 2023
@quickdudley
Copy link

This issue does appear to prevent syncing.

@quickdudley
Copy link

I recently reinstalled Planetary and had it syncing again and showing connections in the side panel. Then I used some room server invites and now I'm no longer seeing anything in the side panel and also no longer seeing new posts in Planetary. The timing could be a coincidence but I think it's worth looking into.

@mplorentz
Copy link
Member Author

Thanks for the report @quickdudley. We aren't spending much time on Planetary these days but this seems worth looking into. I added it to our inbox and we'll figure out the priority for it at our next planning meeting.

@mplorentz mplorentz assigned mplorentz and boreq and unassigned martindsq, boreq and mplorentz Sep 12, 2023
@boreq
Copy link
Contributor

boreq commented Oct 10, 2023

I will try to provide some context that can help someone look into this.

The underlying Secure Scuttlebutt implementation powering Planetary is scuttlego these days. This is where discovering local peers and establishing connections takes place. Scuttlego uses go-ssb under the hood in quite a lot of places. One of those places is the code for local peer discovery which is largely reused from go-ssb.

The source for addresses of local peers is Discoverer. It is a wrapper around the code which implements local peer discovery in go-ssb. A good place to check if the peers are even being discovered would be a loop in an anonymous function executed as a goroutine in function Run in this type.

The addresses of local peers (if they are even being generated) should be then picked up by Discoverer in ports and a ProcessNewLocalDiscovery command should be passed to an application command handler ProcessNewLocalDiscoveryHandler. If those addresses aren't being passed then this is of course bad but I don't think the problem is likely to lie in this specific place.

The command handler triggers a function called ProcessNewLocalDiscovery in PeerManager which then simply calls Connect (possibly ProcessNewLocalDiscovery is there just to document things or maybe it did something else on top of it in the past). Connect should then establish a connection to this identity unless we are already communicating with it.

Those are the places that are good candidates to start investigating this problem. Additionally if the issue exists only between two Planetary instances then the culprit could also be the code which sends out local advertisements. To look at that code we need to come back to the same package in which the discoverer was and look at Advertiser. This code doesn't have a good place in scuttlego to put a breakpoint or println in, I'd recommend checking out function called advertise in go-ssb's Advertiser.

Lastly, I believe that the list of connected peers is retrieved by the app in order to display it by calling a query called Status which calls Peers of the previously mentioned PeerManger.

@setch-l setch-l changed the title Not seeing local peers or system pubs in connected peers list [planetary] Not seeing local peers or system pubs in connected peers list Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Someday/Maybe
Development

No branches or pull requests

4 participants