Commit Graph

91 Commits

Author SHA1 Message Date
Nick Mathewson 302653977d Bump dependencies with "cargo upgrade" 2021-03-06 08:55:13 -05:00
Nick Mathewson 568567c5e0 Update to latest futures, once_cell 2021-02-23 15:54:29 -05:00
Nick Mathewson ab9d4a2229 Update some dependencies. 2021-02-19 09:39:23 -05:00
Nick Mathewson ddf994acc5 Add support to override network parameters in the configuration. 2021-02-16 13:29:46 -05:00
Nick Mathewson 94901ec355 Apply "deny_unknown_fields" to configuration types. 2021-02-12 11:26:00 -05:00
Nick Mathewson aeb410b915 Make authorities and fallbacks configurable.
This commit adds configuration options for these values, with the
right defaults, and uses those options instead of built-in functions
to set them.

We also remove the function to extract information from chutney
directories: now that arti is configurable, it can be chutney's job
to make its own network configurations.
2021-02-11 13:08:46 -05:00
Nick Mathewson 4ba7a89a3f Resolve a few more XXX-A1 comments in dirmgr. 2021-01-25 16:12:56 -05:00
Nick Mathewson fa57fb4995 Upgrade a few more dependencies. 2021-01-13 08:17:14 -05:00
Nick Mathewson f01d641ec8 cargo upgrade. 2020-12-30 15:59:33 -05:00
Nick Mathewson 2e5f694503 Cleanup on DirInfo::circ_params. 2020-12-22 16:17:35 -05:00
Nick Mathewson dd0c866090 Implement the "circwindow" and "ExtendByEd25519ID" parameters
These necessitated a little complexity for our circuit
creation/extension API; we might want to refactor that down the
road.
2020-12-22 16:02:49 -05:00
Nick Mathewson f3ad295224 Expose network parameters more sensibly from NetDir. 2020-12-22 15:20:07 -05:00
Nick Mathewson cc2a5d94ef Migrate from lazy_static to once_cell. 2020-12-22 11:55:41 -05:00
Nick Mathewson df4524d936 Check ipv6 exit policies when trying to connect to an ipv6 port specifically 2020-12-22 09:28:26 -05:00
Nick Mathewson 42db4210ab Simplification: Every relay is in the same family as itself. 2020-12-17 15:32:09 -05:00
Lunar 42f0d294de Make sure that a circuit doesn't use relays in the same family
We implement `Relay::in_same_family` which is in turn used by
`ExitPathBuilder::pick_path` to avoid picking relays in the
same family.

Compared to the original C implementation, we are missing
support for options EnforceDistinctSubnets and NodeFamilySets.

This has only been very lightly tested so far.

Closes: #43
2020-12-16 16:34:59 +01:00
Nick Mathewson 635cdc06d8 Write a few misc unit tests 2020-12-15 15:34:08 -05:00
Nick Mathewson d92c1aac04 Remember the actual usable ports for an exit after we've built a circuit
Previously we'd just remember the port that we _wanted_ a circuit
for, and forget all the ports that it _could_ support.

This is part of a bigger circmgr revision/refactoring pass; there
should be cleanups before I merge this.
2020-12-14 12:29:51 -05:00
Nick Mathewson 90fc798646 Fix some rustdoc warnings. 2020-12-09 09:46:39 -05:00
Nick Mathewson cfdedb995f upgrade rusqlite 2020-12-08 17:26:49 -05:00
Nick Mathewson 9419f6d699 Use uniform weight all measured weights are zero. 2020-12-07 21:07:41 -05:00
Nick Mathewson a52585d9d6 Mark some XXXX issues as XXXX-A1. 2020-12-07 16:07:59 -05:00
Nick Mathewson 9c96b5ea5d Add a missing documentation comment. 2020-12-07 09:26:22 -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
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 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 f9d741ab36 Add a function to load a directory from cache. 2020-11-24 09:00:45 -05:00
Nick Mathewson 9749022fa2 When a consensus has enough descriptors, mark it non-pending. 2020-11-24 07:08:41 -05:00
Nick Mathewson 99e0b1d9f5 Remove a couple of #[allow]s. 2020-11-20 15:30:32 -05:00
Nick Mathewson 7e50c4ad3a Move storage and config logic from netdir to dirmgr. 2020-11-20 12:20:43 -05:00
Nick Mathewson 21ebb5caf3 NetDirConfig: Learn fallback directories from chutney configurations too 2020-11-20 09:48:57 -05:00
Nick Mathewson c7ee4997b5 Missing file: whoops 2020-11-20 09:18:12 -05:00
Nick Mathewson 4721e95c06 Use a builder pattern for NetDir. 2020-11-20 09:02:11 -05:00
Nick Mathewson ff821d3f31 Move NetDirConfig into its own module. 2020-11-20 08:53:34 -05:00
Nick Mathewson d3f94f48f4 Move some netdir code into submodules.
The Authority type gets its own module; so does the ability to load
from legacy storage.
2020-11-20 08:44:26 -05:00
Nick Mathewson 300c9c3fde Remove "dumpdir" example as obsolete 2020-11-20 08:08:32 -05:00
Nick Mathewson 9f4230fb1b Initial pass on directory-manager code.
This code can now bootstrap from the network, cache the results, and
reload from cache.

There's lots more work to do here, including a big pile of tidying
and refactoring and testing and documentation.
2020-11-19 19:11:10 -05:00
Nick Mathewson 02bac5f04e Add support for using fallback directories in path construction
This is mainly a refactoring commit, with a little new code.

It also adds #[derive(Copy,Clone)] for a few types.
2020-11-19 10:06:48 -05:00
Nick Mathewson 658996dae9 Netdir: improve representation
Now a netdir no longer holds unwanted microdescs, and it always
holds a weight function.
2020-11-17 14:14:17 -05:00