]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
hs_pow: Lower several logs from notice to info
authorMicah Elizabeth Scott <beth@torproject.org>
Thu, 6 Apr 2023 15:34:47 +0000 (08:34 -0700)
committerMicah Elizabeth Scott <beth@torproject.org>
Wed, 10 May 2023 14:41:37 +0000 (07:41 -0700)
Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
src/feature/hs/hs_circuit.c
src/feature/hs/hs_client.c
src/feature/hs/hs_pow.c
src/feature/hs/hs_service.c

index d5188b514f783a08cd472e335af78dbf88f71583..3978c69567dbd58d3f5857cb23f5ad61ddaecb99 100644 (file)
@@ -665,7 +665,7 @@ trim_rend_pqueue(hs_pow_service_state_t *pow_state, time_t now)
   smartlist_t *old_pqueue = pow_state->rend_request_pqueue;
   smartlist_t *new_pqueue = pow_state->rend_request_pqueue = smartlist_new();
 
-  log_notice(LD_REND, "Rendezvous request priority queue has "
+  log_info(LD_REND, "Rendezvous request priority queue has "
                     "reached capacity (%d). Discarding the bottom half.",
                     smartlist_len(old_pqueue));
 
@@ -776,10 +776,10 @@ handle_rend_pqueue_cb(mainloop_event_t *ev, void *arg)
 
   (void) ev; /* Not using the returned event, make compiler happy. */
 
-  log_notice(LD_REND, "Considering launching more rendezvous responses. "
-             "%d in-flight, %d pending.",
-             in_flight,
-             smartlist_len(pow_state->rend_request_pqueue));
+  log_info(LD_REND, "Considering launching more rendezvous responses. "
+           "%d in-flight, %d pending.",
+           in_flight,
+           smartlist_len(pow_state->rend_request_pqueue));
 
   /* Process rendezvous request until the maximum per mainloop run. */
   while (smartlist_len(pow_state->rend_request_pqueue) > 0) {
@@ -790,8 +790,8 @@ handle_rend_pqueue_cb(mainloop_event_t *ev, void *arg)
       /* We have queued requests, but they are all low priority, and also
        * we have too many in-progress rendezvous responses. Don't launch
        * any more. Schedule ourselves to reassess in a bit. */
-      log_notice(LD_REND, "Next request to launch is low priority, and "
-                 "%d in-flight already. Waiting to launch more.", in_flight);
+      log_info(LD_REND, "Next request to launch is low priority, and "
+               "%d in-flight already. Waiting to launch more.", in_flight);
       const struct timeval delay_tv = { 0, 100000 };
       mainloop_event_schedule(pow_state->pop_pqueue_ev, &delay_tv);
       return; /* done here! no cleanup needed. */
@@ -820,7 +820,7 @@ handle_rend_pqueue_cb(mainloop_event_t *ev, void *arg)
     hs_metrics_pow_pqueue_rdv(service,
                               smartlist_len(pow_state->rend_request_pqueue));
 
-    log_notice(LD_REND, "Dequeued pending rendezvous request with effort: %u. "
+    log_info(LD_REND, "Dequeued pending rendezvous request with effort: %u. "
                       "Waited %d. "
                       "Remaining requests: %u",
              req->rdv_data.pow_effort,
@@ -828,7 +828,7 @@ handle_rend_pqueue_cb(mainloop_event_t *ev, void *arg)
              smartlist_len(pow_state->rend_request_pqueue));
 
     if (queued_rend_request_is_too_old(req, now)) {
-      log_notice(LD_REND, "Top rend request has been pending for too long; "
+      log_info(LD_REND, "Top rend request has been pending for too long; "
                         "discarding and moving to the next one.");
       free_pending_rend(req);
       continue; /* do not increment count, this one's free */
@@ -907,7 +907,7 @@ enqueue_rend_request(const hs_service_t *service, hs_service_intro_point_t *ip,
   hs_metrics_pow_pqueue_rdv(service,
                             smartlist_len(pow_state->rend_request_pqueue));
 
-  log_notice(LD_REND, "Enqueued rendezvous request with effort: %u. "
+  log_info(LD_REND, "Enqueued rendezvous request with effort: %u. "
                     "Queued requests: %u",
            req->rdv_data.pow_effort,
            smartlist_len(pow_state->rend_request_pqueue));
@@ -1382,9 +1382,9 @@ hs_circ_handle_introduce2(const hs_service_t *service,
   /* Add the rendezvous request to the priority queue if PoW defenses are
    * enabled, otherwise rendezvous as usual. */
   if (have_module_pow() && service->config.has_pow_defenses_enabled) {
-    log_notice(LD_REND,
-               "Adding introduction request to pqueue with effort: %u",
-               data.rdv_data.pow_effort);
+    log_info(LD_REND,
+             "Adding introduction request to pqueue with effort: %u",
+             data.rdv_data.pow_effort);
     if (enqueue_rend_request(service, ip, &data, now) < 0) {
       goto done;
     }
index 6303b8fe7579a6b35be641f6697dfc7f4affca5c..e77e1a3fbda30c391039264f61c988979d1c9cd4 100644 (file)
@@ -787,9 +787,9 @@ consider_sending_introduce1(origin_circuit_t *intro_circ,
       new_effort = MIN((uint64_t)CLIENT_MAX_POW_EFFORT, new_effort);
     }
     if (pow_inputs.effort != (uint32_t)new_effort) {
-      log_notice(LD_REND, "Increasing PoW effort from %d to %d after intro "
-                 "point unreachable_count=%d",
-                 pow_inputs.effort, (int)new_effort, unreachable_count);
+      log_info(LD_REND, "Increasing PoW effort from %d to %d after intro "
+               "point unreachable_count=%d",
+               pow_inputs.effort, (int)new_effort, unreachable_count);
       pow_inputs.effort = (uint32_t)new_effort;
     }
 
index 1f6932a55ddb077ba4c4c00d1306b30a5859b1a1..3cd14c524676cbe922083a4b8cf349ead58a7ebf 100644 (file)
@@ -202,7 +202,7 @@ hs_pow_solve(const hs_pow_solver_inputs_t *pow_inputs,
   equix_solution solutions[EQUIX_MAX_SOLS];
   uint8_t sol_bytes[HS_POW_EQX_SOL_LEN];
 
-  log_notice(LD_REND, "Solving proof of work (effort %u)", effort);
+  log_info(LD_REND, "Solving proof of work (effort %u)", effort);
   for (;;) {
     /* Calculate solutions to S = equix_solve(C || N || E),  */
     int count = equix_solve(ctx, challenge, HS_POW_CHALLENGE_LEN, solutions);
@@ -431,7 +431,7 @@ pow_worker_replyfn(void *work_)
   if (intro_circ && rend_circ && service_identity_pk && desc && ip &&
       job->pow_solution_out) { /* successful pow solve, and circs still here */
 
-    log_notice(LD_REND, "Got a PoW solution we like! Shipping it!");
+    log_info(LD_REND, "Got a PoW solution we like! Shipping it!");
     /* Set flag to reflect that the HS we are attempting to rendezvous has PoW
      * defenses enabled, and as such we will need to be more lenient with
      * timing out while waiting for the service-side circuit to be built. */
index 1a40e34cf770b3f07d8fba6cfeec42a6508b0522..43598ad7681e63d0eeb6aa506a7bd52fb8e9d240 100644 (file)
@@ -298,7 +298,7 @@ initialize_pow_defenses(hs_service_t *service)
    * seed to be predictable even if it doesn't really exist yet, and it needs
    * to be different to the current nonce for the replay cache scrubbing to
    * function correctly. */
-  log_notice(LD_REND, "Generating both PoW seeds...");
+  log_info(LD_REND, "Generating both PoW seeds...");
   crypto_rand((char *)&pow_state->seed_current, HS_POW_SEED_LEN);
   crypto_rand((char *)&pow_state->seed_previous, HS_POW_SEED_LEN);
 
@@ -2450,7 +2450,7 @@ update_all_descriptors_pow_params(time_t now)
        * initialise pow_params in the descriptors. If this runs the next if
        * statement will run and set the correct values. */
       if (!encrypted->pow_params) {
-        log_notice(LD_REND, "Initializing pow_params in descriptor...");
+        log_info(LD_REND, "Initializing pow_params in descriptor...");
         encrypted->pow_params = tor_malloc_zero(sizeof(hs_pow_desc_params_t));
       }