message: fix: set `next_epoch_diff` to one instead of panic when it is zero
diff: @@ -622,10 +622,9 @@ impl Consensus {
  &adjusted_last_epoch_hash_rate * epoch_duration_target,
  U256::one(),
  );
  - let next_epoch_diff = if bound {
  + let diff_denominator = if bound {
  if last_orphan_rate.is_zero() {
  - let denominator = U256::from(next_epoch_length);
  - (diff_numerator / denominator).into_u256()
  + RationalU256::new(next_epoch_length_u256, U256::one())
  } else {
  let orphan_rate_estimation_recip = ((&last_orphan_rate + U256::one())
  * &epoch_duration_target_u256
  @@ -633,24 +632,24 @@ impl Consensus {
  / (&last_orphan_rate * &last_epoch_duration * &next_epoch_length_u256))
  .saturating_sub_u256(U256::one());
  - let denominator = if orphan_rate_estimation_recip.is_zero() {
  + if orphan_rate_estimation_recip.is_zero() {
  // small probability event, use o_ideal for now
  (orphan_rate_target + U256::one()) * next_epoch_length_u256
  } else {
  let orphan_rate_estimation = RationalU256::one() / orphan_rate_estimation_recip;
  (orphan_rate_estimation + U256::one()) * next_epoch_length_u256
  - };
  - (diff_numerator / denominator).into_u256()
  + }
  }
  } else {
  - let denominator = (orphan_rate_target + U256::one()) * next_epoch_length_u256;
  - (diff_numerator / denominator).into_u256()
  + (orphan_rate_target + U256::one()) * next_epoch_length_u256
  };
  - debug_assert!(
  - next_epoch_diff > U256::zero(),
  - "next_epoch_diff should greater than one"
  - );
  + let next_epoch_diff = if diff_numerator > diff_denominator {
  + (diff_numerator / diff_denominator).into_u256()
  + } else {
  + // next_epoch_diff cannot be zero
  + U256::one()
  + };
  let primary_epoch_reward = self.primary_epoch_reward_of_next_epoch(last_epoch).as_u64();
  let block_reward = Capacity::shannons(primary_epoch_reward / next_epoch_length);
  