Skip to content

Onion v3 local address fix + Onion V3 boost tests#103

Merged
RhettCreighton merged 2 commits intoZclassicCommunity:masterfrom
hairetikos:patch-1
Jan 4, 2026
Merged

Onion v3 local address fix + Onion V3 boost tests#103
RhettCreighton merged 2 commits intoZclassicCommunity:masterfrom
hairetikos:patch-1

Conversation

@hairetikos
Copy link

@hairetikos hairetikos commented Dec 6, 2025

Add validation for Tor v3 addresses in CNetAddr. fixes bidirectional multiple 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

we do not have P2P gossip of onion v3 yet, for now we use manual addnodes, as explained before

tested and checked debug=1 log at zclassic side, also tor daemon logging with TestSocks 1 and tcpdump to confirm it is working and watertight, any additional testing and feedback welcome

image

~
image

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
@VictorLux
Copy link

Tested Onion v3 connectivity - working! 🧅

Successfully configured zclassicd in onion-only mode and connected to the boost node.

Test Configuration:

zclassic.conf

proxy=127.0.0.1:9050
listen=1
bind=127.0.0.1:8033
onlynet=onion
addnode=cwmmtcsevvzjurzftl3wvlzpwxwe4fnsu2yl7bfkvirkdxc5idpariqd.onion:8033

Results:

  • ✅ Hidden service created successfully
  • ✅ Connected to boost onion node
  • ✅ Syncing blocks over Tor
  • ✅ getpeerinfo shows onion peer connected

getpeerinfo excerpt:
{
"addr": "cwmmtcsevvzjurzftl3wvlzpwxwe4fnsu2yl7bfkvirkdxc5idpariqd.onion:8033",
"services": "000000000000000d",
"lastsend": 1733788xxx,
"lastrecv": 1733788xxx,
"synced_headers": 2935xxx,
"synced_blocks": 2935xxx
}

Onion v3 peer discovery and connections working as expected. Great work on this fix! 🎉

VictorLux added a commit to VictorLux/zclassic that referenced this pull request Dec 9, 2025
Copy link

@RhettCreighton RhettCreighton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review: APPROVED

Reviewed the changes:

  1. netbase.cpp IsValid() fix (line 896): Correctly adds early return for Tor v3 addresses by checking if torv3_addr is 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.

  2. 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.

@RhettCreighton RhettCreighton merged commit b42be37 into ZclassicCommunity:master Jan 4, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants