Nick Mathewson
6f286ba7c2
fixup! fixup! fixup! Try adding "test --all" and "fmt" and "clippy".
2020-12-07 14:04:05 -05:00
Nick Mathewson
b5f17167c2
fixup! fixup! Try adding "test --all" and "fmt" and "clippy".
2020-12-07 12:51:03 -05:00
Nick Mathewson
09849c64f8
fixup! Try adding "test --all" and "fmt" and "clippy".
2020-12-07 12:41:28 -05:00
Nick Mathewson
fd74f6c13f
Try adding "test --all" and "fmt" and "clippy".
2020-12-07 12:16:00 -05:00
Nick Mathewson
0f963774db
Fix grammar in a log message
2020-12-07 10:21:01 -05:00
Nick Mathewson
9c96b5ea5d
Add a missing documentation comment.
2020-12-07 09:26:22 -05:00
Nick Mathewson
6f1e05a1d3
Add a few log messages about download timing.
2020-12-07 09:24:51 -05:00
Nick Mathewson
bb62dc8eb5
Merge remote-tracking branch 'origin/mr/2' into main
2020-12-07 08:39:39 -05:00
Nick Mathewson
2d19985cb5
Merge branch 'mr_4_squashed' into main
2020-12-07 08:35:11 -05:00
Alexander Færøy
1923c7820f
Let's try explicit target?
2020-12-07 08:35:02 -05:00
Alexander Færøy
dee4d7bf72
No need to install Husky hooks on CI.
2020-12-07 08:35:02 -05:00
Nick Mathewson
57eea69f52
Teach updater to download microdescriptors for usable directory.
...
This follows a three-phase process: We are either fetching
microdescriptors, waiting for the time to download the next
consensus, or fetching the next consensus and making it usable.
We can stop fetching microdescriptors for two reasons: by having no
more mds that we need to download, or by running out of time in
which the current consensus is usable.
2020-12-07 08:29:35 -05:00
Nick Mathewson
915515442f
Reuse microdescriptors from previous consensus
...
Previously, we'd re-parse them from the database every time we got a
new consensus.
2020-12-06 11:42:50 -05:00
Nick Mathewson
5e0b8380e2
Refactor NetDir a little for space savings and updating
...
Rather than having the NetDir own its microdescs and consensus, give
it Arc<>s for them. This way, we can do a shallow copy of a NetDir
to work around mutability issues that would otherwise make it hard
to add microdescs to a netdir on the fly.
2020-12-06 11:13:10 -05:00
Alexander Færøy
6fa8f2c0f5
No need to install libsqlite3-dev on CI servers.
2020-12-06 16:01:06 +00:00
Alexander Færøy
3bccafd6b9
Also install libsqlite3-dev.
2020-12-06 01:05:15 +00:00
Alexander Færøy
128f8c31c0
Add Gitlab CI support.
2020-12-06 00:16:34 +00:00
Alexander Færøy
0eedd017ce
Fix typo in pick_path().
...
This patch fixes a minor typo in the error case when looking for a
middle relay for a 3-hop circuit where the error message should say "No
middle relay found" and not "No exit relay found".
2020-12-05 22:45:43 +00:00
Nick Mathewson
6ddf55f799
Enforce that the periods in a consensus lifetime are nonempty.
...
To be valid, a lifetime must have valid_after < fresh_until <
valid_until.
2020-12-04 15:00:06 -05:00
Nick Mathewson
402d501020
Update a few comments.
2020-12-04 14:03:05 -05:00
Nick Mathewson
b56223f382
Dirmgr: Add a feature to keep the directory up-to-date.
...
This required me to move the sqlite connection from a rwlock into mutex,
since it isn't actually Sync.
2020-12-04 13:53:51 -05:00
Nick Mathewson
bb01a55a8c
authcert: move location into UncheckedAuthCert.
...
This lets us make AuthCert Send and Sync.
2020-12-04 13:17:24 -05:00
Nick Mathewson
58869194f6
tor-dirclient: tweak so that its future is Send.
2020-12-04 13:16:52 -05:00
Nick Mathewson
9418838456
Fix a copy-paste bug in netstatus::Lifetime
2020-12-04 13:15:58 -05:00
Nick Mathewson
4ac4f5496e
rtcompat: add a function to sleep until a given wallclock time
...
(We can't just subtract and sleep, since we should be at least
somewhat concerned about clock jumps.)
2020-12-04 13:12:45 -05:00
Nick Mathewson
40ac33bde2
Upgrade async-io
2020-12-03 13:05:51 -05:00
Nick Mathewson
be23950f37
TODO
2020-12-03 10:12:54 -05:00
Nick Mathewson
2e0c6f900b
A few more tests for role-based weighting
2020-12-02 18:05:12 -05:00
Nick Mathewson
b793e0c075
Use bwweightscale to avoid miscalculating weights for v2dir relays
2020-12-02 17:54:22 -05:00
Nick Mathewson
1d6d9b9c4b
More tests for weight.rs; find a bug.
2020-12-02 17:39:34 -05:00
Nick Mathewson
49fc20426a
Add a few easy tests in weights.rs
2020-12-02 16:57:37 -05:00
Nick Mathewson
42c85026f3
a little more refactoring for testability
2020-12-02 15:59:08 -05:00
Nick Mathewson
64f28a10a5
Clarify DFLT_WEIGHT in weights.rs
2020-12-02 15:48:26 -05:00
Nick Mathewson
e931e811b0
Resolve a couple of TODOs in weight.rs
...
(Thanks to Mike Perry for answers here.)
2020-12-02 15:40:32 -05:00
Nick Mathewson
5dd32ba3c1
weights: refactor a couple of functions to be more testable.
2020-12-02 15:39:12 -05:00
Nick Mathewson
6e755eee4d
Use a slightly prettier syntax in max_weight
2020-12-02 15:27:32 -05:00
Nick Mathewson
01de0cafc5
Run cargo fix --edition-idioms
2020-12-02 15:14:29 -05:00
Nick Mathewson
aebf1fcc0d
Fix a few comments in weight.rs
2020-12-02 14:15:40 -05:00
Nick Mathewson
6f25dd05af
Use a better calculation for deciding if we have enough paths.
2020-12-02 14:09:33 -05:00
Nick Mathewson
412f1763de
Implement correct (?) weighting for path selection.
2020-12-02 13:51:19 -05:00
Nick Mathewson
4aa61322be
Fix a couple of clippy warnings in tor-dirclient.
2020-12-02 13:43:45 -05:00
Nick Mathewson
a72437a1c7
Abandon directory circuits on most kinds of directory failure.
...
(There are more cases that this _doesn't_ handle, but it's a start
for now.)
2020-12-02 09:46:35 -05:00
Nick Mathewson
85c287c4e4
When retiring circuits, do it by ID, not by reference.
2020-12-01 16:50:51 -05:00
Nick Mathewson
0dc5c7b459
Bump to latest async-io
2020-12-01 15:21:50 -05:00
Nick Mathewson
efa6dd708b
Expose UniqId types for channels and circuits
2020-12-01 14:00:07 -05:00
Nick Mathewson
ea0cb1d2cc
Rename LogId -> UniqId.
2020-12-01 13:44:25 -05:00
Nick Mathewson
3fe97baa2a
Derive more types for circuit and channel LogIds
2020-12-01 13:21:46 -05:00
Nick Mathewson
31773e0251
Enforce uniqueness on circuit and channel logids
2020-12-01 13:20:41 -05:00
Nick Mathewson
db55c84c89
tor-dirmgr: retry up to 3 times on download failure.
2020-12-01 09:38:59 -05:00
Nick Mathewson
f5f2a648a3
tor-dirclient: add timeouts
...
This adds two timeouts in total: one for sending begin, and getting
headers, and one for getting the rest of the data.
These timeouts are way too long right now, but at least the code is
there.
2020-12-01 08:56:25 -05:00