| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
Done using:
```
for crate in $(./maint/list_crates | rg '^(tor|arti-)'); do
cargo set-version -p $crate 0.40.0
done
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The non-{arti-,tor-} crates are:
```
./maint/list-crates | rg -v '^(tor|arti)'
oneshot-fused-workaround
slotmap-careful
test-temp-dir
fslock-guard
hashx
equix
caret
fs-mistrust
safelog
retry-error
futures-copy
```
Because this release bumps the MSRV, I am bumping the minor version of all of
them.
MINOR="
oneshot-fused-workaround
slotmap-careful
test-temp-dir
fslock-guard
hashx
equix
caret
fs-mistrust
safelog
retry-error
futures-copy
"
for crate in $MINOR; do
cargo set-version --bump minor -p $crate;
done
```
|
| |
|
|
|
|
|
|
|
| |
`clippy::collapsible_if` started triggering after bumping the MSRV to
1.88.
Since this triggers from a lot of places, and since there even are a
couple of instances where we explicitly allow `clippy::collapsible_ifs`,
I've opened #2342 for deciding what to do about it.
|
| |
|
|
|
|
|
| |
As agreed at our last team meeting.
See
https://gitlab.torproject.org/tpo/core/arti/#minimum-supported-rust-version
|
| |
|
|
| |
Makes docs.rs also document types behind optional feature flags.
|
| |
|
|
|
|
|
|
|
|
| |
Done via:
```
for crate in $(./maint/list-crates | rg '^(tor|arti-)'); do
cargo set-version -p $crate 0.39.0
done
```
|
| | |
|
| |
|
|
| |
This code is still WIP, no need to address the lint yet.
|
| |
|
|
| |
This adds the lint to all our crates.
|
| |
|
|
|
| |
This commit adds a comment explaining why we treat compression errors as
a bug.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit removes `DatabaseError::Compression` because it does not fit
in. Right now, this single variant makes the error to be call-site
oriented which is not nice for error handling. Instead, this error
should indicate that something was truly wrong with the database in
itself, such as an invalid schema, a low-level SQLite bug, etc.
Instead, we now map a compression error to `DatabaseError::Bug` because
there is no good reason on why it should fail, given that we compress
memory data to memory data. Probably because it uses the
`std::io::Writer` interface which itself demands use of
`std::io::Result`.
|
| |\
| |
| |
| |
| | |
tor-dirserver: Refactorings in the database.rs module
See merge request tpo/core/arti!3599
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit removes FromStr for DocumentId because it was only used in
testing anyways.
Instead, it replaces it with a simple From<[u8; 32]> only enabled in
test builds, which is sufficient for what we are trying to do.
An alternative would be to make the inner field pub, but this seems to
aggressive for a testing only thing.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This comit adds a `sha2` column to `router_descriptor` alongside a
`CHECK` to see whether it equals `docid`.
The reason for this is simple: Microdescriptors are the only kind of
documents that are queriable with a SHA2 hash. Previously, we would
have simply used the `docid` column for this, but in order to abstract
it better, a distinct column with this hash is better.
|
| | |
| |
| |
| |
| | |
Because we went with `docid` in the database (due to `rowid`), it is
only natural to call the code variables `docid` too.
|
| | |
| |
| |
| |
| |
| | |
This commit renames the sha256 column to docid for the reason that we
agreed upon making the schema visible to all modules, so if we were to
encapsulate docid properly, this change is only natural.
|
| | |
| |
| |
| |
| | |
This commit renames arti_dirmirror_schema_version to
arti_dirserver_schema_version.
|
| | |
| |
| |
| |
| |
| | |
This commit introduces a new type in the database module named
`DocumentId` for abstracting the underlying content-addressable hash
algorithm we are using.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit makes the downloader found in `mirror::operation::download`
stateless by removing the `preferred_authority` field and changing all
methods from `&mut self` to `&self`.
The preferred authority is now accepted as a parameter to
`DownloadManager::download` which also returns a tuple now with the
actually used authority alongside the response, putting the management
of this to the responsibility of the caller.
Meanwhile, it also renames the structure from `ConsensusBoundDownloader`
to `DownloadManager` because it no longer keeps a state that
invalidates after a consensus "ends".
The purpose of this is to simplify overall state in order to make the
implementation of a finite-state-machine for the dirmirror operation
more easy (and deterministic).
|
| |/
|
|
|
|
|
|
|
|
|
|
|
| |
This commit fixes the flaky `request_fail_ultimately` in tor-dirserver,
which is flaky due to the operating system's handling of TCP RSTs, which
are generally detected stochastically and sometimes are not received
even after the entire response has been parsed.
This leads to tor-dirclient either returning a connection reset or a
truncated header error, depending on whether it successfully or
unsuccessfully reads zero bytes from the server.
Fixes #2318
|
| | |
|
| |
|
|
|
| |
Adding a comment suggesting to implement this as part of abstracting
`Sha256` behind a more generic identifier.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
This commit rpelaces the use of `INSERT` with `INSERT OR REPLACE` for
handling insertion conflicts in `store_insert`.
Because everything is content-addressed anyways, it does not matter to
do this, because if we get a conflict on a SHA256, it means the data is
equal.[1]
[1]: Excluding SHA-2 collisions which are impractical as of 2026.
|
| |
|
|
|
|
| |
This commit modifies the database::store_insert logic to accept an
iterator of the encodings to store the document in, instead of encoding
it with all encodings we support.
|
| | |
|
| | |
|
| |
|
|
| |
Instead of failing, add them to missing and query them again.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
This commit implements the logic necessary to retrieve the (missing)
directory authority certificates from an upstream directory authority.
In order to do so, this commit implements three new functions:
1. `download_authority_certificates()`
2. `parse_authority_certificates()`
3. `verify_authority_certificates()`
4. `insert_authority_certificates()`
|
| |
|
|
|
|
| |
This commit adds a CHECK constraint to the compressed_document table in
order to ensure that `algorithm` may only take up a limited set of
values.
|
| |
|
|
|
|
| |
This commit moves the ContentEncoding enum from the http module to the
database module, primarily because the content encoding is more of a
matter to the database, as this is where the data actually resides.
|
| |
|
|
|
|
|
|
| |
This commit implements support for adding arbitrary documents into the
store table.
It is non-trivial because the relevant data has to be compressed into
various formats, so it can be retrieved without delays.
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
This commit adds the `get_recent_authority_certificates()` function to
the operation of a directory mirror, which is responsible for looking up
the certificates in the database, returning the parsed found ones as
well as the missing ones.
|
| |
|
|
|
|
| |
The reverse direction already exists and it will be required when we act
with functions outside the crate that only accept a `SystemTime` in
situations where we just have a `Timestamp`.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit speeds up the tests in `tor-dirserver` by using
functionality from Tokio's `test-util`.
Most notably, it runs the time intensive test in paused mode, which
means that the clock gets advanced either explicitly or implicitly using
auto-advance in case the runtime has nothing to do.
In our case, the last one, auto-advancing, is used, leading to our
sleep calls returning immediately.
This is good enough for testing in this module. It is not the
responsibility of tor-dirserver to ensure whether `RetryDelay` returns
proper values, as this is the responsibility of `tor-basic-utils`.
Still, it is a bit unfortunate that Tokio offers no way to manually
disbale the auto-advancing. In the future, it might be useful to
migrate more parts of this to crate to `tor-rtcompat`, but for now, this
change is a good enough performance fix.
|
| |
|
|
|
|
|
|
|
|
| |
This commit removes `mirror::download::test::request_fail_timeout` which
takes more than five seconds (due to a timeout) and is generally
ineffective in what it does, because testing whether a task is still
sleeping after a certain time is not super trivial with the tools Tokio
offers.
All this test offers is testing that we enter a timeout at all.
|
| |\
| |
| |
| |
| |
| |
| | |
tor-dirserver: Eliminate use of sleep in tests
Closes #2308
See merge request tpo/core/arti!3582
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit eliminates the use of sleep in database tests because those
can be flaky, especially when the CI scheduler is overloaded, leading to
potential timeout invariants not holding true anymore.
We now fix this by using synchronization primitives from Rust in order
for threads to communicate. Documentation has been added explaining how
these tests work in greater detail.
Fixes #2308
|
| | |
| |
| |
| |
| |
| |
| | |
SQLite does not support u64 and the new version of SQLite makes a
certain piece of tor-dirserver no longer compile due to the lack of
`ToSql` for `u64`. This commit fixes it by converting these types from
`u64` to `i64` saturatingly.
|
| |/ |
|
| |\
| |
| |
| |
| | |
Bump dependencies for 1.9.0
See merge request tpo/core/arti!3570
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This only includes retry-error which had a few functional additions in
December, thereby rasing the minor version as new features were added to
the public API.
Done using the following:
* Find all non arti, non tor crates.
* `ls -1 crates/ | grep -v "^tor-\|^arti"`
* Exclude the ones without changes.
* `maint/changed_crates -v "arti-v$LAST_VERSION" 2>&1 >/dev/null | grep -i "no change"`
* Look into each with changes.
* In this case only retry-error.
* Bump the minor because it had non-trivial changes.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
Done using the following:
```bash
for crate in $(./maint/list_crates | rg '^(tor|arti-)'); do
cargo set-version -p $crate 0.38.0
done
```
|
| |/
|
|
|
|
|
| |
Executed command:
```
cargo run -p fixup-features -- --exclude examples/ --exclude maint/ Cargo.toml
```
|
| | |
|