my question is how does Tor validate routers? There are some specifications that mention that there are "validated" nodes, which have a "valid" flag (e.g. https://gitweb.torproject.org/torspec.git/tree/path-spec.txt?id=ebb7d8701d000683ec7016176996f168dd10637b).
How does Tor determine whether a node is valid or not? I couldn't figure it out of that reference. If you have an answer, please also provide a reference.