summaryrefslogtreecommitdiff
path: root/crates/tor-circmgr
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'versions' into 'main'Ian Jackson2024-10-301-24/+24
|\ | | | | | | | | Version bumps for release of 1.3.0 See merge request tpo/core/arti!2599
| * Bump minor versions of crates with new APIs/implsIan Jackson2024-10-301-1/+1
| | | | | | | | | | cargo set-version --bump=patch -p slotmap-careful cargo set-version --bump=patch -p safelog
| * Bump unstable tor-* and arti-* crates to 0.24.0Ian Jackson2024-10-301-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cargo set-version -p tor-async-utils 0.24.0 cargo set-version -p tor-basic-utils 0.24.0 cargo set-version -p tor-bytes 0.24.0 cargo set-version -p tor-cell 0.24.0 cargo set-version -p tor-cert 0.24.0 cargo set-version -p tor-chanmgr 0.24.0 cargo set-version -p tor-checkable 0.24.0 cargo set-version -p tor-circmgr 0.24.0 cargo set-version -p tor-config 0.24.0 cargo set-version -p tor-config-path 0.24.0 cargo set-version -p tor-consdiff 0.24.0 cargo set-version -p tor-dirclient 0.24.0 cargo set-version -p tor-dirmgr 0.24.0 cargo set-version -p tor-error 0.24.0 cargo set-version -p tor-general-addr 0.24.0 cargo set-version -p tor-geoip 0.24.0 cargo set-version -p tor-guardmgr 0.24.0 cargo set-version -p tor-hsclient 0.24.0 cargo set-version -p tor-hscrypto 0.24.0 cargo set-version -p tor-hsrproxy 0.24.0 cargo set-version -p tor-hsservice 0.24.0 cargo set-version -p tor-key-forge 0.24.0 cargo set-version -p tor-keymgr 0.24.0 cargo set-version -p tor-linkspec 0.24.0 cargo set-version -p tor-llcrypto 0.24.0 cargo set-version -p tor-log-ratelim 0.24.0 cargo set-version -p tor-memquota 0.24.0 cargo set-version -p tor-netdir 0.24.0 cargo set-version -p tor-netdoc 0.24.0 cargo set-version -p tor-persist 0.24.0 cargo set-version -p tor-proto 0.24.0 cargo set-version -p tor-protover 0.24.0 cargo set-version -p tor-ptmgr 0.24.0 cargo set-version -p tor-relay-crypto 0.24.0 cargo set-version -p tor-relay-selection 0.24.0 cargo set-version -p tor-rpcbase 0.24.0 cargo set-version -p tor-rtcompat 0.24.0 cargo set-version -p tor-rtmock 0.24.0 cargo set-version -p tor-socksproto 0.24.0 cargo set-version -p tor-units 0.24.0 cargo set-version -p arti-client 0.24.0 cargo set-version -p arti-relay 0.24.0 cargo set-version -p arti-rpc-client-core 0.24.0 cargo set-version -p arti-rpcserver 0.24.0
* | cargo: Run fixup-features (formatting)Ian Jackson2024-10-301-1/+2
| | | | | | | | Manual fixup. I filed #1719 about the fact that I had to do this.
* | cargo: Run fixup-featuresIan Jackson2024-10-301-1/+1
|/ | | | | | | This is output from nailing-cargo -Eu run -p fixup-features Cargo.toml There are some formatting glitches which I'll fix in a moment.
* tor-circmgr: Clarify that using guarded for client rend is an exception.Gabriela Moldovan2024-10-241-1/+14
|
* tor-circmgr: Rename Short/Extended to Naive/Guarded.Gabriela Moldovan2024-10-244-32/+32
|
* tor-circmgr: Try to clarify what a "circuit stem" is.Gabriela Moldovan2024-10-241-2/+3
|
* tor-circmgr: Post-renaming documentation fixes.Gabriela Moldovan2024-10-244-14/+14
|
* tor-circmgr: s/stub/stem throughout.Gabriela Moldovan2024-10-244-100/+100
|
* tor-circmgr: s/HsCircStubKind/HsCircStemKind.Gabriela Moldovan2024-10-242-27/+27
| | | | As per #1479
* tor-circmgr: s/HsCircStubKind/HsCircStemKind.Gabriela Moldovan2024-10-245-60/+60
| | | | As per #1479
* tor-circmgr: Use the new vanguards terminology throughout.Gabriela Moldovan2024-10-243-75/+75
| | | | | | | | This is the first step towards clarifying the questions from !2230. Corresponding torspec changes: https://gitlab.torproject.org/tpo/core/torspec/-/merge_requests/282 Part of #1479
* Disable a lot of dead code warningsIan Jackson2024-10-171-0/+3
| | | | | | | Now cargo check --workspace --no-default-features --all-targets cargo build -p arti --no-default-features --features=memquota,tokio,native-tls are both clean.
* Merge branch 'mq-prevent' into 'main'Ian Jackson2024-10-151-1/+6
|\ | | | | | | | | | | | | Use clippy to prevent non-mq use of mpsc::channel Closes #1659 See merge request tpo/core/arti!2536
| * Introduce mpsc_channel_no_memquota and use it in the places it's wantedIan Jackson2024-10-151-1/+6
| | | | | | | | | | These are the call sites where using this fucntion is correct. (Outside tor-rtmock, which we'll do separately.)
* | memquota: Change ToplevelAccount to be an alias for Arc<MemoryQuotaTracker>Ian Jackson2024-10-153-2/+5
|/ | | | Fixes a TODO.
* Merge branch 'circmgr-code-motion-for-tests' into 'main'Ian Jackson2024-10-081-193/+193
|\ | | | | | | | | Circmgr code motion for tests See merge request tpo/core/arti!2513
| * CircMgr: Move note_external_{failure, success} methods to generic impl.Wesley Aptekar-Cassels2024-10-031-27/+27
| |
| * CircMgr: Move get_or_launch_dir_specific method to generic impl.Wesley Aptekar-Cassels2024-10-031-18/+18
| |
| * CircMgr: Move get_or_launch_exit method to generic impl.Wesley Aptekar-Cassels2024-10-031-45/+45
| |
| * CircMgr: Move get_or_launch_dir method to generic impl.Wesley Aptekar-Cassels2024-10-031-8/+8
| |
| * CircMgr: Move skew_events method to generic impl.Wesley Aptekar-Cassels2024-10-031-11/+11
| |
| * CircMgr: Move retire_circ method to generic impl.Wesley Aptekar-Cassels2024-10-031-6/+6
| |
| * CircMgr: Move reconfigure method to generic impl.Wesley Aptekar-Cassels2024-10-031-67/+67
| |
| * CircMgr: Move retire_all_circuits method to generic impl.Wesley Aptekar-Cassels2024-10-031-11/+11
| |
* | memquota: Add a toplevel account in tor-chanmgrIan Jackson2024-10-032-0/+4
|/ | | | | | | | | Plumb through a top-level account. This doesn't have any channel-specific, circuit-specific or stream-specific accounts yet. tor-circmgr's and tor-hsclient's *tests* need fake account. In arti-relay, use a dummy account for now.
* Merge branch 'div_ceil' into 'main'Nick Mathewson2024-10-031-14/+1
|\ | | | | | | | | Use {u64,usize}::div_ceil See merge request tpo/core/arti!2473
| * Use {u64,usize}::div_ceilNick Mathewson2024-09-301-14/+1
| | | | | | | | | | Previously we had to avoid it, but now that our MSRV is above 1.73 we can use it with abandon.
* | CircMgr: Start writing tests.Wesley Aptekar-Cassels2024-10-038-289/+424
|/
* Remove semver.md files from 1.2.8Nick Mathewson2024-09-301-1/+0
|
* Bump arti- and tor- crates to 0.23.0Nick Mathewson2024-09-301-22/+22
| | | | | | | | | | | | | | Per our policy, every one of these gets a minor bump. Generated with: ``` for crate in $(./maint/list_crates | grep '^\(tor\|arti\)-' ); do cargo set-version --bump minor -p $crate; done ``` (Note the use of `-` at the end end of the grep pattern to prevent matching the `arti` crate.)
* Minor bumps on non-tor/arti cratesNick Mathewson2024-09-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These crates are not in the tor/arti namespace, but we have given them MSRV bumps: ``` oneshot-fused-workaround slotmap-careful fslock-guard hashx equix caret fs-mistrust safelog test-temp-dir retry-error ``` We are counting this as a breaking change. Since all of these crates are at 0.x.x, we have indicated the breaking change with a minor version bump. This commit was generated with the following script: ``` BUMPS=" oneshot-fused-workaround slotmap-careful fslock-guard hashx equix caret fs-mistrust safelog test-temp-dir retry-error " for crate in $BUMPS; do cargo set-version --bump minor -p $crate; done ```
* Merge branch 'msrv-1.77-and-rusqlite-update' into 'main'David Goulet2024-09-261-1/+1
|\ | | | | | | | | Upgrade MSRV to 1.77 , and rusqlite to 0.32.1 See merge request tpo/core/arti!2451
| * Upgrade MSRV to 1.77Nick Mathewson2024-09-251-1/+1
| | | | | | | | This will allow us to upgrade to the latest version of rusqlite.
* | Upgrade to derive_more version 1.0.0Nick Mathewson2024-09-252-3/+3
|/ | | | | | The `derive_more` crate broke backward compatibility with this version, so this change involved quite a few manual fixups. With luck, they'll keep compatibility for some while in the future.
* CircMgr: Make CircMgr and HsCircPool generic over builder type.Wesley Aptekar-Cassels2024-09-247-446/+853
| | | | | | | | | | This will allow for testing, as the CircuitBuilder can be replaced with a mocked version. This did require moving some of what was in the CircuitBuilder impl into the AbstractCircuitBuilder type, since Drop implementations can't be specialized, but that's fine, as we'll probably be doing more of that in the future anyways.
* Bump MSRV from 1.70 to 1.75.Wesley Aptekar-Cassels2024-09-161-1/+1
|
* Add test for CircList::find_open.Wesley Aptekar-Cassels2024-09-161-1/+55
| | | | | | | This tests that when requesting preemptive circuits, they are not given out when a insufficient number of circuits are in the CircList, but that they are given out once the required number of circuits has been reached.
* tor-circmgr: Remove AbstractSpec and FakeSpec.Wesley Aptekar-Cassels2024-09-163-260/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AbstractSpec and FakeSpec actually make testing more difficult, since they prevent using FakeBuilder in code that relies on the concrete TargetCircUsage and SupportedCircUsage types. Removing them means FakeBuilder can be used in more places, and also means that the test code is closer to the real code, since TargetCircUsage and SupportedCircUsage are now exercised directly in more tests. This did require making one change to a test, which I think was previously testing behaviour that was true for FakeSpec but not for the real code: The mgr::test::isolated test previously asserted that, in the case where three circuits were requested, two with isolation and one without, the non-isolated circuit would be shared with one of the isolated circuits. This was allowed by the FakeSpec::supports function. However, in the actual code, the path is as follows: * AbstractCircMgr::get_or_launch * AbstractCircMgr::prepare_action * CircList::find_open * AbstractSpec::find_supported * abstract_spec_find_supported * OpenEntry::supports * SupportedCircUsage::supports * StreamIsolation::compatible_same_type StreamIsolation::compatible_same_type checks owner_type, which is always zero for non-isolated streams and always non-zero for isolated streams, meaning that a isolated stream will never be compatible with a non-isolated stream. The seems like desirable behaviour, so I simply modified the test to make four connections, two isolated and two not, and checked that the isolated streams never share any circuits, and that the two non-isolated streams use the same circuit. As far as I can tell, this is the intended behaviour in the existing code.
* tor-netdir: Allow access to the `ConsensusBuilder` when building test netdirs.Gabriela Moldovan2024-09-093-4/+4
| | | | | This allows us to set SRVs for example (needed because by default, the test `NetDir` is built from a consensus that doesn't contain any SRVs).
* Bump all the unstable tor- and arti- crates to 0.22.0.Gabriela Moldovan2024-09-031-22/+22
| | | | | | | | | | Done using: ``` for crate in $(./maint/list_crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.22.0 done ```
* oneshot-fused-workaround: Set the initial version to 0.1.0.Gabriela Moldovan2024-09-031-1/+1
| | | | This is the first time we're publishing this, so let's start at 0.1.0.
* Fix formatting issues introduced by fixup-features.Gabriela Moldovan2024-09-031-1/+3
|
* Run fixup-features in preparation for release.Gabriela Moldovan2024-09-031-1/+1
|
* Fix typosDimitris Apostolou2024-09-031-1/+1
|
* extract tor_async_utils::oneshot into ::oneshot-fused-workaroundJim Newsome2024-08-284-3/+4
| | | | | | | | | | | | | | Having this in the `tor-async-utils` crate prevents us from doing both of the following without introducing a circular dependency: * using it in `tor-rtmock` (which we currently do, particularly in tests). * using `tor-rtmock` to test things in `tor-async-utils`. We don't do this yet, but it is generally sensible to do so. In particular we want to move the `stream_peak` module there, which is currently tested with `tor-rtmock`. Moving this into its own crate avoids this circular dependency.
* 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
|
* 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).