| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
Spotted in https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2053#note_3012632
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
See also torspec!258
Part of #1272
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
(Also, correct the comments that describe them.)
We may as well match the spec names when they aren't completely
bogus.
We are already renaming these parameters for this release, so it
isn't an additional breaking change.
|
| |
|
|
|
|
| |
The old names were somewhat inaccurate. (I would have considered
keeping and deprecating the old names, but we already have breaking
changes in tor-netdir.)
|
| |
|
|
|
|
|
|
|
|
| |
clippy in current stable thinks
|(a, b)| (a, b)
is always the identity function, but due to match ergonomics, it might
be an implicit copy.
This is fixed in nightly by
https://github.com/rust-lang/rust-clippy/pull/11792
|
| |
|
|
|
|
| |
It does not help that C tor has a set of parameters and a set of
configuration options with exactly the same names which configure
the same thing in two slightly different ways.
|
| | |
|
| | |
|
| |
|
|
|
| |
This panics on error, and we're fine with a panic on misbehavior in
tests.
|
| |
|
|
|
|
|
| |
These are available unconditionally, since they represent
comparatively little storage and processing effort.
See param-spec.txt section 8 for the original information here.
|
| |
|
|
|
| |
This is precisely the result of running the rune in
maint/adhoc-add-lint-blocks.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
This commit implements the round-trip-time estimation algorithm from Tor
proposal 324, validating the implementation against the test vectors
found in C tor. (Note that at the time of writing, the new test vectors
may not be committed to C tor yet, but they will be soon.)
This also adds the necessary consensus parameters to `NetParameters`.
Some of them have been renamed in order to (hopefully) make them more
understandable.
|
| |
|
|
|
|
|
| |
Now it maintains an up-to-date set of default parameters to be
handed out if there is no directory.
Closes #528.
|
| | |
|
| |
|
|
| |
We need this because it is a type parameter for the types of nf_ito_*.
|
| |
|
|
| |
Pending an official value from the spec.
|
| | |
|
| |
|
|
|
| |
These all say, in one form or another, "there is no guard filtering;
there is only one selection". That's now false.
|
| |
|
|
|
| |
Remove all `use` statements for `TryFrom` and `TryInto`. These are
now redundant in Rust 2021.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We had no function to infallibly convert BoundedInt32<{0 or 1},H>
into a u32, even though we could have. Because of that, we were
treating weight_scale as an i32 when logically it's a u32 or a
NonZeroU32.
Moreover, it turns out we were using an incorrect minimum for the
bwweightscale param, which would in theory have allowed the
authorities to make us divide by zero.
This patch introduces the necessary From<> implementation and uses
it. It corrects the binimum bwweightscale, and prevents a
division-by-zero issue in case weight_scale is zero.
|
| |
|
|
|
| |
I've opened torspec!54 to fill in the missing parts of the spec
about these issues.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
This is a big change, but it does simplify the type of Builder a
little, and isolates locking across different (potential) timeout
estimator types.
|
| |
|
|
|
|
|
| |
There are some missing parts here (like persistence and tests)
and some incorrect parts (I am 90% sure that the "exploratory
circuit" flag is bogus). Also it is not integrated with the circuit
manager code.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we'd have to declare the field for a parameter in one
place, its default in a second, and its consensus key in a third.
That's error-prone and not so fun! This patch changes the
way we declare parameters so that we declare a structure once,
and macros expand it to all do the right thing.
This required a few new traits and implementations to ensure
uniformity across the types that can go in parameters: We need every
parameter type to implement TryFrom<i32> and to implement
SaturatingFromInt32.
Eventually we might want SaturatingFromInt32 to be a more generic
SaturatingFrom, but that's not for now.
|
| |
|
|
|
| |
I'm alright with allowing cognitive-complexity violations in the
tests.
|
| |\ |
|
| | | |
|
| |/ |
|
|
|
This will cause some pain for now, but now is really the best time
to do this kind of thing.
|