aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src/doc/netstatus
Commit message (Collapse)AuthorAgeFilesLines
...
| * | everywhere: Add #[allow(clippy::string_slice)]Clara Engler2026-06-092-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/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | tor-netdoc: Fix a doc comment formatting botchIan Jackson2026-06-091-1/+1
| | |
* | | tor-netdoc: Introduce toplevel NeteworkStatus typeIan Jackson2026-06-094-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All of the pieces are in place for this now. Some of the pieces are not entirely complete or correct at this point: that's sorted out by other MRs already open. Currently there is no encoding, no verification functdion, and no tests. Encoding depends on another oustanding MR (arti!4058). Verification depends on the rework in arti!4065. Tests are still to come.
* | | tor-netdoc: impl EncodeOrd for RouterStatusIan Jackson2026-06-092-1/+10
| | | | | | | | | | | | This defines ordering of routerstatus items.
* | | tor-netdoc: derive encoding for RouterStatusIan Jackson2026-06-092-1/+1
| | |
* | | tor-netdoc: derive encoding for RouterStatusIntroItemIan Jackson2026-06-091-0/+1
|/ / | | | | | | | | | | This is a nontrivial type with much weirdness to do with publication times etc., so let's mark this as incomplete until we have a round trip test.
* | Merge branch 'netdoc-small-fixes' into 'main'Clara Engler2026-06-091-0/+1
|\ \ | | | | | | | | | | | | tor-netdoc: minor fixes arising from netstatus work See merge request tpo/core/arti!4055
| * | tor-netdoc: SoftwareVersion: fix Display implIan Jackson2026-06-031-0/+1
| |/ | | | | | | Now it round-trips.
* | tor-netdoc: netstatus: Abolish StdResult aliasIan Jackson2026-06-021-2/+2
| |
* | tor-netdoc: netstatus: No longer use crate::ResultIan Jackson2026-06-021-6/+6
|/
* tor-netdoc: implement encoding for votes' `m` itemsIan Jackson2026-05-281-0/+1
|
* tor-netdoc: derive Ord for RouterStatusMdDigestsVoteIan Jackson2026-05-281-1/+1
| | | | | | | | Sorting by the applicable consensus methods set seems reasonable. The spec doesn't state the order for this. I think that's fine. We can't expect to repro the same consensus with different software, and we will produce stable output.
* tor-netdoc: Rename RelayWeights to RelayWeightsItemIan Jackson2026-05-275-6/+6
| | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3991#note_3413168
* tor-netdoc: Introduce RelayWeights and use it in RouterStatusIan Jackson2026-05-275-7/+11
| | | | | | | | For encoding, we need to represent the raw parameters. This change is carefully arranged so that when the retain unknown feature is disabled (ie, in clients), the per-router data structure remains the same.
* tor-netdoc: Rename FixedString to ConstantStringIan Jackson2026-05-271-1/+1
| | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3985#note_3413182 I left the word "fixed" in some of the docs and error messages, where it seemed to make sense.
* tor-netdoc: Apply deferred rustfmt import churnIan Jackson2026-05-271-2/+2
|
* tor-netdoc: NetworkStatusVersionItem, replacing poc's tupleIan Jackson2026-05-271-0/+28
| | | | | Defining a struct gives us a place to hang the documentation, and avoids an accidentally-exhaustive tuple.
* tor-netdoc: VarietyKeyword, replacing poc's flavour typeIan Jackson2026-05-273-0/+68
| | | | | | | This is more code than the poc version but much of the extra is documentation, and it seems much less magical this way. We still need a handwritten parser for plain consensuses, sadly.
* tor-netdoc: Promote/adjust poc's NetworkStatusSignaturesIan Jackson2026-05-271-0/+10
| | | | | | | | The order of arguments of poc's ns_type macro is different to that of the real code. This is very confusing! However, the type is correct, once we've added the singleton signature for votes.
* tor-netdoc: use DirectorySignaturesHashesAccu in SignatureGroupIan Jackson2026-05-271-1/+6
| | | | | | This will let us (re)use the existing signature checking code with the parse2 type, since we'll be able to make a SignatureGroup out of a parse2'd UnverifiedNetworkStatus.
* tor-netdoc: Replace poc's NddDirectoryFooter with new FooterIan Jackson2026-05-271-0/+21
| | | | | This is the whole of the footer section, with docs, appropriate derives, and so on.
* tor-netdoc: ConsensusFooterFields: Constructor, parse, encodeIan Jackson2026-05-271-0/+1
|
* tor-netdoc: ConsensusFooterFields: Rename weights field to bandwidth_weightsIan Jackson2026-05-272-3/+3
| | | | This matches the spec.
* tor-netdoc: Rename Footer to ConsensusFooterFieldsIan Jackson2026-05-273-6/+6
| | | | | | | | | | | This will allow us to include this, conditionally, in the new per-variety footer types for consensuses, without too much disruption to the existing code. We don't leave a compatibility alias because we're going to want a Footer in each_variety.rs which is the actual sub-document. This old struct isn't suitable because it doesn't have the intro item and is just for consensuses.
* tor-netdoc: Implement encoding for md rs digestIan Jackson2026-05-182-1/+14
| | | | | This is not tested yet. It will be tested when we add round-trip tests for votes.
* tor-netdoc: Fix comment about from_unparsedIan Jackson2026-05-181-1/+1
| | | | This doesn't parse the keyword, only the value.
* tor-netdoc: Tidy doc_digest_parse2_m into doc_digest_item_mIan Jackson2026-05-182-5/+5
| | | | | | | | | * Rename it so that it doesn't mention parse2, because we're going to want to encode too. * Remove the indirection: rename the one in md.rs to be the name that's used in `with = `. (Previously, things were more complicated so the extra layer of indirection was helpful.)
* tor-netdoc: rs referenced doc digests: Use FixedB64 (fmt)Ian Jackson2026-05-181-2/+1
|
* tor-netdoc: rs referenced doc digests: Use FixedB64Ian Jackson2026-05-186-42/+22
| | | | | | | FixedB64 is the right type for these, when they are present. This abolishes some ad-hoc boilerplate. Sadly we still need a bit of that for Reasons.
* tor-netdoc: relay flags with: Use ns_type! rather than conditional importIan Jackson2026-05-181-4/+7
| | | | | | | | Previously, this was't possible because derive-deftly wanted a string. But now it can take a type, and types can contain macro calls inside their generics etc. This makes the code much more local and direct.
* tor-netdoc: Fix comments in rs variety filesIan Jackson2026-05-183-3/+3
| | | | This is router *status* not router *descriptor*.
* tor-netdoc: Fix NotPresent to use same Each valueIan Jackson2026-05-181-2/+2
|
* tor-netdoc: SharedRandStatuses: Use proper Constructor non-exhaustive patternIan Jackson2026-05-132-0/+2
|
* tor-netdoc: rustfmt (re-alphabetise and re-wrap imports)Ian Jackson2026-05-131-2/+1
|
* tor-netdoc: Soften a TODO.Ian Jackson2026-05-131-2/+2
| | | | | Preamble now doesn't contain anything that's *wrong*. It is missing a couple of fields that will be wanted when we generate votes.
* tor-netdoc: Add a ticket reference for a TODOIan Jackson2026-05-131-1/+1
| | | | | This isn't needed for the arti dirauth consensus method, but it will be needed for arti dirauth vote calculator.
* tor-netdoc: Add shared-rand-*-status to VoteAuthorityEntryIan Jackson2026-05-131-1/+0
|
* tor-netdoc: Break out SharedRandStatuses, and remove it from votesIan Jackson2026-05-134-14/+20
|
* tor-netdoc: Gate vote-related incomplete code with "incomplete"Ian Jackson2026-04-281-1/+1
| | | | | | | | | | | Change "ns-vote" gates to "incomplete": * `vote` modules, and in the variety macro. (And make a TODO more likely to be found.) Change "parse2" gates to "incomplete": * VoteAuthoritySection
* tor-netdoc: Un-gate RouterStatusMdDigestsVote and SoftwareVersionIan Jackson2026-04-281-1/+0
| | | | | These are complete. Un-gate the RouterStatusMdDigestsVote implementation, and the export of both.
* tor-netdoc: Un-gate "plain-consensus" cargo featureIan Jackson2026-04-283-3/+0
| | | | As per #2492.
* tor-netdoc: Un-gate parse2 and encode loose impls under doc/netstatus (tidy)Ian Jackson2026-04-283-17/+9
|
* tor-netdoc: Un-gate parse2 and encode loose impls under doc/netstatusIan Jackson2026-04-284-26/+18
| | | | | | | | | | | | | | | This stabilises the parse2 and encode impls of consensus tyepe: * {plain, md}::{Preamble, RouterStatus, RouterStatusIntroItem} It also un-gates the parse2 and encode impls of some vote types. * VoteAuthorityEntry - this type has been completed. * RouterStatusMdDigestsVote - whole type still gated with ns-vote Re the remaining vote types (vote::*): although each_variety.rs doesn't have a cfg itself, there is a feature gate in the variety macrology.
* tor-netdoc: Un-gate features impls in doc/netstatus/dir_source.rs (rewrap)Ian Jackson2026-04-281-4/+1
|
* tor-netdoc: Un-gate features impls in doc/netstatus/dir_source.rsIan Jackson2026-04-281-8/+4
| | | | There are no outstanding TODOs here.
* tor-netdoc: consensus authority section: ConsensusAuthoritySectionIan Jackson2026-04-271-2/+106
| | | | | | | | | | | | | | | | | | | Replace poc code with new ConsensusAuthoritySection. This is an entirely new parsing approach. Key differences: * We parse the arguments to dir-source, which poc didn't. * We don't clone the input and fully parse the first item; instead, we dismantle the dir-source line ad-hoc to determine the item type. * Rather than a Vec of Enums, we parse into two Vecs of the different entry types. The few lines that aren't rewritten show up as moved in git show --color-moved --color-moved-ws=allow-indentation-change but I suggest reviewing the new implementation de novo.
* tor-netdoc: consensus authority section: SupersededAuthorityKeyIan Jackson2026-04-271-1/+118
| | | | | This is the type corresponding to a "superseded authority key entry", which is a single dir-source line with a weird nickname.
* tor-netdoc: DirSource: move to new dir_source moduleIan Jackson2026-04-271-0/+57
| | | | | | | | | | | | | This is going to handle the bizarre `-legacy` nickname encoding for superseded authority keys. That's going to be a fair amount of code, some derived from DirSource. Make a module for it all. We're going to take a different approach that in poc. So there's going to be all-new code and then the poc version will be deleted. They don't resemble each other very much. In this commit: just code motion, and the creation of the new module with associated doc comment. Review with --color-moved.
* tor-netdoc: ConsensusAuthorityEntry: derive ConstructorIan Jackson2026-04-271-0/+1
|