fix precompile tests, add precompile test cases from besu-native#18
Merged
garyschulte merged 2 commits intoConsensys:mainfrom Apr 2, 2026
Merged
Conversation
Signed-off-by: garyschulte <garyschulte@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix main test target to include precompile tests, fix errors, add test cases from besu-native
Note
Medium Risk
Changes affect cryptographic precompile input validation and pairing semantics (e.g., empty BLS12 pairing input), which can alter execution outcomes; however, behavior is now backed by extensive upstream test vectors.
Overview
Wires
src/precompile/main.ziginto the Zig build as a dedicatedb.addTesttarget so precompile unit tests run via the normalteststep (instead of only via a custom CIzig testinvocation), and ensuresmain.zigactually executestests.zigvia a top-leveltestblock.Tightens precompile correctness:
bls12PairingRunnow rejects empty input per EIP-2537 expectations, and BN254 point validation is upgraded from a stub to enforce EIP-196/197 field-modulus bounds (with explicit infinity handling). Also fixes a RIPEMD-160 long-message expected digest.Adds large, vector-driven test coverage for BN254 and BLS12-381 precompiles by porting Besu CSV suites (new
*_tests.zigplus embeddedtestdata/*.csv), including error-path cases and gas checks for fixed-cost operations.Written by Cursor Bugbot for commit c8dda4d. This will update automatically on new commits. Configure here.