-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/fact_registry_bootloader
- Loading branch information
Showing
57 changed files
with
8,041 additions
and
5,581 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Continuous Integration - proof verification tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
verify-proof: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
layout: ["dex", "recursive", "recursive_with_poseidon", "small", "starknet"] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Scarb | ||
uses: software-mansion/setup-scarb@v1 | ||
|
||
- name: Setup Rust toolchain | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Configure layout | ||
run: python configure.py -l ${{ matrix.layout }} -s keccak | ||
|
||
- name: Build project | ||
run: scarb build | ||
|
||
- name: Test project | ||
run: scarb test | ||
|
||
- name: Run verification | ||
run: cargo run --release --bin runner -- target/dev/cairo_verifier.sierra.json < examples/proofs/${{ matrix.layout }}/example_proof.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Continuous Integration - tests | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
formatting-and-testing: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Scarb | ||
uses: software-mansion/setup-scarb@v1 | ||
|
||
- name: Format code | ||
run: scarb fmt --check | ||
|
||
- name: Run tests | ||
run: scarb test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
scarb 2.6.0 | ||
scarb nightly-2024-03-16 | ||
starknet-foundry 0.20.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import argparse | ||
import sys | ||
import inquirer | ||
from pathlib import Path | ||
from utils import process_file | ||
|
||
LAYOUT_TYPES = ("dex", "recursive", "recursive_with_poseidon", "small", "starknet") | ||
HASH_TYPES = ("keccak", "blake2s") | ||
|
||
|
||
def select_types() -> str: | ||
"""Prompts the user to select a type.""" | ||
questions = [ | ||
inquirer.List("layout_type", message="Select layout", choices=LAYOUT_TYPES), | ||
inquirer.List("hash_type", message="Select hash", choices=HASH_TYPES), | ||
] | ||
answers = inquirer.prompt(questions) | ||
return (answers["layout_type"], answers["hash_type"]) | ||
|
||
|
||
def main(layout_type=None, hash_type=None): | ||
"""Main function for processing files.""" | ||
if layout_type is None or hash_type is None: | ||
layout_type, hash_type = select_types() | ||
|
||
if layout_type.lower() not in LAYOUT_TYPES: | ||
print(f"Invalid layout type: {layout_type}") | ||
sys.exit(1) | ||
|
||
if hash_type.lower() not in HASH_TYPES: | ||
print(f"Invalid hash type: {hash_type}") | ||
sys.exit(1) | ||
|
||
current_directory = Path("src") | ||
for file_path in current_directory.rglob("*.cairo"): | ||
if file_path.is_file(): | ||
process_file(file_path, [layout_type.upper(), hash_type.upper()]) | ||
|
||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser(description="Process files based on block type.") | ||
parser.add_argument( | ||
"-l", "--layout_type", type=str, help=f"Type of layouts {LAYOUT_TYPES}" | ||
) | ||
parser.add_argument( | ||
"-s", "--hash_type", type=str, help=f"Type of hashes {HASH_TYPES}" | ||
) | ||
args = parser.parse_args() | ||
|
||
main(args.layout_type, args.hash_type) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
| Contract Address | Network | Layout | | ||
|-----------------------------------------------------------------------------------------------------|-----------------------|--------------------------------| | ||
| | **Mainnet** | **dex** | | ||
| | **Mainnet** | **recursive** | | ||
| | **Mainnet** | **recursive_with_poseidon** | | ||
| | **Mainnet** | **small** | | ||
| | **Mainnet** | **starknet** | | ||
| | **Mainnet** | **starknet_with_keccak** | | ||
| | **Sepolia Testnet** | **dex** | | ||
|[0x069df5a99fa42c37c946c58da0953d721b928078e740fef14da44e0f8c01f0f6](https://sepolia.starkscan.co/contract/0x069df5a99fa42c37c946c58da0953d721b928078e740fef14da44e0f8c01f0f6) | **Sepolia Testnet** | **recursive** | | ||
| | **Sepolia Testnet** | **recursive_with_poseidon** | | ||
| | **Sepolia Testnet** | **small** | | ||
| | **Sepolia Testnet** | **starknet** | | ||
| | **Sepolia Testnet** | **starknet_with_keccak** | |
Oops, something went wrong.