Module kitsune_p2p_dht::region

source ·
Expand description

A Region is a bounded section of spacetime containing zero or more Ops.

It consists of a RegionCoords object which defines the space and time boundaries of the region, and some RegionData which contains a summary of what is inside that region, including:

  • the number of ops
  • the total size of op data
  • the XOR of all OpHashes within this region.

The actual Region struct is generic over the data type, but in all cases, we simply use RegionData, the default. (The type is generic for the possibility of simpler testing in the future.)

RegionData is composable: The sum of the RegionData of two disjoint (nonoverlapping) Regions represents the union of those two Regions. The sum of hashes is defined as the XOR of hashes, which allows this compatibility.

Structs§

  • The coordinates defining the Region, along with the calculated RegionData
  • A region specified in absolute coords, rather than quantum coords. This type should only be used in the host, which deals in absolute coords. Kitsune itself should only use RegionCoords to ensure proper quantum alignment.
  • The cross product of a space segment and at time segment forms a Region. Hence, these two segments are the coordinates which define a Region of spacetime.
  • The pertinent data that we care about for each Region. This is what gets sent over gossip so that nodes can discover which Regions are different between them.
  • Tuple-based representation of RegionData, used for sending more compact wire messages

Constants§

  • The constant size in bytes of a region, used for calculating bandwidth usage during gossip. All regions require the same number of bytes.

Traits§

Functions§

  • Take bitwise XOR of each element of both arrays
  • Take bitwise XOR of each element of both slices