When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change. Please note we have a code of conduct, please follow it in all your interactions with the project.
[?] Proceed to describe how to setup local development environment. e.g:
To set up a development environment, please follow these steps:
-
Clone the repo
git clone https://github.com/starkware-libs/cairo
-
Download and install VSCode.
-
Follow instructions in vscode-cairo.
The rustfmt
configuration used by cairo requires a nightly version of Rust.
You can install the nightly version by running.
rustup install nightly-2023-07-05
If you have a lot of failing tests when running
cargo test
and those are due to file diff not being correct, there is a way to automatically fix it.
Run the tests again, with the CAIRO_FIX_TESTS
environment variable set to 1
:
CAIRO_FIX_TESTS=1 cargo test
Some tests should now be fixed.
You've found a bug in the source code, a mistake in the documentation or maybe you'd like a new feature? Take a look at GitHub Discussions to see if it's already being discussed. You can help us by submitting an issue on GitHub. Before you create an issue, make sure to search the issue archive -- your issue may have already been addressed!
Please try to create bug reports that are:
- Reproducible. Include steps to reproduce the problem.
- Specific. Include as much detail as possible: which version, what environment, etc.
- Unique. Do not duplicate existing opened issues.
- Scoped to a Single Bug. One bug per report.
Even better: Submit a pull request with a fix or new feature!
- Search our repository for open or closed Pull Requests that relate to your submission. You don't want to duplicate effort.
- Fork the project
- Create your feature branch (
git checkout -b feat/amazing_feature
) - Implement your feature
- Run the code formatter for Rust and Cairo (
scripts/rust_fmt.sh && scripts/cairo_fmt.sh
) - Commit your changes (
git commit -m 'feat: Add amazing_feature'
) - Push to the branch (
git push origin feat/amazing_feature
) - Open a Pull Request to one of the following
branches:
- main - If the change does not break any existing Cairo code (Cairo backward-compatible), and does not affect Sierra to CASM compilation.
- cairo-major-update - If the change breaks existing high level code (Cairo non-backward-compatible), and does not affect Sierra to CASM compilation.
- sierra-minor-update - If Sierra to CASM compilation changed in a backward-compatible manner - meaning existing Sierra code will compile to the same CASM. For example, addition of a new libfunc.
- sierra-major-update - If Sierra to CASM compilation changed in a non-backward-compatible manner - meaning existing Sierra code will compile to different CASM. For example, editing the CASM implementation of a an existing libfunc. This may also include no longer accepting some old Sierra code.