diff options
author | Micah Elizabeth Scott <beth@torproject.org> | 2023-03-21 12:28:23 -0700 |
---|---|---|
committer | Micah Elizabeth Scott <beth@torproject.org> | 2023-05-10 07:38:29 -0700 |
commit | 6a0809c4e301f302367c751c5c11ff470bcf7388 (patch) | |
tree | 99be9e484ef2501e2595fbc511591ba8650047c2 /src/feature/hs/hs_circuit.c | |
parent | d15bbf32dafc3ce1ae2265668e476e7f5dbf5b08 (diff) | |
download | tor-6a0809c4e301f302367c751c5c11ff470bcf7388.tar.gz tor-6a0809c4e301f302367c751c5c11ff470bcf7388.zip |
hs_pow: stop having a "minimum effort", and let PoW effort start low
I don't think the concept of "minimum effort" is really useful to us,
so this patch removes it entirely and consequentially changes the way
that "total" effort is calculated so that we don't rely on any minimum
and we instead ramp up effort no faster than necessary.
If at least some portion of the attack is conducted by clients that
avoid PoW or provide incorrect solutions, those (potentially very
cheap) attacks will end up keeping the pqueue full. Prior to this patch,
that would cause suggested efforts to be unnecessarily high, because
rounding these very cheap requests up to even a minimum of 1 will
overestimate how much actual attack effort is being spent.
The result is that this patch is a simplification and it also allows a
slower start, where PoW effort jumps up either by a single unit or by an
amount calculated from actual effort in the queue.
Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
Diffstat (limited to 'src/feature/hs/hs_circuit.c')
-rw-r--r-- | src/feature/hs/hs_circuit.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/feature/hs/hs_circuit.c b/src/feature/hs/hs_circuit.c index f7ab6442b9..82c77fcfcb 100644 --- a/src/feature/hs/hs_circuit.c +++ b/src/feature/hs/hs_circuit.c @@ -1377,10 +1377,8 @@ hs_circ_handle_introduce2(const hs_service_t *service, goto done; } - /* Increase the total effort in valid requests received this period, - * but count 0-effort as min-effort, for estimation purposes. */ - service->state.pow_state->total_effort += MAX(data.rdv_data.pow_effort, - service->state.pow_state->min_effort); + /* Track the total effort in valid requests received this period */ + service->state.pow_state->total_effort += data.rdv_data.pow_effort; /* Successfully added rend circuit to priority queue. */ ret = 0; |