summaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
...
* | tor-guardmgr: Flush the vanguard changes to disk.Gabriela Moldovan2024-04-221-3/+8
| |
* | tor-guardmgr: Implement VanguardMgr::flush_to_storage.Gabriela Moldovan2024-04-221-10/+15
| |
* | tor-guardmgr: Fix vanguard expiration test.Gabriela Moldovan2024-04-221-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since `rotate_expired()` (previously `remove_expired()`) now also replenishes the vanguard sets, we can't use `advance_until_stalled()` anymore, because `run_once()` is never be stalled in the tests (`next_to_expire` is never `None`, so `sleep_fut` is never `future::pending()`: ``` warning: MockRuntime advance_* looped >1000 (next sleep: 877560507ms) ``` Previously, `next_to_expire` was computed *before* replenishing the vanguard sets, which is why the tests could use `advance_until_stalled()`.
* | tor-guardmgr: Don't try to replenish the sets unless some vanguards expired.Gabriela Moldovan2024-04-221-23/+18
| | | | | | | | | | This addresses a TODO about not calling `handle_netdir_update` unconditionally each time `VanguardMgr::run_once()` runs.
* | tor-guardmgr: Move vanguard set replenishing logic to VanguardSetsTrackedMut.Gabriela Moldovan2024-04-223-225/+373
| | | | | | | | | | | | A lot of this is code motion: the code added to `VanguardSetsTrackedMut` was copied from the `VanguardMgr` impl, so I recommend reviewing this with `git diff --color-moved=zebra`.
* | tor-guardmgr: Add VanguardSetsTrackedMut for mutating VanguardSets.Gabriela Moldovan2024-04-221-0/+54
| | | | | | | | | | | | | | | | | | This enables us to track when `VanguardMgr`'s `VanguardSets` is *actually* mutated. This will soon be useful because we only want to flush the `VanguardSets` to storage if we actually added or removed some relays from the set.
* | tor-guardmgr: Add some accessors for VanguardSets.Gabriela Moldovan2024-04-221-0/+43
| | | | | | | | | | These will be useful later, when we place the `l2_vanguards` and `l3_vanguards` from `VanguardMgr` with a `VanguardSets`.
* | tor-guardmgr: VanguardSet::remove_{unlisted,expired} returns whether the set ↵Gabriela Moldovan2024-04-221-5/+14
| | | | | | | | | | | | | | | | | | changed. The two removal functions now return whether any values were removed from the `VanguardSet`. Their return values are currently ignored, but will soon be used for deciding whether to flush the `VanguardSet`s to disk (if full vanguards are enabled).
* | tor-guardmgr: Add VanguardMgrError variant for tor-persist errors.Gabriela Moldovan2024-04-221-0/+5
| |
* | tor-guardmgr: Create storage handle for storing vanguards.Gabriela Moldovan2024-04-221-3/+11
| |
* | tor-guardmgr: Introduce an abstraction over the two vanguard sets.Gabriela Moldovan2024-04-221-0/+19
| | | | | | | | | | | | | | `VanguardSets` (not to be confused with `VanguardSet`) will soon be used as: * a helper for serializing the L2 and L3 `VanguardSet`s * an abstraction over the two vanguard sets
* | tor-guardmgr: Derive Default for VanguardSet.Gabriela Moldovan2024-04-221-1/+6
| | | | | | | | | | | | | | | | | | | | We will soon replace `VanguardSet::new` with `VanguardSet::default`: `new()` currently expects a set of `VanguardParams` (from which the target size of the set is derived), but we don't have a `VanguardParams` until we obtain a `NetDir`. Moreover, it doesn't make sense to attempt to set the target size of the `VanguardSet` before obtaining a `NetDir`, because we can't actually populate the set without a `NetDir` (we can't select relays).
* | tor-guardmgr: By default, use full vanguards for onion services.Gabriela Moldovan2024-04-221-2/+2
| | | | | | | | | | | | | | By default, HS clients should be using lite vanguards, and HS services full vanguards. See https://gitlab.torproject.org/tpo/core/torspec/-/merge_requests/258#note_3011734
* | tor-guardmgr: Add a TODO about a call that needs to be relocated.Gabriela Moldovan2024-04-221-0/+10
| | | | | | | | This TODO is fixed later in the branch.
* | tor-guardmgr: Use RelayUsage::vanguard in the VanguardMgr.Gabriela Moldovan2024-04-222-3/+2
| | | | | | | | Closes #1364
* | tor-relay-selection: Introduce RelayUsage::vanguard.Gabriela Moldovan2024-04-222-1/+24
|/ | | | | | | | | | | This adds a new `RelayUsage` for vanguards. As per the original [vanguards implementation], vanguards must: * have the Fast, Stable, and Valid flags * be selected using the `Middle` weight Part of #1364 [vanguards implementation]: https://github.com/mikeperry-tor/vanguards
* Merge branch 'upgrade-rustls' into 'main'gabi-2502024-04-224-9/+30
|\ | | | | | | | | | | | | Upgrade to futures-rustls 0.26.0, rustls 0.23.5. Closes #1377 See merge request tpo/core/arti!2095
| * Add a note about CryptoProvicder.Nick Mathewson2024-04-221-0/+4
| |
| * rustls: Avoid aws-lc-rs for now.Nick Mathewson2024-04-222-2/+2
| |
| * Upgrade to futures-rustls 0.26.0, rustls 0.23.5.Nick Mathewson2024-04-224-9/+26
| | | | | | | | | | | | | | | | | | The rustls upgrade will solve #1377 and CVE-2024-32650. Note that we've had to patch our RustlsProvider impl a bit in order to keep the tests passing. See comments. Closes #1377.
* | Resolve nightly clippy errors in hashx.Nick Mathewson2024-04-221-3/+3
|/ | | | | | Nightly clippy doesn't like using "expr as T" when the conversion is lossless; it prefers "T::from(expr)" so that if we later change the type of T to something with a lossy conversion, we'll know.
* arti-client: add hs_circ_pool() method on TorClientRichard Pospesel2024-04-151-0/+14
|
* Merge branch 'vanguards-cleanup' into 'main'Alexander Færøy2024-04-153-37/+4
|\ | | | | | | | | tor-guardmgr: Minor vanguard-related cleanups See merge request tpo/core/arti!2088
| * tor-guardmgr: Remove unnecessary mutable reference.Gabriela Moldovan2024-04-152-4/+4
| |
| * tor-guardmgr: Remove outdated TODO.Gabriela Moldovan2024-04-151-6/+0
| | | | | | | | It was addressed in !2083
| * tor-guardmgr: Remove outdated documentation.Gabriela Moldovan2024-04-151-3/+0
| | | | | | | | | | This is no longer true because of !2082. The `VanguardSet` *does* own its `TimeBoundVanguards`.
| * tor-guardmgr: Remove unused TimeBoundVanguard implementations.Gabriela Moldovan2024-04-151-24/+0
| | | | | | | | These are not used anymore as of !2082, so we can remove them now.
* | vanguards: Fix another doc refIan Jackson2024-04-151-1/+1
| | | | | | | | This was a typo.
* | vanguards: Fix a doc refIan Jackson2024-04-151-2/+3
| | | | | | | | This is a broken link when built without --document-private-items.
* | tor-rtcompat: Add CoarseTimeProvider to docs for Runtime traitIan Jackson2024-04-151-0/+1
|/ | | | I overlooked this, apparently.
* tor-hsservice: use shared status_tx to report OnionServiceStatus via ↵Richard Pospesel2024-04-131-6/+0
| | | | RunningOnionService::status_events()
* tor-guardmgr: Split derive list over multiple lines.Gabriela Moldovan2024-04-111-2/+4
|
* tor-guardmgr: Derive Ord for VanguardMode.Gabriela Moldovan2024-04-112-12/+16
|
* tor-guardmgr: Expand on a TODO about handling config changes.Gabriela Moldovan2024-04-111-0/+4
|
* tor-guardmgr: Add a TODO about updating has_onion_svc on reconfigure.Gabriela Moldovan2024-04-111-0/+1
|
* tor-guardmgr: Fix typo in VanguardMgr error message.Gabriela Moldovan2024-04-111-1/+1
|
* tor-guardmgr: Read the VanguardMode from VanguardParams.Gabriela Moldovan2024-04-111-26/+54
| | | | | | Based on our discussion on https://gitlab.torproject.org/tpo/core/torspec/-/merge_requests/258#note_3011734 If it turns out this is not the behaviour we want, we can update `Inner::mode()` accordingly.
* tor-guardmgr: Store whether we're running an onion svc (fmt).Gabriela Moldovan2024-04-111-1/+6
|
* tor-guardmgr: Store whether we're running an onion svc.Gabriela Moldovan2024-04-113-3/+18
| | | | | | The `VanguardMgr` needs to know whether arti is running as an onion service or not, in order to figure out which of the `vanguards_enabled` and `vanguards_hs_service` modes to use.
* tor-guardmgr: Add the two VanguardModes to VanguardParams.Gabriela Moldovan2024-04-111-0/+12
| | | | | | | | We have two vanguard modes, one for when arti is running as a client, and a separate one for when it's running as a service. Both modes are extracted from the `NetParameters`, so they belong in `VanguardParams`.
* Merge branch 'rpc_deftly' into 'main'Ian Jackson2024-04-1124-290/+510
|\ | | | | | | | | Refactor RPC system to use derive_deftly; add generic-object support See merge request tpo/core/arti!2079
| * Add TODO RPC items from review.Nick Mathewson2024-04-112-0/+9
| |
| * Fix a comment.Nick Mathewson2024-04-111-2/+1
| |
| * rpc: Add a missing not() to generic test.Nick Mathewson2024-04-111-1/+1
| |
| * Upgrade derive-deftly requirement to 0.10.3Nick Mathewson2024-04-1111-12/+12
| | | | | | | | We're taking this for the fix to derive-deftly#52.
| * Remove a duplicate $twheres.Nick Mathewson2024-04-111-1/+1
| |
| * rpc: Adjust a TODO comment.Nick Mathewson2024-04-111-1/+1
| |
| * rpc: Move deftly attributes into an `rpc` namespace.Nick Mathewson2024-04-117-24/+24
| |
| * Add generic support for RPC objects.Nick Mathewson2024-04-081-8/+200
| | | | | | | | | | | | | | | | | | Since we can't enumerate every instantiation at compile time, we instead provide a macro to generate an _installer_ function that installs a set of functions for a given instantiation. Due to the limitations of macro_rules, the syntax for generics is a bit ugly.
| * Refactor invoke_fn macro to make inventory optionalNick Mathewson2024-04-081-14/+19
| | | | | | | | | | Now there is an `decl_rpc_invoke_fn` macro that *only* declares the type-erased functions. Another macro's job will be to register it.