Struct tendermint::block::Id [−][src]
pub struct Id { pub hash: Hash, pub part_set_header: PartSetHeader, }
Expand description
Block identifiers which contain two distinct Merkle roots of the block, as well as the number of parts in the block.
Default implementation is an empty Id as defined by the Go implementation in https://github.com/tendermint/tendermint/blob/1635d1339c73ae6a82e062cd2dc7191b029efa14/types/block.go#L1204.
If the Hash is empty in BlockId, the BlockId should be empty (encoded to None). This is implemented outside of this struct. Use the Default trait to check for an empty BlockId. See: https://github.com/informalsystems/tendermint-rs/issues/663
Fields
hash: Hash
The block’s main hash is the Merkle root of all the fields in the block header.
part_set_header: PartSetHeader
Parts header (if available) is used for secure gossipping of the block during consensus. It is the Merkle root of the complete serialized block cut into parts.
PartSet is used to split a byteslice of data into parts (pieces) for transmission. By splitting data into smaller parts and computing a Merkle root hash on the list, you can verify that a part is legitimately part of the complete data, and the part can be forwarded to other peers before all the parts are known. In short, it’s a fast way to propagate a large file over a gossip network.
https://github.com/tendermint/tendermint/wiki/Block-Structure#partset
PartSetHeader in protobuf is defined as never nil using the gogoproto annotations. This does not translate to Rust, but we can indicate this in the domain type.
Implementations
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Encode into a buffer in Protobuf format. Read more
Encode with a length-delimiter to a buffer in Protobuf format. Read more
Constructor that attempts to decode an instance from a buffer. Read more
Constructor that attempts to decode a length-delimited instance from the buffer. Read more
Returns the encoded length of the message without a length delimiter. Read more
Encodes into a Protobuf-encoded Vec<u8>
.
Constructor that attempts to decode a Protobuf-encoded instance from a
Vec<u8>
(or equivalent). Read more
Encode with a length-delimiter to a Vec<u8>
Protobuf-encoded message.
Auto Trait Implementations
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self
pub fn vzip(self) -> V