mirror of
https://github.com/hinto-janai/cuprate.git
synced 2025-01-24 19:35:57 +00:00
PoW
-> proof-of-work
This commit is contained in:
parent
c079f9e7c0
commit
f0f15d921c
3 changed files with 5 additions and 5 deletions
|
@ -153,7 +153,7 @@ impl PreparedBlock {
|
||||||
|
|
||||||
/// Creates a new [`PreparedBlock`] from a [`PreparedBlockExPow`].
|
/// Creates a new [`PreparedBlock`] from a [`PreparedBlockExPow`].
|
||||||
///
|
///
|
||||||
/// This function will give an invalid `PoW` hash if `randomx_vm` is not initialised
|
/// This function will give an invalid proof-of-work hash if `randomx_vm` is not initialised
|
||||||
/// with the correct seed.
|
/// with the correct seed.
|
||||||
///
|
///
|
||||||
/// # Panics
|
/// # Panics
|
||||||
|
|
|
@ -36,7 +36,7 @@ use crate::{
|
||||||
///
|
///
|
||||||
/// Returns [`AltBlockInformation`], which contains the cumulative difficulty of the alt chain.
|
/// Returns [`AltBlockInformation`], which contains the cumulative difficulty of the alt chain.
|
||||||
///
|
///
|
||||||
/// This function only checks the block's `PoW` and its weight.
|
/// This function only checks the block's proof-of-work and its weight.
|
||||||
pub(crate) async fn sanity_check_alt_block<C>(
|
pub(crate) async fn sanity_check_alt_block<C>(
|
||||||
block: Block,
|
block: Block,
|
||||||
txs: HashMap<[u8; 32], TransactionVerificationData>,
|
txs: HashMap<[u8; 32], TransactionVerificationData>,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
//! `RandomX` VM Cache
|
//! `RandomX` VM Cache
|
||||||
//!
|
//!
|
||||||
//! This module keeps track of the `RandomX` VM to calculate the next blocks `PoW`, if the block needs a randomX VM and potentially
|
//! This module keeps track of the `RandomX` VM to calculate the next blocks proof-of-work, if the block needs a randomX VM and potentially
|
||||||
//! more VMs around this height.
|
//! more VMs around this height.
|
||||||
//!
|
//!
|
||||||
use std::{
|
use std::{
|
||||||
|
@ -69,7 +69,7 @@ impl RandomX for RandomXVm {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The randomX VMs cache, keeps the VM needed to calculate the current block's `PoW` hash (if a VM is needed) and a
|
/// The randomX VMs cache, keeps the VM needed to calculate the current block's proof-of-work hash (if a VM is needed) and a
|
||||||
/// couple more around this VM.
|
/// couple more around this VM.
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub(crate) struct RandomXVmCache {
|
pub(crate) struct RandomXVmCache {
|
||||||
|
@ -221,7 +221,7 @@ impl RandomXVmCache {
|
||||||
|
|
||||||
/// Add a new block to the VM cache.
|
/// Add a new block to the VM cache.
|
||||||
///
|
///
|
||||||
/// hash is the block hash not the blocks `PoW` hash.
|
/// hash is the block hash not the blocks proof-of-work hash.
|
||||||
pub(crate) fn new_block(&mut self, height: usize, hash: &[u8; 32]) {
|
pub(crate) fn new_block(&mut self, height: usize, hash: &[u8; 32]) {
|
||||||
if is_randomx_seed_height(height) {
|
if is_randomx_seed_height(height) {
|
||||||
tracing::debug!("Block {height} is a randomX seed height, adding it to the cache.",);
|
tracing::debug!("Block {height} is a randomX seed height, adding it to the cache.",);
|
||||||
|
|
Loading…
Reference in a new issue