From c6453e215d8ee2100ec3bce6da56876c9093bbcc Mon Sep 17 00:00:00 2001 From: George Kadianakis Date: Tue, 17 Jan 2023 16:16:46 +0200 Subject: [PATCH] EIP4844: Make extra sure we didn't win the jackpot --- .../polynomial_commitments/test_polynomial_commitments.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/core/pyspec/eth2spec/test/eip4844/unittests/polynomial_commitments/test_polynomial_commitments.py b/tests/core/pyspec/eth2spec/test/eip4844/unittests/polynomial_commitments/test_polynomial_commitments.py index b503bba57..6b5e0d38d 100644 --- a/tests/core/pyspec/eth2spec/test/eip4844/unittests/polynomial_commitments/test_polynomial_commitments.py +++ b/tests/core/pyspec/eth2spec/test/eip4844/unittests/polynomial_commitments/test_polynomial_commitments.py @@ -42,8 +42,10 @@ def test_barycentric_outside_domain(spec, state): n_samples = 12 for i in range(n_samples): - # Get a random evaluation point + # Get a random evaluation point and make sure it's not a root of unity z = rng.randint(0, spec.BLS_MODULUS - 1) + while z in roots_of_unity_brp: + z = rng.randint(0, spec.BLS_MODULUS - 1) # Get p(z) by evaluating poly in coefficient form p_z_coeff = eval_poly_in_coeff_form(spec, poly_coeff, z)