Bridges should use create_fast cells for the first hop of their circuits
A friendly anonymous user commented on #4115 (moved) that bridges can be distinguished by whether they use a create cell or create_fast cell. Once we fix #4115 (moved) it will be even more straightforward to distinguish.
should_use_create_fast_for_circuit(origin_circuit_t *circ)
{
or_options_t *options = get_options();
tor_assert(circ->cpath);
tor_assert(circ->cpath->extend_info);
if (!circ->cpath->extend_info->onion_key)
return 1; /* our hand is forced: only a create_fast will work. */
if (!options->FastFirstHopPK)
return 0; /* we prefer to avoid create_fast */
if (server_mode(options)) {
/* We're a server, and we know an onion key. We can choose.
* Prefer to blend in. */
return 0;
}
return 1;
}
Bridge-detector example:
if (or_circ && !or_circ->is_first_hop && rh.command == RELAY_COMMAND_BEGIN_DIR) {
/* non-mirror relay detected or bridge, filter it by consensus. */