Maybe refactor CircMgr to get NetDir objects directly?
There are several places where
CircMgr's interface takes a
DirInfo object as an argument. This mostly works, but there are a few places where it makes things inconvenient.
Notably, it requires
arti-tor-client to pass messages from the
DirMgr to the
CircMgr when the directory or network parameters change. It also requires
arti-tor-client to periodically invoke
launch_timeout_testing_circuit_if_appropriate. Both of these functions would be better handled as part of
tor-circmgr crate, I think.
But there are some factors that make it hard to let
CircMgr get a
CircMgrto make BEGINDIR circuits, so it has to exist at a higher level than
CircMgr. That means that you can't easily give
CircMgra reference to the
DirMgrthat would give it a
NetDirwithout doing something to break circularity.
DirMgrdesign is more efficient if nobody ever keeps a reference to a
NetDirlonger than they need to. (See
- For testing, it's actually pretty convenient for most
CircMgrAPIs to sometimes take a
NetDiras an argument rather than have it stored as a member locally.
This will need some careful thought. Please reach out before hacking here: there are a lot of approaches that won't work, and any approach we do take has architectural implications for the future of Arti.