Skip to content

Commit d609844

Browse files
committed
merging main
2 parents 3b59976 + a5c15ad commit d609844

File tree

71 files changed

+2450
-433
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+2450
-433
lines changed

.github/workflows/benchmarks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
workflow_dispatch: {}
99

1010
concurrency:
11-
group: ${{ github.ref }}
11+
group: ${{ github.workflow }}-${{ github.ref }}
1212
cancel-in-progress: true
1313

1414
jobs:

.github/workflows/build-action.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
workflow_dispatch: {}
1111

1212
concurrency:
13-
group: ${{ github.ref }}
13+
group: ${{ github.workflow }}-${{ github.ref }}
1414
cancel-in-progress: true
1515

1616
jobs:
@@ -301,13 +301,30 @@ jobs:
301301
run: |
302302
npm ci
303303
npm run prepublishOnly
304+
304305
- name: Publish to NPM if version has changed
306+
id: publish
305307
uses: JS-DevTools/npm-publish@v3
306308
with:
307309
token: ${{ secrets.NPM_TOKEN }}
308310
strategy: upgrade
309311
env:
310312
INPUT_TOKEN: ${{ secrets.NPM_TOKEN }}
313+
314+
- name: Configure Git
315+
run: |
316+
git config --local user.email "[email protected]"
317+
git config --local user.name "GitHub Action"
318+
319+
- name: Tag new version
320+
if: ${{ steps.publish.outputs.type }} # https://github.com/JS-DevTools/npm-publish?tab=readme-ov-file#action-output
321+
env:
322+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
323+
RELEASED_VERSION: ${{ steps.publish.outputs.version }}
324+
run: |
325+
git tag $RELEASED_VERSION
326+
git push origin $RELEASED_VERSION
327+
311328
312329
Release-mina-signer-on-NPM:
313330
if: github.ref == 'refs/heads/main'
Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Purpose: We want to build the o1js bindings in CI so that people in the
1+
# Purpose: We want to build the o1js bindings in CI so that people in the
22
# community can change them without being scared of breaking things, or
33
# needing to do the complicated (without nix) build setup.
44

@@ -7,19 +7,52 @@ name: Build o1js bindings
77
on:
88
pull_request:
99

10-
jobs:
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
1115
nix-build:
1216
name: build-bindings-ubuntu
1317
runs-on: [sdk-self-hosted-linux-amd64-build-system]
1418
steps:
19+
- name: Set up Nix
20+
run: echo "PATH=$PATH:/nix/var/nix/profiles/default/bin" >> $GITHUB_ENV
1521
- name: Disable smudging
1622
run: echo "GIT_LFS_SKIP_SMUDGE=1" >> $GITHUB_ENV
1723
- uses: actions/checkout@v4
1824
with:
1925
submodules: recursive
20-
- run: |
26+
- name: Build the o1js bindings
27+
run: |
2128
set -Eeu
22-
# Until we restart the runner and the PATH gets updated from /etc/bash.bashrc
23-
export PATH="$PATH":/nix/var/nix/profiles/default/bin
2429
./pin.sh
25-
nix develop o1js --command bash -c "npm run build:update-bindings"
30+
nix run o1js#update-bindings --max-jobs 4
31+
#fail if this changes any files
32+
cd src/bindings
33+
echo If this check fails you can download a patch from the patch-upload job
34+
echo "https://github.com/o1-labs/o1js/blob/main/README-dev.md#bindings-check-in-ci"
35+
git diff --exit-code
36+
- name: add build to gc-root if on main
37+
if: github.ref == 'refs/heads/main'
38+
run: |
39+
nix build o1js#o1js-bindings --out-link /home/app/actions-runner/nix-cache/main-bindings-gcroot
40+
- name: Cleanup the Nix store
41+
run: |
42+
nix-store --gc --print-dead
43+
nix-store --optimise
44+
patch-upload:
45+
needs: nix-build
46+
if: ${{ failure() }}
47+
runs-on: [sdk-self-hosted-linux-amd64-build-system]
48+
steps:
49+
- name: generate patch
50+
run: |
51+
cd src/bindings
52+
git add .
53+
git diff HEAD --textconv --text > ../../bindings.patch
54+
- name: Upload patch
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: bindings.patch
58+
path: bindings.patch

.github/workflows/doc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
branches:
55
- main
66

7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
711
jobs:
812
Build-Doc:
913
runs-on: ubuntu-latest

.github/workflows/live-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
workflow_dispatch: {}
1414

1515
concurrency:
16-
group: ${{ github.ref }}
16+
group: ${{ github.workflow }}-${{ github.ref }}
1717
cancel-in-progress: true
1818

1919
jobs:

.github/workflows/release.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,6 @@ jobs:
5858
git add CHANGELOG.md
5959
git commit -m "Update CHANGELOG for new version $NEW_VERSION"
6060
61-
- name: Delete existing release tag
62-
run: |
63-
if git rev-parse $NEW_VERSION >/dev/null 2>&1; then
64-
git tag -d $NEW_VERSION
65-
git push origin :refs/tags/$NEW_VERSION
66-
fi
67-
6861
- name: Delete existing release branch
6962
run: |
7063
if git ls-remote --heads origin release/${NEW_VERSION} | grep release/${NEW_VERSION}; then

CHANGELOG.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,36 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
1515
_Security_ in case of vulnerabilities.
1616
-->
1717

18-
## [Unreleased](https://github.com/o1-labs/o1js/compare/e1bac02...HEAD)
18+
## [Unreleased](https://github.com/o1-labs/o1js/compare/b857516...HEAD)
19+
20+
### Changed
21+
- Sort order for actions now includes the transaction sequence number and the exact account id sequence
22+
23+
## [2.2.0](https://github.com/o1-labs/o1js/compare/e1bac02...b857516) - 2024-12-10
24+
25+
### Added
26+
27+
- `ZkProgram` to support non-pure provable types as inputs and outputs https://github.com/o1-labs/o1js/pull/1828
28+
- APIs for recursively proving a ZkProgram method from within another https://github.com/o1-labs/o1js/pull/1931 https://github.com/o1-labs/o1js/pull/1932
29+
- `let recursive = Experimental.Recursive(program);`
30+
- `recursive.<methodName>(...args): Promise<PublicOutput>`
31+
- `recursive.<methodName>.if(condition, ...args): Promise<PublicOutput>`
32+
- This also works within the same program, as long as the return value is type-annotated
33+
- Add `enforceTransactionLimits` parameter on Network https://github.com/o1-labs/o1js/issues/1910
34+
- Method for optional types to assert none https://github.com/o1-labs/o1js/pull/1922
35+
- Increased maximum supported amount of methods in a `SmartContract` or `ZkProgram` to 30. https://github.com/o1-labs/o1js/pull/1918
36+
- Expose low-level conversion methods `Proof.{_proofToBase64,_proofFromBase64}` https://github.com/o1-labs/o1js/pull/1928
37+
- Expore `maxProofsVerified()` and a `Proof` class directly on ZkPrograms https://github.com/o1-labs/o1js/pull/1933
38+
39+
### Changed
40+
41+
- Changed an internal type to improve IntelliSense on ZkProgram methods https://github.com/o1-labs/o1js/pull/1933
1942

2043
### Fixed
2144

2245
- Compiling stuck in the browser for recursive zkprograms https://github.com/o1-labs/o1js/pull/1906
23-
- Sort order for actions now includes the transaction sequence number and the exact account id sequence
46+
- Error message in `rangeCheck16` gadget https://github.com/o1-labs/o1js/pull/1920
47+
- Deprecate `testnet` `networkId` in favor of `devnet` https://github.com/o1-labs/o1js/pull/1938
2448

2549
## [2.1.0](https://github.com/o1-labs/o1js/compare/b04520d...e1bac02) - 2024-11-13
2650

@@ -57,7 +81,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
5781
- `divMod64()` division modulo 2^64 that returns the remainder and quotient of the operation
5882
- `addMod64()` addition modulo 2^64
5983
- Bitwise OR via `{UInt32, UInt64}.or()`
60-
- **BLAKE2B hash function** gadget [#1285](https://github.com/o1-labs/o1js/pull/1285)
84+
- **BLAKE2B hash function** gadget. https://github.com/o1-labs/o1js/pull/1767
6185

6286
## [1.9.1](https://github.com/o1-labs/o1js/compare/f15293a69...7e9394) - 2024-10-15
6387

README-dev.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ Before starting, ensure you have the following tools installed:
1515

1616
- [Git](https://git-scm.com/)
1717
- [Node.js and npm](https://nodejs.org/)
18-
- [Dune](https://github.com/ocaml/dune) (only needed when compiling o1js from source)
19-
- [Cargo](https://www.rust-lang.org/learn/get-started) (only needed when compiling o1js from source)
18+
- [Dune, ocamlc, opam](https://github.com/ocaml/dune) (only needed when compiling o1js from source)
19+
- [Cargo, rustup](https://www.rust-lang.org/learn/get-started) (only needed when compiling o1js from source)
2020

2121
After cloning the repository, you need to fetch the submodules:
2222

@@ -86,6 +86,20 @@ In addition to building the OCaml and Rust code, the build script also generates
8686

8787
o1js uses these types to ensure that the constants used in the protocol are consistent with the OCaml source files.
8888

89+
### Bindings check in ci
90+
91+
If the bindings check fails in CI it will upload a patch you can use to update the bindings without having to rebuild locally.
92+
This can also be helpful when the bindings don't build identically, as unfortunately often happens.
93+
94+
To use this patch:
95+
- Click details on the `Build o1js bindings / build-bindings-ubunutu` job
96+
- Go to the `patch-upload` job and expand the logs for `Upload patch`
97+
- Download the file linked in the last line of the logs ie.
98+
`Artifact download URL: https://github.com/o1-labs/o1js/actions/runs/12401083741/artifacts/2339952965`
99+
- unzip it
100+
- navigate to `src/bindings`
101+
- run `git apply path/to/bindings.patch`
102+
89103
## Development
90104

91105
### Branching Policy

0 commit comments

Comments
 (0)