execution/vm: optimize KZG point evaluation precompile (~24% faster)#20273
execution/vm: optimize KZG point evaluation precompile (~24% faster)#20273
Conversation
Use optimized go-eth-kzg with JointScalarMultiplication and PairingCheckFixedQ for the EIP-4844 point evaluation precompile. Upstream PR: crate-crypto/go-eth-kzg#131 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
chfast
left a comment
There was a problem hiding this comment.
Really cool. I guess we wait for the upstream review?
I think we can use the optimization in branch |
Giulio2002
left a comment
There was a problem hiding this comment.
LGTM — dependency bump replacing go-eth-kzg with erigontech fork for KZG optimization, go.mod/go.sum only
There was a problem hiding this comment.
Pull request overview
This PR aims to speed up the EIP-4844 KZG point evaluation precompile by switching the build to an optimized go-eth-kzg implementation (via a go.mod replace to an erigontech fork/pinned commit).
Changes:
- Add a
replacedirective to redirectgithub.com/crate-crypto/go-eth-kzgtogithub.com/erigontech/go-eth-kzgat a specific pseudo-version. - Update
go.sumto reflect the new module source and remove the old sums for the replaced module.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| go.mod | Adds a replace override for go-eth-kzg to use an erigontech fork/pinned commit. |
| go.sum | Removes sums for the old crate-crypto module version and adds sums for the replacement module version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| google.golang.org/protobuf/cmd/protoc-gen-go | ||
| ) | ||
|
|
||
| replace github.com/crate-crypto/go-eth-kzg => github.com/erigontech/go-eth-kzg v0.0.0-20260401161010-070339460d07 |
There was a problem hiding this comment.
The PR title/description describes runtime changes to the EIP-4844 point evaluation precompile, but this diff only introduces a module replacement. If the precompile optimizations are part of this PR, include the corresponding code changes; otherwise update the PR title/description to reflect that this is a dependency override only.
|
|
||
| replace github.com/crate-crypto/go-eth-kzg => github.com/erigontech/go-eth-kzg v0.0.0-20260401161010-070339460d07 |
There was a problem hiding this comment.
This replace directive is impactful and currently lacks any in-file context (e.g., why a fork is needed and when it should be removed). Consider adding an inline comment with the upstream PR/link and grouping this replace near the existing replace directives at the top of the file to keep go.mod structure consistent.
Part of #14522
Summary
go-eth-kzgwithJointScalarMultiplication(Strauss-Shamir) andPairingCheckFixedQ(precomputed Miller loop lines) for the EIP-4844 point evaluation precompileBenchmark (Apple M2 Max)
Test plan
go test -run TestPrecompiledPointEvaluation ./execution/vm/🤖 Generated with Claude Code