summaryrefslogtreecommitdiff
path: root/crates/arti-client/src
Commit message (Collapse)AuthorAgeFilesLines
* Several typo fixes from `typos`.Nick Mathewson2022-07-271-1/+1
|
* Update arti-client to new NetDirProvider API.Nick Mathewson2022-07-262-6/+32
| | | | | | This allows us to give better errors in the case where bootstrapping succeeds at first, but fails thereafter for long enough to make our directory expire.
* Rename download_tolerance to directory_toleranceNick Mathewson2022-07-221-3/+8
| | | | Closes #503.
* Rename DirSkewTolerance to DirToleranceNick Mathewson2022-07-221-2/+2
| | | | | | This name is more accurate because we aren't only dealing with clock skew here: we're also trying to tolerate the case where the authorities fail to reach consensus for a while.
* arti-client: Split "Persist" into setup and access variants.Nick Mathewson2022-07-212-5/+16
|
* arti_client: turn "Proto" error into StreamFailed.Nick Mathewson2022-07-212-6/+22
|
* arti_client: Split DirMgr error into useful types.Nick Mathewson2022-07-213-6/+15
|
* arti-client: minor edits in error messages and commentsNick Mathewson2022-07-211-17/+20
|
* arti-client: Remove code related to overriding fs-mistrust.Nick Mathewson2022-07-193-45/+8
| | | | | | | | This logic can now be adjusted via the config object so that it does its own overriding by looking at the environment as appropriate. Removing these methods helps simplify the code a bit. Enabled by #483.
* Move responsibility for disable-fs-mistrust envvar.Nick Mathewson2022-07-192-33/+15
| | | | | | | The variable is now handled when building the configuration, and no longer needs to be special-cased. Closes #483.
* arti-client: Do periodic task dormancy in a management taskIan Jackson2022-07-181-37/+28
| | | | | This means that it is no longer possible to write code which updates the dormant mode but forgets to notify the periodic tasks.
* arti-client: Make dormant_mode be an Option, None on dropIan Jackson2022-07-181-13/+27
| | | | | This will allow receivers (which we are about to introduce) to terminate when the last client is dropped.
* arti-client: Convert dormant_mode into a postage::watchIan Jackson2022-07-181-17/+34
| | | | | | | | We are going to want to be able to wake up other tasks elsewhere in Arti, that need to know about dormancy. We will give them a postage watch Receiver. Right now there are no such things yet.
* arti-client: Make DormantMode have a DefaultIan Jackson2022-07-181-1/+3
|
* arti-client: Add Bug variant to errorIan Jackson2022-07-181-0/+5
| | | | We're going to want this in a moment.
* Fix typoDimitris Apostolou2022-06-281-1/+1
|
* Run maint/add_warning crates/*/src/{lib,main}.rsIan Jackson2022-06-231-0/+3
| | | | Update all lint blocks
* Merge branch 'display_source_cleanup' into 'main'eta2022-06-211-8/+8
|\ | | | | | | | | Do not include error source() in display() format. See merge request tpo/core/arti!598
| * Do not include error source() in display() format.Nick Mathewson2022-06-211-8/+8
| | | | | | | | | | | | | | | | | | 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.
* | Merge branch 'stalled_directory' into 'main'Ian Jackson2022-06-211-1/+17
|\ \ | | | | | | | | | | | | | | | | | | Detect and report stalled directory downloads Closes #468 See merge request tpo/core/arti!587
| * | Report directory blockage problems from arti-client.Nick Mathewson2022-06-141-1/+16
| | | | | | | | | | | | Closes #468.
| * | DirMgr: Track errors, stalls, and resets as part of status.Nick Mathewson2022-06-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A "reset" happens whenever we have to start a download attempt over -- either because we ran out of retries, or we found something wrong with the consensus after fetching certificates. An "error" happens when we have a recoverable error from one or more directory sources. A "stall" happens whenever a round of downloads or cache loads leads to no change in the status. We don't yet use this as part of our status reporting.
* | | channel padding: Plumb settings from chanmgrIan Jackson2022-06-211-1/+1
| |/ |/|
* | Merge branch 'main' into 'accel-features'Nick Mathewson2022-06-162-2/+6
|\ \ | | | | | | | | | # Conflicts: # crates/arti-client/Cargo.toml
| * \ Merge branch 'high-level-features' into 'main'Nick Mathewson2022-06-161-41/+68
| |\ \ | | |/ | |/| | | | | | | | | | | | | Add "full" and "experimental" features to arti, arti-client, and below. Closes #499 See merge request tpo/core/arti!584
| | * Remove "rustls" from "full", for license reasons.Nick Mathewson2022-06-151-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Rustls uses ring, which uses code from BoringSSL, which derived from OpenSSL before OpenSSL changed their license. So ring is currently under 3BSD/SSLEay licenses, which aren't GPL-compatible, which may be a problem for some people. See #493.
| * | Merge branch 'dormant_directory' into 'main'Nick Mathewson2022-06-131-0/+1
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | Use TaskSchedule to sleep in directory bootstrapping Closes #497 See merge request tpo/core/arti!571
| | * | New API to expose and use TaskHandle from DirMgr.Nick Mathewson2022-06-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | This change also means that we need to create the handle and scheduler earlier in the process of creating the DirMgr. If we don't, we won't have a way to manage the task before bootstrap() returns.
* | | | Add "accel-*" features to arti-client and arti.Nick Mathewson2022-06-131-0/+9
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | These need to be optional: they improve performance by shifting to asm implementations, which may not be everybody's idea of good practice. These are not 'pure' features, since they select one implementation but disable another. Therefore they don't go in `full`. Closes #441.
* | | Document "full", "experimental" in toplevel crate documentation.Nick Mathewson2022-06-131-41/+65
|/ / | | | | | | | | Also, unify the features documentation format for those two crates, and document previously undocumented features there.
* | Move responsibility for GuardMgr NetDir updates to GuardMgr.Nick Mathewson2022-06-071-7/+0
| | | | | | | | | | | | | | | | | | | | | | Previously it was the job of a task in CircMgr to do this; but we're going to want to give GuardMgr full access to the latest NetDir for this, and for other code-simplification reasons. With this change I'm deprecating a couple of functions in tor-circmgr. It's no longer necessary for us to have an artificial external way for you to feed new NetDirs to a circmgr. (I could just remove them, but I want practice deprecating.)
* | Remove now-redundant Send+Sync constraints alongside NetDirProviderNick Mathewson2022-06-072-4/+4
|/
* 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.
* Split TorClientConfig out of ArtiConfig, and Resolvable traitIan Jackson2022-05-241-0/+4
| | | | | | | | | | | | This gets rid of `#[serde(flatten)]` which prevents serde_ignored (and other kinds of introspection) from working properly. The price is now that the toplevel has to deal with two configuration objects. The Resolvable trait is overkill right now, but is going to do More Things in a moment. In particular, we need the impl on tuples, so that the whole config can be processed in one go.
* Apply fs-mistrust to logfile directories.Nick Mathewson2022-05-241-0/+20
|
* Make fs-mistrust configurable from the top level.Nick Mathewson2022-05-243-35/+87
| | | | | | This change requires a little refactoring of TorClientBuilder: now, instead of enabling or disabling mistrust, it enables or disables the decision to _override_ the mistrust in the config.
* fs-mistrust: make Mistrust have a corresponding Builder type.Nick Mathewson2022-05-242-5/+4
| | | | | This is an approximately minimal revision to get Builder in place; subsequent commits will clean up the API.
* add unit tests for arti_client::StreamPrefsmichael mccune2022-05-231-0/+77
| | | | | | this change adds unit tests for the public methods of StreamPrefs. although these are mostly "setter" style functions, the tests confirm the basic expectations and operation.
* Merge branch 'arti-config-2' into 'main'Nick Mathewson2022-05-131-0/+9
|\ | | | | | | | | Abolish arti-config, replacing with tombstone crate See merge request tpo/core/arti!508
| * arti-config: Move default config file test to arti-clientIan Jackson2022-05-131-0/+9
| | | | | | | | | | | | That's where this definitions is now. This test ought to have been moved in Move default_config_file() into arti-client
* | impl_standard_builder: Have it generate FooConfig::builderIan Jackson2022-05-121-24/+0
|/ | | | | This deletes many handcoded impls. It also generates lots of impls that we previously didn't have.
* Merge branch 'builder-default-bis' into 'main'eta2022-05-121-9/+5
|\ | | | | | | | | impl_standard_builder followup See merge request tpo/core/arti!505
| * Rename impl_standard_builder from impl_default_via_builderIan Jackson2022-05-121-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | I have Plans for this macro. In particular: * I have a wip branch which tests that the Builder can be deserialised from an empty config (ie, that config reading of a config with a blank section for this item works). * I think we should autogenerate $Config::builder(), and promote that, rather than $ConfigBuilder::default(). This macro could do that.
| * config: Move macro calls to next to the structIan Jackson2022-05-121-8/+4
| | | | | | | | | | | | | | This macro is kind of derive-y. Also it has a test in it, and failing to call it could allow bugs to exist, as well as missing bits of API. Putting it next to the structs makes it easy to see that it's actually been called.
* | Merge branch 'ticket_412_467' into 'main'Nick Mathewson2022-05-121-3/+9
|\ \ | |/ |/| | | | | | | | | Teach DirMgr to use slightly untimely directories Closes #467 and #412 See merge request tpo/core/arti!500
| * Add DirSkewTolerance section to DirMgr configuration.Nick Mathewson2022-05-111-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This new section describes how much variance we accept when it comes to expired and not-yet-valid directory documents. (Currently, the only ones where this matters for are consensus documents and authority certificates.) A document that is invalid by no more than these tolerances is not _live_, but it can still be used. These tolerances serve two purposes: * First, they allow clients to run with a little more clock skew than they would tolerate otherwise. * Second, they allow clients to survive the situation where the authorities are unable to reach a consensus for a day or two. Compare with Tor's REASONABLY_LIVE_TIME and NETWORKSTATUS_ALLOW_SKEW constants; also compare with proposal 212. Closes #412.
* | Merge branch 'builder-default' into 'main'eta2022-05-121-27/+5
|\ \ | | | | | | | | | | | | Provide and use macro for impl Derive via Builder See merge request tpo/core/arti!499
| * | Define and use impl_default_via_builderIan Jackson2022-05-111-27/+5
| | |
* | | Add correct serde(default) attrs for humantime_serde::optionIan Jackson2022-05-121-3/+3
|/ / | | | | | | | | | | | | | | | | Discovered by a test case in my local tree. The test case was macro-generated by an extension of impl_standard_builder (which macro istself currently awaiting review, arti!499) Have also sent an MR to update the upstream docs https://github.com/jean-airoldie/humantime-serde/pull/8