summaryrefslogtreecommitdiff
path: root/crates/tor-netdir
Commit message (Collapse)AuthorAgeFilesLines
* Remove semver.md files now that 0.5.0 is outNick Mathewson2022-06-241-2/+0
|
* Bump crate and dependency versions.Nick Mathewson2022-06-241-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ```
* Run maint/add_warning crates/*/src/{lib,main}.rsIan Jackson2022-06-231-0/+3
| | | | Update all lint blocks
* channel padding: Use IntegerMilliseconds in netdirIan Jackson2022-06-211-8/+8
|
* tor-netdir: Make CHANNEL_PADDING_TIMEOUT_UPPER_BOUND pubIan Jackson2022-06-211-1/+1
| | | | We need this because it is a type parameter for the types of nf_ito_*.
* channel padding: Change timeout to match C TorIan Jackson2022-06-211-1/+6
| | | | Pending an official value from the spec.
* channel padding: Add the parameters from the spec to NetDirIan Jackson2022-06-211-0/+28
|
* Merge branch 'reachable_addrs_v2' into 'main'Nick Mathewson2022-06-171-1/+1
|\ | | | | | | | | | | | | Implement support for reachable_addrs Closes #491 and #93 See merge request tpo/core/arti!583
| * Remove some outdated comments.Nick Mathewson2022-06-171-1/+1
| | | | | | | | | | These all say, in one form or another, "there is no guard filtering; there is only one selection". That's now false.
* | Upgrade to float_eq 1.0.0Nick Mathewson2022-06-161-1/+1
|/
* 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 infallibleIan Jackson2022-06-132-5/+5
|/ | | | | This is a *lot* of unwraps. The function takes no parameters and is used only for testing. It ought to be infallible.
* Merge branch 'use-testing-rng'Nick Mathewson2022-06-074-75/+39
|\
| * Rewrite tests in tor-netdir to use testing_rng()Nick Mathewson2022-06-023-76/+36
| | | | | | | | | | | | | | | | | | | | | | The randomized tests in this crate take a lot of iterations to converge, so they default to using a deterministic PRNG seed with few iterations and higher tolerance, and they only randomize the tests (with more iterations and tighter tolerances) when you explicitly opt in to randomization. (If you specify a seed explicitly, you're doing that to reproduce a randomized case, so we use the same behavior.)
| * Use testing_rng() in tests throughout our crates.Nick Mathewson2022-06-023-1/+5
| | | | | | | | | | | | This only affects uses of thread_rng(), and affects them all more or less indiscriminately. One test does not work with ARTI_TEST_PRNG=deterministic; the next commit will fix it.
* | Make NetDirProvider require Send and Sync.Nick Mathewson2022-06-072-1/+3
| | | | | | | | | | | | | | | | Our own code is the only stuff that consumes NetDirProvider, and all the code that consumes it wants it to be Send and Sync. Making this change avoids our having to define a new function to upcast Arc<dyn Foo> to Arc<dyn NetDirProvider + Send + Sync>.
* | Add an upcast_arc function to NetDirProvider.Nick Mathewson2022-06-021-1/+27
| | | | | | | | | | | | | | | | This uses some apparently-standard trickery to implement a function that lets us upcast from Arc<dyn Subtrait> to Arc<dyn Supertrait>. I considered as alternatives `as_dyn_trait` and `cast_dyn_object`. Both were nice, but generated a far larger interface than this.
* | lints: Add let_unit_value allow to all cratesIan Jackson2022-05-311-0/+1
| | | | | | | | | | From running add_warning, with manual picking of the right hunks/lines.
* | lints: Add lint block delimiters to every crateIan Jackson2022-05-311-0/+2
|/ | | | | | This was the result of: maint/add_warning crates/*/src/{lib,main}.rs and then manually curating the results.
* Lexically sort Cargo.toml dependenciesOrhun Parmaksız2022-05-281-10/+9
| | | | | | Utilize cargo-sort: https://github.com/DevinR528/cargo-sort Signed-off-by: Orhun Parmaksız <[email protected]>
* Regenerate version bump from previous commit.arti-v0.4.0Nick Mathewson2022-05-271-2/+2
| | | | | | | This commit was made by reverting the previous commit, then re-running the script I used to generate it. In theory there should be no semantic changes: only changes due to improved formatting from cargo edit.
* Semantic version changes for Arti 0.4.0 releaseNick Mathewson2022-05-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | I followed the following procedure to make these changes: * I used maint/changed_crates to find out which crates had changed since 0.3.0. * I used grep and maint/list_crates to sort those crates in topological (dependency) order. * I looked through semver_status to find which crates were listed as having semver-relevant changes (new APIs and breaking changes). * I scanned through the git logs of the crates with no semver-relevant changes listed to confirm that, indeed, they had no changes. For those crates, I incremented their patch-level version _without_ changing the version that other crates depend on. * I scanned through the git logs of the crates with no semver-relevant changes listed to confirm that, indeed, they had no obvious breaking changes. * I treated all crates that depend on `arti` and/or `arti-client` as having breaking changes. * I identified crates that depend on crates that have changed, even if they have not changed themselves, and identified them as having a non-breaking change. * For all of the crates, I used `cargo set-version -p $CRATE --bump $STATUS` (where `STATUS` is `patch` or `minor`) to update the versions, and the depended-upon versions.
* Bump versions of trivially-changed crates.Nick Mathewson2022-05-271-1/+1
| | | | | | | | | | | | | | | | | | | These crates had only clippy fixes that do not affect their behavior: tor-bytes tor-cell tor-events tor-linkspec tor-netdir tor-socksproto This crate only had the cargo-husky dependency removed, which does not affect compatibility: tor-llcrypto Since these changes have no compatibility effects, it is not necessary to bump the versions of these crates which other crates depend on.
* Resolve the new `derive_partial_eq_without_eq` lint.Nick Mathewson2022-05-231-1/+1
| | | | It's a little overzealous sometimes, but it's mostly to the good.
* Bump the version of every* crate to 0.3.0Nick Mathewson2022-05-061-9/+9
| | | | * Except for safelog and fs-mistrust, which are new.
* Update README.md files (automated).Nick Mathewson2022-05-061-1/+1
|
* Switch to derive_builder_arti_forkIan Jackson2022-05-061-1/+1
| | | | | | | | | For reference, the git source for this crate (and the others in its workspace) currently lives in my personal github account (ijackson). If this fork turns out to be long-lived and gains features and/or users, it would be good to move it to a gitlab somewhere. I have granted Nick crate ownership on the crates.io system.
* Merge branch 'derive-builder-git-fixup' into 'main'eta2022-04-271-1/+1
|\ | | | | | | | | derive_builder: Use git dep everywhere, rather than cargo patch See merge request tpo/core/arti!477
| * derive_builder: Use git dep everywhere, rather than cargo patchIan Jackson2022-04-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `[patch]` approach causes the tree not to build when used as a dependency, unless the `[patch]` is replicated into the depending project. Instead, replace our `derive_builer =` dependencies with a reference to a specific git commit: perl -i~ -pe 'next unless m/^derive_builder/; s#"(0\.11\.2)"#{ version = "$1", git = "https://github.com/ijackson/rust-derive-builder", rev = "ba0c1a5311bd9f93ddf5f5b8ec2a5f6f03b22fbe" }#' crates/*/Cargo.toml Note that the commitid has changed. This is because derive_builder is in fact a workspace of 4 crates. 3 of them are of interest to arti itself (the 4th exists only for testing). So the same "add git revision" treatment had to be done to the `derive_builder` and `derive_builder_macro` crates. Each dependency edge involves a new commit in the derive_builder workspace, since we can't create a git commit containing its own commitid. (We want to use commits, rather than a branch, so that what we are depending on is actually properly defined, and not subject to the whims of my personal github namespace.) There are no actual code changes in derive_builder.
* | Fix grammar and typosSamanta Navarro2022-04-272-2/+2
|/
* squash! Bump every crate's edition to 2021.Nick Mathewson2022-04-251-2/+0
| | | | | Remove all `use` statements for `TryFrom` and `TryInto`. These are now redundant in Rust 2021.
* Bump every crate's edition to 2021.Nick Mathewson2022-04-251-1/+1
| | | | | | | | | | This is an automated change made with a perl one-liner and verified with grep -L and grep -l. Some warnings are introduced with this change; they will be removed in subsequent commits. See arti#208 for older discussion on this issue.
* Add 'rust-version = "1.56"' to every Cargo.toml file.Nick Mathewson2022-04-251-0/+1
| | | | | | | This change was made automatically with a perl one-liner, and confirmed with `grep -L`. The `rust-version` field itself was introduced in 1.56.0.
* Reformat all not-yet-reformatted Cargo.toml files.Nick Mathewson2022-04-251-12/+12
| | | | | There are no semantic changes here; only formatting. This is in preparation for other changes (wrt MSRV and edition)
* Use git source for derive_builder for now, for sub_builder featureIan Jackson2022-04-211-1/+1
| | | | | | | | | | | | | | | This commitid is the current head of my MR branch https://github.com/colin-kiegel/rust-derive-builder/pull/253 https://github.com/ijackson/rust-derive-builder/tree/field-builder Using the commitid prevents surprises if that branch is updated. We will require this newer version of derive_builder. The version will need to be bumped again later, assuming the upstream MR is merged and upstream do a release containing the needed changes. We will need the new version of not only `derive_builder_core` (the main macro implementation) but also`derive_builder` for a new error type.
* Bump all arti*, tor* crates to 0.2.0Nick Mathewson2022-04-011-9/+9
| | | | | | | | Not all of these strictly need to be bumped to 0.2.0; many could go to 0.1.1 instead. But since everything at the tor-rtcompat and higher layers has had breaking API changes, it seems not so useful to distinguish. (It seems unlikely that anybody at this stage is depending on e.g. tor-protover but not arti-client.)
* Move fallback.rs into guardmgr.Nick Mathewson2022-03-302-87/+0
| | | | | | | This is the logical place for it, I think: the GuardMgr's job is to pick the first hop for a circuit depending on remembered status for possible first hops. Making this change will let us streamline the code that interacts with these objects.
* Merge branch 'disallowed_lint' into 'main'eta2022-03-302-2/+0
|\ | | | | | | | | Remove allow(clippy::disallowed_methods) lint flag. See merge request tpo/core/arti!437
| * Remove allow(clippy::disallowed_methods) lint.Nick Mathewson2022-03-302-2/+0
| |
* | Make daemon tasks self-contained; introduce NetDirProvidereta2022-03-302-0/+51
|/ | | | | | | | | | | | | | | The various background daemon tasks that `arti-client` used to spawn are now handled inside their respective crates instead, with functions provided to spawn them that return `TaskHandle`s. This required introducing a new trait, `NetDirProvider`, which steals some functionality from the `DirProvider` trait to enable `tor-circmgr` to depend on it (`tor-circmgr` is a dependency of `tor-dirmgr`, so it can't depend on `DirProvider` directly). While we're at it, we also make some of the tasks wait for events from the `NetDirProvider` instead of sleeping, slightly increasing efficiency.
* Merge branch 'no-system-time' into 'main'eta2022-03-302-0/+2
|\ | | | | | | | | | | | | Don't use SystemTime::now() Closes #306 See merge request tpo/core/arti!365
| * use wallclock where possible in teststrinity-1686a2022-02-262-0/+2
| |
* | Merge branch 'md_allocation' into 'main'Nick Mathewson2022-03-171-106/+62
|\ \ | | | | | | | | | | | | | | | | | | Use less space in hashtables for microdescriptors Closes #386 See merge request tpo/core/arti!415
| * | netdir: Use an even smaller rep for list of microdescsNick Mathewson2022-03-161-55/+29
| | | | | | | | | | | | | | | | | | | | | Every time we want a microdescriptor, we know the index of that microdesc's corresponding routerstatus within the consensus. Therefore, we can use that index to store `Arc<Microdesc>`s in a dense array, and not have to use a HashSet here at all.
| * | tor-dirmgr: Remove redundant hashtable.Nick Mathewson2022-03-161-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | We were using a hashtable to keep track of missing microdescriptor digests. But this information is redundant with the NetDir state, and there's now no longer any performance benefit to keeping a separate copy. Part of #386.
| * | NetDir: Use less space in hash tablesNick Mathewson2022-03-161-61/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We previously kept missing-MD entries and present-MD entries all in the same HashSet, which resulted in using more slack space than we need. Now we use separate tables, so we can drop missing-MD entries as we move forward. Also, when constructing a NetDir, set its hash tables to their final capacities. This also lets us simplify some of our missing-md-listing code a lot.
* | | derive_builder: Switch to upstream 0.11Ian Jackson2022-03-161-1/+1
|/ / | | | | | | | | | | | | | | | | This has the different syntax for builder field attributes than what I originally proposed in my MR, and which therefore is in the pinned branch. My upstream MR for the field attributes feature was morged: https://github.com/colin-kiegel/rust-derive-builder/issues/239
* | Derive Deserialize for derive-builder-generated config buildersIan Jackson2022-03-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | I used git-grep -P '\#\[serde\((?!default|deny_unknown)' to find places where I needed to add additional attributes on the builder method fields. This is currently a bit duplicative, but when #371 is completely done, the validated (non-builder) configs won't need to be Deserialize any more. This is part of #371 and #372.
* | Use git source for derive_builder for now, for attrs featureIan Jackson2022-03-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We are going to want to specify custom attributes on fields of the builder struct. This feature was missing from derive_builder. This commitid is the current head of my MR branch https://github.com/colin-kiegel/rust-derive-builder/pull/237 https://github.com/ijackson/rust-derive-builder/tree/builder-field-attrs Using the commitid prevents surprises if that branch is updated. We will require this newer version of derive_builder. The version will need to be bumped again later, assuming the upstream MR is merged and upstream do a release containing the needed changes.