Ver Fonte

prune few comments

mohab metwally há 3 anos atrás
pai
commit
32a8b83ae2
2 ficheiros alterados com 4 adições e 5 exclusões
  1. 2 1
      src/blockchain/epoch.rs
  2. 2 4
      src/stakeholder/stakeholder.rs

+ 2 - 1
src/blockchain/epoch.rs

@@ -126,6 +126,7 @@ impl Epoch {
         let mut path_sks: Vec<[MerkleNode; MERKLE_DEPTH_ORCHARD]> = vec![];
         let mut path_sks: Vec<[MerkleNode; MERKLE_DEPTH_ORCHARD]> = vec![];
         let mut prev_sk_base: pallas::Base = pallas::Base::one();
         let mut prev_sk_base: pallas::Base = pallas::Base::one();
         for _i in 0..self.len.unwrap() {
         for _i in 0..self.len.unwrap() {
+            //TODO (fix) add sk for the coin struct to be used in txs decryption of tx notes.
             let sk_bytes = if _i == 0 {
             let sk_bytes = if _i == 0 {
                 let base = pedersen_commitment_u64(1, pallas::Scalar::random(&mut rng));
                 let base = pedersen_commitment_u64(1, pallas::Scalar::random(&mut rng));
                 let coord = base.to_affine().coordinates().unwrap();
                 let coord = base.to_affine().coordinates().unwrap();
@@ -283,7 +284,7 @@ impl Epoch {
         let ord = pallas::Base::from(10241024); //TODO fine tune this scalar.
         let ord = pallas::Base::from(10241024); //TODO fine tune this scalar.
         let target = ord * coin.value.unwrap();
         let target = ord * coin.value.unwrap();
         debug!("y_x: {:?}, target: {:?}", y_x, target);
         debug!("y_x: {:?}, target: {:?}", y_x, target);
-        //reversed for testing
+        //TODO (FIX) reversed for testin
         target < y_x
         target < y_x
     }
     }
 
 

+ 2 - 4
src/stakeholder/stakeholder.rs

@@ -359,13 +359,10 @@ impl Stakeholder {
         info!(target: LOG_T, "[new epoch] {}", self);
         info!(target: LOG_T, "[new epoch] {}", self);
         let eta = self.get_eta();
         let eta = self.get_eta();
         let mut epoch = Epoch::new(self.epoch_consensus, eta);
         let mut epoch = Epoch::new(self.epoch_consensus, eta);
-        //TODO calculate total stake
-        // create coin with absolute slo/epocht.
-        //TODO (fix) this is supposed to be the total number of slots
+        // total stake
         let num_slots = self.workspace.sl;
         let num_slots = self.workspace.sl;
         let epochs = self.workspace.e;
         let epochs = self.workspace.e;
         let epoch_len = self.epoch_consensus.get_epoch_len();
         let epoch_len = self.epoch_consensus.get_epoch_len();
-        // total stake;
         // TODO sigma scalar for tunning target function
         // TODO sigma scalar for tunning target function
         // it's value is dependent on the tekonomics,
         // it's value is dependent on the tekonomics,
         // set to one untill then.
         // set to one untill then.
@@ -382,6 +379,7 @@ impl Stakeholder {
     /// commiting it's coins, to maximize success, thus,
     /// commiting it's coins, to maximize success, thus,
     /// the lottery proof need to be conditioned on the slot itself, and previous proof.
     /// the lottery proof need to be conditioned on the slot itself, and previous proof.
     /// this will encourage each potential leader to play with honesty.
     /// this will encourage each potential leader to play with honesty.
+    /// TODO this is fixed by commiting to the stakers at epoch genesis slot
     /// * `e` - epoch index
     /// * `e` - epoch index
     /// * `sl` - slot relative index
     /// * `sl` - slot relative index
     fn new_slot(&mut self, e: u64, sl: u64) {
     fn new_slot(&mut self, e: u64, sl: u64) {