gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[merchant] 01/01: taler-merchant-kyccheck: prevent AML_LOW_FREQ from bei


From: Admin
Subject: [merchant] 01/01: taler-merchant-kyccheck: prevent AML_LOW_FREQ from being faster than AML_FREQ, add randomization to avoid thundering herd problems (#10090)
Date: Mon, 09 Jun 2025 14:57:03 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository merchant.

commit accd9c17b02841e641b144895b05b49dc4fe9a14
Author: Christian Grothoff <grothoff@gnunet.org>
AuthorDate: Mon Jun 9 14:56:21 2025 +0200

    taler-merchant-kyccheck: prevent AML_LOW_FREQ from being faster than 
AML_FREQ, add randomization to avoid thundering herd problems (#10090)
---
 src/backend/taler-merchant-httpd_config.c |  2 +-
 src/backend/taler-merchant-kyccheck.c     | 26 ++++++++++++++++++++++----
 2 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_config.c 
b/src/backend/taler-merchant-httpd_config.c
index 5d09b8be..fdbaccd3 100644
--- a/src/backend/taler-merchant-httpd_config.c
+++ b/src/backend/taler-merchant-httpd_config.c
@@ -43,7 +43,7 @@
  * #MERCHANT_PROTOCOL_CURRENT and #MERCHANT_PROTOCOL_AGE in
  * merchant_api_config.c!
  */
-#define MERCHANT_PROTOCOL_VERSION "18:0:15"
+#define MERCHANT_PROTOCOL_VERSION "18:1:15"
 
 
 /**
diff --git a/src/backend/taler-merchant-kyccheck.c 
b/src/backend/taler-merchant-kyccheck.c
index f0c9e48d..7397705c 100644
--- a/src/backend/taler-merchant-kyccheck.c
+++ b/src/backend/taler-merchant-kyccheck.c
@@ -542,12 +542,15 @@ exchange_check_cb (
     if (i->aml_review || i->zero_limited)
     {
       if (! progress)
-        i->due = GNUNET_TIME_relative_to_absolute (aml_freq);
+        i->due = GNUNET_TIME_relative_to_absolute (
+          GNUNET_TIME_randomize (aml_freq));
     }
     else
     {
       /* KYC is OK, only check again if triggered */
-      i->due = GNUNET_TIME_relative_to_absolute (aml_low_freq);
+      i->due = GNUNET_TIME_relative_to_absolute (
+        GNUNET_TIME_randomize (
+          aml_low_freq));
     }
     break;
   case MHD_HTTP_ACCEPTED:
@@ -574,7 +577,8 @@ exchange_check_cb (
     json_decref (i->jlimits);
     i->jlimits = NULL;
     /* KYC is OK, only check again if triggered */
-    i->due = GNUNET_TIME_relative_to_absolute (aml_low_freq);
+    i->due = GNUNET_TIME_relative_to_absolute (
+      GNUNET_TIME_randomize (aml_low_freq));
     break;
   case MHD_HTTP_FORBIDDEN: /* bad signature */
     i->last_kyc_check = GNUNET_TIME_timestamp_get ();
@@ -843,7 +847,8 @@ start_inquiry (struct Exchange *e,
     /* KYC is OFF, only check again if triggered */
     if (GNUNET_YES != test_mode)
     {
-      i->due = GNUNET_TIME_relative_to_absolute (aml_low_freq);
+      i->due = GNUNET_TIME_relative_to_absolute (
+        GNUNET_TIME_randomize (aml_low_freq));
       GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                   "KYC was disabled, randomizing inquiry to start at %s\n",
                   GNUNET_TIME_absolute2s (i->due));
@@ -1029,6 +1034,8 @@ account_cb (
 /**
  * The set of bank accounts has changed, update our
  * list of active inquiries.
+ *
+ * @param cls unused
  */
 static void
 find_accounts (void *cls)
@@ -1450,6 +1457,17 @@ run (void *cls,
     /* use default */
     aml_low_freq = AML_LOW_FREQ;
   }
+  if (GNUNET_TIME_relative_cmp (aml_low_freq,
+                                <,
+                                aml_freq))
+  {
+    aml_low_freq = GNUNET_TIME_relative_multiply (aml_freq,
+                                                  10);
+    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                "AML_LOW_FREQ was set to less than AML_FREQ. Using %s 
instead\n",
+                GNUNET_TIME_relative2s (aml_low_freq,
+                                        true));
+  }
   GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
                                  NULL);
   ctx = GNUNET_CURL_init (&GNUNET_CURL_gnunet_scheduler_reschedule,

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]