update comments

This commit is contained in:
Kriptikz
2024-07-24 22:38:29 -05:00
parent 49d5e95dbb
commit 97a7d0cb28
2 changed files with 12 additions and 10 deletions

View File

@@ -38,6 +38,7 @@ use crate::{find_and_parse_declared_proof, utils::AccountDeserialize};
/// - Can only succeed if mining is not paused.
/// - Can only succeed if the last reset was less than 60 seconds ago.
/// - Can only succeed if the provided hash satisfies the minimum difficulty requirement.
/// - Can only succeed if the miners proof pubkey matches the declared proof pubkey.
/// - The provided proof account must be associated with the signer.
/// - The provided bus, config, noise, stake, and slot hash sysvar must be valid.
pub fn process_mine<'a, 'info>(
@@ -61,14 +62,6 @@ pub fn process_mine<'a, 'info>(
load_sysvar(instructions_sysvar, sysvar::instructions::id())?;
load_sysvar(slot_hashes_sysvar, sysvar::slot_hashes::id())?;
/// Require that only the declared proof can be processed in this transaction.
///
/// The intent here is to disincentivize sybil. As long as a user can fit multiple hashes in a single
/// transaction, there is a financial incentive to sybil multiple keypairs and pack as many hashes
/// as possible into each transaction to minimize fee / hash.
///
/// If each transaction is limited to one hash only, then a user will minimize their fee / hash
/// by allocating all their hashpower to finding the single most difficult hash they can.
if let Ok(pubkey) = find_and_parse_declared_proof(&instructions_sysvar.data.borrow()) {
if !pubkey.eq(proof_info.key) {
return Err(OreError::DeclaredProofMissmatch.into());