summaryrefslogtreecommitdiff
path: root/crates/tor-consdiff
Commit message (Collapse)AuthorAgeFilesLines
* Bump versions: tor-* and arti-* unstable cratesIan Jackson2026-03-301-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/issues/2436#note_3384773 Made with nailing-cargo -Eu set-version -p arti-client 0.41.0 nailing-cargo -Eu set-version -p arti-relay 0.41.0 nailing-cargo -Eu set-version -p arti-rpcserver 0.41.0 nailing-cargo -Eu set-version -p arti-ureq 0.41.0 nailing-cargo -Eu set-version -p arti-rpc-client-core 0.41.0 nailing-cargo -Eu set-version -p tor-basic-utils 0.41.0 nailing-cargo -Eu set-version -p tor-error 0.41.0 nailing-cargo -Eu set-version -p tor-general-addr 0.41.0 nailing-cargo -Eu set-version -p tor-geoip 0.41.0 nailing-cargo -Eu set-version -p tor-memquota-cost 0.41.0 nailing-cargo -Eu set-version -p tor-llcrypto 0.41.0 nailing-cargo -Eu set-version -p tor-cert-x509 0.41.0 nailing-cargo -Eu set-version -p tor-rtcompat 0.41.0 nailing-cargo -Eu set-version -p tor-rtmock 0.41.0 nailing-cargo -Eu set-version -p tor-async-utils 0.41.0 nailing-cargo -Eu set-version -p tor-config 0.41.0 nailing-cargo -Eu set-version -p tor-config-path 0.41.0 nailing-cargo -Eu set-version -p tor-rpc-connect 0.41.0 nailing-cargo -Eu set-version -p tor-log-ratelim 0.41.0 nailing-cargo -Eu set-version -p tor-rpcbase 0.41.0 nailing-cargo -Eu set-version -p tor-memquota 0.41.0 nailing-cargo -Eu set-version -p tor-units 0.41.0 nailing-cargo -Eu set-version -p tor-bytes 0.41.0 nailing-cargo -Eu set-version -p tor-protover 0.41.0 nailing-cargo -Eu set-version -p tor-checkable 0.41.0 nailing-cargo -Eu set-version -p tor-cert 0.41.0 nailing-cargo -Eu set-version -p tor-key-forge 0.41.0 nailing-cargo -Eu set-version -p tor-hscrypto 0.41.0 nailing-cargo -Eu set-version -p tor-socksproto 0.41.0 nailing-cargo -Eu set-version -p tor-linkspec 0.41.0 nailing-cargo -Eu set-version -p tor-cell 0.41.0 nailing-cargo -Eu set-version -p tor-persist 0.41.0 nailing-cargo -Eu set-version -p tor-keymgr 0.41.0 nailing-cargo -Eu set-version -p tor-relay-crypto 0.41.0 nailing-cargo -Eu set-version -p tor-proto 0.41.0 nailing-cargo -Eu set-version -p tor-netdoc 0.41.0 nailing-cargo -Eu set-version -p tor-consdiff 0.41.0 nailing-cargo -Eu set-version -p tor-netdir 0.41.0 nailing-cargo -Eu set-version -p tor-relay-selection 0.41.0 nailing-cargo -Eu set-version -p tor-chanmgr 0.41.0 nailing-cargo -Eu set-version -p tor-ptmgr 0.41.0 nailing-cargo -Eu set-version -p tor-dircommon 0.41.0 nailing-cargo -Eu set-version -p tor-guardmgr 0.41.0 nailing-cargo -Eu set-version -p tor-circmgr 0.41.0 nailing-cargo -Eu set-version -p tor-dirclient 0.41.0 nailing-cargo -Eu set-version -p tor-dirmgr 0.41.0 nailing-cargo -Eu set-version -p tor-dirserver 0.41.0 nailing-cargo -Eu set-version -p tor-hsclient 0.41.0 nailing-cargo -Eu set-version -p tor-hsservice 0.41.0 nailing-cargo -Eu set-version -p tor-hsrproxy 0.41.0
* Run cargo sort --workspace and commit the parts we wantIan Jackson2026-03-301-1/+1
|
* Plumb web-time-compat/full dependency through everywhere.Ian Jackson2026-03-301-1/+1
| | | | As generated by maint/fixup-features.
* consdiff: Additionally require tor-netdoc/ns-vote.Nick Mathewson2026-03-251-1/+2
| | | | Without it, CI seems to fail.
* consdiff: Only use the single feature we require from tor-netdoc.Nick Mathewson2026-03-251-1/+1
| | | | | Requiring all features, including experimental features, is too general.
* tor-consdiff: Apply comment suggestionClara Engler2026-03-251-2/+3
| | | Co-authored-by: Ian Jackson
* tor-consdiff: Prevent dotlines with WS tailClara Engler2026-03-251-4/+18
| | | | | | | | This commit modifies the dotline check to prevent generating lines that consist of a single dot followed by an arbitrary amount of whitespace, such as `.`, `. `, `. \t `, but not `. \t foo`. It also adjusts the tests appropriately.
* tor-consdiff: Rename `.lno` to `.lno_for_error`Clara Engler2026-03-251-2/+2
|
* tor-consdiff: Prevent dotlines properlyClara Engler2026-03-251-1/+19
| | | | | | | As pointed out by Diziet, our implementation does not reject dotlines properly, due to our use of `trim_end()`. This commit fixes this, by just checking for `line == ".\n"`. This is fine because we ensure Unix line endings now anyways.
* tor-consdiff: Enforce Unix line endingsClara Engler2026-03-252-10/+10
| | | | | | | | | | This commit changes the consdiff generation to enforce Unix line endings and reject all other ones, including Windows line endings as well as no line endings. In other words, it checks for `\n` while forbidding `\r\n`. It also renames the relevant error variant to reflect this change better.
* tor-consdiff: Justify our use of peek'ingClara Engler2026-03-251-0/+3
| | | | This is done to only get the first directory-signature.
* tor-consdiff: Refactor result compositionClara Engler2026-03-251-11/+17
| | | | | | This commit refactors the result composition by simply looping over every line and checking whether it ends with a newline AND does not consist of a single dot.
* tor-consdiff: Use named variants for lno errorsClara Engler2026-03-252-10/+16
| | | | | | This commit changes the error variants that contain a line number to a named variant with a field `lno: usize` to make it semantically clear, that it is a line number.
* tor-consdiff: Use derive_more for HunkType's DisplayClara Engler2026-03-252-13/+6
|
* tor-consdiff: Use usize::try_fromClara Engler2026-03-251-2/+5
|
* tor-consdiff: Fix clippy warningsClara Engler2026-03-251-2/+2
|
* tor-consdiff: Test with CRLFClara Engler2026-03-251-0/+10
| | | | | Now that we no longer use .lines(), everything should work fine with CRLF -- and it does. :-)
* tor-consdiff: Remove manual line splitsClara Engler2026-03-252-19/+35
| | | | | | | | | This commit removes all manual line splits in the consdiff generation. Instead, it now simply uses the primitives offered by imara-diff to access the lines in the input itself. Meanwhile, it also adds a check for missing newlines/assertions that all lines are actually terminated by \n.
* tor-consdiff: Cut signature using byte offsetsClara Engler2026-03-251-30/+36
| | | | | This commit replaces the use of lines with byte offsets for cutting of the signatures.
* tor-consdiff: Use same rng in testClara Engler2026-03-251-2/+3
|
* tor-consdiff: Compile-time assertion for 32-bitClara Engler2026-03-252-0/+4
| | | | | This commit adds a compile time assertion that a u32 can always be safely casted into a usize.
* tor-consdiff: Return error for dotlineClara Engler2026-03-252-16/+47
| | | | | This commit adds a check that prevents gen_cons_diff from computing a diff with a single dot line.
* tor-consdiff: Refactor gen_ed_diffClara Engler2026-03-251-28/+63
| | | | | | This commit refactors gen_ed_diff to have less code duplication by not matching upon the hunk type once but by splitting it into two different matches for the header and the body.
* tor-consdiff: Failed applies are a BugClara Engler2026-03-253-6/+13
| | | | | | Mark a failed apply from a consensus diff we generate as a bug as this should not happen. We must obviously always accept the consensus diffs we produce.
* tor-consdiff: Replace `+=` with `std::fmt`Clara Engler2026-03-251-20/+36
| | | | | This commit replaces repeated `result += &format!(...)` cruft with `write!` calls and multi-line strings.
* tor-consdiff: Constify directory-signature literalClara Engler2026-03-251-3/+10
| | | | | This commit moves "directory-signature" and "directory-signature " into semantically meaningful constants.
* tor-consdiff: Replace names with custom wordlistClara Engler2026-03-252-8/+31
| | | | | | | This commit replaces the names crate with a simple hardcoded wordlist of length 20, obtained from my systems wordlist. Reason for that being that names triggers a cargo-audit failure.
* tor-consdiff: Add consdiff generation algorithmClara Engler2026-03-255-3/+212
| | | | | | | | This commit implements support for the consensus diff generation. Unlike CTor, it does not use its own custom algorithm but rather uses an implementation of Myers' algorithm from the `imara-diff` crate, which is pretty performant and comparable to size and run time to CTor, while being much simpler in the interfacing code.
* Bump all the unstable tor- and arti- crates to 0.40.0.Gabriela Moldovan2026-03-021-2/+2
| | | | | | | | | Done using: ``` for crate in $(./maint/list_crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.40.0 done
* Allow clippy::collapsible_if to triggerGabriela Moldovan2026-02-161-0/+1
| | | | | | | | | `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.
* Bump MSRV from 1.86 to 1.89Gabriela Moldovan2026-02-161-1/+1
| | | | | | | As agreed at our last team meeting. See https://gitlab.torproject.org/tpo/core/arti/#minimum-supported-rust-version
* release: Bump `arti-*` and `tor-*` crates to 0.39.0Wesley Aptekar-Cassels2026-02-021-2/+2
| | | | | | | | | | Done via: ``` for crate in $(./maint/list-crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.39.0 done ```
* maint/add_warning: Run script to add new warningGabriela Moldovan2026-01-271-0/+1
| | | | This adds the lint to all our crates.
* cargo: Update `arti-*` and `tor-*` to `0.38.0`Clara Engler2026-01-121-2/+2
| | | | | | | | | Done using the following: ```bash for crate in $(./maint/list_crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.38.0 done ```
* Bump all the unstable tor- and arti- crates to 0.37.0.Gabriela Moldovan2025-12-021-2/+2
| | | | | | | | | Done using: ``` for crate in $(./maint/list_crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.37.0 done
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-2/+2
| | | | Run maint/add_warning
* maint: bump minor versions of all published cratesSteven Engler2025-10-291-2/+2
| | | | | | | ```bash readarray -t publish < <(cargo metadata --format-version 1 | jq -r '.packages[] | select((.id | startswith("path+file:///")) and (.rust_version != null) and (.publish == null or .publish == true or .publish != [])) | .name') for package in "${publish[@]}"; do echo "$package:"; cargo set-version --bump minor -p "$package"; done ```
* Bump MSRV from 1.85.1 to 1.86Clara Engler2025-10-211-1/+1
|
* release: Bump versions.Wesley Aptekar-Cassels2025-10-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because we've updated our MSRV, we must bump the minor version for every package. This was done as follows: cargo set-version -p arti 1.6.0 cargo set-version -p oneshot-fused-workaround 0.4.0 cargo set-version -p slotmap-careful 0.4.0 cargo set-version -p test-temp-dir 0.5.0 cargo set-version -p fslock-guard 0.4.0 cargo set-version -p hashx 0.5.0 cargo set-version -p equix 0.4.0 cargo set-version -p caret 0.7.0 cargo set-version -p fs-mistrust 0.12.0 cargo set-version -p safelog 0.6.0 cargo set-version -p retry-error 0.8.0 xargs -I P <<END cargo set-version -p P 0.35.0 tor-basic-utils tor-error tor-general-addr tor-geoip tor-rtcompat tor-rtmock tor-async-utils tor-config tor-config-path tor-rpc-connect tor-log-ratelim tor-rpcbase tor-memquota tor-units tor-llcrypto tor-bytes tor-protover tor-checkable tor-cert tor-key-forge tor-hscrypto tor-socksproto tor-linkspec tor-cell tor-proto tor-netdoc tor-consdiff tor-netdir tor-relay-selection tor-persist tor-keymgr tor-chanmgr tor-ptmgr tor-dircommon tor-guardmgr tor-circmgr tor-dirclient tor-dirmgr tor-dirserver tor-hsclient tor-hsservice tor-hsrproxy tor-relay-crypto arti-client arti-relay arti-rpcserver arti-ureq arti-rpc-client-core END
* Remove "doc_auto_cfg" incantation from all crates.Nick Mathewson2025-09-291-1/+1
| | | | This feature has been removed from nightly, in favor of doc_cfg.
* Bump MSRV from 1.85 to 1.85.1Nick Mathewson2025-09-091-1/+1
| | | | Closes #2107
* Bump the minor version of every published crate except for `arti`.Nick Mathewson2025-08-281-2/+2
| | | | | | | | Per policy, we bump the minor version of every tor-*, arti-* crate on each release. We have updated our MSRV, so we're treating this as a breaking change for our non-(arti/tor)-prefixed crates too.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-073-35/+49
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* Update code for Edition 2024Nick Mathewson2025-08-071-1/+1
| | | | | | | | | | | | | | | | | | 1. Run cargo fix --edition 2. Selectively revert the "if let"->"match" changes. These changes are meant to protect us from the lifetime changes for "if let" bindings in Rust 2024. But we're not actually relying on the old lifetime rules anywhere, and the match syntax here is quite ugly. 3. Automatically revert `$pat:expr_2021` to `$pat:expr`. (We don't actually want to restrict the expression syntax that our macros accept). Done with `git grep -l expr_2021 | xargs perl -i -pe 's/expr_2021/expr/g;'` 4. Run cargo fmt.
* Set MSRV to 1.85.Nick Mathewson2025-08-051-1/+1
|
* Version bumps for 1.4.6Ian Jackson2025-08-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Made with the following shell script: export CARGO='nailing-cargo -Eu' # Non-functional changes only maint/bump_nodep hashx # Special $CARGO set-version -p arti 1.4.6 # Additional features, no breaking changes, depended on in tree $CARGO set-version -p safelog 0.4.8 # Unconditional bump to 0.33.0 xargs -I P <<END $CARGO set-version -p P 0.33.0 tor-error tor-general-addr tor-geoip tor-rtcompat tor-rtmock tor-async-utils tor-config tor-config-path tor-rpc-connect tor-log-ratelim tor-rpcbase tor-memquota tor-units tor-llcrypto tor-bytes tor-protover tor-checkable tor-cert tor-key-forge tor-hscrypto tor-socksproto tor-linkspec tor-cell tor-proto tor-netdoc tor-consdiff tor-netdir tor-relay-selection tor-persist tor-chanmgr tor-ptmgr tor-guardmgr tor-circmgr tor-dirclient tor-dirmgr tor-keymgr tor-hsclient tor-hsservice tor-hsrproxy tor-relay-crypto arti-client arti-relay arti-rpcserver arti-ureq arti-rpc-client-core END
* Bump all the unstable tor- and arti- crates to 0.32.0.Gabriela Moldovan2025-07-071-2/+2
| | | | | | | | | | Done using: ``` for crate in $(./maint/list_crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.32.0 done ```
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* release: Bump all tor-/arti- crates to 0.31.0.Alexander Hansen Færøy2025-06-051-2/+2
| | | | | | | | This was done using: for crate in $(./maint/list_crates | grep -P '^tor-|^arti-'); do cargo set-version -p $crate 0.31.0 done
* All crates: bump rust-version to 1.83.Nick Mathewson2025-05-131-1/+1
|