Skip to content
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

Arkworks EIP-4844 implementation #216

Merged
merged 6 commits into from
Apr 16, 2023
Merged

Arkworks EIP-4844 implementation #216

merged 6 commits into from
Apr 16, 2023

Conversation

belijzajac
Copy link
Collaborator

@belijzajac belijzajac commented Apr 15, 2023

This is a hacky implementation for Arkworks because Arkworks doesn't support loading precomputed trusted setups other than generating them from a secret value.

As a result, EIP-4844 tests for this implementation have been disabled, and it's recommended to rely on benchmark results to gauge real Arkworks' performance relative to other ECC backend libraries that incorporate EIP-4844.

Refer to issue arkworks-rs/poly-commit#111 for more information.

@belijzajac
Copy link
Collaborator Author

Local benchmark results with the mainnet trusted setup1 and the parallel feature:

benchmark times slower than blst-from-scratch
blob_to_kzg_commitment 5.08x
compute_kzg_proof 1.98x
verify_kzg_proof 3.81x
compute_blob_kzg_proof 1.94x
verify_blob_kzg_proof 2.25x
verify_blob_kzg_proof_batch/1 2.34x
verify_blob_kzg_proof_batch/2 1.57x
verify_blob_kzg_proof_batch/4 1.30x
verify_blob_kzg_proof_batch/8 1.18x
verify_blob_kzg_proof_batch/16 1.12x
verify_blob_kzg_proof_batch/32 1.14x
verify_blob_kzg_proof_batch/64 1.13x

I think it's weird that blob_to_kzg_commitment is 5 times slower while all its work happens inside the g1_linear_combination function; and verify_kzg_proof just calls internal Arkworks function for proof verification.

Footnotes

  1. Arkworks generates trusted setups dynamically containing either 4096 or 4 G1 points.

@belijzajac belijzajac mentioned this pull request Apr 15, 2023
8 tasks
The reason why the test fails is that KZGSettings, when utilizing a minimal trusted setup, doesn't generate enough roots of unity.
This is necessary to prevent unnecessary copying of expanded roots of unity while also running the bits reversal on them.
@belijzajac belijzajac merged commit 54557dd into main Apr 16, 2023
@belijzajac belijzajac deleted the arkworks_4844 branch April 16, 2023 17:58
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.

1 participant