latest.ipv8.attestation.wallet.caches

Attributes

logger

Classes

HashCache

Cache tied to a hash.

PeerCache

Cache tied to a peer (mid).

ReceiveAttestationVerifyCache

Pending attestation transfer, after request for attestation verification.

ReceiveAttestationRequestCache

Pending attestation transfer, after request for a new attestation.

ProvingAttestationCache

Pending attestation verification, stores expected relmap, hashed challenges and completion callback.

PendingChallengeCache

Single pending challenge for a ProvingAttestationCache.

Module Contents

latest.ipv8.attestation.wallet.caches.logger
class latest.ipv8.attestation.wallet.caches.HashCache(request_cache: latest.ipv8.requestcache.RequestCache, prefix: str, cache_hash: bytes, id_format: str)

Bases: latest.ipv8.requestcache.NumberCache

Cache tied to a hash.

id_format
classmethod id_from_hash(prefix: str, cache_hash: bytes) tuple[str, int]

Get a cache prefix and identifier from a hash.

class latest.ipv8.attestation.wallet.caches.PeerCache(request_cache: latest.ipv8.requestcache.RequestCache, prefix: str, mid: bytes, id_format: str)

Bases: latest.ipv8.requestcache.NumberCache

Cache tied to a peer (mid).

id_format
classmethod id_from_address(prefix: str, mid: bytes) tuple[str, int]

Get a cache prefix and identifier from an mid.

property timeout_delay: float

The default timeout is two minutes.

class latest.ipv8.attestation.wallet.caches.ReceiveAttestationVerifyCache(community: latest.ipv8.attestation.wallet.community.AttestationCommunity, cache_hash: bytes, id_format: str)

Bases: HashCache

Pending attestation transfer, after request for attestation verification.

attestation_map: set[tuple[int, bytes]]
on_timeout() None

Too bad, nothing gained and nothing lost: log and drop the cache.

property timeout_delay: float

The default timeout is two minutes.

class latest.ipv8.attestation.wallet.caches.ReceiveAttestationRequestCache(community: latest.ipv8.attestation.wallet.community.AttestationCommunity, mid: bytes, key: Any, name: str, id_format: str)

Bases: PeerCache

Pending attestation transfer, after request for a new attestation. Stores one-time key for this attribute attestation.

attestation_map: set[tuple[int, bytes]]
key
name
on_timeout() None

Too bad, nothing gained and nothing lost: log and drop the cache.

class latest.ipv8.attestation.wallet.caches.ProvingAttestationCache(community: latest.ipv8.attestation.wallet.community.AttestationCommunity, cache_hash: bytes, id_format: str, public_key: Any | None = None, on_complete: collections.abc.Callable[[bytes, dict], None] = lambda x, y: ...)

Bases: HashCache

Pending attestation verification, stores expected relmap, hashed challenges and completion callback.

hash
public_key = None
relativity_map: dict[int, int]
hashed_challenges: list[bytes] = []
challenges: list[bytes] = []
attestation_callbacks
on_timeout() None

Too bad, nothing gained and nothing lost: log and drop the cache.

property timeout_delay: float

The default timeout is two minutes.

class latest.ipv8.attestation.wallet.caches.PendingChallengeCache(community: latest.ipv8.attestation.wallet.community.AttestationCommunity, cache_hash: bytes, proving_cache: ProvingAttestationCache, id_format: str, honesty_check: int = -1)

Bases: HashCache

Single pending challenge for a ProvingAttestationCache.

proving_cache
honesty_check = -1
on_timeout() None

Too bad, nothing gained and nothing lost: log and drop the cache.