Fix issue found in auditions (#170)

This commit is contained in:
bruno-valante 2024-08-27 17:36:55 +08:00 committed by GitHub
parent 5757c98d2a
commit aaba4b5da0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 2 deletions

View File

@ -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,
)
}
}

View File

@ -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)
}
}

View File

@ -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