aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2021-11-09Implement proposal 275: don't put "published" times in md consensusNick Mathewson
When a new consensus method is negotiated, these values will all get replaced with "2038-01-01 00:00:00". This change should be safe because: * As of 0.2.9.11 / 0.3.0.7 / 0.3.1.1-alpha, Tor takes no action about published_on times in the future. * The only remaining parties relying on published_on values are (we believe) relays running 0.3.5.x, which rely on the values in a NS consensus to see whether their descriptors are out of date. But this patch only changes microdesc consensuses. * The latest Tor no longer looks at this field in consensuses. Why make this change? In experiments, replacing these values with a fixed value made the size of compressed consensus diffs much much smaller. (Like, by over 50%!) Implements proposal 275; Implements #40130.
2021-11-09Move published_on from routerstatus_t to vote_routerstatus_t.Nick Mathewson
Nothing breaks here, since all non-voting users of routerstatus_t.published_on have been adjusted or removed in previous commits. We have to expand the API of routerstatus_format_entry() a bit, though, so that it can always get a published time as argument, since it can't get it from the routerstatus any more. This should have no effect on voter behavior.
2021-11-09Stop checking published_on in routerstatus_has_visibly_changed()Nick Mathewson
This function is only used for the controller; and any time that the published_on time has changed, the digest should also change.
2021-11-09Change a log not to use published_on.Nick Mathewson
It used to describe when the old and new routerinfos were published when we'd decide to download a routerinfo. Now it describes what their descriptor digests are.
2021-11-09Stop using published_on in rs to decide whether to download a routerdesc.Nick Mathewson
The consensus voters shouldn't actually include such old routers in the consensus anyway, so this logic shouldn't come up... but if a client _does_ download something it wouldn't use, it won't retry infinitely: see checks for WRA_NEVER_DOWNLOADABLE.
2021-11-09Retain all routerinfos listed in the consensus.Nick Mathewson
Previously we'd look at the routerstatus published_on field when deciding what to dump, which really has no point. If something's in the consensus with an ancient published date, then we do want to keep it.
2021-11-09Stop using published_on to decide whether to republish.Nick Mathewson
Thanks to the StaleDesc flag, this is not something we need to look at any longer.
2021-11-05Merge branch 'maint-0.4.6'David Goulet
2021-11-05Merge branch 'maint-0.4.5' into maint-0.4.6David Goulet
2021-11-05protover: Fix merge forward from 035David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-11-05Merge branch 'maint-0.3.5' into maint-0.4.5David Goulet
2021-11-05Light edit to protover warnings.Nick Mathewson
2021-11-05protover: Add a note on why LinkAuth is not recommended or requiredDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-11-05protover: Move all hardcoded lists in one placeDavid Goulet
This also moves the warnings and add some theatrical effect around the code so anyone modifying those list should notice the warnings signs and read the comment accordingly. Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-11-05Add scary warnings about changing the protover list.Nick Mathewson
Doing this in the wrong way has potential to cause serious havoc on the network, so let's make it harder for future programmers to mess it up.
2021-11-03Merge branch 'maint-0.4.6'David Goulet
2021-11-03Merge branch 'maint-0.4.5' into maint-0.4.6David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-11-03relay: Don't allow DirPort on non-IPv4David Goulet
Our code doesn't allow it and so this prevents an assert() crash if the DirPort is for instance IPv6 only. Fixes #40494 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-11-02Merge remote-tracking branch 'tor-gitlab/mr/474' into mainAlexander Færøy
2021-10-29Use TOR_PRIuSZ instead of %ld for CC logging.Alexander Færøy
This patch fixes the current build of main on Windows.
2021-10-29Fix Windows build.Alexander Færøy
While trying to resolve our CI issues, the Windows build broke with an unused function error: src/test/test_switch_id.c:37:1: error: ‘unprivileged_port_range_start’ defined but not used [-Werror=unused-function] We solve this by moving the `#if !defined(_WIN32)` test above the `unprivileged_port_range_start()` function defintion such that it is included in its body. This is an unreviewed commit. See: tor#40275
2021-10-28don't retry entry guards if they're bridges without descriptorsRoger Dingledine
When we don't yet have a descriptor for one of our bridges, disable the entry guard retry schedule on that bridge. The entry guard retry schedule and the bridge descriptor retry schedule can conflict, e.g. where we mark a bridge as "maybe up" yet we don't try to fetch its descriptor yet, leading Tor to wait (refusing to do anything) until it becomes time to fetch the descriptor. Fixes bug 40497; bugfix on 0.3.0.3-alpha.
2021-10-28do notice-level log when we resume having enough dir infoRoger Dingledine
we do a notice-level log when we decide we *don't* have enough dir info, but in 0.3.5.1-alpha (see commit eee62e13d97, #14950) we lost our corresponding notice-level log when things come back. bugfix on 0.3.5.1-alpha; fixes bug 40496.
2021-10-28handle other de-sync cases from #40396Roger Dingledine
Specifically, every time a guard moves into or out of state GUARD_REACHABLE_MAYBE, it is an opportunity for the guard reachability state to get out of sync with the have-minimum-dir-info state. Fixes even more of #40396.
2021-10-28reassess minimum-dir-info when a bridge failsRoger Dingledine
When we try to fetch a bridge descriptor and we fail, we mark the guard as failed, but we never scheduled a re-compute for router_have_minimum_dir_info(). So if we had already decided we needed to wait for this new descriptor, we would just wait forever -- even if, counterintuitively, *losing* the bridge is just what we need to *resume* using the network, if we had it in state GUARD_REACHABLE_MAYBE and we were stalling to learn this outcome. See bug 40396 for more details.
2021-10-28only log "new bridge descriptor" if really newRoger Dingledine
The bridge descriptor fetching codes ends up fetching a lot of duplicate bridge descriptors, because this is how we learn when the descriptor changes. This commit only changes comments plus whether we log that one line. It moves us back to the old behavior, before the previous commit for 30496, where we would only log that line when the bridge descriptor we're talking about is better than the one we already had (if any).
2021-10-28Fix compilation on systems with older compilers.Alexander Færøy
This patch fixes a build error with GCC 7.x which doesn't seem to accept const int's as constants in macro initialization. See: tpo/core/tor#40410
2021-10-28version: Missing version update in couple filesDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-10-28version: Missing version update in couple filesDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-10-28version: Missing version update in couple filesDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-10-28version: Missing version update in couple filesDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-10-26version: Bump to 0.4.6.8David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-10-26version: Bump to 0.4.5.11David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-10-26version: Bump to 0.3.5.17David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-10-24fetch missing bridge descriptors without delayRoger Dingledine
Without this change, if we have a working bridge, and we add a new bridge, we will schedule the fetch attempt for that new bridge descriptor for three hours(!) in the future. This change is especially needed because of bug #40396, where if you have one working bridge and one bridge whose descriptor you haven't fetched yet, your Tor will stall until you have successfully fetched that new descriptor -- in this case for hours. In the old design, we would put off all further bridge descriptor fetches once we had any working bridge descriptor. In this new design, we make the decision per bridge based on whether we successfully got *its* descriptor. To make this work, we need to also call learned_bridge_descriptor() every time we get a bridge descriptor, not just when it's a novel descriptor. Fixes bug 40396. Also happens to fix bug 40495 (redundant descriptor fetches for every bridge) since now we delay fetches once we succeed. A side effect of this change is that if we have any configured bridges that *aren't* working, we will keep trying to fetch their descriptors on the modern directory retry schedule -- every couple of seconds for the first half minute, then backing off after that -- which is a lot faster than before.
2021-10-21Merge branch 'maint-0.4.6'David Goulet
2021-10-21Merge branch 'maint-0.4.5' into maint-0.4.6David Goulet
2021-10-21Merge branch 'maint-0.3.5' into maint-0.4.5David Goulet
2021-10-21fallbackdir: Regenerate the list for October 2021David Goulet
Closes #40493 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-10-21Merge branch 'tor-gitlab/mr/452_squashed' into mainAlexander Færøy
2021-10-21Add a new consensus method to handle MiddleOnly specially.Nick Mathewson
When this method is in place, then any relay which is assigned MiddleOnly has Exit, V2Dir, Guard, and HSDir cleared (and has BadExit set if appropriate).
2021-10-21Implement a MiddleOnly flag for vote generation.Nick Mathewson
This proposal implements part of Prop335; it's based on a patch from Neel Chauhan. When configured to do so, authorities will assign a MiddleOnly flag to certain relays. Any relay which an authority gives this flag will not get Exit, V2Dir, Guard, or HSDir, and might get BadExit if the authority votes for that one.
2021-10-21Merge remote-tracking branch 'tor-gitlab/mr/442' into mainAlexander Færøy
2021-10-21Merge branch 'maint-0.4.5' into maint-0.4.6Alexander Færøy
2021-10-21Merge remote-tracking branch 'tor-gitlab/mr/338' into maint-0.4.5Alexander Færøy
2021-10-20Merge branch 'maint-0.3.5' into maint-0.4.5Alexander Færøy
2021-10-20Announce URL to bridge status page when starting Tor as a bridge relay.Alexander Færøy
This patch makes Tor announce the relay specific bridge status page URL when Tor is starting up before bootstrap occours. See: tor#30477
2021-10-20relay: Comment out a unused variable for nowDavid Goulet
We keep it around until libevent is fixed, it should be used again. In the meantime, avoid the compiler to complain of this unused variable. https://gitlab.torproject.org/dgoulet/tor/-/jobs/43358#L1522 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-10-20Merge branch 'tor-gitlab/mr/464_squashed' into mainAlexander Færøy
2021-10-20Move "Didn't recognize cell, but circ stops here" into heartbeat.Nick Mathewson
When we looked, this was the third most frequent message at PROTOCOL_WARN, and doesn't actually tell us what to do about it. Now: * we just log it at info * we log it only once per circuit * we report, in the heartbeat, how many times it happens, how many cells it happens with per circuit, and how long these circuits have been alive (on average). Fixes the final part of #40400.