Onion v3 local address fix + Onion V3 boost tests#103
Onion v3 local address fix + Onion V3 boost tests#103RhettCreighton merged 2 commits intoZclassicCommunity:masterfrom
Conversation
Add validation for Tor v3 addresses in CNetAddr. fixes bidirectional onlynet=onion connections also now shows the local onion V3 address with `getnetworkinfo` remote peers onion V3 addresses now show in `getpeerinfo` inbound Onion V3 nodes show as 127.0.0.1, this is normal behaviour, bitcoin and other coins display it like this. only outbound shows V3 addresses "us" when connecting is still a zeroed 0.0.0.0 "IP" address, this is just cosmetic, and we do not have P2P gossip of onion v3 yet, for now we use manual `addnodes`, as explained before
|
Tested Onion v3 connectivity - working! 🧅 Successfully configured zclassicd in onion-only mode and connected to the boost node. Test Configuration: zclassic.confproxy=127.0.0.1:9050 Results:
getpeerinfo excerpt: Onion v3 peer discovery and connections working as expected. Great work on this fix! 🎉 |
RhettCreighton
left a comment
There was a problem hiding this comment.
Code Review: APPROVED
Reviewed the changes:
-
netbase.cpp IsValid() fix (line 896): Correctly adds early return for Tor v3 addresses by checking if
torv3_addris non-empty and has the expected size (ADDR_TORV3_SIZE = 32 bytes). Without this fix, v3 onion addresses would incorrectly fall through to IPv4/IPv6 validation logic and be rejected. -
Unit tests: Comprehensive tests for v3 onion address parsing, validation, routing, and round-trip string conversion. Tests CService with v3 onion as well.
The fix is consistent with how IsTor() and ToStringIP() already handle v3 addresses. Testing confirmed by VictorLux with real onion v3 connectivity.
Ready to merge.
Add validation for Tor v3 addresses in CNetAddr. fixes bidirectional multiple
onlynet=onionconnectionsalso now shows the local onion V3 address with
getnetworkinforemote peers onion V3 addresses now show in
getpeerinfoinbound Onion V3 nodes show as 127.0.0.1, this is normal behaviour, bitcoin and other coins display it like this. only outbound shows V3 addresses
we do not have P2P gossip of onion v3 yet, for now we use manual
addnodes, as explained beforetested and checked
debug=1log at zclassic side, also tor daemon logging withTestSocks 1andtcpdumpto confirm it is working and watertight, any additional testing and feedback welcome~
