Opened 9 months ago

Closed 8 months ago

Last modified 5 months ago

#28633 closed defect (fixed)

Pad on specific circuit purposes + ltups

Reported by: asn Owned by:
Priority: Medium Milestone: Tor: 0.4.0.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: wtf-pad, tor-relay, tor-cell, padding
Cc: nickm Actual Points: 10
Parent ID: #28632 Points: 10
Reviewer: asn Sponsor: Sponsor2

Description

We want to add another criterion to the circuit padding machines so that they don't just pad blindly any circuit, and instead they only pad circuits with specific purposes and ltups (?).

Child Tickets

Change History (7)

comment:1 Changed 9 months ago by mikeperry

This functionality is provided already by the circpad_machine_conditions_t. We can use those conditions to say that machines don't activate unless there are a minimum hops built, vanguards is enabled, certain usage state conditions, and purpose flags.

See circpad_machine_conditions_met(), circpad_shutdown_old_machines(), circpad_add_matching_machines(), and callers.

If you think that is sufficient, please close. Otherwise we should figure out what else we need soon.

comment:2 Changed 9 months ago by mikeperry

Reviewer: asn
Status: newneeds_review

comment:3 Changed 9 months ago by asn

Status: needs_reviewneeds_revision

Code LGTM but the bitmask logic is non-trivial. Let's close this ticket after we get some unittests as well.

I'm also wondering if we should test that CIRCUIT_PURPOSE_MAX_ is less than 32 (which is the max state we can encode in the 32-bit bitfield).

comment:4 in reply to:  3 Changed 9 months ago by nickm

Replying to asn:

Code LGTM but the bitmask logic is non-trivial. Let's close this ticket after we get some unittests as well.

I'm also wondering if we should test that CIRCUIT_PURPOSE_MAX_ is less than 32 (which is the max state we can encode in the 32-bit bitfield).

FWIW, we now have a "CTASSERT" macro for compile-time assertions.

comment:5 Changed 8 months ago by asn

Resolution: fixed
Status: needs_revisionclosed

Tests from #28142 LGTM! Closing thiss as it will be resolved along with #28142.

comment:6 Changed 8 months ago by gaba

Actual Points: 10
Points: 10

comment:7 Changed 5 months ago by teor

Sponsor: Sponsor2

Move all WTF-PAD tickets that do not have a sponsor into sponsor2.

Note: See TracTickets for help on using tickets.