Update LibAuth test vector and benchmark scheme (on top of BigInt + VMLimits CHIP)

This MR depends on !1876 (merged) and !1874 (merged). It is on top of those two MRs. It closes #529 (closed) .

Summary

See #529 (closed) for more detail, but the most significant changes are:

Test Framework:

  • Imported latest vmb_tests from libauth
  • Revamped the libauth_testing_setup framework to no longer keep track of libauth failure reasons since this was not necessary and created complexity.
  • Instead, we just track internal BCHN failure reasons changing.
    • These get saved and if there is a change, error out.
    • If we are missing a failure reason for a test, don't error out, just politely warn and nudge user to update src/test/data/libauth_expected_test_fail_reasons.json
  • In order to support the 2025 VMLimits changes, we also track "opCost" and other "metrics" for each successful test run.
    • Scheme works similarly to the failure reasons scheme except the file it maintains is src/test/data/libauth_expected_test_metrics.json

Build system:

  • Added a generate_header_and_cpp.py script that can be used to import JSON and other data files into test_bitcoin in a cleaner .h/.cpp split. The build system uses this script now to import "heavy" JSON tests and save their compressed contents to a .cpp file and only expose their declaration in a .h file. This makes IDEs happier and also makes compiling faster.
  • Modified the existing bigint_tests to use this new .h/.cpp split scheme which makes src/test/bigint_tests.cpp easier to load in IDEs now and faster to compile after modification.
  • We now depend on zlib to correctly compile test_bitcoin. So depends/ has been updated to make zlib a general dependency, not just qt-only.
  • Gitian descriptors were updated to bring in zlib into the host gitian builder.

Benchmarks:

  • Revamped how the benchmarks work for libauth benches.
  • Made the libauth benches be suppressed unless user passes -libauth to bench_bitcoin. In that mode only libauth benches run.
  • Modified the data/columns that the libauth benchmarks print
  • Misc correctness / bugfixes.

Test Plan

  • ninja check bench_bitcoin
  • ./src/bench/bench_bitcoin -libauth
Edited by Calin Culianu

Merge request reports

Loading