Skip to content

Commit

Permalink
Standard Circom Gadget with Keccak example (#997)
Browse files Browse the repository at this point in the history
* chore: ignore Jetbrain config folder

* feat(circom): CLI import with author/name

Circom circuit are now imported under a reference composed by author/name. As this format is the one used to point to Github repository, it will allow us to have a seemless workflow for local and distant Gadgets.

* feat(circom): adapt current circom implem

Adapted the current CircomCoprocessor implementation to properly handle reference instead of name only. Also adapted the circom.rs example to use them.

* feat(circom): default local and fallback remote

- With the new implementation, we first try to fetc hthe gadget locally and fallback on remote when needed.
- Introduced a version over Circom Gadgets. Useful to point to a particular remote release.
- Better error propagation
- Precise error message based on where the flow is failing

* docs(circom): README to explain behavior of Circom Coproc & Gadget

* docs(circom): added link to template gadget

* docs(circom): wip example keccak

This is WIP as there is a need to fix circom-scotia before being able to make the Keccak example work.

- Update framework -> stack in the README
- Create an example skeleton for a remote Keccak example
- Fix the circom example to use an imported Circom Gadget from the CLI

* fix(circom): fixed CI test

- Removed deleted keccak mod
- Fixed clippy warning

* fix(circom): fixed clippy in examples

* feat(circom): wip review

- Adapted circom-scotia to use main instead of dev
- Created a structure, CircomReference to qualify an identifier for CircomGadget
- Better check on CircomReference initialization

* feat(circom): wip argument from lurk

Arity is now inherited directly from the gadget, making it declarative by the gadget developer.

* feat(circom): trying out AllocatedPtr and Var

* feat(circom): wip working on evaluation values

* refactor(circom): wip making list work

* feature(circom): working keccak example

* feature(circom): only keeping one example

* refactor(circom): fix xclippy

* refactor(circom): fix wasm build

* refactor(circom): integrate review & adapt chain_car_cdr

* refactor(circom): remove unecessary todos

* refactor(circom): to bits le on alloc num

* Update src/coprocessor/circom/mod.rs

Co-authored-by: François Garillot <[email protected]>

* refactor(circom): using bellpepper utils

* fix(circom): using proper commit for lurk lib

---------

Co-authored-by: François Garillot <[email protected]>
  • Loading branch information
tchataigner and huitseeker authored Mar 13, 2024
1 parent 4e5cd03 commit ddf26a1
Show file tree
Hide file tree
Showing 13 changed files with 997 additions and 369 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ Cargo.lock

# Configurations for VSCode
.vscode/

# Configuration for Jetbrains
.idea/
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ thiserror = { workspace = true }
abomonation = { workspace = true }
abomonation_derive = { version = "0.1.0", package = "abomonation_derive_ng" }
byteorder = "1.4.3"
circom-scotia = { git = "https://github.com/lurk-lab/circom-scotia", branch = "dev" }
circom-scotia = { git = "https://github.com/lurk-lab/circom-scotia", branch = "main" }
sha2 = { version = "0.10.2" }
reqwest = { version = "0.11.18", features = ["stream", "blocking"] }
ansi_term = "0.12.1"
Expand Down Expand Up @@ -95,6 +95,7 @@ criterion = "0.5"
expect-test = "1.4.1"
hex = "0.4.3"
statrs = "0.16.0"
tiny-keccak = { version = "2.0.2", features = ["keccak"] }
tap = "1.0.1"
tempfile = { workspace = true }

Expand Down
155 changes: 0 additions & 155 deletions examples/circom.rs

This file was deleted.

Loading

1 comment on commit ddf26a1

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmarks

Table of Contents

Overview

This benchmark report shows the Fibonacci GPU benchmark.
NVIDIA L4
Intel(R) Xeon(R) CPU @ 2.20GHz
32 vCPUs
125 GB RAM
Workflow run: https://github.com/lurk-lab/lurk-rs/actions/runs/8272751652

Benchmark Results

LEM Fibonacci Prove - rc = 100

ref=4e5cd03bdb3f1b354856ea3283b323589933c1c9 ref=ddf26a125ef85f83df299e3cf6e8836b06ef050a
num-100 1.45 s (✅ 1.00x) 1.46 s (✅ 1.00x slower)
num-200 2.77 s (✅ 1.00x) 2.78 s (✅ 1.00x slower)

LEM Fibonacci Prove - rc = 600

ref=4e5cd03bdb3f1b354856ea3283b323589933c1c9 ref=ddf26a125ef85f83df299e3cf6e8836b06ef050a
num-100 1.83 s (✅ 1.00x) 1.83 s (✅ 1.00x slower)
num-200 3.07 s (✅ 1.00x) 3.03 s (✅ 1.01x faster)

Made with criterion-table

Please sign in to comment.