Struct grin_core::core::compact_block::CompactBlock
source · pub struct CompactBlock {
pub header: BlockHeader,
pub nonce: u64,
/* private fields */
}
Expand description
Compact representation of a full block. Each input/output/kernel is represented as a short_id. A node is reasonably likely to have already seen all tx data (tx broadcast before block) and can go request missing tx data from peers if necessary to hydrate a compact block into a full block.
Fields§
§header: BlockHeader
The header with metadata and commitments to the rest of the data
nonce: u64
Nonce for connection specific short_ids
Implementations§
Trait Implementations§
source§impl Clone for CompactBlock
impl Clone for CompactBlock
source§fn clone(&self) -> CompactBlock
fn clone(&self) -> CompactBlock
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for CompactBlock
impl Debug for CompactBlock
source§impl From<Block> for CompactBlock
impl From<Block> for CompactBlock
source§impl From<UntrustedCompactBlock> for CompactBlock
impl From<UntrustedCompactBlock> for CompactBlock
source§fn from(ucb: UntrustedCompactBlock) -> Self
fn from(ucb: UntrustedCompactBlock) -> Self
source§impl Into<CompactBlockBody> for CompactBlock
impl Into<CompactBlockBody> for CompactBlock
source§fn into(self) -> CompactBlockBody
fn into(self) -> CompactBlockBody
source§impl Readable for CompactBlock
impl Readable for CompactBlock
Implementation of Readable for a compact block, defines how to read a compact block from a binary stream.
source§impl Writeable for CompactBlock
impl Writeable for CompactBlock
Implementation of Writeable for a compact block, defines how to write the block to a binary writer. Differentiates between writing the block for the purpose of full serialization and the one of just extracting a hash.
impl DefaultHashable for CompactBlock
Auto Trait Implementations§
impl Freeze for CompactBlock
impl RefUnwindSafe for CompactBlock
impl Send for CompactBlock
impl Sync for CompactBlock
impl Unpin for CompactBlock
impl UnwindSafe for CompactBlock
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<D> Hashed for Dwhere
D: DefaultHashable,
impl<D> Hashed for Dwhere
D: DefaultHashable,
source§impl<T> PMMRIndexHashable for Twhere
T: DefaultHashable,
impl<T> PMMRIndexHashable for Twhere
T: DefaultHashable,
source§fn hash_with_index(&self, index: u64) -> Hash
fn hash_with_index(&self, index: u64) -> Hash
source§impl<H> ShortIdentifiable for Hwhere
H: Hashed,
impl<H> ShortIdentifiable for Hwhere
H: Hashed,
source§fn short_id(&self, hash: &Hash, nonce: u64) -> ShortId
fn short_id(&self, hash: &Hash, nonce: u64) -> ShortId
Generate a short_id via the following -
- extract k0/k1 from block_hash hashed with the nonce (first two u64
values) * initialize a siphasher24 with k0/k1
- self.hash() passing in the siphasher24 instance
- drop the 2 most significant bytes (to return a 6 byte short_id)