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

Rewrite with support for zk-AluVM #128

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open

Rewrite with support for zk-AluVM #128

wants to merge 8 commits into from

Conversation

dr-orlovsky
Copy link
Member

@dr-orlovsky dr-orlovsky commented Oct 20, 2024

This re-writes the entire codebase of AluVM with two main goals:

  • Remove sheer complexity of the code and ensure all pieces of business logic are as small and compact as possible, easy to unit-test, audit and document; reduce instruction set to the initial minimum possible.
  • Create zk-STARK-compatible zk-AluVM version of the VM, activated with just a feature flag.

zk-AluVM design

  1. ALU128 base ISA which contains just:
    • only A8-A128 registers;
    • control flow instructions;
    • EQ instruction (and no LE/LT/GE/GT);
    • data instructions: put a value into a register, clear value, test value, copy move and swap values between registers; all these ops are compatible with values being field elements;
    • no bit logic instructions.
  2. GFA ISA extension:
    • adds fp read-only register contanining the used field order;
    • adds field_order to the CoreConfig with which AluVM core is initialized;
    • treats all A8-A128 registers as field elements;
    • adds arithmetic ops over finite field; if a register has a value which doesn't fit it the operation sould fail.
  3. zk-aluvm feature flag which allows only zk-STARK-compatible ISA and ISA extension: ALU128 and GFA.

@dr-orlovsky dr-orlovsky added this to the v0.12.0 milestone Oct 20, 2024
@dr-orlovsky dr-orlovsky self-assigned this Oct 20, 2024
@dr-orlovsky dr-orlovsky changed the title Complete rewrite Rewrite with support for zk-AluVM Oct 22, 2024
@dr-orlovsky dr-orlovsky added *security* Issues affecting safety/security (include undefined behaviours) *consensus* Issues affecting distributed concensus refactoring Refactoring of the existing code test Test implementation or failures breaking Breaking API changes labels Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Breaking API changes *consensus* Issues affecting distributed concensus refactoring Refactoring of the existing code *security* Issues affecting safety/security (include undefined behaviours) test Test implementation or failures
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant