Poh subsystem cleanup, genesis plumbing, enable real PoH on edge testnet (#4292)
* Remove unused PohServiceConfig::Step * Clarify variable name * Poh::hash() now takes an iteration counter * man -> max * Inline functions with single call site * Move PohServiceConfig into GenesisBlock * Add plumbing to enable real PoH on testnets * Batch hashes to improve PoH hash rate * Ensure a constant hashes_per_tick * Remove PohEntry mixin field * Poh/PohEntry no longer maintains tick_height * Ensure a constant hashes_per_tick * ci/localnet-sanity.sh: Use real PoH * Rework Poh/PohService to keep PohRecorder unlocked as much as possible while hashing
This commit is contained in:
@@ -171,16 +171,12 @@ fn next_hash(start_hash: &Hash, num_hashes: u64, transactions: &[Transaction]) -
|
||||
return *start_hash;
|
||||
}
|
||||
|
||||
let mut poh = Poh::new(*start_hash, 0);
|
||||
|
||||
for _ in 1..num_hashes {
|
||||
poh.hash();
|
||||
}
|
||||
|
||||
let mut poh = Poh::new(*start_hash, None);
|
||||
poh.hash(num_hashes.saturating_sub(1));
|
||||
if transactions.is_empty() {
|
||||
poh.tick().hash
|
||||
poh.tick().unwrap().hash
|
||||
} else {
|
||||
poh.record(hash_transactions(transactions)).hash
|
||||
poh.record(hash_transactions(transactions)).unwrap().hash
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user