summaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | | | | proto: Remove doc ref to private itemGabriela Moldovan2025-10-291-1/+1
| | | | | | | | | |
| * | | | | | | | | proto: Add RelayCirc API for checking if circuit is closedGabriela Moldovan2025-10-291-0/+7
| | | | | | | | | |
| * | | | | | | | | proto: Remove redundant channel from RelayCircGabriela Moldovan2025-10-292-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't really need this channel here, because we already have control and command channels for checking if the reactor task is still alive.
| * | | | | | | | | proto: Make RelayCirc publicGabriela Moldovan2025-10-292-2/+2
| | | | | | | | | |
| * | | | | | | | | proto: Rename RelayReatorHandle to RelayCircGabriela Moldovan2025-10-292-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While this is technically a "reactor handle", I think RelayCirc sounds better, because this is essentially our only public API for interacting with a relay circuit (it will be used outside of tor-proto). (This would also be consistent with our existing ClientCirc client-side terminology).
| * | | | | | | | | proto: Move RelayReactorHandle to relay moduleGabriela Moldovan2025-10-292-11/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will soon become `pub`, so I am factoring it out of `reactor.rs`.
| * | | | | | | | | proto: Update RelayReactorHandle docsGabriela Moldovan2025-10-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BackwardReactor is an implementation detail, so it shouldn't really be mentioned in the soon-to-be-public-facing docs. And besides, the control messages are no longer handled by the BackwardReactor.
* | | | | | | | | | Merge branch 'deftly-1.5' into 'main'Alexander Hansen Færøy2025-11-1026-27/+27
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bump derive-deftly to 1.5.0 See merge request tpo/core/arti!3451
| * | | | | | | | | | Bump derive-deftly to 1.5.0Ian Jackson2025-11-0726-27/+27
| | |_|_|/ / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This has the meta attributes with optional values feature and also hygiene rework for modules. The breaking changes don't break arti.
* | | | | | | | | | Merge branch 'cell-sender' into 'main'Alexander Hansen Færøy2025-11-103-10/+10
|\ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | proto: Move cell_sender out of the client module See merge request tpo/core/arti!3407
| * | | | | | | | | proto: Move cell_sender out of the client moduleGabriela Moldovan2025-10-283-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Soon we'll use CircuitCellSender in the relay reactor too (we need to, because it provides a useful abstraction for handling block/unblock padding actions, and because it has some handy helper functions such as `congestion_signals()`).
| * | | | | | | | | proto: Make everything in CircuitCellSender pub(crate)Gabriela Moldovan2025-10-281-8/+8
| |/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is in preparation for moving `CircuitCellSender` out of the client module (it makes the next commit easier to review, because `cell_sender.rs` will be moved without any modifications).
* | | | | | | | | arti: better error when tokio-console in cfg but feature is absent.Nick Mathewson2025-11-061-3/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the pattern we used elsewhere with the "rpc" option. IMO, this kind of thing is another argument in favor if arti#1704 (redoing config types using derive-deftly.)
* | | | | | | | | arti: Experimental support for tokio-consoleNick Mathewson2025-11-065-0/+64
| |_|_|/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is controlled by a new option, `logging.tokio_console.enabled`. It requires building with `--cfg tokio_unstable`. See documentation and comments for more information.
* | | | | | | | Merge branch 'deftly-1.4' into 'main'opara2025-11-0626-27/+27
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bump derive-deftly to 1.4.0 See merge request tpo/core/arti!3448
| * | | | | | | | Bump derive-deftly to 1.4.0Ian Jackson2025-11-0626-27/+27
| | |/ / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will let us use the new modules feature. There are no breaking changes to beta features in 1.4.0.
* | | | | | | | Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-06358-388/+388
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Run maint/add_warning
* | | | | | | | Conditionalise a test-only `use`Ian Jackson2025-11-061-1/+4
| | | | | | | |
* | | | | | | | Use a while let loop (to placate clippy)Ian Jackson2025-11-061-2/+1
| | | | | | | |
* | | | | | | | Decorate a use with an allowIan Jackson2025-11-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This seems to depend on cfgs. As I say in #1060, I don't think precise cfg decoration of imports is sensible. Also, it shouldn't be my job to fix whatever this is...
* | | | | | | | Drop two use's that seem no longer to be necessaryIan Jackson2025-11-062-2/+2
|/ / / / / / /
* | | | | | | Merge branch 'dirserver-http-db' into 'main'Ian Jackson2025-11-052-120/+114
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | | | | | | | | | | | | | | | tor-dirserver: Apply database changes to http See merge request tpo/core/arti!3426
| * | | | | | tor-dirserver: clippy fixesClara Engler2025-11-032-4/+4
| | | | | | |
| * | | | | | tor-dirserver: Apply database changes to httpClara Engler2025-11-032-120/+114
| | |_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit applies the recent changes to the database module into the http and http::cache module. Notably, this includes the use of the database::sql! macro as well as the use of database::read_tx and database::rw_tx for creation transaction and saving, as well as retrying, although the latter one is subject to SQLite's own busy handler
* | | | | | tor-rtcompat: add `#[track_caller]` within `implement_opaque_runtime`Steven Engler2025-11-041-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the `#[track_caller]` attribute to spawn-related trait method impls, for traits implemented by the `implement_opaque_runtime` macro. This is for compatibility with tokio-console.
* | | | | | all: run cargo fmtSteven Engler2025-11-0417-17/+17
| | | | | |
* | | | | | all: replace all uses of `futures::task::SpawnExt` with `tor_rtcompat::SpawnExt`Steven Engler2025-11-0437-46/+46
| | | | | |
* | | | | | tor-rtcompat: add our own `SpawnExt` traitSteven Engler2025-11-042-3/+43
| |_|_|_|/ |/| | | | | | | | | | | | | | This new trait is compatible with tokio-console.
* | | | | Merge branch 'bug1885a' into 'main'Nick Mathewson2025-11-043-11/+6
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Stop using MockSleepProvider in a few crates See merge request tpo/core/arti!3424
| * | | | | Remove one stray allow(deprecated)Neel Chauhan2025-11-041-1/+0
| | | | | |
| * | | | | Stop using MockSleepProvider in a few cratesNeel Chauhan2025-11-023-10/+6
| |/ / / / | | | | | | | | | | | | | | | Part of #1885.
* | | | | Merge branch 'refactor-get-recent-consensus' into 'main'Clara Engler2025-11-041-19/+16
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | tor-dirserver: Refactor cons retrieval with JOIN See merge request tpo/core/arti!3436
| * | | | | tor-dirserver: Refactor cons retrieval with JOINClara Engler2025-11-041-19/+16
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit refactors `get_recent_consensus()` in `tor-dirserver` to use a single SQL statement with the power of `INNER JOIN` instead of two SQL statements querying the store after retrieving the SHA256 hash. The primary motivation for this is to have cleaner code. A single SQL statement is often-times easier to comprehend, as well more performant in execution, although that can only be proven with a profiler and is not of much concern, given that this function is only executed roughly every 60-90min.
* | | | | bad_extend_test_impl: Wait for message instead of a 100 ms delay.Nick Mathewson2025-11-041-8/+18
| | | | | | | | | | | | | | | | | | | | Possible fix for #2232.
* | | | | proto: use assert_matches in circuit.rs tests.Nick Mathewson2025-11-042-5/+7
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unlike assert!(matches!(..)), assert_matches prints the value of the expression on a failure. Probably we should use this macro more widely in the future. This might help diagnose recurrences of #2232
* | | | Merge branch 'use_futures_copy' into 'main'Nick Mathewson2025-11-036-187/+61
|\ \ \ \ | |/ / / |/| | | | | | | | | | | Replace copy_interactive with futures-copy. See merge request tpo/core/arti!3416
| * | | Replace copy_interactive with futures-copy.Nick Mathewson2025-10-306-187/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change lets us avoid spawning extra tasks (due to one-direction nature of copy_interactive), and avoid some lock contention (due to use of AsyncReadExt::split). Addresses part of #786.
* | | | arti: fix deprecation warnings in assert_cmd libSteven Engler2025-10-314-8/+9
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ```text warning: use of deprecated associated function `assert_cmd::Command::cargo_bin`: incompatible with a custom cargo build-dir, see instead `cargo::cargo_bin_cmd!` --> crates/arti/tests/cli_tests/hsc.rs:26:28 | 26 | let mut cmd = Command::cargo_bin("arti").unwrap(); | ^^^^^^^^^ | = note: `#[warn(deprecated)]` on by default ```
* | | proto: Move a TODO to CircSyncViewGabriela Moldovan2025-10-302-3/+3
| | |
* | | proto: Replace ClientCircSyncView in IncomingStreamRequestFilterGabriela Moldovan2025-10-306-8/+11
| | |
* | | proto: Add a new CircSyncView typeGabriela Moldovan2025-10-302-0/+40
| | | | | | | | | | | | | | | | | | This will replace ClientCircView in the IncomingStreamRequestFilter APIs, which will enable us to use IncomingStreamRequestFilter for incoming streams on the exit side too.
* | | tor-dirserver: Add SaturatingSystemTimeClara Engler2025-10-303-156/+289
| | | | | | | | | | | | | | | | | | This commit changes various things in the dirmirror operation, namely the use of a SystemTime wrapper type that provides saturation on both ends.
* | | tor-dirserver: Ensure positive timestampsClara Engler2025-10-301-1/+5
| | | | | | | | | | | | | | | This commit adds `CHECK` constraints to the database schema in order to ensure all timestamps are positive.
* | | tor-dircommon: Add TODO to DirTolerance::DefaultClara Engler2025-10-301-0/+2
| | |
* | | tor-dirserver: Small database::open() improvementsClara Engler2025-10-301-115/+58
| | |
* | | tor-dirserver: Make database full syncClara Engler2025-10-306-292/+231
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit makes the entire database operations synchronous, thereby replacing deadpool with r2d2. The full motivation is outlined in a rustdoc comment at the top of the `database` module, but it can be summarized to the fact that SQLite is by design inherently synchronous due to directly interfacing with the file system.
* | | tor-dirserver: Outline the dirmirror operationClara Engler2025-10-302-147/+260
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit creates a function named `mirror::operation::serve`, that will serve as the primary entry point for the dirmirror operation. While the function itself already contains some logic, such as querying the timeout to wait for the next consensus, it is largely a rustdoc design document that adds lots of comment to the `mirror::operation` module.
* | | tor-dirserver: Implement download timeoutClara Engler2025-10-304-0/+450
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit starts work in the `mirror::operation` module by implementing the functions for calculating the `Duration` to wait from a given `SystemTime` until the point in time when the dirmirror should download new documents from the authorities again. Also, this commit introduces new error types and internal helper functions in order to fulfill this purpose better.
* | | tor-dirserver: Implement read_tx and rw_txClara Engler2025-10-302-55/+352
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit does a large overhaul in the overall way on how we interact with SQLite. Although SQLite is a fairly straightforward tool, it has one large caveat, namely the handling of the infamous `SQLITE_BUSY` error. In WAL mode, the journaling mode we are using, the respective error may occur if there is an existing write transaction while another thread is trying to either upgrade an existing read transaction or create an exclusive transaction at the same time. In this case, SQLite will fail at the statement that either requires the write operation or at the creation of the transaction respectively. In order to tackle this problem, SQLite provides the `busy_timeout` pragma, which allows specifying a timeout in milliseconds during which SQLite will retry to obtain a write transaction or fail immediately. This only works in the latter case, that is, creating a write transaction from the beginning. To solve this issue, we introduce two new functions: 1. `database::read_tx` 2. `database::rw_tx` Both functions accept a database pool alongside a closure accepting a `Transaction` and returning an arbitrary return value. The first function creates a deferred transaction that gets rolled-back in the end, making it suitable for read-only connections. The latter function creates an exclusive transaction that gets committed in the end, making it suitable for read-write connections. This also honors the `busy_timeout`, i.e. the function retries for up to 1s to acquire a write transaction before failing ultimately.
* | | tor-dirmirror: Introduce the `sql!` macroClara Engler2025-10-303-2/+23
| | | | | | | | | | | | | | | | | | This commit introduces the no-op sql macro used to mark string literals as SQL statements. It is purely semantical and serves the purpose to quickly identify string literals as SQL statements.