Browse Source

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

mohab metwally 3 years ago
parent
commit
edb58dddd6
1 changed files with 2 additions and 2 deletions
  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 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 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(): T = {:?}", target);
 
-
         y < target
     }