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

Fix KZG precompile I/O #213

Merged
merged 7 commits into from
May 6, 2024
Merged

Fix KZG precompile I/O #213

merged 7 commits into from
May 6, 2024

Conversation

Nashtare
Copy link
Collaborator

@Nashtare Nashtare commented May 2, 2024

Some adaptation around KZG precompile CALLDATA / RETURNDATA format to pass transactions (couldn't test it previously as no tests on the Ethereum test suite side) and the hardcoded tests are only checking the parsing / pairing computation.

Note that txn 57 is still failing at the precompile level because of mismatch between versioned_hash and commitment hash. It's puzzling me a bit, because the official hardcoded tests that we run in the CI are passing fine, and skipping this validation check gets the rest of the precompile to run smoothly (so most importantly, the commitment is of correct form, i.e. compact G1 encoding and the KZG evaluation is verified). Keeping it for now while debugging the remaining errors, will go back to it later.

@Nashtare Nashtare added this to the Cancun - Q2 2024 milestone May 2, 2024
@Nashtare Nashtare self-assigned this May 2, 2024
@github-actions github-actions bot added the crate: evm_arithmetization Anything related to the evm_arithmetization crate. label May 2, 2024
Copy link
Contributor

@4l0n50 4l0n50 left a comment

Choose a reason for hiding this comment

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

LGTM. Thought the real check would be more blocks being proven.

@Nashtare
Copy link
Collaborator Author

Nashtare commented May 6, 2024

The issue with versioned_hash mismatch against commitment hash was simply that I was using keccak instead of sha256. Blocks calling KZG precompile are now all fine. Attached an example of txn calling it.

b19791700_txn_112_input.log

@Nashtare Nashtare enabled auto-merge (squash) May 6, 2024 14:28
@Nashtare Nashtare merged commit a5f5421 into feat/cancun May 6, 2024
6 checks passed
@Nashtare Nashtare deleted the fix-kzg-calldata branch May 6, 2024 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crate: evm_arithmetization Anything related to the evm_arithmetization crate.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants