Commit Graph

522 Commits

Author SHA1 Message Date
Nick Mathewson 89d1fb1767 Initial work on periodically reloading state.
We can use this in the case where we don't get the lock on the
state file, because another process is running.
2021-10-19 11:26:22 -04:00
Nick Mathewson f15cde80de Use better reporting for guard status.
The previous code would report all failures to build a circuit as
failures of the guard.  But of course that's not right:  If we
fail to extend to the second or third hop, that might or might not
be the guard's fault.

Now we use the "pending status" feature of the GuardMonitor type so
that an early failure is attributed to the guard, but a later
failure is attributed as "Indeterminate".  Only a complete circuit
is called a success.  We use a new "GuardStatusHandle" type here so
that we can report the status early if there is a timeout.
2021-10-13 11:24:37 -04:00
Nick Mathewson 733aa3a4e2 Implement guards for multihop paths.
There are some limitations here, as noted in the comments.
2021-10-13 10:27:46 -04:00
Nick Mathewson fd893f750c Actually select guards for directory circuits. 2021-10-13 09:30:50 -04:00
Nick Mathewson 5b06b3c64a Pass the guard manager down to the path selection functions. 2021-10-11 15:59:45 -04:00
Nick Mathewson ad851c43c6 WIP 2021-10-11 15:37:59 -04:00
Nick Mathewson 34b576a815 Integrate GuardUsability and GuardMonitor into CircuitBuilder.
(When we're building a path with a guard, we need to tell the guard
manager whether the path succeeded, and we need to wait to hear
whether the guard is usable.)
2021-10-10 13:48:58 -04:00
Nick Mathewson 33ba697b5d Notify guard manager on network change and state flush. 2021-10-10 12:38:50 -04:00
Nick Mathewson c41dd01a14 Add a GuardMgr member to CircuitBuilder 2021-10-10 12:24:48 -04:00
Nick Mathewson 58355d7d54 Re-export configuration types from tor-client. 2021-10-09 17:30:06 -04:00
Nick Mathewson af7c9d5a0b enable checked_conversions lint. 2021-10-09 16:53:13 -04:00
Nick Mathewson 0779923d64 Initial backend implementation for guard node manager.
There are some missing parts here (like persistence and tests)
and some incorrect parts (I am 90% sure that the "exploratory
circuit" flag is bogus).  Also it is not integrated with the circuit
manager code.
2021-10-07 10:45:42 -04:00
Nick Mathewson f1d6779218 Use StorageHandle in tor_circmgr. 2021-09-30 15:36:11 -04:00
Jani Monoses b0bb7bd100 Do not use set_ prefix on derive_builder setters 2021-09-16 08:41:04 +03:00
Daniel Eades fb3b8b84b5 fix/silence clippy lints in test modules 2021-09-08 17:28:31 +02:00
Nick Mathewson 9cf1fa36f4 More tests in pareto.rs 2021-09-08 09:18:23 -04:00
Nick Mathewson 74fa18458e Use same defaults for abandon and close times in timeout code.
On torspec!40, Mike says:

    I don't think there is a practical difference here. As per
    Section 2.4.5, if 60 seconds is not enough and causes the
    liveness test to fail due to too many timeouts, we will double
    the initial timeout.

This makes our behavior the same as C tor.
2021-09-07 14:53:50 -04:00
Nick Mathewson 5d7b08993e Stop making abandoned/successful circuit counts persistent
The C Tor implementation doesn't do this, and Mike says:

   I think it is a reasonable enough assumption that if Tor has
   restarted, this kind data is no longer fresh enough to be
   accurate for this purpose. This is also only 20 circuits here,
   and typical timeouts are now around 1-2 seconds or less.. So a
   restarted client with a timeout that is too low for a new
   internet connection will figure this out pretty quickly. I think
   that is OK.

(from torspec!40)
2021-09-07 14:50:36 -04:00
Nick Mathewson e5cb5de223 A little more test coverage in tor-circmgr::mgr 2021-09-07 14:43:55 -04:00
Nick Mathewson 6c37f78e58 tor_circmgr::mgr -- refactor some duplicate code. 2021-09-07 14:24:16 -04:00
Nick Mathewson 45e880f507 Rename pick_action to clarify that it can modify self 2021-09-07 14:14:31 -04:00
Nick Mathewson 557a0ff40b Move all crates into a `crates` subdirectory.
This will cause some pain for now, but now is really the best time
to do this kind of thing.
2021-08-27 09:53:09 -04:00