Modules

Functions for checking gaps in coverage for tests.

Structs

This represents the range of values covered by an arc

Represents how much of a dht arc is held center_loc is where the hash is. The center_loc is the center of the arc The half length is the length of items held from the center in both directions half_length 0 means nothing is held half_length 1 means just the center_loc is held half_length n where n > 1 will hold those positions out half_length u32::MAX / 2 + 1 covers all positions on either side of center_loc. Imagine an bidirectional array:

When sampling a section of the arc we can collect all the other peer DhtArcs into a DhtBucket. All the peer arcs arc contained within the buckets filter arc. The filter is this peer’s “view” into their section of the dht arc. This type is mainly used for Display purposes.

Type for representing a location that can wrap around a u32 dht arc

The default, and only, strategy for generating a PeerView

The default, and only, strategy for generating a PeerView

The default, and only, PeerView.

An alternative PeerView.

Enums

An alternate implementation of ArcRange

A Strategy for generating PeerViews. The enum allows us to add new strategies over time.

A “view” of the peers in a neighborhood. The view consists of a few observations about the distribution of peers within a particular arc, used to make inferences about the rest of the (out-of-view) DHT, ultimately enabling the calculation of the target arc size for the agent who has this View.

Constants

The minimum number of peers before sharding can begin. This factors in the expected uptime to reach the redundancy target.

The minimum number of peers we can consider acceptable to see in our arc during testing.

The maximum you can hold either side of the hash location is half the circle. This is half of the furthest index you can hold 1 is added for rounding 1 more is added to represent the middle point of an odd length array

Functions

Check a set of peers the actual redundancy across all peers. This can tell if there is bad distribution. Note this function is only used for verification in tests at this time.