Code needed to validate an externally provided ChanTarget/CircTarget against a NetDir
See also #794 (closed).
We need code that can answer the question, "Is this CircTarget/ChanTarget possible given this directory we have?" And possibly, "What Protocols
should we assume it has?"
-
According to the spec, we are allowed to reject linkspecs because they are not consistent with the directory. This is probably limited to "one of the identities is associated with a different identity"; we should allow ORPorts and Ntor keys to change.
-
If a relay is listed, we should use its listed protocols. Otherwise, we should assume that it has the minimum list of protocols to be a relay on the network, plus whatever other protocols are assumed as part of the operation that we're being asked to use with it.