[−][src]Struct grin_core::core::block::BlockHeader
Block header, fairly standard compared to other blockchains.
Fields
version: u16
Version of the block
height: u64
Height of this block since the genesis block (height 0)
prev_hash: Hash
Hash of the block previous to this in the chain.
prev_root: Hash
Root hash of the header MMR at the previous header.
timestamp: DateTime<Utc>
Timestamp at which the block was built.
output_root: Hash
Merklish root of all the commitments in the TxHashSet
range_proof_root: Hash
Merklish root of all range proofs in the TxHashSet
kernel_root: Hash
Merklish root of all transaction kernels in the TxHashSet
total_kernel_offset: BlindingFactor
Total accumulated sum of kernel offsets since genesis block. We can derive the kernel offset sum for this block from the total kernel offset of the previous block header.
output_mmr_size: u64
Total size of the output MMR after applying this block
kernel_mmr_size: u64
Total size of the kernel MMR after applying this block
pow: ProofOfWork
Proof of work and related
Methods
impl BlockHeader
[src]
impl BlockHeader
pub fn write_pre_pow<W: Writer>(&self, writer: &mut W) -> Result<(), Error>
[src]
pub fn write_pre_pow<W: Writer>(&self, writer: &mut W) -> Result<(), Error>
Write the pre-hash portion of the header
pub fn pre_pow(&self) -> Vec<u8>
[src]
pub fn pre_pow(&self) -> Vec<u8>
Return the pre-pow, unhashed Let the cuck(at)oo miner/verifier handle the hashing for consistency with how this call is performed everywhere else
pub fn total_difficulty(&self) -> Difficulty
[src]
pub fn total_difficulty(&self) -> Difficulty
Total difficulty accumulated by the proof of work on this header
pub fn overage(&self) -> i64
[src]
pub fn overage(&self) -> i64
The "overage" to use when verifying the kernel sums. For a block header the overage is 0 - reward.
pub fn total_overage(&self, genesis_had_reward: bool) -> i64
[src]
pub fn total_overage(&self, genesis_had_reward: bool) -> i64
The "total overage" to use when verifying the kernel sums for a full chain state. For a full chain state this is 0 - (height * reward).
pub fn total_kernel_offset(&self) -> BlindingFactor
[src]
pub fn total_kernel_offset(&self) -> BlindingFactor
Total kernel offset for the chain state up to and including this block.
Trait Implementations
impl Writeable for BlockHeader
[src]
impl Writeable for BlockHeader
Serialization of a block header
impl Readable for BlockHeader
[src]
impl Readable for BlockHeader
Deserialization of a block header
impl PMMRable for BlockHeader
[src]
impl PMMRable for BlockHeader
type E = HeaderEntry
The type of element actually stored in the MMR data file. This allows us to store Hash elements in the header MMR for variable size BlockHeaders. Read more
fn as_elmt(&self) -> Self::E
[src]
fn as_elmt(&self) -> Self::E
impl PartialEq<BlockHeader> for BlockHeader
[src]
impl PartialEq<BlockHeader> for BlockHeader
fn eq(&self, other: &BlockHeader) -> bool
[src]
fn eq(&self, other: &BlockHeader) -> bool
fn ne(&self, other: &BlockHeader) -> bool
[src]
fn ne(&self, other: &BlockHeader) -> bool
impl Clone for BlockHeader
[src]
impl Clone for BlockHeader
fn clone(&self) -> BlockHeader
[src]
fn clone(&self) -> BlockHeader
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Default for BlockHeader
[src]
impl Default for BlockHeader
fn default() -> BlockHeader
[src]
fn default() -> BlockHeader
impl Debug for BlockHeader
[src]
impl Debug for BlockHeader
Auto Trait Implementations
impl Send for BlockHeader
impl Send for BlockHeader
impl Sync for BlockHeader
impl Sync for BlockHeader
Blanket Implementations
impl<W> Hashed for W where
W: Writeable,
[src]
impl<W> Hashed for W where
W: Writeable,
impl<H> ShortIdentifiable for H where
H: Hashed,
[src]
impl<H> ShortIdentifiable for H where
H: Hashed,
fn short_id(&Self, &Hash, u64) -> ShortId
[src]
fn short_id(&Self, &Hash, 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)
impl<T> PMMRIndexHashable for T where
T: Writeable,
[src]
impl<T> PMMRIndexHashable for T where
T: Writeable,
fn hash_with_index(&Self, u64) -> Hash
[src]
fn hash_with_index(&Self, u64) -> Hash
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
impl<T> DebugAny for T where
T: Any + Debug,
impl<T> DebugAny for T where
T: Any + Debug,
impl<T> CloneAny for T where
T: Clone + Any,
impl<T> CloneAny for T where
T: Clone + Any,
fn clone_any(&self) -> Box<dyn CloneAny + 'static>
fn clone_any(&self) -> Box<dyn CloneAny + 'static>
fn clone_any_send(&self) -> Box<dyn CloneAny + 'static + Send> where
T: Send,
fn clone_any_send(&self) -> Box<dyn CloneAny + 'static + Send> where
T: Send,
fn clone_any_sync(&self) -> Box<dyn CloneAny + 'static + Sync> where
T: Sync,
fn clone_any_sync(&self) -> Box<dyn CloneAny + 'static + Sync> where
T: Sync,
fn clone_any_send_sync(&self) -> Box<dyn CloneAny + 'static + Sync + Send> where
T: Send + Sync,
fn clone_any_send_sync(&self) -> Box<dyn CloneAny + 'static + Sync + Send> where
T: Send + Sync,
impl<T> UnsafeAny for T where
T: Any,
impl<T> UnsafeAny for T where
T: Any,
impl<T> Erased for T
impl<T> Erased for T
impl<T> Same for T
impl<T> Same for T
type Output = T
Should always be Self