aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-circmgr
Commit message (Collapse)AuthorAgeFilesLines
...
* Bump crates that have had backward compatible API changes.Nick Mathewson2022-10-031-3/+3
|
* Add the necessary APIs for bridge-based circuit construction.Nick Mathewson2022-09-261-0/+1
|
* CircMgr: Add an accessor for the CircuitBuilder.Nick Mathewson2022-09-221-0/+8
| | | | | | | Without this, actually building circuits manually is a pain. This API is behind the `experimental-api` feature, and so it does not require a semver.md entry.
* Remove semver.md from arti-1.0.0Nick Mathewson2022-09-071-1/+0
|
* Bump crate versions in preparation for Arti 1.0.0 release.Nick Mathewson2022-09-011-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because we want to work more on ensuring that our semver stability story is solid, we are _not_ bumping arti-client to 1.0.0 right now. Here are the bumps we _are_ doing. Crates with "minor" bumps have had API breaks; crates with "patch" bumps have had new APIs added. Note that `tor-congestion` is not bumped here: it's a new crate, and hasn't been published before. ``` tor-basic-utils minor fs-mistrust minor tor-config minor tor-rtcompat minor tor-rtmock minor tor-llcrypto patch tor-bytes patch tor-linkspec minor tor-cell minor tor-proto minor tor-netdoc patch tor-netdir minor tor-persist patch tor-chanmgr minor tor-guardmgr minor tor-circmgr minor tor-dirmgr minor arti-client minor arti-hyper minor arti major arti-bench minor arti-testing minor ```
* Shorten the duration needed in preemptive::test::does_not_predict_old_ports.Alexander Færøy2022-08-311-2/+3
| | | | | | | | | | | This patch shortens the duration of the `does_not_predict_old_ports` test in the preemptive module. AppVeyor spawns its VMs/containers per build, so the `Instant::now()` call returns a value smaller than `60 * 60 + 1` which causes the subtraction to overflow and thus panic. Thanks to @trinity-1686a for the help here. See: tpo/core/arti#563.
* circmgr: treat usage as sensitive.Nick Mathewson2022-08-251-1/+6
|
* enable doc_auto_cfg feature on every crate when documenting for docs.rstrinity-1686a2022-08-242-0/+4
|
* Merge branch 'channel' into 'main'Ian Jackson2022-08-175-16/+76
|\ | | | | | | | | Channel padding See merge request tpo/core/arti!657
| * channel usage: Rename CU::UserTraffic from CU::ExitIan Jackson2022-08-173-6/+6
| | | | | | | | | | As suggested in https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2827246
| * Add semver notesIan Jackson2022-08-171-0/+1
| |
| * Move ChannelUsage from tor_proto to tor_chanmgrIan Jackson2022-08-173-6/+5
| | | | | | | | | | | | | | | | | | | | | | Replace Channel::note_usage with Channel::engage_padding_activities, which unconditionally causes the channel to (start to) do netflow padding things. The condition now lives in chanmgr. Addresses https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/657#note_2826094
| * chanmgr: Use NetDirProvider::params and Arc<dyn..Netparameters>Ian Jackson2022-08-171-0/+1
| | | | | | | | | | | | | | | | | | This gets rid of many Result(). Many parameters are renamed. Test cases of the now-impossible branch are removed. Deleting the match from padding_parameters will come in a moment. I've split off that commit since it has much whitespace noise. for now, change the error type to Void.
| * Introduce ChannelConfigIan Jackson2022-08-161-1/+6
| | | | | | | | | | This commit is just the necessary plumbing. The config is currently empty. We'll add something to it, for padding control, later.
| * Provide ChannelUsage and plumb it all the way downIan Jackson2022-08-164-14/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | Channel padding depends on what the channel is being used for. We therefore need to let the channel code know this information. The implementation of the per-channel padding control logic will be in the new note_usage function, which for now is simply a stub. A future commit will introduce a `PaddingControlState` which lives in the channel frontend; consult the doc comment for that type to see why the plumbing through the channel manager terminates in the channel frontend.
| * dormancy: Plumb through to chanmgr reconfigure_generalIan Jackson2022-08-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The chanmgr remembers the last dormancy state it was told. We invent a chanmgr-specific Dormancy which the arti-client code knows how to convert from the richer top-level dormant status. This avoids having to have everyone know all the variants of the top-level state. To call reconfigure_general, we must also obtain and plumb through a netdir. Right now we must return an internal error if there is in fact no netdir, because reconfigure_general does not yet cope with a missing netdir. Nothing actually *uses* the dormancy yet.
* | Additionally, mark the LostUsablityRace error as a "reset".Nick Mathewson2022-08-161-1/+5
| |
* | Mark some circuit-building errors as "transient".Nick Mathewson2022-08-162-15/+71
|/ | | | | | | | | | | | A "transient" error is one that does not indicate a true failure, but rather an _expected_ need to retry. When we hit one of these, we do not count it against the total number of permitted failures. (We do impose a higher limit on "real failures plus transient failures", though, to prevent infinite loops in the event of a programming error. Closes #517.
* tor-netdir: Collapse by_id and by_relay_id into a single fn.Nick Mathewson2022-08-103-8/+11
| | | | | | There are some downstream changes required for this to work, but they are all just unit tests that could no longer infer the type of an Ed25519 key.
* Final (?) API revisions for tor-linkspecNick Mathewson2022-08-102-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this change, each individual identity type becomes optional. The functions that expose them unconditionally are now in a "legacy" trait that only some downstream types are expected to implement. There are new convenience APIs in HasRelayIds: * to return Option<&keytype>, * to see if one identity-set contains another. This commit will break several downstream crates! For the reviewer's convenience, I will put the fixes for those crates into a series of squash! commits on this one. tor-netdir ---------- Revise tor-netdir to accept optional identities. This required some caveats and workarounds about the cases where we have to deal with a key type that the tor-netdir code does not currently recognize at all. If we start to add more identity types in the future, we may well want more internal indices in this code. tor-proto --------- In order to make tor-proto support optional identities, there were fewer changes than I thought. Some "check" functions needed to start looking at "all the ids we want" rather than at "the two known IDs"; they also needed to accommodate that case where we don't have an ID that we demand. This change will also help with bridges, since we want to be able to connect to a bridge without knowing all of its IDs up front. The protocol currently _requires_ the two current ID types in some places. To deal with that, I added a new `MissingId` error. I also removed a couple of unconditional identity accessors for chanmgr; code should use `target().identity(...)` instead. tor-chanmgr ----------- This is an incomplete conversion: it does not at all handle channel targets without Ed25519 identities yet. It still uses those identities to index its internal map from identity to channel; but it gives a new `MissingId` error type if it's given a channel target that doesn't have one. We'll want to revise the map type again down the road when we implement bridges, but I'd rather not step on the channel-padding work in progress right now. tor-guardmgr ------------ This change is mostly a matter of constructing owned identity types more sensibly, rather than unwrapping them directly. There are some places marked with TODOs where we still depend on particular identity types, because of how the directory protocol works. This will need revisiting when we add bridge support here. tor-circmgr ----------- These changes are just relatively simple API changes in the tests.
* Introduce a RelayIdSet and use it in place of HashSet<RelayId>.Nick Mathewson2022-08-101-8/+11
| | | | | This makes lookups a little more efficient. I do with that HashSet just supported this use-case, but for now this seems our best option.
* Teach guard restrictions about RelayId.Nick Mathewson2022-08-101-2/+7
| | | | | This implementation is (sadly) too copy-heavy or now, because HashSet<RelayId> can't be indexed with RelayIdRef.
* Use accessors in two places where tests look at specific keys.Nick Mathewson2022-08-101-7/+17
| | | | | | (It's safe to require these specific keys, since we constructed the objects for testing, and we know for certain that they contain given keys.)
* Avoid a simple usage of ed_identity() in circmgr testsNick Mathewson2022-08-021-2/+1
|
* Introduce HasRelayIds::same_relay_ids.Nick Mathewson2022-08-023-14/+18
| | | | | This method tells if two HasRelayIds contain exactly the same set of Relay identities, and is generally useful for debugging.
* guardmgr: Change APIs that used to take IDs.Nick Mathewson2022-08-021-10/+8
| | | | These are the other inspiration for #428.
* tor-linkspec: Refactor out traits to represent a relay's ID set.Nick Mathewson2022-08-025-4/+5
| | | | | | | | | | | | | | We want the set of identities supported by a relay to be extensible in the future with minimal fuss; we'd also like to make working with these ID sets more convenient. To handle that, this commit adds a new trait for "Something that has the same IDs as a relay" and a new object for "an owned representation of a relay's IDs." This commit introduces a similar trait for "Something with a list of SocketAddr, like a relay has." There's no owned equivelent for that, since Vec<SocketAddr> is already a thing. Closes #428.
* Now that versions have bumped, remove semver.md files.Nick Mathewson2022-08-011-1/+0
|
* Bump patch versions on crates that have new APIs.Nick Mathewson2022-08-011-2/+2
| | | | | | | | | | | | | | Do _not_ bump the dependency versions on crates that have had no changes since arti 0.0.5, since those crates do not depend on the new APIs. ``` cargo set-version -p tor-basic-utils --bump patch cargo set-version -p tor-llcrypto --bump patch git restore crates/tor-checkable git restore crates/tor-consdiff git restore crates/tor-rtmock ```
* Bump minor version on crates with deps with breaking changes.Nick Mathewson2022-08-011-3/+3
| | | | | | | | | | | | | | | This performs the transitive closure of the last operation: everything that depends on a crate with a breaking change gets the version which it depends on bumped. ``` cargo set-version -p tor-proto --bump minor cargo set-version -p tor-netdoc --bump minor cargo set-version -p arti-hyper --bump minor cargo set-version -p arti-bench --bump minor cargo set-version -p arti-testing --bump minor cargo set-version -p tor-config --bump minor ```
* Bump minor versions on all crates that have had breaking changes.Nick Mathewson2022-08-011-9/+9
| | | | | | | | | | | | | | | | | | | | | | Done with these commands: ``` cargo set-version -p fs-mistrust --bump minor cargo set-version -p tor-bytes --bump minor cargo set-version -p tor-socksproto --bump minor cargo set-version -p tor-cert --bump minor cargo set-version -p tor-linkspec --bump minor cargo set-version -p tor-cell --bump minor cargo set-version -p tor-netdir --bump minor cargo set-version -p tor-persist --bump minor cargo set-version -p tor-chanmgr --bump minor cargo set-version -p tor-guardmgr --bump minor cargo set-version -p tor-circmgr --bump minor cargo set-version -p tor-dirclient --bump minor cargo set-version -p tor-dirmgr --bump minor cargo set-version -p arti-client --bump minor cargo set-version -p arti --bump minor ```
* fix runtime issues on iostrinity-1686a2022-07-301-4/+6
|
* CircMgr: Remove directory liveness testing.Nick Mathewson2022-07-262-23/+2
|
* CircMgr: Update to new NetDirProvider APINick Mathewson2022-07-261-8/+7
| | | | | Everything here wants a timely directory, except that it is okay to build timeout-testing circuits with a stale one.
* Apply 1 suggestion(s) to 1 file(s)Ian Jackson2022-07-131-1/+1
|
* circmgr: Refactor DirPathBuilder::pick_path.Nick Mathewson2022-07-121-9/+7
| | | | | We no longer needs to have a "return" at the end of each match block.
* circmgr: Use FilterCounts to explain why we couldn't build pathsNick Mathewson2022-07-124-20/+58
|
* circmgr: Use FilterCounts to explain why we couldn't find an exit.Nick Mathewson2022-07-122-14/+40
|
* tor-circmgr: Clarify and improve Protocol error.Nick Mathewson2022-07-123-1/+24
|
* tor-circmgr: minor error message edits.Nick Mathewson2022-07-121-5/+5
|
* Add more information to failed-to-select fallback errors.Nick Mathewson2022-07-071-1/+1
| | | | Also re-order the filters to be a little more logical.
* Bump crate and dependency versions.Nick Mathewson2022-06-241-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These were done with the following commands: ``` cargo set-version -p tor-basic-utils --bump patch cargo set-version -p fs-mistrust --bump minor cargo set-version -p tor-error --bump patch cargo set-version -p tor-config --bump patch cargo set-version -p tor-units --bump patch cargo set-version -p tor-rtcompat --bump minor cargo set-version -p tor-llcrypto --bump patch cargo set-version -p tor-bytes --bump minor cargo set-version -p tor-socksproto --bump minor cargo set-version -p tor-cert --bump minor cargo set-version -p tor-cell --bump minor cargo set-version -p tor-proto --bump minor cargo set-version -p tor-netdoc --bump patch cargo set-version -p tor-netdir --bump minor cargo set-version -p tor-persist --bump patch cargo set-version -p tor-chanmgr --bump minor cargo set-version -p tor-guardmgr --bump minor cargo set-version -p tor-circmgr --bump patch cargo set-version -p tor-dirclient --bump patch cargo set-version -p tor-dirmgr --bump minor cargo set-version -p arti-client --bump patch cargo set-version -p arti --bump minor cargo set-version -p arti-bench --bump minor cargo set-version -p arti-testing --bump minor ```
* clippy: Consolidate many lints in maint/add_warningIan Jackson2022-06-241-1/+8
| | | | | | Found these by disabling the nightly dbg macro special case. Now, we have a mechanism for globally adding suppressions to tests, we can use that instead.
* Run maint/add_warning crates/*/src/{lib,main}.rsIan Jackson2022-06-231-0/+3
| | | | Update all lint blocks
* Do not include error source() in display() format.Nick Mathewson2022-06-211-5/+5
| | | | | | | | | According to doc/Errors.md, and in keeping with current best practices, we should not include display an error's `source()` as part of that error's display method. Instead, we should let the caller decide to call source() and display that error in turn. Part of #323.
* CircMgr: Enable reachable_addrs filter.Nick Mathewson2022-06-172-1/+21
|
* Add a configuration option for reachable_addrsNick Mathewson2022-06-171-0/+28
| | | | (This doesn't do anything yet.)
* Merge branch 'high-level-features' into 'main'Nick Mathewson2022-06-161-0/+2
|\ | | | | | | | | | | | | Add "full" and "experimental" features to arti, arti-client, and below. Closes #499 See merge request tpo/core/arti!584
| * Add "full" and "experimental" features to arti-client and below.Nick Mathewson2022-06-101-0/+2
| | | | | | | | | | | | | | | | | | The "full" feature is a catch-all for all features, _except_: * Those that select a particular implementation (like tor-llcrypto/with-openssl) or build flag (like "static") * Those that are experimental or unstable (like "experimental-api") * Those that are testing-only.
* | tor-netdir: testnet: Make construct_netdir infallible (rustfmt)Ian Jackson2022-06-134-21/+7
| | | | | | | | | | Run rustfmt. Separate commit to make review of the substantive commit easier.