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_testsfrom 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
- Scheme works similarly to the failure reasons scheme except the file it maintains is
Build system:
- Added a
generate_header_and_cpp.pyscript that can be used to import JSON and other data files intotest_bitcoinin a cleaner .h/.cpp split. The build system uses this script now to import "heavy" JSON tests and save their compressed contents to a.cppfile and only expose their declaration in a.hfile. This makes IDEs happier and also makes compiling faster. - Modified the existing
bigint_teststo use this new .h/.cpp split scheme which makessrc/test/bigint_tests.cppeasier to load in IDEs now and faster to compile after modification. - We now depend on zlib to correctly compile
test_bitcoin. Sodepends/has been updated to makezliba 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
-libauthtobench_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