From 18ab53e4df7b55346157ce4a1eb6bb1aa301e008 Mon Sep 17 00:00:00 2001 From: AztecBot Date: Tue, 14 Apr 2026 06:06:48 +0000 Subject: [PATCH] fix: wrap debug pairing point checks in try-catch to fix nightly debug build The debug-only (#ifndef NDEBUG) native pairing point validation in stdlib PairingPoints constructor and aggregate() throws when witness values are zero-initialized (e.g. during VK generation with dummy data). The native check calls reduced_ate_pairing_batch_precomputed which aborts on off-curve points. Wraps the debug checks in try-catch so they log the skip instead of crashing. This only affects debug builds; release builds are unchanged. --- .../stdlib/primitives/pairing_points.hpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/pairing_points.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/pairing_points.hpp index c87964f35620..ebf22b105223 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/pairing_points.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/pairing_points.hpp @@ -54,8 +54,12 @@ template struct PairingPoints { } #ifndef NDEBUG - bb::PairingPoints native_pp(P0().get_value(), P1().get_value()); - info("Are Pairing Points with tag ", tag_index, " valid? ", native_pp.check() ? "true" : "false"); + try { + bb::PairingPoints native_pp(P0().get_value(), P1().get_value()); + info("Are Pairing Points with tag ", tag_index, " valid? ", native_pp.check() ? "true" : "false"); + } catch (const std::exception& e) { + info("Pairing Points with tag ", tag_index, " native check skipped: ", e.what()); + } #endif } @@ -210,8 +214,13 @@ template struct PairingPoints { } #ifndef NDEBUG - bb::PairingPoints native_pp(P0().get_value(), P1().get_value()); - info("Are aggregated Pairing Points with tag ", tag_index, " valid? ", native_pp.check() ? "true" : "false"); + try { + bb::PairingPoints native_pp(P0().get_value(), P1().get_value()); + info( + "Are aggregated Pairing Points with tag ", tag_index, " valid? ", native_pp.check() ? "true" : "false"); + } catch (const std::exception& e) { + info("Aggregated Pairing Points with tag ", tag_index, " native check skipped: ", e.what()); + } #endif }