From 748009d0a0c520027e88bf254e6602b01fac20b5 Mon Sep 17 00:00:00 2001 From: thomaslavaur Date: Tue, 2 Sep 2025 10:13:07 +0200 Subject: [PATCH] fixed the generation of test that was miscalculating t0 and t1 --- circom_circuits/Blend/generate_inputs_for_poq.py | 7 +++++-- circom_circuits/Mantle/generate_inputs_for_pol.py | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/circom_circuits/Blend/generate_inputs_for_poq.py b/circom_circuits/Blend/generate_inputs_for_poq.py index c47aa53..7be2740 100644 --- a/circom_circuits/Blend/generate_inputs_for_poq.py +++ b/circom_circuits/Blend/generate_inputs_for_poq.py @@ -239,8 +239,11 @@ epoch_nonce = F(randrange(0, p,1)) slot_number = F(randrange(0, 2**32,1)) total_stake = F(5000) -t0 = F(0x27b6fe27507ca57ca369280400c79b5d2f58ff94d87cb0fbfc8294eb69eb1ea) -t1 = F(0x104bfd09ebdd0a57772289d0973489b62662a4dc6f09da8b4af3c5cfb1dcdd) +t0_constant = F(0x27b6fe27507ca57ca369280400c79b5d2f58ff94d87cb0fbfc8294eb69eb1ea) +t1_constant = F(0x104bfd09ebdd0a57772289d0973489b62662a4dc6f09da8b4af3c5cfb1dcdd) + +t0 = F(int(t0_constant) / total_stake) +t1 = F(p- (int(t1_constant) / total_stake**2)) value = F(total_stake / 100) threshold = (t0 + t1 * value) * value diff --git a/circom_circuits/Mantle/generate_inputs_for_pol.py b/circom_circuits/Mantle/generate_inputs_for_pol.py index 4f24c4e..7a38f65 100755 --- a/circom_circuits/Mantle/generate_inputs_for_pol.py +++ b/circom_circuits/Mantle/generate_inputs_for_pol.py @@ -219,8 +219,11 @@ if total_stake >= p: print("total stake must be less than p") exit() -t0 = F(0x27b6fe27507ca57ca369280400c79b5d2f58ff94d87cb0fbfc8294eb69eb1ea) -t1 = F(0x104bfd09ebdd0a57772289d0973489b62662a4dc6f09da8b4af3c5cfb1dcdd) +t0_constant = F(0x27b6fe27507ca57ca369280400c79b5d2f58ff94d87cb0fbfc8294eb69eb1ea) +t1_constant = F(0x104bfd09ebdd0a57772289d0973489b62662a4dc6f09da8b4af3c5cfb1dcdd) + +t0 = F(int(t0_constant) / total_stake) +t1 = F(p- (int(t1_constant) / total_stake**2)) value = F(total_stake / 100)