Skip to content

Commit

Permalink
merging main
Browse files Browse the repository at this point in the history
  • Loading branch information
45930 committed Jan 8, 2025
2 parents 3b59976 + a5c15ad commit d609844
Show file tree
Hide file tree
Showing 71 changed files with 2,450 additions and 433 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
workflow_dispatch: {}

concurrency:
group: ${{ github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Expand Down
19 changes: 18 additions & 1 deletion .github/workflows/build-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
workflow_dispatch: {}

concurrency:
group: ${{ github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Expand Down Expand Up @@ -301,13 +301,30 @@ jobs:
run: |
npm ci
npm run prepublishOnly
- name: Publish to NPM if version has changed
id: publish
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
strategy: upgrade
env:
INPUT_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Configure Git
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
- name: Tag new version
if: ${{ steps.publish.outputs.type }} # https://github.com/JS-DevTools/npm-publish?tab=readme-ov-file#action-output
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASED_VERSION: ${{ steps.publish.outputs.version }}
run: |
git tag $RELEASED_VERSION
git push origin $RELEASED_VERSION
Release-mina-signer-on-NPM:
if: github.ref == 'refs/heads/main'
Expand Down
45 changes: 39 additions & 6 deletions .github/workflows/build-bindings.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Purpose: We want to build the o1js bindings in CI so that people in the
# 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.

Expand All @@ -7,19 +7,52 @@ name: Build o1js bindings
on:
pull_request:

jobs:
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
- run: |
- name: Build the o1js bindings
run: |
set -Eeu
# Until we restart the runner and the PATH gets updated from /etc/bash.bashrc
export PATH="$PATH":/nix/var/nix/profiles/default/bin
./pin.sh
nix develop o1js --command bash -c "npm run build:update-bindings"
nix run o1js#update-bindings --max-jobs 4
#fail if this changes any files
cd src/bindings
echo If this check fails you can download a patch from the patch-upload job
echo "https://github.com/o1-labs/o1js/blob/main/README-dev.md#bindings-check-in-ci"
git diff --exit-code
- name: add build to gc-root if on main
if: github.ref == 'refs/heads/main'
run: |
nix build o1js#o1js-bindings --out-link /home/app/actions-runner/nix-cache/main-bindings-gcroot
- name: Cleanup the Nix store
run: |
nix-store --gc --print-dead
nix-store --optimise
patch-upload:
needs: nix-build
if: ${{ failure() }}
runs-on: [sdk-self-hosted-linux-amd64-build-system]
steps:
- name: generate patch
run: |
cd src/bindings
git add .
git diff HEAD --textconv --text > ../../bindings.patch
- name: Upload patch
uses: actions/upload-artifact@v4
with:
name: bindings.patch
path: bindings.patch
4 changes: 4 additions & 0 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Build-Doc:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/live-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
workflow_dispatch: {}

concurrency:
group: ${{ github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,6 @@ jobs:
git add CHANGELOG.md
git commit -m "Update CHANGELOG for new version $NEW_VERSION"
- name: Delete existing release tag
run: |
if git rev-parse $NEW_VERSION >/dev/null 2>&1; then
git tag -d $NEW_VERSION
git push origin :refs/tags/$NEW_VERSION
fi
- name: Delete existing release branch
run: |
if git ls-remote --heads origin release/${NEW_VERSION} | grep release/${NEW_VERSION}; then
Expand Down
30 changes: 27 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,36 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
_Security_ in case of vulnerabilities.
-->

## [Unreleased](https://github.com/o1-labs/o1js/compare/e1bac02...HEAD)
## [Unreleased](https://github.com/o1-labs/o1js/compare/b857516...HEAD)

### Changed
- Sort order for actions now includes the transaction sequence number and the exact account id sequence

## [2.2.0](https://github.com/o1-labs/o1js/compare/e1bac02...b857516) - 2024-12-10

### Added

- `ZkProgram` to support non-pure provable types as inputs and outputs https://github.com/o1-labs/o1js/pull/1828
- 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
- `let recursive = Experimental.Recursive(program);`
- `recursive.<methodName>(...args): Promise<PublicOutput>`
- `recursive.<methodName>.if(condition, ...args): Promise<PublicOutput>`
- This also works within the same program, as long as the return value is type-annotated
- Add `enforceTransactionLimits` parameter on Network https://github.com/o1-labs/o1js/issues/1910
- Method for optional types to assert none https://github.com/o1-labs/o1js/pull/1922
- Increased maximum supported amount of methods in a `SmartContract` or `ZkProgram` to 30. https://github.com/o1-labs/o1js/pull/1918
- Expose low-level conversion methods `Proof.{_proofToBase64,_proofFromBase64}` https://github.com/o1-labs/o1js/pull/1928
- Expore `maxProofsVerified()` and a `Proof` class directly on ZkPrograms https://github.com/o1-labs/o1js/pull/1933

### Changed

- Changed an internal type to improve IntelliSense on ZkProgram methods https://github.com/o1-labs/o1js/pull/1933

### Fixed

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

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

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

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

Expand Down
18 changes: 16 additions & 2 deletions README-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Before starting, ensure you have the following tools installed:

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

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

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

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

### Bindings check in ci

If the bindings check fails in CI it will upload a patch you can use to update the bindings without having to rebuild locally.
This can also be helpful when the bindings don't build identically, as unfortunately often happens.

To use this patch:
- Click details on the `Build o1js bindings / build-bindings-ubunutu` job
- Go to the `patch-upload` job and expand the logs for `Upload patch`
- Download the file linked in the last line of the logs ie.
`Artifact download URL: https://github.com/o1-labs/o1js/actions/runs/12401083741/artifacts/2339952965`
- unzip it
- navigate to `src/bindings`
- run `git apply path/to/bindings.patch`

## Development

### Branching Policy
Expand Down
Loading

0 comments on commit d609844

Please sign in to comment.