| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This commit makes use of the presence of only one descriptor hash inside
consensus_router_descriptor_member by adding a respective AND clause to
the select statements of missing descriptors to only select the rows
with a non-null SHA-1 (or SHA-2 for the sake of microdescs) in the
consensus_router_descriptor_member table.
This is defensive programming and should not be required in practice
because the docid as well as the "XOR" CHECK should already ensure that
this value is always non-NULL. However, if it still happens and slips
through, the statement would return NULL rows, which is not what we
want and was previously prevented by ensuring this field was never NULL
in the first place.
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This commit modifies the consensus_router_descriptor_member table in the
database schema, removing the NOT NULL constraint on unsigned_sha1 and
unsigned_sha2 by replacing it with a new CHECK constraint that checks
that either one of them is set but not both.
The reason for this is as follows: We are going to use this table to
compute the queue of missing descriptors, which means that we can only
populate this table with the data we know from the consensus. The
consensus however tells us only one of those hashes, namely sha1 in the
case of a consensus-ns and sha2 in the case of a consensus-md.
In other words: This commit can also be seen as an effort to change the
design of the operation in such a way that the queue is obtained
directly from the database and not computed at the start during state
transition.
|
| |\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
tor-netdoc: Parsing and encoding for netstatus authority sections
See merge request tpo/core/arti!3892
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This is the type corresponding to a "superseded authority key entry",
which is a single dir-source line with a weird nickname.
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
| | | | | | |
|
| | | | | | |
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
We must add to our ad-hoc derive, since the normal derive can't do the
encoding either.
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Use deftly's field loop, rather than handcoding the two fields.
(We don't expect to add any fields, but if we did this would be more correct.)
|
| | | | | | |
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Almost entirely code motion. Review with --color-moved.
This is new correct for votes, and uses the non-poc names for things.
We'll improve up a few minor things in a moment.
The cfg situation is getting very tangled. There are already various
TODOs about this. I think it is time to bite the bullet; I will do
that separately from this MR.
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Prepare for the namespace environment in the mainline doc/netstatus
modules. (Add a couple of temporary use's.)
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
We are going to move this code to the main doc/netstatus modules.
Rename the struct and its associated derive macro, to the naming
approach used outside poc.
We leave a `use` behind in poc. That can remain until poc is
eventually abolished.
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Purely whitespace change: deindent certain lines by 4.
`git show -w` is helpful.
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This has a side effect of testing the parsing.
(Testing of the encoding will have to come a lot later.)
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
| | | | | |
| | | | |
| | | | |
| | | | | |
Deprecate the compatibility alias.
|
| | | | | |
| | | | |
| | | | |
| | | | | |
Use the terminology from the spec.
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
| | | | | |
| | | | |
| | | | |
| | | | | |
This makes the struct more legible.
|
| | | | | | |
|
| | | | | |
| | | | |
| | | | |
| | | | | |
We'll want this with Constructor's __non_exhaustive.
|
| |\ \ \ \ \
| |/ / / /
|/| | | |
| | | | |
| | | | | |
Prep work for EmbeddedCert
See merge request tpo/core/arti!3918
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
As discussed in
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3918#note_3401409
|
| | | | | | |
|
| |\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
tor-netdoc: Introduce EmbeddedCert, and a demo of how to use it
Closes #2485
See merge request tpo/core/arti!3922
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | | |
Fixes #2485.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | | |
This reverts commit 68caf324a320fff1a4f0e9b0f5014a34d0e3729f.
|
| | |/ / / /
| | | | |
| | | | |
| | | | |
| | | | | |
This is more sensible and will make the code in tor-netdoc less strange.
We'll revert the TryFrom in a moment.
|
| | | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Implement the Writeable trait.
Explain why this approach is correct and leave a comment near the
decoder (to avoid future changes making this implementation buggy) and
a test case.
|
| | | | | |
| | | | |
| | | | |
| | | | | |
Otherwise we can't implement trait-based decoding in tor-netdoc.
|
| | | | | | |
|