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

Tracking PR for v0.7.0 release #979

Merged
merged 181 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
181 commits
Select commit Hold shift + click to select a range
ecb4811
chore: update crate versions to v0.7.0
bobbinth Jun 29, 2023
0b61d89
refactor(processor): remove the 8 bit segment of the range checker
tohrnii Jun 29, 2023
26744a0
refactor(air): modify the shape of the trace and modify the air const…
tohrnii Jun 29, 2023
927d28f
test: refactor range checker tests based on the new construct
tohrnii Jun 29, 2023
d04275d
feat(docs): update docs to describe the new range checker construct
tohrnii Jun 29, 2023
3aa5dae
refactor: refactor bridge row calculation
tohrnii Jun 30, 2023
48b0330
feat(docs): add range checker image excalidraw
tohrnii Jun 30, 2023
6f30097
stark: compute lde_g earlier and remove tmp0
hackaugusto Jun 30, 2023
ca9a330
Merge pull request #949 from 0xPolygonMiden/tohrnii-rangechecker
tohrnii Jun 30, 2023
844eb7a
stark: save the domain generator to memory
hackaugusto Jun 30, 2023
770d867
Merge pull request #960 from 0xPolygonMiden/hacka-verifier-save-domai…
hackaugusto Jun 30, 2023
3aa346f
chore: update changelog
bobbinth Jul 1, 2023
764e8be
feat: introduce additional methods on the AdviceProvider
frisitano Jun 30, 2023
7cfaaec
Merge pull request #987 from 0xPolygonMiden/frisitano-tx-result
frisitano Jul 4, 2023
7a85dda
refactor: change directory structure for stdlib docs
tohrnii Jul 5, 2023
6f7d07e
Merge pull request #995 from 0xPolygonMiden/tohrnii-nested-docs-direc…
bobbinth Jul 6, 2023
ba4d98c
feat(stdlib): Allow arbitrary length sha256 hashes
bergkvist Jul 7, 2023
a401fa8
feat: add support for docs for re-exported procedures
tohrnii Jul 5, 2023
42f3de5
Merge pull request #994 from 0xPolygonMiden/tohrnii-reexported-docs
tohrnii Jul 7, 2023
3c4c5d6
chore: update changelog
bobbinth Jul 8, 2023
785da42
Used procedures map added to AST
jjcnn Jun 29, 2023
587289f
Merge pull request #986 from 0xPolygonMiden/jjcnn-ast-imported-proced…
jjcnn Jul 11, 2023
69f6ccb
docs: small word fix
hackaugusto Jul 13, 2023
dd1fa01
Merge pull request #1006 from 0xPolygonMiden/hacka-small-word-fix
bobbinth Jul 17, 2023
532fa20
cli: add command to compile libraries
hackaugusto Jul 7, 2023
18a1295
fix: stack depth constraint for syscall operation
bobbinth Jul 17, 2023
09186fd
fix: typos in bundle command
bobbinth Jul 18, 2023
a7c35cc
fix: new clippy errors
bobbinth Jul 18, 2023
9155e63
Merge pull request #997 from 0xPolygonMiden/hacka-cli-compile-library
bobbinth Jul 18, 2023
602d185
Merge pull request #1008 from 0xPolygonMiden/bobbin-fix-syscall-const…
bobbinth Jul 18, 2023
f2d9e8f
Add execution options for processor and prover (#991)
Fumuran Jul 18, 2023
a83d9c5
feat: introduce error handling for StackOutputs constructor
frisitano Jul 18, 2023
e2ac922
Ast formatter
jjcnn Jun 29, 2023
0bc80b0
Merge pull request #1003 from 0xPolygonMiden/jjcnn-ast-pretty-printer
bobbinth Jul 19, 2023
d0e2ba2
chore: updated changelog
bobbinth Jul 20, 2023
4772e2f
Merge pull request #1010 from 0xPolygonMiden/frisitano-stack-outputs-…
bobbinth Jul 20, 2023
a4a1a32
chore: update rustyline dependency to v12.0
bobbinth Jul 20, 2023
b9dfc66
chore: add dependabot.yml
bobbinth Jul 20, 2023
1343f91
refactor: track RpoDigests in CallSet instead of ProcedureIds
bobbinth Jul 20, 2023
18704c1
Merge pull request #1017 from 0xPolygonMiden/bobbin-callset-rpo
bobbinth Jul 21, 2023
6b5c73e
refactor: change procedure cache to track unnamed procedures
bobbinth Jul 20, 2023
fc00e8f
Merge pull request #1018 from 0xPolygonMiden/bobbin-proc-cache
bobbinth Jul 21, 2023
7a3609a
feat: allow the assembler to produce programs with phantom calls
bobbinth Jul 21, 2023
06721cb
Merge pull request #1019 from 0xPolygonMiden/bobbin-phantom-calls
bobbinth Jul 21, 2023
4460662
feat: impl cycle limit and expected memory consumption
Fumuran Jul 4, 2023
0d01aa9
Merge pull request #998 from 0xPolygonMiden/andrew-impl-exec-limit
Fumuran Jul 21, 2023
d9015bd
feat: add support for nested modules
tohrnii Jul 22, 2023
89a918d
remove test
tohrnii Jul 22, 2023
7588767
Merge pull request #992 from 0xPolygonMiden/tohrnii-nested-modules
bobbinth Jul 22, 2023
f15e84e
fix: duplicate mast root diffent proc id
frisitano Jul 24, 2023
579fcf4
Merge pull request #1023 from 0xPolygonMiden/frisitano-dup-mast-fix
bobbinth Jul 24, 2023
2e72879
feat: Modifications to RecordingAdviceProvider to support Transaction…
frisitano Jul 4, 2023
3c90bf4
Merge pull request #1016 from 0xPolygonMiden/frisitano-advice-provide…
frisitano Jul 26, 2023
f9997ef
refactor: replace MerklePathSet with PartialMerkleTree
Fumuran Jun 26, 2023
fd91776
Merge pull request #961 from 0xPolygonMiden/andrew-replace-mps-with-pmt
bobbinth Jul 27, 2023
98aa1cc
feat(stdlib): Add sha256::hash_memory(addr, len)
bergkvist Jul 31, 2023
69a50f1
feat(stdlib): Improve comments in sha256::hash_memory
bergkvist Jul 31, 2023
6c3412f
chore: update std::collections::smt get procedures to work with the l…
bobbinth Aug 2, 2023
a105511
chore: fix clippy issues
bobbinth Aug 3, 2023
bcfaf0a
Merge pull request #1030 from 0xPolygonMiden/bobbin-tsmt-get
bobbinth Aug 3, 2023
31ce97f
feat: implement TraceInfo struct
Fumuran Aug 1, 2023
8b671b5
refactor: add accessor, fix typos
Fumuran Aug 4, 2023
66bb63c
refactor: improve names, constructor, add getters
Fumuran Aug 4, 2023
d6fae84
Implement basic arithmetic on constant values (#1026)
Fumuran Aug 4, 2023
1bd70f4
docs: add paragraph for constant value
Fumuran Aug 4, 2023
d631be4
refacor: add trace_len() for chiplets
Fumuran Aug 4, 2023
ecef2db
Merge pull request #1033 from 0xPolygonMiden/andrew-docs-hotfix
bobbinth Aug 4, 2023
81773ee
Merge pull request #1029 from 0xPolygonMiden/andrew-persist-trace-length
bobbinth Aug 4, 2023
32598b8
feat: add smtinsert advice injector
bobbinth May 22, 2023
eb083f8
feat(air): migrate range checker bus to LogUp
grjte Jul 27, 2023
3c64447
feat(proc): update range checker trace gen main/aux
grjte Jul 28, 2023
5a78583
test(proc): update range checker tests
grjte Jul 28, 2023
382ff12
feat(proc): optimize range checker aux trace generation
grjte Jul 29, 2023
2aaeb40
docs: update changelog for range checker logup migration
grjte Aug 7, 2023
288d02b
Merge pull request #1027 from 0xPolygonMiden/grjte-rc-logup
grjte Aug 7, 2023
a2a3328
feat(stdlib): Change prepare_message_schedule_and_consume from being …
bergkvist Aug 8, 2023
631e663
feat(stdlib): Add test for sha256::hash_memory
bergkvist Aug 8, 2023
8aacf0e
Merge pull request #996 from bergkvist/tobias/sha256
bobbinth Aug 9, 2023
5b3b93b
feat: implementing updates and simple insertions into TSMT
bobbinth Jun 1, 2023
4f1dc0e
feat: implement TSMT complex insertion for 15->32 case
bobbinth Aug 10, 2023
87e7a82
Merge pull request #912 from 0xPolygonMiden/bobbin-smt-insert
bobbinth Aug 10, 2023
e6394b2
Merge pull request #1036 from 0xPolygonMiden/bobbin-tsmt-replace
bobbinth Aug 10, 2023
5cc3327
feat: add support for module aliases
tohrnii Aug 10, 2023
becf35f
Merge pull request #1037 from 0xPolygonMiden/tohrnii-module-aliases
bobbinth Aug 10, 2023
57110fa
fix: error message format
bobbinth Aug 12, 2023
9bcbd24
feat: implement TSMT procedure to handle complex inserts at depth 48
bobbinth Aug 11, 2023
c3d7b4b
refactor: make TSMT replace32 work similarly to replace48
bobbinth Aug 13, 2023
afe6839
Merge pull request #1038 from 0xPolygonMiden/bobbin-smt-complex-insert
bobbinth Aug 15, 2023
7d70762
fix: implement TSMT leaf insertion into advice map
bobbinth Aug 15, 2023
518ed44
Merge pull request #1042 from 0xPolygonMiden/bobbin-tsmt-bugfix
bobbinth Aug 15, 2023
820cb01
migrate to clap
leviathanbeak Aug 16, 2023
51ec1f6
Merge branch 'next' of github.com:0xPolygonMiden/miden-vm into leviat…
leviathanbeak Aug 16, 2023
aa39f20
docs: update with LogUp + range checker changes
grjte Aug 7, 2023
0b04783
Merge pull request #1034 from 0xPolygonMiden/grjte-rc-docs
bobbinth Aug 16, 2023
f67b722
Merge pull request #1044 from leviathanbeak/leviathanbeak/migrate_to_…
bobbinth Aug 16, 2023
e206e44
fix(docs): constraint expression multiplies same term twice
eightfilms Aug 22, 2023
8bc3de6
Merge pull request #1051 from bingcicle/fix-logup-documentation
bobbinth Aug 22, 2023
d6c49ce
fix: clippy changes
bobbinth Aug 28, 2023
c90513e
feat: implement TSMT delete procedures
bobbinth Aug 17, 2023
bdc7109
feat: finish implemented basic TSMT functionality
bobbinth Aug 19, 2023
824e282
refactor(processor): impose limit on the memory address
Fumuran Aug 18, 2023
0d47b0e
Merge pull request #1049 from 0xPolygonMiden/andrew-mem-addr-limit-pr…
Fumuran Aug 29, 2023
5adec34
Merge pull request #1046 from 0xPolygonMiden/bobbin-tsmt-delete
bobbinth Aug 29, 2023
1170394
refactor: rename smtinsert advice injector into smtset
bobbinth Aug 30, 2023
ed012cc
feat: implement adv.push_smtpeek decorator
bobbinth Aug 30, 2023
0aa1ffc
refactor: move smt decorator handlers into stand-alone module
bobbinth Aug 30, 2023
62ece8f
style: print traces lenghts during run and prove
Fumuran Aug 30, 2023
7a05e66
Merge pull request #1058 from 0xPolygonMiden/andrew-print-cycles-cli
bobbinth Aug 30, 2023
3a51a58
Merge pull request #1056 from 0xPolygonMiden/bobbin-tsmt-wrapup
bobbinth Aug 31, 2023
3e6239e
refactor: use EMPTY_WORD, ZERO and ONE
Fumuran Aug 31, 2023
7019d69
Merge pull request #1059 from 0xPolygonMiden/andrew-replace-with-empt…
bobbinth Aug 31, 2023
034630d
assembly: add details about re-export failure
hackaugusto Sep 1, 2023
ad2a5de
Merge pull request #1061 from 0xPolygonMiden/hacka-reexport-proc-erro…
hackaugusto Sep 1, 2023
84c7fba
feat: add elgamal encryption to stdlib with tests
goblinoats Apr 25, 2023
b766dc7
refactor: simplify methods and improve documentation
goblinoats Sep 5, 2023
8e96c3e
Merge pull request #879 from tonk-gg/add-elgamal-to-stdlib
grjte Sep 5, 2023
eea2573
docs: add dyn program block
grjte Aug 23, 2023
c2a8e80
feat: add dyn block
grjte Aug 23, 2023
776873e
test(proc): add dyn node test
grjte Aug 25, 2023
4911edd
test: add test to validate dyn node constant
grjte Sep 6, 2023
1d380e1
Merge pull request #1055 from 0xPolygonMiden/grjte-dyn-block
grjte Sep 6, 2023
95de7ca
docs: add dyn block to operation & flag docs
grjte Sep 6, 2023
23e447e
docs: add dyn to decoder docs
grjte Sep 6, 2023
2e6c250
Merge pull request #1065 from 0xPolygonMiden/grjte-dyn-docs
grjte Sep 7, 2023
62d1c15
docs: fix decoder constraints errors
grjte Sep 7, 2023
557b572
Merge pull request #1067 from 0xPolygonMiden/grjte-dyn-docs-fix
grjte Sep 7, 2023
ce2af47
missing params descriptive error message
saxenism Sep 4, 2023
c3369ed
Merge pull request #1062 from saxenism/descriptive-error-missing-param
bobbinth Sep 8, 2023
4730515
refactor: replace string reference with as_str()
bobbinth Sep 8, 2023
f0dc575
feat: add procedure name to the ImportedProcModuleNotFound error
Fumuran Sep 8, 2023
d544433
Merge pull request #1063 from 0xPolygonMiden/andrew-improve-imported-…
bobbinth Sep 11, 2023
a8b3175
refactor: make ProgramAst parameter for AssemblyContext optional
bobbinth Sep 11, 2023
a29c0b0
Merge pull request #1070 from 0xPolygonMiden/bobbin-asc-constructor
bobbinth Sep 12, 2023
319334d
fix: typo in example command name
bobbinth Sep 12, 2023
11e2554
feat: implement basic Debug decorator
bobbinth Sep 10, 2023
4075c09
Merge pull request #1069 from 0xPolygonMiden/bobbin-debug-decorator
bobbinth Sep 14, 2023
cbe384b
feat: add error code to assert operation
bobbinth Sep 18, 2023
7885f42
feat: implement parsing of assert instructions with error codes
bobbinth Sep 18, 2023
2649494
docs: added documentation for custom assert error codes
bobbinth Sep 18, 2023
e2e604e
Merge pull request #1075 from 0xPolygonMiden/bobbin-assert-err
bobbinth Sep 22, 2023
7548541
feat: support PMT in the .input file
Fumuran Sep 13, 2023
9fba0ce
Merge pull request #1072 from 0xPolygonMiden/andrew-support-pmt-via-c…
Fumuran Sep 25, 2023
1347746
feat: parse long hex strings in litte-endian
Fumuran Sep 20, 2023
b3a5d3f
Merge pull request #1076 from 0xPolygonMiden/andrew-make-push-le
Fumuran Oct 2, 2023
2d90faf
fix: fix the merkle store example
Fumuran Oct 3, 2023
ea2b6f6
feat: implement error codes for u32assert instructions
Fumuran Sep 29, 2023
c711d08
Merge pull request #1081 from 0xPolygonMiden/andrew-refactor-assert
Fumuran Oct 3, 2023
3c6c540
Merge pull request #1086 from 0xPolygonMiden/andrew-fix-merkle-store-…
bobbinth Oct 3, 2023
79f944c
feat(asm): add dynexec assembly instruction
grjte Sep 27, 2023
12c09a0
test: add simple assembly and integration tests for dynexec instr
grjte Sep 27, 2023
dcf42ec
docs: add dynexec to the user docs
grjte Sep 27, 2023
a68a28a
feat(asm): add dyncall assembly instruction
grjte Sep 28, 2023
406acfb
test: add simple assembly and integration tests for dyncall instr
grjte Sep 28, 2023
d1432d1
docs: add dyncall to the user docs
grjte Oct 3, 2023
8ff713f
docs: minor changes in dynamic proc invocation docs
bobbinth Oct 4, 2023
48b0eb0
Merge pull request #1078 from 0xPolygonMiden/grjte-asm-dynexec
bobbinth Oct 4, 2023
2cc5d95
feat: Falcon verification in MASM
Al-Kindi-0 Oct 4, 2023
71091b7
fix: assert2 errors and minor refactoring
bobbinth Oct 5, 2023
5c57495
Merge pull request #1000 from 0xPolygonMiden/al-falcon
bobbinth Oct 5, 2023
b3e8967
feat: Falcon DSA decorator
Al-Kindi-0 Oct 5, 2023
e3834b3
chore: minor nits plus simplifications
Al-Kindi-0 Oct 6, 2023
f2d092f
chore: rustfmt fix
Al-Kindi-0 Oct 6, 2023
031aca2
chore: minor nits
Al-Kindi-0 Oct 6, 2023
22aab19
fix: signature in no_std context
bobbinth Oct 6, 2023
73d9334
Merge pull request #1094 from 0xPolygonMiden/al-decorator-falcon-ver2
bobbinth Oct 6, 2023
b5aea22
feat: compile module without path
Fumuran Sep 27, 2023
821beae
Merge pull request #1079 from 0xPolygonMiden/andrew-compile-modules-w…
Fumuran Oct 6, 2023
1efc2c0
feat: introduce Host object
frisitano Sep 26, 2023
fb47d83
Merge pull request #1082 from 0xPolygonMiden/frisitano-host-refactor
frisitano Oct 10, 2023
40b6085
feat: add graviton compilation target
bobbinth Oct 3, 2023
418a8ad
chore: update dependency versions
bobbinth Oct 6, 2023
6d8cb96
feat: add into_inner() method to DefaultHost
bobbinth Oct 10, 2023
b5eb79a
chore: set crypto dependency to crate version
bobbinth Oct 9, 2023
082affc
Merge pull request #1084 from 0xPolygonMiden/bobbin-graviton
bobbinth Oct 10, 2023
bf4dbdf
refactor: improve analyze tool
Fumuran Oct 9, 2023
85b6c80
Merge pull request #1099 from 0xPolygonMiden/andrew-improve-analyze
bobbinth Oct 10, 2023
b58bf35
feat: writing ProgramAst to files
Dominik1999 Oct 11, 2023
1be3caa
docs: update readmes and docs for v0.7 release
bobbinth Oct 11, 2023
cf698d6
Merge pull request #1101 from 0xPolygonMiden/bobbin-v0.7-release-prep
bobbinth Oct 11, 2023
c63d9cc
feat: add serialization of masb files to the CLI
bobbinth Oct 11, 2023
7e65588
Merge pull request #1102 from 0xPolygonMiden/dominik_serialize_progra…
bobbinth Oct 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "weekly"
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
# Changelog

## 0.7.0 (2023-10-11)

#### Assembly
- Added ability to attach doc comments to re-exported procedures (#994).
- Added support for nested modules (#992).
- Added support for the arithmetic expressions in constant values (#1026).
- Added support for module aliases (#1037).
- Added `adv.insert_hperm` decorator (#1042).
- Added `adv.push_smtpeek` decorator (#1056).
- Added `debug` decorator (#1069).
- Refactored `push` instruction so now it parses long hex string in little-endian (#1076).

#### CLI
- Implemented ability to output compiled `.masb` files to disk (#1102).

#### VM Internals
- Simplified range checker and removed 1 main and 1 auxiliary trace column (#949).
- Migrated range checker lookups to use LogUp and reduced the number of trace columns to 2 main and
1 auxiliary (#1027).
- Added `get_mapped_values()` and `get_store_subset()` methods to the `AdviceProvider` trait (#987).
- [BREAKING] Added options to specify maximum number of cycles and expected number of cycles for a program (#998).
- Improved handling of invalid/incomplete parameters in `StackOutputs` constructors (#1010).
- Allowed the assembler to produce programs with "phantom" calls (#1019).
- Added `TraceLenSummary` struct which holds information about traces lengths to the `ExecutionTrace` (#1029).
- Imposed the 2^32 limit for the memory addresses used in the memory chiplet (#1049).
- Supported `PartialMerkleTree` as a secret input in `.input` file (#1072).
- [BREAKING] Refactored `AdviceProvider` interface into [Host] interface (#1082).

#### Stdlib
- Completed `std::collections::smt` module by implementing `insert` and `set` procedures (#1036, #1038, #1046).
- Added new module `std::crypto::dsa::rpo_falcon512` to support Falcon signature verification (#1000, #1094)

## 0.6.1 (2023-06-29)

- Fixed `no-std` compilation for `miden-core`, `miden-assembly`, and `miden-processor` crates.
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FEATURES_INTERNALS=--features internals
FEATURES_CONCURRENT_EXEC=--features concurrent,executable
FEATURES_GRAVITON_EXEC=--features concurrent,executable,sve
FEATURES_METAL_EXEC=--features concurrent,executable,metal
PROFILE_OPTIMIZED=--profile optimized
PROFILE_TEST=--profile test-release
Expand All @@ -13,5 +14,8 @@ exec:
exec-metal:
cargo build $(PROFILE_OPTIMIZED) $(FEATURES_METAL_EXEC)

exec-graviton:
RUSTFLAGS="-C target-cpu=native" cargo build $(PROFILE_OPTIMIZED) $(FEATURES_GRAVITON_EXEC)

test:
cargo test $(PROFILE_TEST) $(FEATURES_INTERNALS)
61 changes: 39 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Miden VM is a zero-knowledge virtual machine written in Rust. For any program ex
* If you'd like to learn more about STARKs, check out the [references](#references) section.

### Status and features
Miden VM is currently on release v0.6. In this release, most of the core features of the VM have been stabilized, and most of the STARK proof generation has been implemented. While we expect to keep making changes to the VM internals, the external interfaces should remain relatively stable, and we will do our best to minimize the amount of breaking changes going forward.
Miden VM is currently on release v0.7. In this release, most of the core features of the VM have been stabilized, and most of the STARK proof generation has been implemented. While we expect to keep making changes to the VM internals, the external interfaces should remain relatively stable, and we will do our best to minimize the amount of breaking changes going forward.

The next version of the VM is being developed in the [next](https://github.com/0xPolygonMiden/miden-vm/tree/next) branch. There is also a documentation for the latest features and changes in the next branch [documentation next branch](https://0xpolygonmiden.github.io/miden-vm/intro/main.html).

Expand All @@ -31,7 +31,7 @@ Miden VM is a fully-featured virtual machine. Despite being optimized for zero-k
* **Cryptographic operations.** Miden assembly provides built-in instructions for computing hashes and verifying Merkle paths. These instructions use the Rescue Prime Optimized hash function (which is the native hash function of the VM).
* **External libraries.** Miden VM supports compiling programs against pre-defined libraries. The VM ships with one such library: Miden `stdlib` which adds support for such things as 64-bit unsigned integers. Developers can build other similar libraries to extend the VM's functionality in ways which fit their use cases.
* **Nondeterminism**. Unlike traditional virtual machines, Miden VM supports nondeterministic programming. This means a prover may do additional work outside of the VM and then provide execution *hints* to the VM. These hints can be used to dramatically speed up certain types of computations, as well as to supply secret inputs to the VM.
* **Custom advice providers.** Miden VM can be instantiated with user-defined advice providers. These advice providers are used to supply external data to the VM during execution/proof generation (via nondeterministic inputs) and can connect the VM to arbitrary data sources (e.g., a database or RPC calls).
* **Customizable hosts.** Miden VM can be instantiated with user-defined hosts. These hosts are used to supply external data to the VM during execution/proof generation (via nondeterministic inputs) and can connect the VM to arbitrary data sources (e.g., a database or RPC calls).

#### Planned features
In the coming months we plan to finalize the design of the VM and implement support for the following features:
Expand Down Expand Up @@ -78,41 +78,58 @@ A few general notes on performance:
* Both proof generation and proof verification times are greatly influenced by the hash function used in the STARK protocol. In the benchmarks below, we use BLAKE3, which is a really fast hash function.

### Single-core prover performance
When executed on a single CPU core, the current version of Miden VM operates at around 10 - 15 KHz. In the benchmarks below, the VM executes a [Fibonacci calculator](miden/README.md#fibonacci-calculator) program on Apple M1 Pro CPU in a single thread. The generated proofs have a target security level of 96 bits.
When executed on a single CPU core, the current version of Miden VM operates at around 20 - 25 KHz. In the benchmarks below, the VM executes a [Fibonacci calculator](miden/README.md#fibonacci-calculator) program on Apple M1 Pro CPU in a single thread. The generated proofs have a target security level of 96 bits.

| VM cycles | Execution time | Proving time | RAM consumed | Proof size |
| :-------------: | :------------: | :----------: | :-----------: | :--------: |
| 2<sup>10</sup> | 1 ms | 80 ms | 20 MB | 47 KB |
| 2<sup>12</sup> | 2 ms | 260 ms | 52 MB | 57 KB |
| 2<sup>14</sup> | 8 ms | 0.9 sec | 240 MB | 66 KB |
| 2<sup>16</sup> | 28 ms | 4.6 sec | 950 MB | 77 KB |
| 2<sup>18</sup> | 85 ms | 15.5 sec | 3.7 GB | 89 KB |
| 2<sup>20</sup> | 310 ms | 67 sec | 14 GB | 100 KB |
| 2<sup>10</sup> | 1 ms | 60 ms | 20 MB | 46 KB |
| 2<sup>12</sup> | 2 ms | 180 ms | 52 MB | 56 KB |
| 2<sup>14</sup> | 8 ms | 680 ms | 240 MB | 65 KB |
| 2<sup>16</sup> | 28 ms | 2.7 sec | 950 MB | 75 KB |
| 2<sup>18</sup> | 81 ms | 11.4 sec | 3.7 GB | 87 KB |
| 2<sup>20</sup> | 310 ms | 47.5 sec | 14 GB | 100 KB |

As can be seen from the above, proving time roughly doubles with every doubling in the number of cycles, but proof size grows much slower.

We can also generate proofs at a higher security level. The cost of doing so is roughly doubling of proving time and roughly 40% increase in proof size. In the benchmarks below, the same Fibonacci calculator program was executed on Apple M1 Pro CPU at 128-bit target security level:

| VM cycles | Execution time | Proving time | RAM consumed | Proof size |
| :-------------: | :------------: | :----------: | :-----------: | :--------: |
| 2<sup>10</sup> | 1 ms | 300 ms | 30 MB | 61 KB |
| 2<sup>12</sup> | 2 ms | 590 ms | 106 MB | 78 KB |
| 2<sup>14</sup> | 8 ms | 1.7 sec | 500 MB | 91 KB |
| 2<sup>16</sup> | 28 ms | 6.7 sec | 2.0 GB | 106 KB |
| 2<sup>18</sup> | 85 ms | 27.5 sec | 8.0 GB | 122 KB |
| 2<sup>20</sup> | 310 ms | 126 sec | 24.0 GB | 138 KB |
| 2<sup>10</sup> | 1 ms | 120 ms | 30 MB | 61 KB |
| 2<sup>12</sup> | 2 ms | 460 ms | 106 MB | 77 KB |
| 2<sup>14</sup> | 8 ms | 1.4 sec | 500 MB | 90 KB |
| 2<sup>16</sup> | 27 ms | 4.9 sec | 2.0 GB | 103 KB |
| 2<sup>18</sup> | 81 ms | 20.1 sec | 8.0 GB | 121 KB |
| 2<sup>20</sup> | 310 ms | 90.3 sec | 20.0 GB | 138 KB |

### Multi-core prover performance
STARK proof generation is massively parallelizable. Thus, by taking advantage of multiple CPU cores we can dramatically reduce proof generation time. For example, when executed on an 8-core CPU (Apple M1 Pro), the current version of Miden VM operates at around 100 KHz. And when executed on a 64-core CPU (Amazon Graviton 3), the VM operates at around 250 KHz.
STARK proof generation is massively parallelizable. Thus, by taking advantage of multiple CPU cores we can dramatically reduce proof generation time. For example, when executed on an 8-core CPU (Apple M1 Pro), the current version of Miden VM operates at around 140 KHz. And when executed on a 64-core CPU (Amazon Graviton 3), the VM operates at around 250 KHz.

In the benchmarks below, the VM executes the same Fibonacci calculator program for 2<sup>20</sup> cycles at 96-bit target security level:

| Machine | Execution time | Proving time | Execution % |
| ------------------------------ | :------------: | :----------: | :---------: |
| Apple M1 Pro (8 threads) | 310 ms | 9.8 sec | 3.1% |
| Apple M2 Max (16 threads) | 290 ms | 7.7 sec | 3.6% |
| AMD Ryzen 9 5950X (16 threads) | 270 ms | 10.7 sec | 2.6% |
| Amazon Graviton 3 (64 threads) | 330 ms | 3.7 sec | 9.0% |
| Machine | Execution time | Proving time | Execution % | Implied Frequency |
| ------------------------------ | :------------: | :----------: | :---------: | :---------------: |
| Apple M1 Pro (16 threads) | 310 ms | 7.0 sec | 4.2% | 140 KHz |
| Apple M2 Max (16 threads) | 280 ms | 5.8 sec | 4.5% | 170 KHz |
| AMD Ryzen 9 5950X (16 threads) | 270 ms | 10.0 sec | 2.6% | 100 KHz |
| Amazon Graviton 3 (64 threads) | 330 ms | 3.6 sec | 8.5% | 265 KHz |

### Recursive proofs
Proofs in the above benchmarks are generated using BLAKE3 hash function. While this hash function is very fast, it is not very efficient to execute in Miden VM. Thus, proofs generated using BLAKE3 are not well-suited for recursive proof verification. To support efficient recursive proofs, we need to use an arithmetization-friendly hash function. Miden VM natively supports Rescue Prime Optimized (RPO), which is one such hash function. One of the downsides of arithmetization-friendly hash functions is that they are considerably slower than regular hash functions.

In the benchmarks below we execute the same Fibonacci calculator program for 2<sup>20</sup> cycles at 96-bit target security level using RPO hash function instead of BLAKE3:

| Machine | Execution time | Proving time | Proving time (HW) |
| ------------------------------ | :------------: | :----------: | :---------------: |
| Apple M1 Pro (16 threads) | 310 ms | 94.3 sec | 42.0 sec |
| Apple M2 Max (16 threads) | 280 ms | 75.1 sec | 20.9 sec |
| AMD Ryzen 9 5950X (16 threads) | 270 ms | 59.3 sec | |
| Amazon Graviton 3 (64 threads) | 330 ms | 21.7 sec | 14.9 sec |

In the above, proof generation on some platforms can be hardware-accelerated. Specifically:

* On Apple M1/M2 platforms the built-in GPU is used for a part of proof generation process.
* On the Graviton platform, SVE vector extension is used to accelerate RPO computations.

## References
Proofs of execution generated by Miden VM are based on STARKs. A STARK is a novel proof-of-computation scheme that allows you to create an efficiently verifiable proof that a computation was executed correctly. The scheme was developed by Eli Ben-Sasson, Michael Riabzev et al. at Technion - Israel Institute of Technology. STARKs do not require an initial trusted setup, and rely on very few cryptographic assumptions.
Expand Down
8 changes: 4 additions & 4 deletions air/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "miden-air"
version = "0.6.0"
version = "0.7.0"
description = "Algebraic intermediate representation of Miden VM processor"
authors = ["miden contributors"]
readme = "README.md"
Expand All @@ -9,7 +9,7 @@ repository = "https://github.com/0xPolygonMiden/miden-vm"
categories = ["cryptography", "no-std"]
keywords = ["air", "arithmetization", "crypto", "miden"]
edition = "2021"
rust-version = "1.67"
rust-version = "1.73"

[lib]
bench = false
Expand All @@ -28,10 +28,10 @@ default = ["std"]
std = ["vm-core/std", "winter-air/std"]

[dependencies]
vm-core = { package = "miden-core", path = "../core", version = "0.6", default-features = false }
vm-core = { package = "miden-core", path = "../core", version = "0.7", default-features = false }
winter-air = { package = "winter-air", version = "0.6", default-features = false }

[dev-dependencies]
criterion = "0.5"
proptest = "1.1"
proptest = "1.3"
rand-utils = { package = "winter-rand-utils", version = "0.6" }
4 changes: 2 additions & 2 deletions air/benches/enforce_stack_constraint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use miden_air::{
Felt, FieldElement,
};
use std::time::Duration;
use vm_core::Operation;
use vm_core::{Operation, ZERO};

fn enforce_stack_constraint(c: &mut Criterion) {
let mut group = c.benchmark_group("enforce_stack_constraint");
Expand All @@ -27,7 +27,7 @@ fn enforce_stack_constraint(c: &mut Criterion) {
frame.current_mut()[STACK_TRACE_OFFSET] = Felt::new(89u64);
frame.next_mut()[STACK_TRACE_OFFSET] = Felt::new(89u64).inv();

let mut result = [Felt::ZERO; NUM_CONSTRAINTS];
let mut result = [ZERO; NUM_CONSTRAINTS];

let frame = generate_evaluation_frame(36);
bench.iter(|| {
Expand Down
31 changes: 7 additions & 24 deletions air/src/constraints/chiplets/bitwise/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use crate::{
BITWISE_OUTPUT_COL_IDX, BITWISE_PREV_OUTPUT_COL_IDX, BITWISE_SELECTOR_COL_IDX,
},
utils::{are_equal, binary_not, is_binary, is_zero, EvaluationResult},
ONE, ZERO,
};
use winter_air::TransitionConstraintDegree;

Expand Down Expand Up @@ -413,27 +414,9 @@ pub fn agg_bits<E: FieldElement>(row: &[E], start_idx: usize) -> E {

// CYCLE MASKS
// ================================================================================================
pub const BITWISE_K0_MASK: [Felt; OP_CYCLE_LEN] = [
Felt::ONE,
Felt::ZERO,
Felt::ZERO,
Felt::ZERO,
Felt::ZERO,
Felt::ZERO,
Felt::ZERO,
Felt::ZERO,
];

pub const BITWISE_K1_MASK: [Felt; OP_CYCLE_LEN] = [
Felt::ONE,
Felt::ONE,
Felt::ONE,
Felt::ONE,
Felt::ONE,
Felt::ONE,
Felt::ONE,
Felt::ZERO,
];
pub const BITWISE_K0_MASK: [Felt; OP_CYCLE_LEN] = [ONE, ZERO, ZERO, ZERO, ZERO, ZERO, ZERO, ZERO];

pub const BITWISE_K1_MASK: [Felt; OP_CYCLE_LEN] = [ONE, ONE, ONE, ONE, ONE, ONE, ONE, ZERO];

// TEST HELPERS
// ================================================================================================
Expand All @@ -442,8 +425,8 @@ pub const BITWISE_K1_MASK: [Felt; OP_CYCLE_LEN] = [
#[cfg(test)]
fn get_periodic_values(cycle_row: usize) -> [Felt; 2] {
match cycle_row {
0 => [Felt::ONE, Felt::ONE],
8 => [Felt::ZERO, Felt::ZERO],
_ => [Felt::ZERO, Felt::ONE],
0 => [ONE, ONE],
8 => [ZERO, ZERO],
_ => [ZERO, ONE],
}
}
Loading
Loading