aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-hsservice
Commit message (Collapse)AuthorAgeFilesLines
...
* tor-hsservice: Add note about SUGGESTED_EFFORT_DEADZONE.Wesley Aptekar-Cassels2025-07-231-0/+4
|
* tor-hsservice: Fix typo.Wesley Aptekar-Cassels2025-07-231-4/+4
|
* tor-hsservice: Remove remaining `as` casts from suggested effort update.Wesley Aptekar-Cassels2025-07-231-12/+23
| | | | | This basically converts everything to use the num_traits conversion function, and explicitly panics on errors.
* tor-hsservice: Remove another use of `as`.Wesley Aptekar-Cassels2025-07-232-3/+8
| | | | | | This pulls in num_traits (which is already a dependency for PoW) to allow f64 casts that for reasons I do not understand are not implemented via TryFrom in the standard library.
* tor-hsservice: Convert as into checked conversion.Wesley Aptekar-Cassels2025-07-231-1/+1
| | | | | This should never happen, as the queue size is limited to well below u32. However, it's still nicer not to use `as`.
* tor-hsservice: Make num_dequeued u32 instead of usize.Wesley Aptekar-Cassels2025-07-231-2/+2
| | | | | | | | | | | | We need to divide a Duration by this, and Duration only supports division by u32. This is, in a sense, just pushing around where the overflow would happen, (from the conversion in the suggested update to the increment when a item is dequeued). However, this overflow is so unlikely to happen (it would require more that 14 million requests per second) that it does not seem worth slowing down the increment operation to try to handle it.
* tor-hsservice: Fix typos.Wesley Aptekar-Cassels2025-07-231-6/+6
|
* tor-hsservice: Use Mutex for suggested_effort.Wesley Aptekar-Cassels2025-07-231-16/+16
| | | | | | | | This has fewer weird edge cases than RwLock does. It might also be reasonable to make this a AtomicU32 (or AtomicEffort which wraps AtomicU32), but that's slightly more complex, so I've opted for a mutex for now.
* tor-hsservice: Add tests for PowManager control loop.Wesley Aptekar-Cassels2025-07-231-21/+244
| | | | | | This modifies the code to be more testable (making it generic over RendRequest, getting the time from the runtime rather than Instant::now(), etc) and adds some tests for the PoW control loop.
* tor-hsservice: Make PowManager generic over RendRequests.Wesley Aptekar-Cassels2025-07-231-12/+15
|
* tor-hsservice: Initial work towards mocking RendRequest.Wesley Aptekar-Cassels2025-07-231-24/+39
|
* tor-hsservice: Allow mocking PowManager.Wesley Aptekar-Cassels2025-07-231-4/+16
|
* tor-hsservice: Enforce maximum RendRequest queue size.Wesley Aptekar-Cassels2025-07-231-0/+12
|
* tor-hsservice: Update suggested effort in PowManager main loop.Wesley Aptekar-Cassels2025-07-231-1/+51
|
* tor-hsservice: Add suggested effort update function.Wesley Aptekar-Cassels2025-07-231-0/+63
|
* tor-hsservice: Give PowManager reference to RendRequestReceiver.Wesley Aptekar-Cassels2025-07-231-3/+8
|
* tor-hsservice: Allow constructing RendRequestReceiver without spawning.Wesley Aptekar-Cassels2025-07-231-19/+21
| | | | | | This will allow the PowManager to have a copy of RendRequestReceiver, which is important to allow the PowManager update loop to control the suggseted_effort updating.
* tor-hsservice: Add state for prop362 update loop.Wesley Aptekar-Cassels2025-07-231-1/+45
|
* tor-hsservice: Change storage of PoW suggested_effort.Wesley Aptekar-Cassels2025-07-231-4/+21
| | | | | | | This makes the suggested_effort value a Arc<RwLock<Effort>>, which is shared between the PowManager (as a reader) and the RendRequestReceiver (as a writer), since the RendRequestReceiver has the information needed to update the suggested_effort value.
* tor-hsservice: Implement PoW queue with BTreeSet.Wesley Aptekar-Cassels2025-07-231-6/+6
| | | | | | | | | | | | | The updated PoW control loop in prop362 requires this data structure to be double ended, which BinaryHeap is not. I benchmarked [email protected] against BTreeSet on a synthetic benchmark based on what I expected typical load to look like, and found that BTreeSet performed much better. It is additionally in the standard library, and is maintained, which no third-party double ended priority queue crate seems to be. Given that, BTreeSet seems like a reasonable thing to build on, although we should provide metrics on the performance of this queue so operators can let us know if it seems to be a problem in real-world use.
* tor-hsservice: RendRequestOrdByEffort use time as tiebreaker.Wesley Aptekar-Cassels2025-07-231-5/+15
| | | | | | | Since this will be used in a BTreeSet, we need to ensure that in practice no two requests will be equal. Ordering by a combination of effort and time received should be sufficient for this, and gives us the behaviour we want.
* Merge branch 'prop360-combined' into 'main'Nick Mathewson2025-07-104-8/+67
|\ | | | | | | | | | | | | Implement proposal 360 (limit HsDesc inflation opportunities) Closes #2046 See merge request tpo/core/arti!3070
| * netdoc, hsservice: Respect maximum descriptor sizesNick Mathewson2025-07-103-4/+19
| | | | | | | | | | It would be better to take a more sophisticated approach; see #2048.
| * hs*: Define some HsDesc errors as _suspicious_.Nick Mathewson2025-07-101-2/+32
| | | | | | | | | | These errors are suspicious as hsdir inflation attacks, in the context of prop360.
| * hs*: Include SourceInfo when making HsDesc requests.Nick Mathewson2025-07-102-2/+16
| |
* | Typo fixes (automatic and hand-verified)Nick Mathewson2025-07-093-5/+5
|/ | | | Made with https://crates.io/crates/typos-cli
* Bump all the unstable tor- and arti- crates to 0.32.0.Gabriela Moldovan2025-07-071-30/+30
| | | | | | | | | | Done using: ``` for crate in $(./maint/list_crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.32.0 done ```
* Bump the versions of the non-{arti-,tor-} crates.Gabriela Moldovan2025-07-071-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The non-{arti-,tor-} crates are: ``` ./maint/list_crates | rg -v '^(tor|arti)' oneshot-fused-workaround slotmap-careful test-temp-dir fslock-guard hashx equix caret fs-mistrust safelog retry-error ``` We split them in the following categories: * crates with no changes (no version bumps): None ``` maint/changed_crates -v "arti-v$LAST_VERSION" 2>&1 >/dev/null | grep -i "no change" | grep -v '\(tor\|arti\)-' ``` * crates that only have non-functional changes (bump the patch version): - oneshot-fused-workaround - slotmap-careful - test-temp-dir - fslock-guard - hashx - equix - caret - safelog - retry-error * crates where APIs were broken (bump minor): - fs-mistrust (the implicit once_cell feature was removed) The bumps from this commit were created using this script: ``` PATCH=" oneshot-fused-workaround slotmap-careful test-temp-dir fslock-guard hashx equix caret safelog retry-error " for crate in $PATCH; do cargo set-version --bump patch -p $crate; done MINOR=" fs-mistrust " for crate in $MINOR; do cargo set-version --bump minor -p $crate; done ```
* tor-hsservice: Suppress false-positive clippy::useless_concat.Gabriela Moldovan2025-07-071-1/+4
|
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* Merge branch 'arti-1.4.5-prep' into 'main'gabi-2502025-07-071-1/+1
|\ | | | | | | | | Run fixup-features, upgrade deps in preparation for release See merge request tpo/core/arti!3083
| * Upgrade to derive-deftly 1.1.0.Gabriela Moldovan2025-07-071-1/+1
| | | | | | | | | | | | I had to also bump `toml` to `0.8.23`, because `toml 0.8.22` is incompatible with `serde_spanned 0.6.9` (which is automatically pulled in because of the d-d upgrade).
* | hspow: Add a clippy::cognitive_complexity exceptionNick Mathewson2025-07-031-0/+1
|/
* hsservice: Stop using HopNum and use TargetHopDavid Goulet2025-06-261-1/+1
| | | | | | | | | | | This requires some changes to the tor-proto crate to handle the inbound TargetHop from the HS subsystem and then resolve it into a HopNum for a single circuit. It is expected that this will change again with Conflux to only use HopLocation internally in a Tunnel and then use HopNum into a Circuit. Signed-off-by: David Goulet <[email protected]>
* proto: Make send_raw_msg() use a TargetHopDavid Goulet2025-06-261-1/+1
| | | | | | | | | | | | | | | In order for this to work, a last_target_hop() function is added to ClientCirc in order to return a precise hop location as a TargetHop of the last hop. This is needed because in the HS subsystem, we need such value in order to get a location on the last physical hop before adding the virtual hop. The RDV1 cell is sent to that last target hop while the allow_stream_request() is done on the virtual target hop. Signed-off-by: David Goulet <[email protected]>
* hs: Remove the use of HopNum and instead use TargetHopDavid Goulet2025-06-261-4/+1
| | | | | | | | | | This is in the spirit of making everything going inbound the tor-proto crate to use a TargetHop. This becomes much easier for the HS subsystem as it only uses the last hop for its conversation and setup. Signed-off-by: David Goulet <[email protected]>
* proto: Add a control command to get the binding keyDavid Goulet2025-06-261-1/+3
| | | | | | | | | | | | | This allows us to use TargetHop instead of HopNum but also to get one step closer to not depend on a mutable state. We prefer resolving a TargetHop within the Reactor object in order to use the circuit list instead of the MutableState path. The HS service subsystem is modified to use this modified function that is now async and uses a TargetHop. Signed-off-by: David Goulet <[email protected]>
* proto: Move NegotiatedHopSettings to a higher levelNick Mathewson2025-06-101-1/+5
| | | | | | We will construct this object based on the circuit parameters _and_ on the target's supported protocol versions, so we need to do so when we have both pieces of info.
* release: Bump all tor-/arti- crates to 0.31.0.Alexander Hansen Færøy2025-06-051-30/+30
| | | | | | | | This was done using: for crate in $(./maint/list_crates | grep -P '^tor-|^arti-'); do cargo set-version -p $crate 0.31.0 done
* release: Bump crates non-arti/non-tor crates with functional changes.Alexander Hansen Færøy2025-06-051-1/+1
| | | | | | | | This is done using: cargo set-version --bump patch -p fs-mistrust cargo set-version --bump patch -p equix cargo set-version --bump patch -p fslock-guard
* Sort dependencies to make cargo sort happy.Alexander Hansen Færøy2025-06-041-10/+11
|
* Fix various missing incorrect feature entries as prep for release.Alexander Hansen Færøy2025-06-031-1/+1
|
* *: suppress cognitive_complexity warnings from nightlyNick Mathewson2025-05-294-0/+6
| | | | | | | | | | | | | Apparently clippy nightly is better (or worse?) about detecting complex functions than before, so I'm suppressing these warnings where they occur. I have mixed feelings about these warnings: On the plus side, they really do help to detect functions that are twistier than they need to be. On the minus side, they get confused by tracing macros, and the "allows" do pile up. But on the plus side, those "allows" do provide a way to find functions that need to be refactored, and they are never uglier than the functions they decorate.
* tor-hsservice: Fix typo.Wesley Aptekar-Cassels2025-05-271-1/+1
|
* tor-hsservice: Warn instead of panic on KeyMgr error in PowManager.Wesley Aptekar-Cassels2025-05-271-4/+8
|
* tor-hsservice: Refactor PoW error handling.Wesley Aptekar-Cassels2025-05-272-17/+35
| | | | | | This adds a error type for internal errors, and in error cases where we previously panicked, returns a Result instead. The publisher then simply doesn't publish the pow_params line and warns the user.
* tor-hsservice: Make PoW publisher_update_tx closed a warning.Wesley Aptekar-Cassels2025-05-271-4/+3
| | | | | This shouldn't happen, but there's not a good reason to panic if it does.
* tor-hsservice: Make PowManager persist state.Wesley Aptekar-Cassels2025-05-275-13/+75
|
* tor-hsservice: Add ReplayLog to PowManager.Wesley Aptekar-Cassels2025-05-274-15/+71
|
* tor-hsservice: Add PowNonceReplayLog.Wesley Aptekar-Cassels2025-05-272-0/+37
|