-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into feature/lookup-runtim…
…e-tables
- Loading branch information
Showing
14 changed files
with
167 additions
and
26 deletions.
There are no files selected for viewing
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 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,36 @@ | ||
# Purpose: We want to build the o1js bindings in CI so that people in the | ||
# community can change them without being scared of breaking things, or | ||
# needing to do the complicated (without nix) build setup. | ||
|
||
name: Build o1js bindings | ||
|
||
on: | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
nix-build: | ||
name: build-bindings-ubuntu | ||
runs-on: [sdk-self-hosted-linux-amd64-build-system] | ||
steps: | ||
- name: Set up Nix | ||
run: echo "PATH=$PATH:/nix/var/nix/profiles/default/bin" >> $GITHUB_ENV | ||
- name: Disable smudging | ||
run: echo "GIT_LFS_SKIP_SMUDGE=1" >> $GITHUB_ENV | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: Build the o1js bindings | ||
run: | | ||
set -Eeu | ||
./pin.sh | ||
nix develop o1js --command bash -c "npm run build:update-bindings" | ||
- name: Cleanup the Nix store | ||
run: | | ||
nix-env --delete-generations old | ||
nix-collect-garbage -d --quiet | ||
nix-store --gc --print-dead | ||
nix-store --optimise |
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 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Submodule bindings
updated
4 files
+7 −4 | crypto/bindings/srs.ts | |
+1 −1 | crypto/elliptic-curve.ts | |
+2 −0 | js/web/web-backend.js | |
+9 −0 | js/web/worker-spec.js |
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,14 +1,31 @@ | ||
import replace from 'replace-in-file'; | ||
|
||
const options = { | ||
files: './dist/web/examples/zkapps/**/*.js', | ||
from: /from 'o1js'/g, | ||
to: "from '../../../index.js'", | ||
}; | ||
|
||
try { | ||
const results = await replace(options); | ||
console.log('Replacement results:', results); | ||
} catch (error) { | ||
console.error('Error occurred:', error); | ||
const replaceOptions = [ | ||
{ | ||
files: './dist/web/examples/zkapps/**/*.js', | ||
from: /from 'o1js'/g, | ||
to: "from '../../../index.js'", | ||
}, | ||
{ | ||
files: './dist/web/examples/zkprogram/*.js', | ||
from: /from 'o1js'/g, | ||
to: "from '../../index.js'", | ||
}, | ||
]; | ||
|
||
async function performReplacement(options) { | ||
try { | ||
const results = await replace(options); | ||
console.log(`Replacement results for ${options.files}:`, results); | ||
} catch (error) { | ||
console.error(`Error occurred while replacing in ${options.files}:`, error); | ||
} | ||
} | ||
|
||
async function main() { | ||
for (const options of replaceOptions) { | ||
await performReplacement(options); | ||
} | ||
} | ||
|
||
main(); |
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,23 @@ | ||
import { SelfProof, Field, ZkProgram } from 'o1js'; | ||
|
||
export const RecursiveProgram = ZkProgram({ | ||
name: 'recursive-program', | ||
publicInput: Field, | ||
|
||
methods: { | ||
baseCase: { | ||
privateInputs: [], | ||
async method(input: Field) { | ||
input.assertEquals(Field(0)); | ||
}, | ||
}, | ||
|
||
inductiveCase: { | ||
privateInputs: [SelfProof], | ||
async method(input: Field, earlierProof: SelfProof<Field, void>) { | ||
earlierProof.verify(); | ||
earlierProof.publicInput.add(1).assertEquals(input); | ||
}, | ||
}, | ||
}, | ||
}); |
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 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