summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | 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.
* | | | | Merge branch 'ticket1534_01' into 'main'Alexander Færøy2024-08-205-4/+280
|\ \ \ \ \ | |_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | relay: Add basic configuration and builder Closes #1534 See merge request tpo/core/arti!2352
| * | | | relay: Add basic configuration and builderDavid Goulet2024-08-205-4/+280
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]>
* | | | Merge branch 'tor-log-ratelim-test' into 'main'Ian Jackson2024-08-201-0/+64
|\ \ \ \ | |_|/ / |/| | | | | | | | | | | test: add logstate tests See merge request tpo/core/arti!2349
| * | | 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.
* | | Merge branch 'mandatory-guardmgr' into 'main'gabi-2502024-08-153-177/+23
|\ \ \ | | | | | | | | | | | | | | | | tor-circmgr: Remove unused "chosen exit" functionality See merge request tpo/core/arti!2347
| * | | 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
| | | |
* | | | Merge branch 'queue' into 'main'Ian Jackson2024-08-157-23/+842
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | tor-memquota: (MPSC) queue with memory quota tracking See merge request tpo/core/arti!2292
| * | | | 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 'macos-allow-fail' into 'main'Alexander Færøy2024-08-151-0/+2
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | CI: allow the MacOS build test to fail See merge request tpo/core/arti!2346
| * | | | CI: allow the MacOS build test to failIan Jackson2024-08-151-0/+2
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | My efforts to fix it by flailing with CC versions have not been successful. We need CI passing so we can continue to do other work.
* | | | 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).
| * | | | tor-circmgr: assert in test that exit path begins with guardSteven Engler2024-08-121-2/+4
| | | | |
| * | | | tor-circmgr: make `GuardMgr` mandatorySteven Engler2024-08-127-316/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Functions that took `Option<&GuardMgr>` now take only `&GuardMgr`. Three unit tests were removed that covered behaviour when no guard manager was set.
| * | | | tor-circmg: prepare tests for runtime requirementSteven Engler2024-08-122-218/+229
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This wraps some unit tests with `tor_rtcompat::test_with_all_runtimes!`. This is its own commit to get the indentation changes out of the way and declutter the following commit.
* | | | | Merge branch 'rpc-use-slotmap' into 'main'gabi-2502024-08-156-54/+46
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rpcserver: Use slotmap-careful instead of generational-arena. Closes #1282 See merge request tpo/core/arti!2343