RNS Logo

rns.recipes

◈ 9ce92808be498e9e05590ff27cbfdfe4
RNS 1.5.5 released https://pypi.org/project/rns/

macOS autoconnect discovery tries to use BackboneInterface

Started by ozCleric 1747e565d5d11f4c... ·

ozCleric 9699f98b4d0135f7...
#1

Hello Mark,I think I've found a bug with interface discovery/autoconnect on macOS in RNS 1.4.2. I'm running RNS 1.4.2 installed with pipx on a Mac mini. RNS is using Python 3.12.13. I have: autoconnect_discovered_interfaces = 4 I'm getting errors when RNS tries to connect to discovered BackboneInterfaces: An interface error occurred for BackboneInterface[...]: module 'select' has no attribute 'epoll' I checked the Python environment RNS is actually running under and get: epoll available: False kqueue available: True I understand BackboneInterface itself isn't supported on macOS, so that's expected. The odd bit is that autoconnect seems to be trying to create a BackboneClientInterface on macOS anyway. I had a look through Discovery.py and BackboneInterface.py. Discovery.py seems to know about this limitation when generating discovered interface configs. It checks for Darwin and falls back to TCPClientInterface. But the autoconnect path looks like it uses the advertised interface type directly. If the remote advertises BackboneInterface it creates a BackboneClientInterface. That then ends up in BackboneInterface.ensure_epoll(), which calls select.epoll(), and fails on macOS. So I think the issue is specifically with autoconnect of discovered BackboneInterfaces on Darwin, rather than BackboneInterface not supporting macOS generally. For now I've set: autoconnect_discovered_interfaces = 0 and I'm using TCPClientInterface manually for backbone endpoints. It looks like autoconnect probably needs to check the local platform before creating BackboneClientInterface, or use TCPClientInterface on Darwin in the same way the discovered config generation already does. Happy to post the full logs/config if they're useful. ozCleric

ozCleric 9699f98b4d0135f7...
#2

Oh I really should have checked the formatting for that post, oops sorry…

Anonymous
#3

It does exactly the same thing on Windows last I checked, if you enable interface discovery it spams logs and fails to actually make any interfaces

ozCleric 9699f98b4d0135f7...
#4

Correct. On Windows the autoconnect path bypasses the degradation logic: backbone_support = ( not RNS.vendor.platformutils.is_windows() and not RNS.vendor.platformutils.is_darwin() ) It then directly constructs BackboneClientInterface when the remote advertises itself as a BackboneInterface.

Anonymous
#5

Perhaps nodes could just advertise themselves as TCPInterface so every other node knows it's compatible and can swap out TCPInterface and BackboneInterface

nongkhaem_bkk_th e23e9a470d42f05d...
#6

Can confirm 100% on OSX still happens on 1.5.4. The core issue is that "autoconnect_discovered_interfaces = 3" attempts to use BackboneInterfaces. Evidently the docs show that windows and osx should use TCP_CLIENT_INTERFACE instead, but that's userland stuff, and users that read docs at that :)

 

So in the real world, what actually happens is the only interface(s) that actually gets connected to is/are the initial TCP client interfaces selected on the onboarding of clients that support it (MCX), or picked manually on this site for more advanced users that read docs.

 

Therefore, IF the user has autodiscovery on, and no matter how many slots there are for autoconnection, the user will always be connected the bootstraps, which will never get cleared, because the users, being users, are more likely to be on OSX or windows than linux

By extension, imho this makes the network weaker than it should, because peering for whatever % of nodes is windows/osx is done based on a arbitrary community list and not autodiscovery.

 

I'd love to know if maybe this an unsolvable issue, I'm not qualified enough to comment on that, but I do believe it to be an issue.

Mark 8dd57a7382268096...
#7

Yes, this is definitely a bug. It should work automatically on both macOS and Windows, and automatically fall back to TCPInterface (until BackboneInterface variants for those systems are ready).

 

It's 100% solvable, but it's the code that needs fixing ;)

 

I'll have it fixed in the upcoming release.

Mark 8dd57a7382268096...
#8

Now fixed in 1.5.5! Auto-connect works on Windows and macOS now :)

Post a Reply

Supports Markdown: **bold**, *italic*, `code`, ```code blocks```, [links](url)

Log in to upload images

Quote
Copied to clipboard