Open gtg2619 opened 5 months ago
I also tried sys.setrecursionlimit()
to solve this, but it makes output to be None
.
Did you manage to solve the issue? I am facing a similar issue on a Mac M2, RecursionError: maximum recursion depth exceeded
`--------------------------------------------------------------------------- RecursionError Traceback (most recent call last) Cell In[24], line 5 2 B = multiply(G1, 6) 3 C = multiply(G2, 5 * 6) ----> 5 pairing(A, B) == pairing(C, G1)
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/py_ecc/bn128/bn128_pairing.py:110, in pairing(Q, P) 108 assert is_on_curve(Q, b2) 109 assert is_on_curve(P, b) --> 110 return miller_loop(twist(Q), cast_point_to_fq12(P))
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/py_ecc/bn128/bn128_pairing.py:103, in miller_loop(Q, P) 101 f = f * linefunc(R, nQ2, P) 102 # R = add(R, nQ2) This line is in many specifications but technically does nothing --> 103 return f ((field_modulus12 - 1) // curve_order)
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/py_ecc/fields/field_elements.py:276, in FQP.pow(self, other) 274 return type(self)(self.coeffs) 275 elif other % 2 == 0: --> 276 return (self * self) * (other // 2) 277 else: 278 return ((self self) * int(other // 2)) self
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/py_ecc/fields/field_elements.py:276, in FQP.pow(self, other) 274 return type(self)(self.coeffs) 275 elif other % 2 == 0: --> 276 return (self * self) * (other // 2) 277 else: 278 return ((self self) * int(other // 2)) self
[... skipping similar frames: FQP.__pow__ at line 276 (3 times)]
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/py_ecc/fields/field_elements.py:278, in FQP.pow(self, other) 276 return (self * self) * (other // 2) 277 else: --> 278 return ((self self) * int(other // 2)) self
[... skipping similar frames: FQP.__pow__ at line 276 (2 times)]
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/py_ecc/fields/field_elements.py:278, in FQP.pow(self, other) 276 return (self * self) * (other // 2) 277 else: --> 278 return ((self self) * int(other // 2)) self
[... skipping similar frames: FQP.__pow__ at line 276 (368 times), FQP.__pow__ at line 278 (359 times)]
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/py_ecc/fields/field_elements.py:278, in FQP.pow(self, other) 276 return (self * self) * (other // 2) 277 else: --> 278 return ((self self) * int(other // 2)) self
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/py_ecc/fields/field_elements.py:276, in FQP.pow(self, other) 274 return type(self)(self.coeffs) 275 elif other % 2 == 0: --> 276 return (self * self) * (other // 2) 277 else: 278 return ((self self) * int(other // 2)) self
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/py_ecc/fields/field_elements.py:246, in FQP.mul(self, other) 242 for i in range(self.degree): 243 b[exp + i] -= top * self.FQP_corresponding_FQ_class( 244 self.modulus_coeffs[i] 245 ) --> 246 return type(self)(b) 247 else: 248 raise TypeError( 249 "Expected an int or FQ object or FQP object, " 250 f"but got object of type {type(other)}" 251 )
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/py_ecc/fields/field_elements.py:374, in FQ12.init(self, coeffs) 371 if self.FQ12_MODULUS_COEFFS is None: 372 raise AttributeError("FQ12 Modulus Coeffs haven't been specified") --> 374 super().init(coeffs, self.FQ12_MODULUS_COEFFS)
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/py_ecc/fields/field_elements.py:208, in FQP.init(self, coeffs, modulus_coeffs) 204 # Encoding all coefficients in the corresponding type FQ 205 self.FQP_corresponding_FQ_class = type( 206 "FQP_corresponding_FQ_class", (FQ,), {"field_modulus": self.field_modulus} 207 ) # type: Type[FQ] --> 208 self.coeffs = tuple( 209 self.FQP_corresponding_FQ_class(c) for c in coeffs 210 ) # type: Tuple[IntOrFQ, ...] 211 # The coefficients of the modulus, without the leading [1] 212 self.modulus_coeffs = tuple(modulus_coeffs) # type: Tuple[IntOrFQ, ...]
File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/py_ecc/fields/field_elements.py:209, in
RecursionError: maximum recursion depth exceeded`
The error doesn't show when switching from Python 3.12.1 to Python 3.9.6
We don't support Python 3.12 here yet. @gtg2619 what Python version are you using?
We don't support Python 3.12 here yet. @gtg2619 what Python version are you using?
Python 3.8.4 (tags/v3.8.4:dfa645a, Jul 13 2020, 16:46:45) [MSC v.1924 64 bit (AMD64)]
I'm not able to replicate even with Python 3.12 and it's going to be hard for the team to debug since none of us have windows machines. I've heard that our libraries tend to work better with WSL, so maybe you could try that? I'll leave this open in case there is someone out there who might have a solution/workaround. Sorry I can't be of more help!
Did you manage to sovle this? I have the same problem on Windows.
Did you manage to sovle this? I have the same problem on Windows.
I switched to python 3.9.6 to solve this
What happened?
Testing pairing mapping under Windows resulted in the process exiting unexpectedly and no other output. Running results on windows
Compared running results under Linux
![07199a6823d5051a064873e7022e3e80](https://github.com/ethereum/py_ecc/assets/110759348/d2836e1d-51d2-4877-9a1d-d58f86773c26)
Code that produced the error
Full error output
Fill this section in if you know how this could or should be fixed
No response
py-ecc Version
7.0.0
Python Version
3.8.4
Operating System
win
Output from
pip freeze