Kaynağa Gözat

debugging reputation proof synchronization

tristangurtler 3 yıl önce
ebeveyn
işleme
cb7d96a280
1 değiştirilmiş dosya ile 10 ekleme ve 0 silme
  1. 10 0
      prsona/src/networkClient.cpp

+ 10 - 0
prsona/src/networkClient.cpp

@@ -139,6 +139,8 @@ bool make_reputation_proof(
     std::chrono::high_resolution_clock::time_point wallTimeBefore = std::chrono::high_resolution_clock::now();
     clock_t cpuTimeBefore = clock();
 
+    std::cout << "Getting generator." << std::endl;
+
     // Get current fresh generator (it's not guaranteed we've done this in the current epoch)
     std::vector<Proof> generatorProof;
     Twistpoint freshGenerator = get_generator(rng, serverIPs, serverPorts, true, generatorProof, bandwidthData);
@@ -149,6 +151,8 @@ bool make_reputation_proof(
     // Make current short term public key
     Twistpoint shortTermPublicKey = prsonaClient->get_short_term_public_key();
 
+    std::cout << "Getting encrypted score." << std::endl;
+
     // Get this client's current encrypted score
     std::vector<Proof> encryptedScoreProof;
     EGCiphertext encryptedScore = get_server_committed_val<EGCiphertext>(rng, serverIPs, serverPorts, REQUEST_CLIENT_TALLY_URI, REQUEST_CLIENT_TALLY_COMMITMENT_URI, encryptedScoreProof, shortTermPublicKey, bandwidthData);
@@ -164,15 +168,21 @@ bool make_reputation_proof(
     std::uniform_int_distribution<int> scoreThresholdDistribution(0, maxScoreInt);
     Scalar threshold(scoreThresholdDistribution(rng));
 
+    std::cout << "Making proof." << std::endl;
+
     // Use client object to generate a correct reputation proof with the chosen parameters
     std::vector<Proof> repProof = prsonaClient->generate_reputation_proof(threshold, numClients);
 
     // Serialize that proof
     std::string data = make_rep_proof_string(repProof, shortTermPublicKey, threshold);
 
+    std::cout << "Sending proof." << std::endl;
+
     // Send that proof to a chosen client (and set up a file to receive whether or not the client accepted the proof)
     char *responseFile = send_item(rng, target, targetPort, VERIFY_REPUTATION_PROOF_URI, data, true, bandwidthData);
 
+    std::cout << "Work done." << std::endl;
+
     clock_t cpuTimeAfter = clock();
     std::chrono::high_resolution_clock::time_point wallTimeAfter = std::chrono::high_resolution_clock::now();
     std::vector<size_t> bandwidthDataAfter = get_server_log_data(civetServer.getContext());