summaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
...
| * connpts: Document behavior on nonexistent directoryNick Mathewson2025-01-231-0/+2
| |
| * rpc: Tolerate NotFound on configured connect point directory.Nick Mathewson2025-01-231-8/+14
| | | | | | | | | | | | | | | | If Arti tries to bind to a directory of connect points, and that directory isn't there, the right behavior is to treat the directory as if it were empty. Otherwise, the user would have to create the default connect point directory (as empty) before Arti would start.
* | Merge branch 'avoid_execute_internal_ok' into 'main'Nick Mathewson2025-01-234-31/+69
|\ \ | | | | | | | | | | | | rpclib: Avoid overuse of execute_internal_ok. See merge request tpo/core/arti!2730
| * | rpclib: More explanations about internal method usage.Nick Mathewson2025-01-231-3/+5
| | |
| * | arti-rpc-client-core: Rename Authentication{Rejected=>Failed}Nick Mathewson2025-01-233-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | Also change corresponding message. This way, it will be clear that we're just reporting that Arti gave us an error—not that the error necessarily means that the authentication itself was "wrong".
| * | rpclib: Avoid overuse of execute_internal_ok.Nick Mathewson2025-01-234-24/+60
| |/ | | | | | | | | | | | | | | | | | | | | The execute_internal_ok method converts every error response into an internal error; as such, it's only appropriate when there is no way for a well-behaved Arti instance to give an error response. But we had been using it in a few places where errors were possible under other circumstances. This commit fixes that behavior, and adds documentation to help avoid it.
* | Merge branch 'rpc-todos-1' into 'main'Nick Mathewson2025-01-232-20/+3
|\ \ | | | | | | | | | | | | rpc: Resolve a couple of dead code TODOs See merge request tpo/core/arti!2731
| * | rpcserver: remove dead code exception in objmap.rsNick Mathewson2025-01-221-3/+1
| | |
| * | rpcserver: remove dead code in codecs.rsNick Mathewson2025-01-221-17/+2
| | |
* | | arti: Make Rpc argument unconditional when constructing socks proxyNick Mathewson2025-01-236-33/+43
| | | | | | | | | | | | | | | | | | Formerly this was a conditional method argument, which is a huge antipattern. Now it is unconditionally present, as `Option<T>` for a type that is uninhabited when RPC isn't supported.
* | | arti::socks: Re-wrap a section.Nick Mathewson2025-01-231-2/+3
| | | | | | | | | | | | | | | rust-analyzer keeps re-wrapping this piece for me, even though rustfmt doesn't complain.
* | | arti: remove an obsolete rpc todo.Nick Mathewson2025-01-231-1/+0
| | | | | | | | | | | | Information _is_ passed to the RpcMgr, via the argument to new_connection.
* | | arti: remove an obsolete rpc todo.Nick Mathewson2025-01-231-1/+0
| | | | | | | | | | | | | | | The RpcMgr does indirectly hold a reference to the client, via its make_session argument.
* | | arti: remove an obsolete rpc todo.Nick Mathewson2025-01-231-1/+0
| | | | | | | | | | | | We _do_ have error detection from this function, and have for ages.
* | | arti: Remove old workaround for runtime selection under RPC.Nick Mathewson2025-01-231-6/+1
| |/ |/| | | | | | | This was necessary before we had support for implementing RPC methods on generic types.
* | Merge branch 'dev/cve/mistrust-doc' into 'main'Nick Mathewson2025-01-231-0/+12
|\ \ | | | | | | | | | | | | tor-config: Improve mistrust documentation See merge request tpo/core/arti!2727
| * | tor-config: Improve mistrust documentationClara Engler2025-01-231-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | This commit improves the documentation for `ConfigurationSources::set_mistrust`, by explaining that this option is unrelated to the paths defined within the configuration file itself, referring to the `storage.permissions.dangerously_trust_everyone` option.
* | | arti-rpc-client-core: Use EmptyReply instead of EmptyResponse.Gabriela Moldovan2025-01-231-2/+2
| | | | | | | | | | | | | | | | | | It looks like !2729 and !2722 raced with each other, because we're still using the old name for `EmptyReply` (and so `arti-rpc-client-core` doesn't currently compile on `main`).
* | | Merge branch 'rpc-cancel-2' into 'main'Nick Mathewson2025-01-239-49/+391
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | rpc: Implement request cancellation Closes #818 See merge request tpo/core/arti!2722
| * | Document more that cancel is uncancellable.Nick Mathewson2025-01-221-0/+2
| | |
| * | rpc: Correct RPC error code for "RequestNotFound".Nick Mathewson2025-01-221-1/+4
| | |
| * | cancel: Distinguish the internal-error case for double-cancel.Nick Mathewson2025-01-221-2/+23
| | |
| * | cancel: Document deadlock/panic issue and how to avoid it.Nick Mathewson2025-01-221-2/+19
| | |
| * | rpc: Make cancel requests uncancellable.Nick Mathewson2025-01-223-28/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | The current cancel code is prone to deadlock, so the easiest way to solve it appears to be making cancel requests themselves uncancellable. I've included a test to verify the behavior; previously, this test caused a deadlock.
| * | cancel: Add a TODO about moving the Future inside the lock.Nick Mathewson2025-01-221-0/+5
| | |
| * | Cancel: Drop lock before calling waker.Nick Mathewson2025-01-221-0/+1
| | |
| * | cancel: Remove FusedFuture implementation.Nick Mathewson2025-01-221-12/+1
| | | | | | | | | | | | | | | | | | | | | Nothing used it, and it has some semantic complexity. (see https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2722#note_3149591 )
| * | cancel: Use Waker::clone_from to avoid needless clones.Nick Mathewson2025-01-221-1/+9
| | | | | | | | | | | | | | | | | | The Waker::clone_from implementation uses Waker::will_wake to avoid unnecessarily cloning a Waker that it already has a copy of.
| * | arti-rpc-client-core: Document that dropping a request does not cancel it.Nick Mathewson2025-01-223-6/+8
| | | | | | | | | | | | | | | | | | | | | I hope that this limitation is acceptable; the alternative involves some significant refactoring to give Request a Weak reference to RpcConn -- but RpcConn isn't currently kept in an Arc<> at all, and so we'd need some fairly heavy hacking.
| * | arti-rpc-client-core: Implement and expose cancellation.Nick Mathewson2025-01-224-3/+65
| | |
| * | rpc: Implement the rpc:cancel command.Nick Mathewson2025-01-162-1/+79
| | |
| * | rpc: Better RpcErrorKind for for RequestCancelled.Nick Mathewson2025-01-161-4/+7
| | |
| * | rpc: Strengthen guarantees from Cancel.Nick Mathewson2025-01-162-20/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cancellation is now fallable, which allows us to detect attempts to cancel which cannot work. We now guarantee that when you try to cancel a `Cancel<F>` future, either the cancel operation will succeed, or the future will return (or will have already returned) Ok(), but not both, and not neither. Closes #818.
* | | rpclib: Rename params/reply structs for consistency.Nick Mathewson2025-01-214-29/+28
| |/ |/| | | | | | | | | | | | | Our now convention here in rpclib is that a struct holding a request's parameters is called `FooParams`, and a struct holding that request's reply is called `FooReply`. Closes #1586
* | Merge branch 'test-sleep' into 'main'David Goulet2025-01-161-15/+5
|\ \ | | | | | | | | | | | | tor-proto: Replace sleep() in test with advance_until_stalled(). See merge request tpo/core/arti!2721
| * | tor-proto: Replace sleep() in test with advance_until_stalled().Gabriela Moldovan2025-01-161-15/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test spuriously failed on my !2720 branch (https://gitlab.torproject.org/gabi-250/arti/-/jobs/811495): ``` failures: ---- circuit::test::invalid_circ_sendme stdout ---- E tor_proto::channel::reactor: UniqId(71): Running reactor E tor_proto::circuit::reactor: Circ 23.17: Running circuit reactor E tor_proto::circuit::reactor: Circ 23.17: reactor received AddFakeHop { relay_cell_format: V0, fwd_lasthop: false, rev_lasthop: false, params: CircParameters { extend_by_ed25519_id: true, ccontrol: CongestionControlParams { alg: FixedWindow(FixedWindowParams { circ_window_start: 1000, circ_window_min: 100, circ_window_max: 1000 }), cwnd_params: CongestionWindowParams { cwnd_init: 124, cwnd_inc_pct_ss: Percentage { value: 100 }, cwnd_inc: 1, cwnd_inc_rate: 31, cwnd_min: 124, cwnd_max: 4294967295, sendme_inc: 31 }, rtt_params: RoundTripEstimatorParams { ewma_cwnd_pct: Percentage { value: 50 }, ewma_max: 10, ewma_ss_max: 2, rtt_reset_pct: Percentage { value: 100 } } } }, done: Sender { complete: false } } E tor_proto::circuit::reactor: Circ 23.17: reactor received AddFakeHop { relay_cell_format: V0, fwd_lasthop: true, rev_lasthop: true, params: CircParameters { extend_by_ed25519_id: true, ccontrol: CongestionControlParams { alg: FixedWindow(FixedWindowParams { circ_window_start: 1000, circ_window_min: 100, circ_window_max: 1000 }), cwnd_params: CongestionWindowParams { cwnd_init: 124, cwnd_inc_pct_ss: Percentage { value: 100 }, cwnd_inc: 1, cwnd_inc_rate: 31, cwnd_min: 124, cwnd_max: 4294967295, sendme_inc: 31 }, rtt_params: RoundTripEstimatorParams { ewma_cwnd_pct: Percentage { value: 50 }, ewma_max: 10, ewma_ss_max: 2, rtt_reset_pct: Percentage { value: 100 } } } }, done: Sender { complete: false } } E tor_proto::circuit::reactor: Circ 23.17: reactor received BeginStream { hop_num: HopNum(2), message: Begin(Begin { addr: [119, 119, 119, 46, 101, 120, 97, 109, 112, 108, 101, 46, 99, 111, 109], port: 443, flags: BeginFlags(IPV6_OKAY) }), sender: Sender { tx: Sender { closed: false }, mq: TypedParticipation(Participation(Noop)) }, rx: Receiver { inner: ReceiverInner { state: Mutex { data: Ok(ReceiverState { rx: StreamUnobtrusivePeeker { buffered: None, poll_waker: None, inner: Some(Receiver { closed: false }) }, mq: TypedParticipation(Participation(Noop)), collapse_callbacks: 0 }), poisoned: false, .. } } }, done: Sender { complete: false }, cmd_checker: DataCmdChecker { expecting_connected: true } } Using RNG seed ARTI_TEST_PRNG=62d085c0fb1213c4f41d1a0a5c3f92dd10223a27c42bfda3caedfe60e011e95d E tor_proto::circuit::reactor: Circ 23.17: handling cell: Relay(Relay { body: .. }) Using RNG seed ARTI_TEST_PRNG=fd2f2f045a7340f1189972b13645346943efa2c42f43afd2161420c692bb4ff0 E tor_proto::circuit::reactor: Circ 23.17: handling cell: Relay(Relay { body: .. }) E tor_proto::circuit::reactor: Circ 23.17: Circuit reactor stopped: Err(CircProto("Mismatched tag on circuit SENDME")) E tor_proto::channel::reactor: UniqId(71): reactor received CloseCircuit(CircId(128)) E tor_proto::channel::reactor: UniqId(71): Circuit 128 is gone; sending DESTROY thread 'circuit::test::invalid_circ_sendme' panicked at crates/tor-proto/src/circuit.rs:2262:21: reactor continued running after invalid sendme failures: circuit::test::invalid_circ_sendme test result: FAILED. 142 passed; 1 failed; 1 ignored; 0 measured; 0 filtered out; finished in 4.93s ``` This is probably because of the `sleep()`-based check. This branch changes the test to use `MockRuntime`, replacing the `sleep()` with `advance_until_stalled()`.
* | | tor-proto: Replace std::result::Result with shorter alias.Gabriela Moldovan2025-01-161-5/+6
| | | | | | | | | | | | | | | | | | The more concise name makes the code a bit more readable, IMO (and it's consistent with the `Result` type-aliasing style we've been using in the rest of the codebase).
* | | tor-proto: Remove unnecessary fully qualified path.Gabriela Moldovan2025-01-161-1/+1
| | | | | | | | | | | | It's not needed because `CircHop` is defined in the same file.
* | | tor-proto: Move outbound message sending out of circuit run_once() (fmt).Gabriela Moldovan2025-01-161-64/+64
| | | | | | | | | | | | No functional changes, just `cargo fmt`.
* | | tor-proto: Move outbound message sending out of circuit run_once().Gabriela Moldovan2025-01-161-13/+23
| |/ |/| | | | | | | | | | | | | | | This is mostly code motion in preparation for refactoring `run_once()` to use `select!` instead of the hand-rolled `poll_fn` impl. Note: the code here is intentionally mis-indented, to simplify diffing (I recommend using `git diff --color-moved`). A future commit will fix the indentation.
* | Merge branch 'feature-doc' into 'main'Nick Mathewson2025-01-161-0/+5
|\ \ | |/ |/| | | | | | | | | arti: Add `restricted-discovery` to the list of experimental features. Closes #1808 See merge request tpo/core/arti!2719
| * arti: Add `restricted-discovery` to the list of experimental features.Gabriela Moldovan2025-01-161-0/+5
| | | | | | | | | | | | | | Note: there are other experimental features we might want to document here (possibly after we settle the discussion from #1706?) Closes #1808
* | Merge branch 'ticket1743_02' into 'main'David Goulet2025-01-1634-832/+2098
|\ \ | | | | | | | | | | | | Implement congestion control from prop324 See merge request tpo/core/arti!2675
| * | congestion: Don't use Vegas just yetDavid Goulet2025-01-161-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without circuit negotiation and flow control (XON/XOFF), the Vegas algorithm can not be used. Temporarily, this commit pins the algorithm to fixed window until we have the above. Signed-off-by: David Goulet <[email protected]>
| * | Make cargo clippy happyDavid Goulet2025-01-161-4/+4
| | | | | | | | | | | | Signed-off-by: David Goulet <[email protected]>
| * | Add missing semver.md filesDavid Goulet2025-01-162-0/+3
| | | | | | | | | | | | | | | | | | Both in tor-proto and tor-circmgr. Signed-off-by: David Goulet <[email protected]>
| * | Bring back tor-congestion empty with a tombstoneDavid Goulet2025-01-164-57/+7
| | | | | | | | | | | | Signed-off-by: David Goulet <[email protected]>
| * | circmgr: Remove the CircParameters build .expect()David Goulet2025-01-166-55/+30
| | | | | | | | | | | | | | | | | | Instead, return an error and make all call site handle it. Signed-off-by: David Goulet <[email protected]>
| * | congestion: Use getters for all parametersDavid Goulet2025-01-164-68/+94
| | | | | | | | | | | | | | | | | | Allows us to remove the pub. Signed-off-by: David Goulet <[email protected]>
| * | circ: Specialize the circparams from netparams functionDavid Goulet2025-01-167-70/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Congestion control parameters have specific values depending on the circuit type. Instead of using a CircuitType, which is removed in this commit, specialize the function in this case onion and exit. This allows us to get rid of CircuitType and solely use TargetCircUsage instead. At this commit, we use .expect() on the Builder. Future commit will remove this to return a Result in case of failure. Worth noting that we don't expect one. Signed-off-by: David Goulet <[email protected]>