test(precompile): add benchmarkoor bls12-381 benches#3766
Conversation
Merging this PR will not alter performance
Performance Changes
Comparing Footnotes
|
|
I opened #3770 against this branch as a small follow-up. While going through the MSM changes here I noticed the infinity-point skip (68ade1a) only landed in the blst backend — the arkworks fallback still pushes points at infinity into the MSM (it only picked up the zero-scalar skip). #3770 brings arkworks to parity by mirroring the
Output is unchanged in both backends (an infinity point contributes nothing to the MSM); it just avoids feeding infinity into the MSM and the subgroup check. The PR targets this branch, so the diff is only the follow-up — feel free to fold it in or use it as a reference. 🙏 |
Adds benchmarkoor-named Criterion coverage for the EIP-2537 BLS12-381 precompiles using the EF/Jochemnet compute cases from
NethermindEth/gas-benchmarksreleaseamsterdam-repricings-v5.2.0.The BLS bench matrix now covers the cached
test_bls12_381[...]cases, fixed MSM sizesk=1,16,64,128, pairing sizesnum_pairs=1,3,6,12,24, and uncachable variants for add/MSM/map/pairing-style inputs. The MSM inputs keep the benchmarkoor scalar asSpec.Q; the uncachable MSM variants vary only the point input.The MSM implementation now reduces scalars modulo the subgroup order before deciding whether to skip a term. This means scalar values equal to
r/Spec.Qtake the zero-scalar path and return encoded infinity when every term reduces to zero. The blst backend also skips MSM terms whose point is infinity after on-curve validation, avoiding the subgroup/scalar/MSM work for the later iterations of benchmarkoor-style uncachable MSM loops.