pub enum ShardKind {
BeaconChain,
IntermediateShard,
LeafShard,
Phantom,
Invalid,
}
Expand description
A kind of shard.
Schematically, the hierarchy of shards is as follows:
Beacon chain
/ \
Intermediate shard 1 Intermediate shard 2
/ \ / \
Leaf shard 11 Leaf shard 12 Leaf shard 22 Leaf shard 22
Beacon chain has index 0, intermediate shards indices 1..=1023. Leaf shards share the same least significant 10 bits as their respective intermediate shards, so leaf shards of intermediate shard 1 have indices like 1025,2049,3097,etc.
If represented as least significant bits first (as it will be in the formatted address):
Intermediate shard bits
\ /
1000_0000_0001_0000_0000
/ \
Leaf shard bits
Note that shards that have 10 least significant bits set to 0 (corresponds to the beacon chain) are not leaf shards, in fact, they are not even physical shards that have nodes in general. The meaning of these shards is TBD, currently they are called “phantom” shards and may end up containing some system contracts with special meaning, but no blocks will ever exist for such shards.
Variants§
BeaconChain
Beacon chain shard
IntermediateShard
Intermediate shard directly below the beacon chain that has child shards
LeafShard
Leaf shard, doesn’t have child shards
Phantom
TODO
Invalid
Invalid shard kind (if decoded from invalid bit pattern)
Trait Implementations§
impl Copy for ShardKind
impl Eq for ShardKind
impl StructuralPartialEq for ShardKind
Auto Trait Implementations§
impl Freeze for ShardKind
impl RefUnwindSafe for ShardKind
impl Send for ShardKind
impl Sync for ShardKind
impl Unpin for ShardKind
impl UnwindSafe for ShardKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more