From 3ed405b066fe024579a207d346b79b038fc415a1 Mon Sep 17 00:00:00 2001 From: Edgar Costa Date: Fri, 4 Aug 2023 10:52:47 -0400 Subject: [PATCH 1/5] disable Artin L-functions with large conductor/degree --- lmfdb/lfunctions/Lfunction.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lmfdb/lfunctions/Lfunction.py b/lmfdb/lfunctions/Lfunction.py index 49e2491bcb..2fb4677e86 100644 --- a/lmfdb/lfunctions/Lfunction.py +++ b/lmfdb/lfunctions/Lfunction.py @@ -44,6 +44,8 @@ ) import sage.libs.lcalc.lcalc_Lfunction as lc +from lmfdb.app import is_debug_mode + from lmfdb.backend.encoding import Json from lmfdb.utils import ( Downloader, @@ -1254,6 +1256,11 @@ def __init__(self, **args): self.primitive = self.artin.primitive() self.degree = self.artin.dimension() self.level = self.artin.conductor() + + # disable expensive L-functions, these should not be linked anywhere regardless + if not is_debug_mode() and self.level**self.degree > 729000000000000: + raise ValueError(f'Error constructing L-function for the Artin representation {self.origin_label}, as the conductor/degree is too large.') + self.level_factored = factor(self.level) self.mu_fe = self.artin.mu_fe() self.nu_fe = self.artin.nu_fe() @@ -1320,7 +1327,7 @@ def __init__(self, **args): # Check for compulsory arguments if "t" in args and "family" in args: args["label"] = args["family"] + "_" + args["t"] - validate_required_args ('Unable to construct hypergeometric motive L-function.', args, 'label') + validate_required_args('Unable to construct hypergeometric motive L-function.', args, 'label') self._Ltype = "hgmQ" # Put the arguments into the object dictionary From 5f68cb323fda4e77352ff897ccf7c09fa68aab87 Mon Sep 17 00:00:00 2001 From: Edgar Costa Date: Fri, 4 Aug 2023 11:02:55 -0400 Subject: [PATCH 2/5] comment to clarify where the threshold comes from --- lmfdb/lfunctions/Lfunction.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lmfdb/lfunctions/Lfunction.py b/lmfdb/lfunctions/Lfunction.py index 2fb4677e86..00c1cfd0e4 100644 --- a/lmfdb/lfunctions/Lfunction.py +++ b/lmfdb/lfunctions/Lfunction.py @@ -1258,6 +1258,7 @@ def __init__(self, **args): self.level = self.artin.conductor() # disable expensive L-functions, these should not be linked anywhere regardless + # this threshold comes from lmfdb/artin_representations/main.py if not is_debug_mode() and self.level**self.degree > 729000000000000: raise ValueError(f'Error constructing L-function for the Artin representation {self.origin_label}, as the conductor/degree is too large.') From 5b772b733da186bed10b9664d4ff5d5d31205fe3 Mon Sep 17 00:00:00 2001 From: David Roe Date: Mon, 7 Aug 2023 00:12:37 -0400 Subject: [PATCH 3/5] Change threshold for computing galois orbit --- lmfdb/characters/TinyConrey.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lmfdb/characters/TinyConrey.py b/lmfdb/characters/TinyConrey.py index 0d8530f9af..71c241163a 100644 --- a/lmfdb/characters/TinyConrey.py +++ b/lmfdb/characters/TinyConrey.py @@ -213,7 +213,7 @@ def galois_orbit(self, limit=31): elif order < limit or order * order < limit * self.modulus: logger.debug(f"compute all conjugate characters and return first {limit}") return self.galois_orbit_all(limit) - elif limit == 1 or self.modulus < 30 * order: + elif limit == 1 or self.modulus <= 1000000: logger.debug(f"compute {limit} first conjugate characters") return self.galois_orbit_search(limit) else: From ce8ef6539f479db41736a9a62acce681a60f3e18 Mon Sep 17 00:00:00 2001 From: David Roe Date: Mon, 7 Aug 2023 00:18:00 -0400 Subject: [PATCH 4/5] Add test --- lmfdb/characters/test_characters.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lmfdb/characters/test_characters.py b/lmfdb/characters/test_characters.py index 71ab364781..1d285f12d0 100644 --- a/lmfdb/characters/test_characters.py +++ b/lmfdb/characters/test_characters.py @@ -142,6 +142,9 @@ def test_dirichletgalorbs(self): W = self.tc.get('/Character/Dirichlet/9999999999/banana', follow_redirects=True) assert 'Error: Galois orbits have only been computed for modulus up to 100,000' in W.get_data(as_text=True) + W = self.tc.get('/Character/Dirichlet/58589/50021', follow_redirects=True) + assert 'Number field defined by a degree 1428 polynomial' in W.get_data(as_text=True) + def test_dirichletchar11(self): W = self.tc.get('/Character/Dirichlet/1/1') assert '/NumberField/1.1.1.1' in W.get_data(as_text=True) From 75913b9ff12b20c88d27b8046015a8a50e28b8d2 Mon Sep 17 00:00:00 2001 From: Edgar Costa Date: Wed, 9 Aug 2023 12:22:40 -0400 Subject: [PATCH 5/5] double wait time --- lmfdb/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lmfdb/app.py b/lmfdb/app.py index 92197b15fc..bc0d650d90 100644 --- a/lmfdb/app.py +++ b/lmfdb/app.py @@ -307,7 +307,7 @@ def badbot(): ua = request.user_agent.string.lower() for elt in bad_bots_list(): if elt in ua: - time.sleep(5) + time.sleep(10) def timestamp():