Просмотр исходного кода

[consensus/leadcoin] negate sigmas, and remove negation of target to avoid negation in zkas

mohab metwally 3 лет назад
Родитель
Сommit
edb58dddd6
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      src/consensus/leadcoin.rs

+ 2 - 2
src/consensus/leadcoin.rs

@@ -312,7 +312,8 @@ impl LeadCoin {
         let y = poseidon_hash(y_msg);
         let y = poseidon_hash(y_msg);
 
 
         let value = pallas::Base::from(self.value);
         let value = pallas::Base::from(self.value);
-        let target = pallas::Base::one().neg() * (sigma1 * value + sigma2 * value * value);
+
+        let target =  sigma1 * value + sigma2 * value * value;
 
 
         let mut y_t_str = format!("{:?},{:?}\n", y,target);
         let mut y_t_str = format!("{:?},{:?}\n", y,target);
         let mut f = File::options().append(true).open(constants::LOTTERY_HISTORY_LOG).unwrap();
         let mut f = File::options().append(true).open(constants::LOTTERY_HISTORY_LOG).unwrap();
@@ -323,7 +324,6 @@ impl LeadCoin {
         info!("is_leader(): y = {:?}", y);
         info!("is_leader(): y = {:?}", y);
         info!("is_leader(): T = {:?}", target);
         info!("is_leader(): T = {:?}", target);
 
 
-
         y < target
         y < target
     }
     }