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

no_std support #19

Merged
merged 41 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
aad482f
wip nostd
rkdud007 Jul 20, 2024
c76092e
no std support!
rkdud007 Jul 20, 2024
baadc25
fix: attr remove
rkdud007 Jul 20, 2024
70f5b6c
fix:ci
rkdud007 Jul 20, 2024
44c212f
test init
rkdud007 Jul 20, 2024
7f1304b
feat: ci update
rkdud007 Jul 20, 2024
2218cca
cargo toml fix
rkdud007 Jul 20, 2024
ca8dd35
fix: cargo toml
rkdud007 Jul 20, 2024
5cedd47
fix:cargo.toml
rkdud007 Jul 20, 2024
f475c47
see if it works
rkdud007 Jul 20, 2024
d3fb06f
cargo toml
rkdud007 Jul 20, 2024
69e8720
please
rkdud007 Jul 21, 2024
4253bc5
is this working?
rkdud007 Jul 21, 2024
059b24a
is this?
rkdud007 Jul 21, 2024
5b53b9f
does this helps?
rkdud007 Jul 21, 2024
5d39189
please?
rkdud007 Jul 21, 2024
a9e8cee
feels gmi
rkdud007 Jul 21, 2024
0c8dc4b
think i have one
rkdud007 Jul 21, 2024
950175c
cli fix
rkdud007 Jul 21, 2024
86e633c
hope this works
rkdud007 Jul 21, 2024
fd5f88e
just to check ci
rkdud007 Jul 22, 2024
b99d6a4
Merge branch 'main' into no-std
Okm165 Jul 22, 2024
72fe346
features deps fixes and refactor
Okm165 Jul 22, 2024
90968a0
ci fix
Okm165 Jul 22, 2024
b388def
no_std test package name change and import fix
Okm165 Jul 22, 2024
97fd9ef
proof-parser -> proof_parser
Okm165 Jul 22, 2024
2794480
wasm-binding -> wasm_bindings
Okm165 Jul 22, 2024
fb4c05d
wasm_bindings ci fix
Okm165 Jul 22, 2024
42e8991
ci fix
Okm165 Jul 22, 2024
4b473fd
minor refactor
Okm165 Jul 22, 2024
1990dd6
no_std fix
Okm165 Jul 22, 2024
4ff45aa
rename mocking no_std build for now more work tbd
Okm165 Jul 22, 2024
9ea93d9
almost works
Okm165 Jul 22, 2024
15d64eb
WS to no_std
Okm165 Jul 22, 2024
0744ed9
riscv build
Okm165 Jul 22, 2024
6b8b4de
no_std builds work && std builds work
Okm165 Jul 22, 2024
221eff3
CI improved
Okm165 Jul 23, 2024
51a58ad
CI improved
Okm165 Jul 23, 2024
97f225b
refactor
Okm165 Jul 23, 2024
20dc157
Merge pull request #24 from iosis-tech/arm_riscv_support
rkdud007 Jul 23, 2024
261c73f
chore: cli std by default
rkdud007 Jul 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 105 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Rust CI

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: "**"

Expand All @@ -11,46 +11,59 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Check out the repository
uses: actions/checkout@v2

- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Cache Cargo registry
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-

- name: Cache Cargo build
uses: actions/cache@v2
with:
path: target
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-

- name: Run tests
run: cargo test --verbose
- name: Check out the repository
uses: actions/checkout@v2

- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Cache Cargo registry
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-

- name: Cache Cargo build
uses: actions/cache@v2
with:
path: target
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-

- name: Run tests
run: cargo test -rv

verify-proof:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
layout: ["dex", "recursive", "recursive_with_poseidon", "small", "starknet", "starknet_with_keccak"]
layout:
[
"dex",
"recursive",
"recursive_with_poseidon",
"small",
"starknet",
"starknet_with_keccak",
]

env:
PROOFS_DIR: ${{ github.workspace }}/examples/proofs
WORKING_DIR: ${{ github.workspace }}/cli

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Cache Cargo registry
uses: actions/cache@v2
with:
Expand All @@ -60,14 +73,73 @@ jobs:
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-

- name: Cache Cargo build
uses: actions/cache@v2
with:
path: target
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-

- name: Run verification
run: cargo run --release --bin swiftness --features ${{ matrix.layout }},keccak --no-default-features -- --proof examples/proofs/${{ matrix.layout }}/cairo0_example_proof.json
run: cargo run -r --bin swiftness --features ${{ matrix.layout }},keccak --no-default-features -- --proof ${{ env.PROOFS_DIR }}/${{ matrix.layout }}/cairo0_example_proof.json
working-directory: ${{ env.WORKING_DIR }}

no-std-build:
runs-on: ubuntu-latest
needs: verify-proof
strategy:
fail-fast: false
matrix:
layout:
[
"dex",
"recursive",
"recursive_with_poseidon",
"small",
"starknet",
"starknet_with_keccak",
]
hash: ["blake2s", "keccak"]
target: ["armebv7r-none-eabi", "riscv64imac-unknown-none-elf"]

env:
WORKING_DIR: ${{ github.workspace }}/examples/no_std_build

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Cache Cargo registry
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-

- name: Cache Cargo build
uses: actions/cache@v2
with:
path: target
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-

- name: Show rustup
run: rustup show
working-directory: ${{ env.WORKING_DIR }}

- name: Build project
run: cargo build -r --features ${{ matrix.layout }},${{ matrix.hash }} --no-default-features --target ${{ matrix.target }}
working-directory: ${{ env.WORKING_DIR }}

- name: Print binary metadata
run: file target/${{ matrix.target }}/release/no_std_build
working-directory: ${{ env.WORKING_DIR }}
4 changes: 2 additions & 2 deletions .github/workflows/npm_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest

env:
WORKING_DIR: wasm-binding # define the working directory here
WORKING_DIR: ${{ github.workspace }}/wasm_bindings

strategy:
fail-fast: false
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
run: cargo install wasm-pack

- name: Build package
run: wasm-pack build --out-dir pkg --target web --workspace --features ${{ matrix.layout }},${{ matrix.hash }} --no-default-features
run: wasm-pack build --out-dir pkg --target web --features std,${{ matrix.layout }},${{ matrix.hash }} --no-default-features
working-directory: ${{ env.WORKING_DIR }}

- name: Rename package
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# will have compiled files and executables
debug/
target/
pkg/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Expand Down
Loading
Loading