Skip to content

Make KZG precompute value configurable #9663

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 15, 2025
Merged

Conversation

jtraglia
Copy link
Contributor

PR Description

Allow users to configure KZG libraries with a new hidden --Xkzg-precompute flag.

For reference, see: https://github.com/ethereum/c-kzg-4844/blob/main/README.md#precompute

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

cursor[bot]

This comment was marked as outdated.

Copy link
Contributor

@StefanBratanov StefanBratanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: RustKZG Incorrectly Converts Integer to Boolean

The RustKZG implementation incorrectly converts the kzgPrecompute integer parameter to a boolean (kzgPrecompute != 0). This leads to inconsistent behavior with the CKZG4844 implementation, which passes the exact integer value. This contradicts CLI documentation stating values 0-15 provide fine-grained control over performance/memory. As a result, RustKZG treats all non-zero values identically (e.g., 5 vs. 10), contrary to user expectations for distinct effects.

infrastructure/kzg/src/main/java/tech/pegasys/teku/kzg/RustKZG.java#L56-L58

try {
final boolean usePrecompute = kzgPrecompute != 0;
this.library = new LibEthKZG(usePrecompute);

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

@tbenr tbenr merged commit 8941e9f into Consensys:master Jul 15, 2025
17 checks passed
@jtraglia jtraglia deleted the kzg-precompute branch July 15, 2025 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants