Skip to content

Commit

Permalink
add log to debug submit solution
Browse files Browse the repository at this point in the history
  • Loading branch information
miralandlabs committed Aug 10, 2024
1 parent 22ce552 commit d4948c9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/miner/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ use ore_api::{
use rand::Rng;
use serde_wasm_bindgen::to_value;
use solana_client_wasm::solana_sdk::{
compute_budget::ComputeBudgetInstruction, pubkey::Pubkey, signature::Signature, signer::Signer,
keccak::Hash as KeccakHash, compute_budget::ComputeBudgetInstruction, pubkey::Pubkey,
signature::Signature, signer::Signer,
};
use solana_sdk::keccak::Hash as KeccakHash;
use web_sys::{window, Worker};
pub use web_worker::*;

Expand Down Expand Up @@ -181,6 +181,7 @@ impl Miner {

// Display error
Err(err) => {
toolbar_state.set_status(MinerStatus::Error);
toolbar_state.set_status_message(MinerStatusMessage::Error);
log::error!("Failed to submit hash: {:?}", err);
}
Expand All @@ -195,7 +196,7 @@ pub async fn submit_solution(
) -> GatewayResult<Signature> {
let signer = signer();
// let priority_fee = use_priority_fee();
let priority_fee_strategy = use_priority_fee_strategy();
// let priority_fee_strategy = use_priority_fee_strategy();

// Build ixs
let cu_limit_ix = ComputeBudgetInstruction::set_compute_unit_limit(CU_LIMIT_MINE);
Expand All @@ -205,6 +206,7 @@ pub async fn submit_solution(

// Reset if needed
// if needs_reset(gateway).await { // MI: vanilla
log::info!("checking if reset required..."); // MI
if needs_reset(gateway).await && rand::thread_rng().gen_range(0..100).eq(&0) {
ixs.push(ore_api::instruction::reset(signer.pubkey()));
}
Expand Down

0 comments on commit d4948c9

Please sign in to comment.