Commit Graph

7885 Commits

Author SHA1 Message Date
Micah Elizabeth Scott ae58ea0697 equix, hashx: Benchmark against C implementation
This is a small batch of improvements for the equix and hashx
benchmarks. The headline feature is that we are now including
the C implementations (slightly modified from tevador's, hosted
as part of c-tor) and using them in apples-to-apples comparisons.

Minor features:
- Benchmarks moved to new nested crates, preventing their
  dependencies from spilling into the main workspace build.
- Tests are now grouped
- We also test the performance of memory reuse where possible
- Code cleanup for per-runtime options

These benchmark builds will now automatically pull in the c-tor
git repo and build portions of it with a Rust wrapper. This uses
the 'cc' and 'bindgen' crates, so it requires a C compiler and
libclang on the host system.

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-08-01 19:28:43 -07:00
Nick Mathewson b0b6e47d05 Merge branch 'misc_upgrades' into 'main'
Upgrade to sanitize-filename 0.5.0

See merge request tpo/core/arti!1453
2023-08-02 00:11:42 +00:00
Nick Mathewson 1dc47a65cf Upgrade to sanitize-filename 0.5.0 2023-08-01 19:47:39 -04:00
Nick Mathewson 4abad7b6fd Merge branch 'update-hss-dep' into 'main'
hsservice: Upgrade tor-keymgr dep

See merge request tpo/core/arti!1463
2023-08-01 23:28:58 +00:00
Nick Mathewson f7c0350e7f hsservice: Upgrade tor-keymgr dep
This breakage was caused by increasing the version of tor-keymgr
and independently merging !1452, which added a dependency on the
old version.
2023-08-01 18:51:55 -04:00
Ian Jackson f365b41c13 Merge branch 'remove_semver' into 'main'
Remove semver.md files now that 1.1.7 is out.

See merge request tpo/core/arti!1460
2023-08-01 17:42:58 +00:00
Ian Jackson d799a7c5a7 Merge branch 'ipts2bis' into 'main'
dev notes: Draft IPT algorithm: Overhaul for latest version of torspec!154

See merge request tpo/core/arti!1444
2023-08-01 17:42:18 +00:00
gabi-250 3a64c5b79c Merge branch 'bump_version' into 'main'
Script to bump patchlevel without touching other crates

Closes #945

See merge request tpo/core/arti!1461
2023-08-01 17:35:29 +00:00
Nick Mathewson dee95436f5 Merge branch 'hss_apis' into 'main'
hsservice: Initial data structures and APIs

Closes #972, #971, and #970

See merge request tpo/core/arti!1452
2023-08-01 17:06:10 +00:00
Nick Mathewson b71b04eb84 Script to bump patchlevel without touching other crates
Closes #945.

Based on @diziet's comment in #945, with a little extra safety and
paranoia.  We use this for cases when there are trivial changes only
in one of our crates.
2023-08-01 12:57:58 -04:00
Nick Mathewson 1e96d1b95a Remove semver.md files now that 1.1.7 is out. 2023-08-01 12:55:52 -04:00
Ian Jackson bcde97624b Merge branch 'pt-not-found-err' into 'main'
Add error if [[bridges.transports]] isn't written in config file

Closes #880

See merge request tpo/core/arti!1229
2023-08-01 16:43:46 +00:00
Saksham Mittal 752f748910 Add error if [[bridges.transports]] isn't written in config file 2023-08-01 16:43:46 +00:00
Nick Mathewson 3422169ff4 Merge branch 'bump_versions_117' into 'main'
Vesion bumps for 1.1.7.

See merge request tpo/core/arti!1458
2023-08-01 15:40:26 +00:00
Nick Mathewson 9e96079b6d Merge branch 'changelog_117_part2' into 'main'
Changelog 117 part2

See merge request tpo/core/arti!1457
2023-08-01 15:13:20 +00:00
Nick Mathewson 5cc3fe1629 Bump patchlevel versions of crates with trivial changes
These crates have had trivial changes only: typically,
changes to documentation or to clippy warnings.  There's no
good reason to update which version of them other crates depend on,
so we only bump _their_ patchlevels.

```
tor-async-utils
caret
safelog
tor-events
tor-units
tor-rtcompat
tor-rpcbase
tor-llcrypto
tor-protover
tor-bytes
tor-hscrypto
tor-socksproto
tor-cert
tor-cell
tor-consdiff
tor-congestion
arti-rpcserver
arti-testing
arti-bench
arti-config
arti-hyper
```
2023-08-01 11:03:56 -04:00
Nick Mathewson 5970c90fcd Merge branch 'fixup-features' into 'main'
Run "fixup features" in preparation for a release.

See merge request tpo/core/arti!1456
2023-08-01 15:01:53 +00:00
Nick Mathewson 3acdf102c7 Increment patchlevel versions of crates with minor changes
These crates are at version 0.x.y, so we don't need to distinguish
new-feature changes from other changes:

```
tor-basic-utils
fs-mistrust
tor-error
tor-geoip
tor-checkable
tor-linkspec
tor-netdoc
tor-netdir
tor-persist
tor-ptmgr
tor-hsservice
```

This crate has a breaking change, but only when the semver-breaking
feature `experimental-api` is enabled:

```
tor-config
```

This crate is at version 1.x.y, but has no new public APIs, and
therefore does not need a minor version bump:

```
arti
```
2023-08-01 10:57:55 -04:00
Nick Mathewson 6f2ae59603 Update minor versions on crates that have had breaking changes
These crates had first-order breaking changes:

```
retry-error
tor-keymgr
tor-proto
tor-hsclient
tor-rtmock
```

Additionally, these broke because they re-exposed RetryError:

```
tor-circmgr
```

Additionally, these broke because they may re-expose something from
tor-proto:

```
    arti-client
    tor-chanmgr
    tor-dirclient
    tor-dirmgr
    tor-guardmgr
```

Additionally, these broke for other fiddly reasons:

`tor-ptmgr` implements traits from tor-chanmgr, which has a breaking
change above.

`arti-hyper` exposes types from arti-client in its API.
2023-08-01 10:51:25 -04:00
Nick Mathewson 03eabedef4 changelog 1.1.7: Acknowledgments and links. 2023-08-01 10:28:08 -04:00
Nick Mathewson 140564aab8 changelog: spelling fixes. 2023-08-01 10:18:03 -04:00
Nick Mathewson 848d329c09 Merge branch 'changelog_117' into 'main'
First draft of a changelog for 1.1.7

See merge request tpo/core/arti!1454
2023-08-01 14:16:02 +00:00
gabi-250 5d1a3575ae Merge branch 'update_20230801' into 'main'
Run cargo update in preparation for a release.

See merge request tpo/core/arti!1455
2023-08-01 13:19:58 +00:00
gabi-250 55a12bee85 Apply 1 suggestion(s) to 1 file(s) 2023-08-01 13:11:23 +00:00
Nick Mathewson 9ce6f0a0eb Run "fixup features" in preparation for a release. 2023-08-01 08:32:20 -04:00
Nick Mathewson f37915587e Run cargo update in preparation for a release. 2023-08-01 08:10:44 -04:00
Nick Mathewson 2085e43cfc Changelog: add breaking changes from semver.md 2023-08-01 08:02:34 -04:00
Nick Mathewson 17f6074850 Begin work on a changelog for 1.1.7. 2023-08-01 07:57:49 -04:00
Nick Mathewson 7dc24f38e0 hsservice: Add a sketched API for HsDir publishers.
As with the other APIs here, I'd expect that the implementors will
need to refactor this a lot.

Closes #972.
2023-07-31 13:47:44 -04:00
Nick Mathewson 16fef0057b A couple of notes on intropoint establisher API. 2023-07-31 13:47:44 -04:00
Nick Mathewson 982bfcba06 hsservice: Add a draft API for intropoint establisher.
Taken from @diziet's !1439 and lightly cleaned up so that it
compiles.

Closes #971.
2023-07-31 13:47:44 -04:00
Nick Mathewson 20afc76c0a hsservice: Adapt API sketches from onion-service-notes.md 2023-07-31 13:47:44 -04:00
Nick Mathewson 20b3679dbb hsservice: Adapt data structures from onion-service-notes.md
Also, removed some older structures that don't make sense in the
current design.

Closes #970
2023-07-31 13:47:44 -04:00
Ian Jackson 0c9b2eb4af key-management.md: Use scenarios 2023-07-28 18:05:11 +01:00
Ian Jackson 0aa5810246 key-management.md: Fix pandoc formatting
Add a missing blank line.
2023-07-28 18:04:50 +01:00
Ian Jackson e798f8e322 dev notes: Draft IPT algorithm: Make IPT persistence optional
As per current version of torpsec!154
2023-07-28 15:22:08 +01:00
Ian Jackson ec63468606 dev notes: Draft IPT algorithm: Reuse relays when cycling IPT 2023-07-28 15:13:08 +01:00
Ian Jackson 476846d73c dev notes: Draft IPT algorithm: Maintain k*N, not 2N
Make this a separate parameter.
2023-07-28 15:08:24 +01:00
Nick Mathewson 5906c2c92e Merge branch 'ticket889_prototype' into 'main'
Rust implementation of onion service client puzzles (Proposal 327)

See merge request tpo/core/arti!1368
2023-07-28 12:33:22 +00:00
Micah Elizabeth Scott 61bf60d177 check_licenses: Whitelist for crates that may use LGPL-3.0-only
Narrows the previous check, allowing this particular LGPL
only for the hashx and equix crates.

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-07-27 13:23:26 -07:00
Micah Elizabeth Scott 9257949b80 equix, hashx: Additional comment tweaks
More review feedback. Thanks nickm!

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-07-27 13:17:23 -07:00
Micah Elizabeth Scott fdba82100f equix, hashx: Prepare for an initial LGPL release
This replaces the 'TODO' marker from earlier commits, using tevador's
copyright and license (LGPL 3.0 only) for the hashx and equix crates.

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-07-27 07:20:14 -07:00
Micah Elizabeth Scott 4affddaa08 tor-hspow, equix, hashx: Comment tweaks
Making a few comment tweaks suggested in review feedback.

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-07-27 07:20:14 -07:00
Micah Elizabeth Scott bd48c23a40 tor-hspow: Simplify and optimize Challenge::new
Challenges are now built using try_extend_from_slice instead of
iterators. There's no CPU benchmark in this crate yet, but I can confirm
that the resulting code is shorter. With this patch, the entirety of
Challenge:new() is automatically inlined at call sites.

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-07-27 07:20:14 -07:00
Micah Elizabeth Scott 7579febb46 hashx: Simplify RegisterWriterMap
I originally wrote this in an overcomplicated way, to avoid
frequent initialization of a RegisterWriter array. It turns out
that RegisterWriter can be fairly compact, so this extra level of
indirection isn't necessary or measurably helpful.

This still manages to avoid declaring RegisterWriter as Copy, by
using Default to initialize the array instead of an array constructor.

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-07-27 07:20:14 -07:00
Micah Elizabeth Scott f4939a5fd8 tor-hspow, equix, hashx: Make all error types Clone
This uses an Arc to hold std::io::Error for low-level HashX runtime
errors.

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-07-27 07:20:14 -07:00
Micah Elizabeth Scott 10b7352c98 hashx: Simplify hash_to_bytes, only support fixed output width
In response to review feedback. The byte output is only needed
for unit tests right now, since Equi-X uses u64 output exclusively.

The optimization for shorter output widths can shave tiny amounts of
time off hash benchmarks, but in this case it's more helpful to avoid
introducing APIs that offer parameters with incomplete compile-time
range checking.

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-07-27 07:20:14 -07:00
Micah Elizabeth Scott d17c12b152 hashx: use RngCore for HashX's internal PRNG
This refactors the random number generator used within HashX's program
generator so that it uses the rand::RngCore trait. The basic SipHash
powered u64 generator now implements RngCore, while a buffer layer
wraps this and provides u8 and u32 values as needed by the generator.

Some of this new RngCore layer is now exposed to the hashx crate's
public API. The intent is to allow external code to test, benchmark, or
fuzz the program generator by supplying its own random number stream.

Benchmarks show a small but confusing performance improvement
associated with this patch. About a 2% improvement in generation.
This could be due to the Rng changes. No change in compiled hash
execution performance. Even though this patch only touches program
generation, benchmarks show a 4% speedup in interpreted execution.
This seems most likely explained by instruction cache effects,
but I'm not sure.

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-07-27 07:20:14 -07:00
Micah Elizabeth Scott 2c20b46921 hashx: Implement Default for RuntimeOption 2023-07-27 07:20:14 -07:00
Micah Elizabeth Scott c5976c6675 equix: Refactoring for bucket_array
This splits up bucket_array into two smaller modules, one for the hash
table behavior and one for the MaybeUninit memory management.

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-07-27 07:20:14 -07:00