aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-consdiff
Commit message (Collapse)AuthorAgeFilesLines
* Bump versions for tor-* and arti-* cratesSteven Engler2026-08-031-5/+5
| | | | | | | ```bash readarray -t bump < <(maint/list-crates | grep -P '^tor-|^arti-') for crate in "${bump[@]}"; do cargo set-version --bump minor -p "${crate}"; done ```
* add_warning: add reference to arti#2556Jim Newsome2026-07-151-1/+1
|
* Removed unnecessary lintpryty262026-07-151-1/+1
| | | | Removed unnecessary lint
* Version bumps for 2.5.0Nick Mathewson2026-06-301-5/+5
| | | | | | | | | | | | | Closes #2617. We've lucked out this time, and it turns out that every one of our published crates gets a minor bump. So this was generated with: ``` for cr in $(./maint/list-crates); do cargo set-version -p $cr --bump minor done ```
* Merge branch 'msrv-1.91' into 'main'gabi-2502026-06-181-1/+1
|\ | | | | | | | | Bump MSRV to 1.91 See merge request tpo/core/arti!4105
| * Bump MSRV to 1.91Clara Engler2026-06-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit bumps the MSRV to 1.91 which was released on 2025-10-30. The Cargo.toml files were updated as follows: ```sh git ls-files | \ grep ".*Cargo\.toml$" | \ xargs sed -i '' 's/^rust-version = "1\.89"$/rust-version = "1\.91"/g' ``` The following files were updated manually: ``` modified: .gitlab-ci.yml modified: README.md modified: flake.nix modified: maint/docker-android/Dockerfile ```
* | consdiff: remove string slice usageNick Mathewson2026-06-101-8/+5
|/
* everywhere: Add #[allow(clippy::string_slice)]Clara Engler2026-06-091-0/+2
| | | | | | | | This commit adds #[allow(clippy::string_slice)] to all functions in the code where string slices are used, alongside a TODO comment. We do this add the function header to have it consistent, as things like expression based allow's are still experimental.
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-091-0/+2
| | | | | | | | | | | | This commit executes maint/add_warning with the just added change to deny string slices except in tests. I recommend auditing this by checking out the previous commit followed by running the script yourself and then verifying that the diff is identical to this commit. This commit makes cargo clippy fail. We will add exceptions in the next commit.
* Bump all the unstable tor- and arti- crates to 0.43.0Gabriela Moldovan2026-06-011-5/+5
| | | | | | | | | | Done using: ``` for crate in $(./maint/list-crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.43.0 done ```
* Upgrade rand crates to 0.10.Wesley Aptekar-Cassels2026-05-121-1/+1
| | | | | | | | | | | When the circ-padding feature is enabled, we use maybenot, which does not yet support rand 0.10. In the meantime, enabling this feature pulls in rand 0.9. This is not ideal, but should be okay as a temporary situation. This also replaces the use of ReseedingRng (which was removed in 0.10) with the reseeding_rng crate. This is somewhat less performant, but it should be okay.
* tor-netdoc: Abolish empty undocumented feature ns-voteIan Jackson2026-05-121-1/+1
| | | | | | | This was never documented. The relevant code is now part of "incomplete". Part of #2492.
* tor-netdoc: Abolish empty undocumented feature parse2Ian Jackson2026-05-121-1/+1
| | | | | | | This was never documented. The relevant code is now either unconditional, or part of "incomplete". Part of #2492.
* release: Bump tor- and arti- crate versions.Wesley Aptekar-Cassels2026-05-061-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cargo set-version -p arti-client 0.42.0 cargo set-version -p arti-config 0.42.0 cargo set-version -p arti-relay 0.42.0 cargo set-version -p arti-rpc-client-core 0.42.0 cargo set-version -p arti-rpcserver 0.42.0 cargo set-version -p arti-testing 0.42.0 cargo set-version -p arti-ureq 0.42.0 cargo set-version -p tor-async-utils 0.42.0 cargo set-version -p tor-basic-utils 0.42.0 cargo set-version -p tor-bytes 0.42.0 cargo set-version -p tor-cell 0.42.0 cargo set-version -p tor-cert 0.42.0 cargo set-version -p tor-cert-x509 0.42.0 cargo set-version -p tor-chanmgr 0.42.0 cargo set-version -p tor-checkable 0.42.0 cargo set-version -p tor-circmgr 0.42.0 cargo set-version -p tor-config 0.42.0 cargo set-version -p tor-config-path 0.42.0 cargo set-version -p tor-consdiff 0.42.0 cargo set-version -p tor-dirclient 0.42.0 cargo set-version -p tor-dircommon 0.42.0 cargo set-version -p tor-dirmgr 0.42.0 cargo set-version -p tor-dirserver 0.42.0 cargo set-version -p tor-error 0.42.0 cargo set-version -p tor-events 0.42.0 cargo set-version -p tor-general-addr 0.42.0 cargo set-version -p tor-geoip 0.42.0 cargo set-version -p tor-guardmgr 0.42.0 cargo set-version -p tor-hsclient 0.42.0 cargo set-version -p tor-hscrypto 0.42.0 cargo set-version -p tor-hsrproxy 0.42.0 cargo set-version -p tor-hsservice 0.42.0 cargo set-version -p tor-key-forge 0.42.0 cargo set-version -p tor-keymgr 0.42.0 cargo set-version -p tor-linkspec 0.42.0 cargo set-version -p tor-llcrypto 0.42.0 cargo set-version -p tor-log-ratelim 0.42.0 cargo set-version -p tor-memquota 0.42.0 cargo set-version -p tor-memquota-cost 0.42.0 cargo set-version -p tor-netdir 0.42.0 cargo set-version -p tor-netdoc 0.42.0 cargo set-version -p tor-persist 0.42.0 cargo set-version -p tor-proto 0.42.0 cargo set-version -p tor-protover 0.42.0 cargo set-version -p tor-ptmgr 0.42.0 cargo set-version -p tor-relay-crypto 0.42.0 cargo set-version -p tor-relay-selection 0.42.0 cargo set-version -p tor-rpcbase 0.42.0 cargo set-version -p tor-rpc-connect 0.42.0 cargo set-version -p tor-rtcompat 0.42.0 cargo set-version -p tor-rtmock 0.42.0 cargo set-version -p tor-socksproto 0.42.0 cargo set-version -p tor-units 0.42.0
* 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