Settings
Help

Module v1

Module v1 

Source
Expand description

Code implementing version 1 proof-of-work for onion service hosts.

Spec links:

StructsΒ§

PowManagerGeneric πŸ”’
This is responsible for rotating Proof-of-Work seeds and doing verification of PoW solves.
PowManagerStateRecord πŸ”’
On-disk record of PowManagerGeneric state.
RendRequestOrdByEffort πŸ”’
Wrapper around RendRequest that implements std::cmp::Ord to sort by [Effort] and time.
RendRequestReceiver πŸ”’
Implements Stream for incoming RendRequests, using a priority queue system to dequeue high-[Effort] requests first.
RendRequestReceiverInner πŸ”’
Inner implementation for RendRequestReceiver.
SeedsForTimePeriod πŸ”’
Information about the current and previous [Seed] for a given TimePeriod.
State πŸ”’
Internal state for PowManagerGeneric.

EnumsΒ§

PowError
Error within the PoW subsystem.
PowSolveError πŸ”’
A PoW solve was invalid.

ConstantsΒ§

EXPIRATION_TIME_MINS_MAX πŸ”’
Maximum seed expiration time in minutes. See: https://spec.torproject.org/hspow-spec/v1-equix.html#parameter-descriptor
EXPIRATION_TIME_MINS_MIN πŸ”’
Minimum seed expiration time in minutes. See: https://spec.torproject.org/hspow-spec/v1-equix.html#parameter-descriptor
HS_UPDATE_PERIOD πŸ”’
How frequently the suggested effort should be recalculated.
PUBLISHER_UPDATE_QUEUE_DEPTH πŸ”’
Depth of the queue used to signal the publisher that it needs to update a given time period.
SEED_EARLY_ROTATION_TIME πŸ”’
How soon before a seed’s expiration time we should rotate it and publish a new seed.
SUGGESTED_EFFORT_DEADZONE πŸ”’
When the suggested effort has changed by less than this much, we don’t republish it.

TraitsΒ§

MockablePowManager πŸ”’
Trait to allow mocking PowManagerGeneric in tests.
MockableRendRequest πŸ”’
Trait to allow mocking RendRequest in tests.

Type AliasesΒ§

PowManager πŸ”’
Proof-of-Work manager type alias for production, using concrete RendRequest.