From aaba4b5da0d7fc3d1b2ff0172f8031642c0b25da Mon Sep 17 00:00:00 2001 From: bruno-valante <140794260+bruno-valante@users.noreply.github.com> Date: Tue, 27 Aug 2024 17:36:55 +0800 Subject: [PATCH] Fix issue found in auditions (#170) --- node/miner/src/mine.rs | 2 +- node/miner/src/miner_id.rs | 1 + node/miner/src/pora.rs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/node/miner/src/mine.rs b/node/miner/src/mine.rs index 6fe6ace..12ffe8f 100644 --- a/node/miner/src/mine.rs +++ b/node/miner/src/mine.rs @@ -99,7 +99,7 @@ impl MineRangeConfig { } Some( self_start_position <= recall_position + SECTORS_PER_LOAD as u64 - || self_end_position > recall_position, + && self_end_position > recall_position, ) } } diff --git a/node/miner/src/miner_id.rs b/node/miner/src/miner_id.rs index 6deac4b..bdf87fc 100644 --- a/node/miner/src/miner_id.rs +++ b/node/miner/src/miner_id.rs @@ -37,6 +37,7 @@ pub(crate) async fn check_and_request_miner_id( d_id, c_id )) } else { + check_miner_id(&mine_contract, d_id).await?; Ok(d_id) } } diff --git a/node/miner/src/pora.rs b/node/miner/src/pora.rs index db7ff88..a74d2b5 100644 --- a/node/miner/src/pora.rs +++ b/node/miner/src/pora.rs @@ -111,7 +111,7 @@ impl<'a> Miner<'a> { "Find a PoRA valid answer, quality: {}, target_quality {}, scale {:.3}", U256::MAX / quality, U256::MAX / self.target_quality, - difficulty_scale_x64.as_u128() as f64 / (u64::MAX as f64 + 1.0) + difficulty_scale_x64.as_u128() as f64 / u64::MAX as f64 ); inc_counter(&HIT_COUNT); // Undo mix data when find a valid solition