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

Optimising the number of RAM gates #522

Open
Rumata888 opened this issue Jun 9, 2023 · 0 comments
Open

Optimising the number of RAM gates #522

Rumata888 opened this issue Jun 9, 2023 · 0 comments
Labels
enhancement New feature or request optimization

Comments

@Rumata888
Copy link
Contributor

Right now if we were to do a circuit consisting predominantly of RAM interactions with 1 RAM array, each one would cost us around 3.25 gates:

  1. The memory gate itself
  2. Fixing the witness for the timestamp
  3. Sorted memory gate
  4. 0.25 for the range constraint for timestamp delta in the sorted memory gate.

If we delay the creation of memory gates until circuit finalisation, we can get rid of step 2. We'd simply have to add the relation timestamp_omega - timestamp - 1 == 0 into the RAM memory gate and fix the first timestamp to be 0 or 1. This would allow us to jump to 2.25 gates per interaction + 1 fix_witness + 1 waste gate after the memory gates.

@Rumata888 Rumata888 added enhancement New feature or request optimization labels Jun 9, 2023
@Rumata888 Rumata888 self-assigned this Jun 9, 2023
@codygunton codygunton mentioned this issue Mar 6, 2025
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request optimization
Projects
None yet
Development

No branches or pull requests

1 participant