summaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | keymanip: Use doc(cfg(...)) in place of "Availability" sectionsNick Mathewson2024-08-211-8/+2
| | | |
| * | | llcrypto: Make `blind_keypair` build without hsv3-client.Nick Mathewson2024-08-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `blind_keypair` function should only call `blind_pubkey` when it is present. Also, fix the documentation: blind_keypair is a hsv3-service function, not a hsv3-client function. Closes #1504.
* | | | rpclib: Allow ConnectionClosed in arti_socket_closed testNick Mathewson2024-08-211-0/+9
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test is supposed to check the case where we launch a bunch of requests but the socket is dropped before we get a response. Different operating systems handle 'drop' a bit differently, and schedule threads differently, so we shouldn't be surprised at slightly different errors here. In particular, OSX is more prone to deliver the close as a proper "close" rather than an EPIPE or such, which previously broke this test. Closes #1510.
* | | Merge branch 'noop-tracker-2' into 'main'Ian Jackson2024-08-219-134/+448
|\ \ \ | | | | | | | | | | | | | | | | Make arrangements in tor-memquota for memory tracking to be optional See merge request tpo/core/arti!2351
| * | | tor-memquota: IfEnabled: Complete a thought in a commentIan Jackson2024-08-211-1/+3
| | | | | | | | | | | | | | | | | | | | Reported at https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2351#note_3062292
| * | | tor-memquota: Pass EnabledToken to HasMemoryCost methodIan Jackson2024-08-192-17/+29
| | | |
| * | | tor-memquota: Pass EnabledToken to IsParticipant methodsIan Jackson2024-08-196-19/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This will hopefully allow much caller code to be compiled out. The users (IsParticipant impls) don't generally need to bother with it - they can just ignore it.
| * | | tor-memquota: Put EnabledToken in various structs, including the reclaimerIan Jackson2024-08-193-4/+26
| | | |
| * | | tor-memquota: Allow memory tracking to be compiled outIan Jackson2024-08-196-6/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Now if we run doctests without the feature enabled, we test that a no-op MemoryQuotaTracker works. Those tests aren't currently run in CI, but they will be after !2350.
| * | | tor-memquota: Support a no-op MemoryQuotaTrackerIan Jackson2024-08-194-51/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wrap up most of the structures in IfEnabled. Sadly this diff is very noisy. I experimented with macros for the little enabled check at the start of each function but they didn't really help. We don't test this yet. We'll do a smoke test of this later.
| * | | tor-memquota: Introduce self_ variables in mtracker.rs (fmt)Ian Jackson2024-08-191-1/+4
| | | |
| * | | tor-memquota: Introduce self_ variables in mtracker.rsIan Jackson2024-08-191-48/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're going to bind self_ to something more complicated, in each of these functions, and that's what all these field references etc. will need to refer to. Do this mechanical change first for clarity.
| * | | tor-memquota: Introduce IfEnabled and EnabledTokenIan Jackson2024-08-193-0/+84
| | | | | | | | | | | | | | | | EnabledToken is pub because it's going to appear in public APIs.
| * | | tor-memquota: find_in_tracker: Allow internal use of non-unit errorsIan Jackson2024-08-191-6/+6
| | | |
| * | | tor-memquota: pre-apply rustfmt churnIan Jackson2024-08-192-4/+14
| |/ / | | | | | | | | | This will make some later diffs easier to read.
* | | Merge branch 'rpc-delegate' into 'main'Nick Mathewson2024-08-213-32/+138
|\ \ \ | | | | | | | | | | | | | | | | rpcbase: Implement RPC method delegation support. See merge request tpo/core/arti!2342
| * | | rpcbase: Implement RPC method delegation support.Nick Mathewson2024-08-143-32/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (Couldn't use Deref here, since we needed to get an Arc.) Only one delegation target per object is permitted for now. This will help with #1523.
* | | | relay: Add basic configuration and builderDavid Goulet2024-08-204-4/+267
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the basic TorRelayConfig object along a builder in order to create a TorRelay object. At this commit, the configuration object only holds a "StorageConfig" which is a simple starting point which will allow to expand to a KeyMgr and then a ChanMgr along more configuration. There is also no custom Error for the crate at this point. Fixes #1534 Signed-off-by: David Goulet <[email protected]>
* | | tor-log-ratelim: test: add logstate testskn0sys2024-08-201-0/+64
| |/ |/| | | | | | | | | This commit adds the display_recovery and display_problem tests. Line coverage is increased from 0 to 96.97 percent.
* | tor-circmgr: removed unused 'skip_guard_subnet_check' workaround in testsSteven Engler2024-08-151-18/+5
| |
* | tor-circmgr: removed unused "chosen exit" functionalitySteven Engler2024-08-153-159/+18
| |
* | Merge branch 'flow-ctrl-future' into 'main'Jim Newsome2024-08-155-143/+241
|\ \ | | | | | | | | | | | | tor-proto: Encapsulate flow-control See merge request tpo/core/arti!2340
| * | Circuit reactor: Update comments about outbound message handlingJim Newsome2024-08-151-3/+7
| | |
| * | Circuit reactor: remove `'hop_streams` loopJim Newsome2024-08-131-33/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As clippy points out otherwise, this no longer actually loops. Since the iterator already guarantees that the messages it produces are ready to send with respect to flow control, and we've already validated that we can send with respect to the circuit window, the loop, we can always handle the first item from the iterator. i.e. this changes a `while let` to an `if let`.
| * | Circuit reactor: remove `'outer` loopJim Newsome2024-08-131-55/+50
| | | | | | | | | | | | This is no longer needed. Removing it shouldn't change any behavior.
| * | Circuit reactor: don't process streams when we don't have circuit windowJim Newsome2024-08-131-18/+11
| | | | | | | | | | | | | | | | | | | | | When we've exhausted circuit-level SENDME window, iterating over streams is likely to be a waste of CPU. Theoretically we might be able to send some messages that don't count towards windows, but on balance it doesn't seem worth it.
| * | StreamMap: apply stream flow control before making messages availableJim Newsome2024-08-132-17/+83
| | | | | | | | | | | | | | | | | | This prevents us from having to iterate over streams blocked on flow control inside the circuit reactor, and potentially allows further simplification.
| * | tor-proto: Encapsulate flow-controlJim Newsome2024-08-135-59/+132
| | | | | | | | | | | | | | | | | | Encapsulate flow-control into a separate object that partially abstracts away the difference between window-based (legacy) flow control and xon-based (prop324) flow control.
| * | Circuit reactor: remove unnecessary circ window precheckJim Newsome2024-08-131-21/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since we no longer have an outbound queue for each hop, and instead return an error here if there is insufficient circuit window to send a message, there's no need to pre-check whether we have sufficient window. If there's insufficient circuit window, we'll still return an error slightly later, after failing to take from the circuit window.
| * | StreamMap: rm stray commentJim Newsome2024-08-131-3/+0
| | |
* | | tor-memquota: mq_queue: tests: Replace eprintln with debugIan Jackson2024-08-151-1/+1
| | | | | | | | | | | | We use `debug!` (tracing logging) everywhere else. Use it here too.
* | | tor-memquota: mq_queue: tests: fill_and_empty: check balanceIan Jackson2024-08-151-0/+3
| | |
* | | tor-memquota: mq_queue: tests: break out check_zero_claimed and fix bugIan Jackson2024-08-151-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each queue has two `Participation`s, not just one. This didn't matter in the `lifecycle` test, because one of the two Participations was never touched since it was cloned, and a fresh clone starts out with a cache of zero. But we're about to reuse this code in a context where both Participations end up with a cache.
* | | tor-memquota: mq_queue: impl Default for MpscUnboundedSpecIan Jackson2024-08-151-1/+1
| | |
* | | tor-memquota: mq_queue: Provide `new` constructors for SpecsIan Jackson2024-08-152-3/+8
| | | | | | | | | | | | | | | Discussed here https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2292#note_3059928
* | | tor-memquota: mq_queue: Fix doc for `MpscSpec`Ian Jackson2024-08-151-2/+2
| | | | | | | | | | | | It's not a unit. It's `MpscUnboundedSpec` that's a unit
* | | tor-memquota: mq_queue: Rename Mpsc to MpscSpecIan Jackson2024-08-151-12/+12
| | | | | | | | | | | | | | | | | | | | | And MpscUnboundedSpec too. As discussed in https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2292#note_3059516
* | | tor-memquota: mq_queue: Add a caveat about faithfulness/accuracyIan Jackson2024-08-151-0/+14
| | | | | | | | | | | | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2292#note_3059543
* | | tor-memquota: Rename mby test helper fn to mbytesIan Jackson2024-08-153-18/+18
| | | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2292#note_3059520
* | | tor-memquota: mq_queue: Call mpsc::Receiver::close in our rx DropIan Jackson2024-08-151-0/+27
| | | | | | | | | | | | | | | Fixes the livelock possibility discussed here https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2292#note_3059519
* | | tor-memquota: StreamUnobtrusivePeeker: provide as_raw_inner_pin_mutIan Jackson2024-08-151-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | This will let us call mpsc::Receiver::close. We have it take Pin, even though we don't really want that for our use case, because if you use StreamUnobtrusivePeeker with a non-Unpin stream you'll ant that.
* | | tor-memquota: mq_queue: Add fill_and_empty testIan Jackson2024-08-151-0/+23
| | | | | | | | | | | | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2292#note_3059518
* | | tor-memquota: Add blank lines before fns except in testsIan Jackson2024-08-151-0/+6
| | | | | | | | | | | | | | | Requested by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2292#note_3059517
* | | tor-memquota: Fix typosIan Jackson2024-08-152-5/+5
| | |
* | | tor-memquota: Add mq_queue, memory-quota-tracking (MPSC) queue (tests)Ian Jackson2024-08-151-0/+179
| | |
* | | tor-memquota: Add mq_queue, memory-quota-tracking (MPSC) queueIan Jackson2024-08-155-5/+507
| | |
* | | tor-memquota: Add a Sealed traitIan Jackson2024-08-152-0/+7
| | | | | | | | | | | | We'll use this in a moment.
* | | tor-memquota: Provide Participation::new_dangling and WeakAccount::new_danglingIan Jackson2024-08-151-0/+26
| | | | | | | | | | | | | | | We're going to want the one for Participation - it saves us an annoying Option. Let's provide the one for WeakAccount too.
* | | Merge branch 'mandatory-guardmgr' into 'main'gabi-2502024-08-157-510/+369
|\ \ \ | | | | | | | | | | | | | | | | tor-circmg: Make `GuardMgr` mandatory See merge request tpo/core/arti!2339
| * | | tor-circmgr: fix flaky `path::exitpath::test::by_ports` testSteven Engler2024-08-132-7/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `path::exitpath::test::by_ports` test sometimes failed now that the test is using a `GuardMgr` since `select_guard`, when given a chosen exit, only ensures that the guard and chosen exit are not in the same family. It does not ensure that the guard and exit do not share an extended family. This commit relaxes an assertion in the test. ```text thread 'path::exitpath::test::by_ports' panicked at crates/tor-circmgr/src/path/exitpath.rs:295:9: assertion failed: r1.can_share_circuit(r3, subnet_config) ``` This "chosen exit" functionality isn't actually being used anywhere (`ExitPathBuilderInner::ChosenExit` is only ever constructed in tests).