Skip to content
Snippets Groups Projects
Closed Construct NetDir with geoip support
  • View options
  • Construct NetDir with geoip support

  • View options
  • Closed Issue created by Janosch Gräf

    I wanted to get the country codes from Relay, but noticed that they're never set. tor-netdir has a geoip feature that gives PartialNetDir a new_with_geoip method. This method is never called currently.

    Changes needed to use PartialNetDir::new_with_geoip:

    • add geoip feature to arti_client. This is not strictly needed, but is how I imagine one enables geoip support in general.
    • add geoip feature and optional dependency on tor-geoip to tor-dirmgr.
    • add geoip_db: Arc<GeoipDb> to DirMgr.
    • in DirMgr::from_config: get GeoipDb::from_embedded and put it into DirMgr. We could also pass in the GeoipDb from further up the graph. I'm not sure about this.
    • add geoip_db field to GetConsensusState and add it to the constructor.
    • add geoip_db to GetCertsState
    • add geoip_db to GetMicrodescsState. This is needed for GetMicrodescsState::reset.
    • pass geoip_db to GetMicrodescsState::new
      • this is the call-site of PartialNetDir::new_with_geoip
      • adding an argument here triggers clippy's warning that the method has to many arguments.

    I have working code (only clippy fails) here

    So my main questions are:

    1. How do we make clippy happy with the method with too many arguments. Note that 2 arguments in that signature are behind a feature flag.

    2. Should we pass the GeoipDb to the dirmgr from further up. If so, how?

    3. Should we pass Option<Arc<GeoipDb>> instead (so it can be disabled at runtime).

    Linked items ... 0

  • Activity

    • All activity
    • Comments only
    • History only
    • Newest first
    • Oldest first
    Loading Loading Loading Loading Loading Loading Loading Loading Loading Loading