Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
dannywillems authored Dec 16, 2024
2 parents 3013ac7 + 2fcefed commit 10b7d4b
Show file tree
Hide file tree
Showing 11 changed files with 98 additions and 351 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Check build

on:
[pull_request]
pull_request:

jobs:
check_build:
Expand All @@ -18,12 +18,13 @@ jobs:

steps:
- name: Get code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Use OCaml ${{ matrix.ocaml-version }}
uses: avsm/setup-ocaml@v1
uses: ocaml/setup-ocaml@v3
with:
ocaml-version: ${{ matrix.ocaml-version }}
ocaml-compiler: ${{ matrix.ocaml-version }}
disable-cache: true

- name: Build
run: |
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
name: ci

on:
[pull_request]
pull_request:

jobs:
docker-build:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
uses: docker/setup-buildx-action@v1
- name: Checkout
uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
id: docker-build
with:
install: true
-
name: Build
- name: Build
run: |
docker build . # will run buildx
62 changes: 30 additions & 32 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,37 @@
name: Deploy Docs to GitHub Pages

on:
push:
branches:
- master
push:
branches:
- master

jobs:
release:
name: GitHub Pages
runs-on: ubuntu-latest
release:
name: GitHub Pages
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2

steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Use OCaml "4.14.0"
uses: avsm/setup-ocaml@v1
with:
ocaml-version: 4.14.0

- name: Use OCaml "4.14.0"
uses: avsm/setup-ocaml@v1
with:
ocaml-version: 4.14.0

- name: Build Documentation
run: |
eval $(opam env)
opam pin add . -y
opam install odoc
make website
cd website/website
yarn
yarn build
pwd
ls
ls build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./website/website/build/snarky
- name: Build Documentation
run: |
eval $(opam env)
opam pin add . -y
opam install odoc
make website
cd website/website
yarn
yarn build
pwd
ls
ls build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./website/website/build/snarky
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,6 @@ let implied_root_unchecked entry_hash addr0 path0 =
The two obviously look very similar, but the first one can be run to generate an R1CS
(and also an "auxiliary input") to verify that computation.

## Implementation

Currently, the library uses a free-monad style AST to represent the snark computation.
This may change in future versions if the overhead of creating the AST is significant.
Most likely it will stick around since the overhead doesn't seem to be too bad and it
enables optimizations like eliminating equality constraints.

## Building

```
Expand Down
68 changes: 0 additions & 68 deletions src/base/as_prover_ref.ml

This file was deleted.

100 changes: 0 additions & 100 deletions src/base/free_monad.ml

This file was deleted.

30 changes: 6 additions & 24 deletions src/base/snark0.ml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ module Make_basic
(Backend : Backend_extended.S)
(Checked : Checked_intf.Extended with type field = Backend.Field.t)
(As_prover : As_prover0.Extended with type field := Backend.Field.t)
(Ref : As_prover_ref.S
with module Types := Checked.Types
and type 'f field := Backend.Field.t
and type ('a, 'f) checked := 'a Checked.t)
(Runner : Runner.S
with module Types := Checked.Types
with type field := Backend.Field.t
Expand Down Expand Up @@ -659,13 +655,6 @@ module Make (Backend : Backend_intf.S) = struct

module As_prover_ext = As_prover0.Make_extended (Field_T) (As_prover0)

module Ref :
As_prover_ref.S
with module Types = Checked1.Types
and type ('a, 'f) checked := ('a, 'f) Checked1.t
and type 'f field := Backend_extended.Field.t =
As_prover_ref.Make (Checked1) (As_prover0)

module Checked_for_basic = struct
include (
Checked1 :
Expand All @@ -682,8 +671,7 @@ module Make (Backend : Backend_intf.S) = struct
end

module Basic =
Make_basic (Backend_extended) (Checked_for_basic) (As_prover_ext) (Ref)
(Runner0)
Make_basic (Backend_extended) (Checked_for_basic) (As_prover_ext) (Runner0)
include Basic
module Number = Number.Make (Basic)
module Enumerable = Enumerable.Make (Basic)
Expand Down Expand Up @@ -767,7 +755,9 @@ module Run = struct
module Constraint = Snark.Constraint

module Typ = struct
include Types.Typ.T
open Snark.Typ
module Data_spec = Typ.Data_spec

type nonrec ('var, 'value) t = ('var, 'value) t

Expand All @@ -793,7 +783,9 @@ module Run = struct

let of_hlistable = of_hlistable

module Internal = Internal
type nonrec 'a prover_value = 'a prover_value

let prover_value = prover_value
end

let constant (Typ typ : _ Typ.t) x =
Expand Down Expand Up @@ -1131,16 +1123,6 @@ module Run = struct

include Field.Constant.T

module Ref = struct
type 'a t = 'a As_prover_ref.t

let create f = run As_prover.(Ref.create (map (return ()) ~f))

let get r = eval_as_prover (As_prover.Ref.get r)

let set r x = eval_as_prover (As_prover.Ref.set r x)
end

let run_prover f _tbl =
(* Allow for nesting of prover blocks, by caching the current value and
restoring it once we're done.
Expand Down
Loading

0 comments on commit 10b7d4b

Please sign in to comment.