Explorar el Código

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

mohab metwally hace 3 años
padre
commit
edb58dddd6
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  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
     }
     }