Skip to content

Latest commit

 

History

History
161 lines (122 loc) · 5.75 KB

CONTRIBUTING.md

File metadata and controls

161 lines (122 loc) · 5.75 KB

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, before making a change. Please note we have a code of conduct, please follow it in all your interactions with the project.

Contributing guidelines

Kakarot is an open-source project and we welcome contributions of all kinds. However, we ask that you follow these guidelines when contributing:

  • If you have an idea for a new feature or a bug fix, please create an issue first. This will allow us to discuss the idea and provide feedback before you start working on it.
  • If you are working on an issue, please ask to be assigned. This will help us keep track of who is working on what and avoid duplicated work.
  • Do not ask to be assigned to an issue if you are not planning to work on it immediately. We want to keep the project backlog clean and organized. If you are interested in working on an issue, please comment on the issue and we will assign it to you. We will remove the assignment if you do not start working on the issue within 2 days. You can, of course, submit a draft PR if you need more time or have questions regarding the issue.
  • Prefer rebasing over merging when updating your PR. This will keep the commit history clean and make it easier to review your changes.
  • Adopt conventional commit messages. This will help us when reviewing your PR.

Prerequisites

To get started on Kakarot, you'll need python3.10, as well as Starknet-related libraries, e.g. cairo-lang.

  • Install pyenv to manage your Python versions (and don't forget to setup your shell)

  • Download the Python version used for Kakarot using pyenv: pyenv install 3.10

  • Install poetry

  • Install cargo to manage our Rust dependencies

  • Install docker to build some experimental solidity contracts that require a custom solc compiler

  • Install foundry to compile the Solidity contracts we use for testing.

  • Install scarb using asdf to the Cairo contracts we use as dependencies. As these dependencies rely on different versions of Cairo, you will need to install the following versions of Scarb:

    asdf install scarb 0.7.0
    asdf install scarb 2.6.5
  • Install Go to profile tests using pprof

  • Install the two VSCode extensions for Cairo:

Setting up the environment

To set up a development environment, please follow these steps:

  1. Clone the repo and navigate to it

    git clone https://github.com/kkrt-labs/kakarot && cd kakarot
  2. Create and activate a virtual environment specifically for your Python project by running poetry shell.

  3. Install dependencies

    make setup
  4. Install katana

    make install-katana
  5. Build the Solidity contracts

    make build-sol
  6. Copy the default environment variables

    cp .env.example .env
  7. Start a local katana instance

    make run-katana
  8. Run tests

    make test

Common caveats:

  • You will need to symlink starknet-compile-deprecated (new name of the starknet-compile binary) to starknet-compile in order to make the CairoLS VSCode extension work.

    ln -s <YOUR_PATH_TO_YOUR_PYTHON_VENV_BINARIES>/starknet-compile-deprecated <YOUR_PATH_TO_LOCAL_BINARIES>/starknet-compile
    # example: ln -s /Users/eliastazartes/code/kakarot/.venv/bin/starknet-compile-deprecated /usr/local/bin/starknet-compile

    If you followed the instructions above, you can run poetry show cairo-lang -v to find the path to your cairo-lang dependency, and the binaries should be in the bin directory.

  • Mac M1 chips are subject to some quirks/bugs with regards to some cryptographic libraries used by cairo-lang.

Issues and feature requests

You've found a bug in the source code, a mistake in the documentation or maybe you'd like a new feature? 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!

How to submit a Pull Request

  1. Search our repository for open or closed Pull Requests that relate to your submission. You don't want to duplicate effort.
  2. Fork the project
  3. Create your feature branch (git checkout -b feat/amazing_feature)
  4. Add, then commit your changes (git commit -m 'feat: add amazing_feature')
  5. Push to the branch (git push origin feat/amazing_feature)
  6. Open a Pull Request