You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Virtual Machine is half way there in terms of features, but there is still a long way to go to achieve production quality.
Stage I: MVP (Completed)
The first stage we do the minimal features required by a VM to work with basic programs:
Implement a Basic Instruction Loop (assert equal, jump, ap+=call and ret)
Implement the Write Once Memory System.
Write a basic Cairo Zero Runner, enough to run a basic program.
Implement Proof Mode and compare traces with another production tested VM (using the Python VM currently, but we can switch)
Stage II: Cairo Zero (In Progress)
During this stage we aim to give full compatibility to Cairo Zero. Our VM targets latest version of the compiler but because it Cairo Zero and CASM are very similar is easier to test the former (no intermediate language during compilation).
This is probably the bigger Stage of them all due to the sheer amount of Hints to implement as well as a several Builtins. Part of the Hints and all of the Builtins implemented are going to be used in the following stages.
To mark this stage as completed the following list should be implemented with unit tests and integration tests. Adding benchmarks here will be a very nice to have because it would give us a nice baseline on how the implementation is performing.
Prepare the VM to for the easy addition of hints and builtins:
Update the VM to receive a hintrunner and execute hints accordingly
Make segments to perform differently depending if they are a builtin segment or not.
Make a full featured Cairo Zero runner (hints and builtin detection)
Add unit and integration tests for all of this features.
Add benchmarks (strongly suggested, but optional)
When completed we can make a v0.1 release.
Stage III: Cairo (In Progress)
This stage can only be completed once Stage II is complete. The main blocker on this part of development is that at the moment of writing there is no support for the current Cairo compiler for tools outside of Rust.
Most of the tools that make use of the Compiler or Scarb are written in Rust using those tools internal APIs. It doesn't exist a good way of representing a Cairo Program or Sierra Program in a json format. Note here that I am referring to Cairo files and not Starknet contracts since this issue doesn't exist there.
After discussing with Starkware, it was decided that this was going to be implemented at Scarb, there is already an issue created for this here.
Make a full fledged Cairo 1 Runner (point 3 should be completed first)
As usual, this stage should include thorough unit testing and integration tests. When completed it could be a v0.2 release.
Stage IV: Starknet
This is the final stage that will include features for the VM. Here we will implement Starknet only hints and builtins. This stage is too long in to the future to have an accurate description but it should be the same as the previous ones.
The only thing that need to be investigated is how system calls like deploy, storage write and read etc. will interact with the VM and if current structure should be modified. Perhaps is better to this investigation sooner rather than later.
The final stage of development. Here we will keep the VM up to date fixing any possible bugs and using the Benchmark tests written in the previous stages (if not, they should be written here) to optimize execution. Also, make the required updates as the tooling improves/changes over time.
Optimization Ideas
Separate sub section to write possible optimizations to add to the VM:
Execute Hints Asynchronously: An instruction in Cairo can have a Hint appended to it or not. If it has, then:
The hint is executed
The instruction is decoded
The instruction is executed
There is a possibility for steps (i) and (ii) to be performed at the same time using Go channels. This can improve performance or not but it is an idea worth checking.
The text was updated successfully, but these errors were encountered:
Roadmap
The Virtual Machine is half way there in terms of features, but there is still a long way to go to achieve production quality.
Stage I: MVP (Completed)
The first stage we do the minimal features required by a VM to work with basic programs:
assert equal
,jump
,ap+=
call
andret
)Stage II: Cairo Zero (In Progress)
During this stage we aim to give full compatibility to Cairo Zero. Our VM targets latest version of the compiler but because it Cairo Zero and CASM are very similar is easier to test the former (no intermediate language during compilation).
This is probably the bigger Stage of them all due to the sheer amount of Hints to implement as well as a several Builtins. Part of the Hints and all of the Builtins implemented are going to be used in the following stages.
To mark this stage as completed the following list should be implemented with unit tests and integration tests. Adding benchmarks here will be a very nice to have because it would give us a nice baseline on how the implementation is performing.
When completed we can make a v0.1 release.
Stage III: Cairo (In Progress)
This stage can only be completed once Stage II is complete. The main blocker on this part of development is that at the moment of writing there is no support for the current Cairo compiler for tools outside of Rust.
Most of the tools that make use of the Compiler or Scarb are written in Rust using those tools internal APIs. It doesn't exist a good way of representing a Cairo Program or Sierra Program in a json format. Note here that I am referring to Cairo files and not Starknet contracts since this issue doesn't exist there.
After discussing with Starkware, it was decided that this was going to be implemented at Scarb, there is already an issue created for this here.
To mark this stage as completed:
As usual, this stage should include thorough unit testing and integration tests. When completed it could be a v0.2 release.
Stage IV: Starknet
This is the final stage that will include features for the VM. Here we will implement Starknet only hints and builtins. This stage is too long in to the future to have an accurate description but it should be the same as the previous ones.
The only thing that need to be investigated is how system calls like
deploy
,storage write
andread
etc. will interact with the VM and if current structure should be modified. Perhaps is better to this investigation sooner rather than later.To mark this task as completed:
This can be the v0.3 release of the VM.
Stage V: Optimization & Maintenance
The final stage of development. Here we will keep the VM up to date fixing any possible bugs and using the Benchmark tests written in the previous stages (if not, they should be written here) to optimize execution. Also, make the required updates as the tooling improves/changes over time.
Optimization Ideas
Separate sub section to write possible optimizations to add to the VM:
There is a possibility for steps (i) and (ii) to be performed at the same time using Go channels. This can improve performance or not but it is an idea worth checking.
The text was updated successfully, but these errors were encountered: