Commit Graph

1599 Commits

Author SHA1 Message Date
Nick Mathewson d78b25f2b0 Typo fix in comment. 2021-09-29 13:49:07 -04:00
Trinity Pointard e05a2ae51d add basic integration test 2021-09-27 17:35:32 +02:00
Nick Mathewson 5e196f7f3f Run cargo update on other dependencies. 2021-09-25 15:46:32 -04:00
Trinity Pointard 954395573a update fslock to compile android 2021-09-25 12:01:45 +02:00
Nick Mathewson 34ad08c1db Run cargo upate. 2021-09-23 08:27:48 -04:00
Nick Mathewson b51e2ff5b3 Upgrade memmap2, directories, and dirs dependencies. 2021-09-23 08:26:29 -04:00
Trinity Pointard 1a157f5d60 refactor a bit reproducible_build.sh 2021-09-20 17:48:13 +02:00
Trinity Pointard 0493c2b830 try use cache and make MacOS bin available as artifact 2021-09-20 17:48:13 +02:00
Trinity Pointard 78b6a36671 add reproducible builds for MacOS 2021-09-20 17:48:12 +02:00
Nick Mathewson 8bf394b0d5 Move version-controlled Cargo.lock to /.
Previously I'd hoped to have it only apply to reproducible builds,
but the work of keeping it up-to-date and checking it for drift
seems to have been tripping us up.  Let's try doing it the other way
for now, and we'll see how that goes.
2021-09-20 11:37:11 -04:00
Daniel Eades 5d0e00ecef update lock file 2021-09-19 13:46:11 +01:00
Daniel Eades 9a3b183679 remove unused dep 2021-09-19 09:47:57 +01:00
Nick Mathewson 19a920d12a Update misc/Cargo.lock. 2021-09-17 08:11:39 -04:00
Jani Monoses 5f1f239d51 Enable js feature for getrandom for WASM.
By default rand does not build for WASM browser targets.
2021-09-17 06:43:02 +03:00
Nick Mathewson 4df5596aab Update misc/Cargo.lock 2021-09-16 14:27:47 -04:00
Jani Monoses 08c9edfc54 Stop using anyhow in tor-dirclient. 2021-09-16 14:27:04 -04:00
Nick Mathewson 039601f179 tor-netdir: Add a by_id_pair() function to look up a relay by both IDs. 2021-09-16 10:19:35 -04:00
Nick Mathewson 140e5d4ca2 Merge remote-tracking branch 'origin/mr/82' 2021-09-16 08:39:21 -04:00
Nick Mathewson 95343a25e3 Add small qualifiers on android.md 2021-09-16 08:35:02 -04:00
Jani Monoses b0bb7bd100 Do not use set_ prefix on derive_builder setters 2021-09-16 08:41:04 +03:00
Trinity Pointard 1d006684c9 fix typo and change upstream link 2021-09-15 11:59:28 +02:00
Trinity Pointard 285b3126f7 document android building 2021-09-14 19:59:23 +02:00
Nick Mathewson 4d0cd5e86f Update maint/Cargo.lock again. 2021-09-13 09:39:13 -04:00
Nick Mathewson 6dd8a40f93 Merge remote-tracking branch 'origin/mr/80' 2021-09-13 09:38:49 -04:00
Trinity Pointard 0e906058e6 update misc/Cargo.lock 2021-09-12 10:28:00 +02:00
Trinity Pointard 193f518b6b CI: make fail when new deps not in misc/Cargo.lock
Currently adding new deps can cause builds to not be reproducibles
because that new dependancies don't have their versions frozen in
misc/Cargo.lock.
This make so CI reject commits in that situation, with a message telling
what to do to fix the issue.
2021-09-12 10:20:53 +02:00
Daniel Eades 27cca71978 derive 'Default' where possible 2021-09-11 20:02:33 +01:00
Nick Mathewson 1c08bb44c8 Add identity-based accessors (and indices) to NetDir.
(Thank goodness for rust; we messed up the coherency in C here so
many times, but I'm pretty sure that this time around we can't have
gotten it wrong.)
2021-09-10 15:13:57 -04:00
Nick Mathewson e5ef19962b Merge remote-tracking branch 'origin/mr/77' 2021-09-10 10:26:14 -04:00
Nick Mathewson 0949582fab Use derive_builder for Authority and FallbackDir. 2021-09-10 10:03:33 -04:00
Nick Mathewson 8bfb04f562 Suppress a cognitive-complexity lint in tests 2021-09-09 14:20:55 -04:00
Nick Mathewson 1c97918d67 Typo fixes 2021-09-09 13:06:05 -04:00
Nick Mathewson 9b2df3edd8 Add guard-related network parameters. 2021-09-09 13:01:52 -04:00
Nick Mathewson 0635ec6721 Add an IntegerDays numeric type. 2021-09-09 12:32:13 -04:00
Nick Mathewson 41f96c4f2f Use macros and traits to simplify the declaration of parameters.
Previously, we'd have to declare the field for a parameter in one
place, its default in a second, and its consensus key in a third.
That's error-prone and not so fun!  This patch changes the
way we declare parameters so that we declare a structure once,
and macros expand it to all do the right thing.

This required a few new traits and implementations to ensure
uniformity across the types that can go in parameters: We need every
parameter type to implement TryFrom<i32> and to implement
SaturatingFromInt32.

Eventually we might want SaturatingFromInt32 to be a more generic
SaturatingFrom, but that's not for now.
2021-09-09 09:29:04 -04:00
Nick Mathewson a00248723d Use derive_builder for the rest of tor_dirmgr::config 2021-09-09 07:38:12 -04:00
Jani Monoses 4d52f99020 Create a separate logging section in config. 2021-09-09 10:38:29 +03:00
Nick Mathewson 372c38e041 Use derive_builder for DownloadScheduleConfig 2021-09-08 17:55:18 -04:00
Nick Mathewson d42d910a4f Use derive_builder for NetworkConfig. 2021-09-08 17:46:00 -04:00
Trinity Pointard e69d2d45bc run CI only on amd64 runners 2021-09-08 22:15:20 +02:00
Nick Mathewson 6996c0f1b5 Merge remote-tracking branch 'origin/mr/73' 2021-09-08 16:04:58 -04:00
Nick Mathewson d9dc6f9d5c Fix clippy warnings in tests with --all-features 2021-09-08 14:28:38 -04:00
Nick Mathewson ab0c80de2b Fix/suppress a few more clippy lints in tests.
I'm alright with allowing cognitive-complexity violations in the
tests.
2021-09-08 14:20:47 -04:00
Nick Mathewson 949313e288 Merge remote-tracking branch 'origin/mr/71' 2021-09-08 14:14:39 -04:00
Nick Mathewson 9ba16a3104 Check for correct-ish decoding of all parameters. 2021-09-08 13:46:24 -04:00
Nick Mathewson 929cf84073 Add validation function to WeightSet
Our relay selection code can give wrong answers if we overflow
u64::MAX, so let's make sure we never do that.
2021-09-08 12:38:20 -04:00
Nick Mathewson 0468b41f33 Replace weighted-choice code with rand::seq::SliceRandom.
Doing this makes the code faster, lets us throw away some code, and
makes it easier to add a "choose-N-disjoint relays" implementation.

See large comment about plusses and minuses of new code.  (Note that
the old implementation wasn't constant-time either.)
2021-09-08 12:22:56 -04:00
Daniel Eades c2c6a04309 run clippy on test modules 2021-09-08 17:28:40 +02:00
Daniel Eades fb3b8b84b5 fix/silence clippy lints in test modules 2021-09-08 17:28:31 +02:00
Nick Mathewson 9cf1fa36f4 More tests in pareto.rs 2021-09-08 09:18:23 -04:00