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

feat: skip range-checking PUSH operations in KERNEL mode #373

Merged
merged 8 commits into from
Jul 9, 2024

Conversation

Nashtare
Copy link
Collaborator

@Nashtare Nashtare commented Jul 9, 2024

Following internal discussion, as part of our assumptions are the KERNEL validity, as source of truth, we do not need to range-check the hardcoded PUSH operations happening in context 0. This involves a new CpuGeneralColumnsView to hold a temporary variable to account for the increased degree when filtering the associated CTL.

This allows to massively reduce both BytePackingStark and MemoryStark trace lengths, as PUSH operations normally require a range-check on all bytes of the pushed value.

Example on an ERC20 transfer:

  • BP: 17023 -> 537
  • Memory: 363111 -> 232806

This PR also cleans-up the way BytePackingOps are appended, by skipping empty sequences which would be filtered out after anyway.

Idea initially suggested by @4l0n50.

@Nashtare Nashtare added the performance Performance improvement related changes label Jul 9, 2024
@Nashtare Nashtare requested a review from 4l0n50 July 9, 2024 20:52
@Nashtare Nashtare self-assigned this Jul 9, 2024
@Nashtare Nashtare requested review from wborgeaud and muursh as code owners July 9, 2024 20:52
@github-actions github-actions bot added the crate: evm_arithmetization Anything related to the evm_arithmetization crate. label Jul 9, 2024
@github-actions github-actions bot added the crate: zero_bin Anything related to the zero-bin subcrates. label Jul 9, 2024
@Nashtare Nashtare requested a review from hratoanina July 9, 2024 21:45
@Nashtare
Copy link
Collaborator Author

Nashtare commented Jul 9, 2024

I'm going to update the specs too, it's missing a mention of the new view

@github-actions github-actions bot added the specs label Jul 9, 2024
@Nashtare Nashtare merged commit 10ce334 into develop Jul 9, 2024
14 checks passed
@Nashtare Nashtare deleted the kernel/push branch July 9, 2024 22:35
@Nashtare Nashtare added this to the Type 1 - Q3 2024 milestone Jul 25, 2024
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. crate: zero_bin Anything related to the zero-bin subcrates. performance Performance improvement related changes specs
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants