diff options
author | Micah Elizabeth Scott <beth@torproject.org> | 2023-03-31 13:36:58 -0700 |
---|---|---|
committer | Micah Elizabeth Scott <beth@torproject.org> | 2023-05-10 07:40:46 -0700 |
commit | 903c6cf1ab5ba115bbfd33385e0acd5f88ad2ba3 (patch) | |
tree | cfdc82f2f312dcf7c6567c67958ee2249b2a76d7 /src/feature/hs/hs_client.h | |
parent | ac466a22195f8d550a8612bb89583c5e58eadb1a (diff) | |
download | tor-903c6cf1ab5ba115bbfd33385e0acd5f88ad2ba3.tar.gz tor-903c6cf1ab5ba115bbfd33385e0acd5f88ad2ba3.zip |
hs_pow: client side effort adjustment
The goal of this patch is to add an additional mechanism for adjusting
PoW effort upwards, where clients rather than services can choose to
solve their puzzles at a higher effort than what was suggested in the
descriptor.
I wanted to use hs_cache's existing unreachability stats to drive this
effort bump, but this revealed some cases where a circuit (intro or
rend) closed early on can end up in hs_cache with an all zero intro
point key, where nobody will find it. This moves intro_auth_pk
initialization earlier in a couple places and adds nonfatal asserts to
catch the problem if it shows up elsewhere.
The actual effort adjustment method I chose is to multiply the suggested
effort by (1 + unresponsive_count), then ensure the result is at least
1. If a service has suggested effort of 0 but we fail to connect,
retries will all use an effort of 1. If the suggestion was 50, we'll try
50, 100, 150, 200, etc. This is bounded both by our client effort limit
and by the limit on unresponsive_count (currently 5).
Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
Diffstat (limited to 'src/feature/hs/hs_client.h')
-rw-r--r-- | src/feature/hs/hs_client.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/feature/hs/hs_client.h b/src/feature/hs/hs_client.h index e87cc00b75..234306a3c3 100644 --- a/src/feature/hs/hs_client.h +++ b/src/feature/hs/hs_client.h @@ -119,6 +119,8 @@ int hs_client_any_intro_points_usable(const ed25519_public_key_t *service_pk, int hs_client_refetch_hsdesc(const ed25519_public_key_t *identity_pk); void hs_client_dir_info_changed(void); +int hs_client_setup_intro_circ_auth_key(origin_circuit_t *circ); + int hs_client_send_introduce1(origin_circuit_t *intro_circ, origin_circuit_t *rend_circ); |