Resolve hostname seed nodes and trusted snapshot peers - #156
Merged
Merged
Conversation
fc::resolve() takes a bare host, but both p2p seed parsing and the --test-trusted-seeds probe fed it a whole "host:port" string. Resolution always failed, so every hostname seed from the shipped config template and the docs was dropped silently: the node started with "connecting to 0 seed nodes" and sat in sync isolation, while the diagnostic reported REACHABLE peers as ERROR. Split host and port before resolving, reject out-of-range ports, and log a warning instead of discarding a seed without a trace. Verified against the public build: with hostname seeds the node loaded the snapshot but reported 0 seed nodes; with literal IPs it connected and followed the chain.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
fc::resolve()takes a bare host, but the p2p seed parsing (and the--test-trusted-seedsprobe) passed it the wholehost:portstring. Resolutiontherefore always failed, and the failure was swallowed by
catch (...) {}.Consequence for anyone following our own documentation: every seed written as a
hostname is discarded. The shipped
share/vizd/config/config_witness.initemplate and the examples in
docs/node/{getting-started,configuration,snapshot,validator-node}.mdall use
seed3.viz.world:2001, so a node started from them comes up withThe same string handling made
--test-trusted-seedsreport perfectly goodhostname peers as
ERROR("error converting std::string to IP endpoint"), eventhough the real sync path resolves them (
asio_tcp_socket::connect_to_endpoint).Verified on the current public build
vizblockchain/vizd:latest, empty data dir, config straight from the docs:seed3.viz.world:2001,rpc.viz.cx:2001connecting to 0 seed nodes→ sync isolation175.110.112.214:2001,178.156.251.126:2001--test-trusted-seeds:ERRORfor both hostname peers,REACHABLE connect=0ms latency=3ms speed=22103KB/sfor the same peers written as IPs.Change
Split host and port before resolving, in both places; reject out-of-range
ports; log a warning instead of dropping a seed without a trace.
Non-consensus: config parsing and a diagnostic path only. Both touched TUs pass
-fsyntax-onlyon this branch.