Skip to content

Commit

Permalink
Merge branch 'v2' into feature/blake2b
Browse files Browse the repository at this point in the history
  • Loading branch information
boray authored Oct 14, 2024
2 parents b972e7a + eb56a56 commit cd102fc
Show file tree
Hide file tree
Showing 80 changed files with 2,449 additions and 509 deletions.
2 changes: 2 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
./pin.sh
use flake o1js#default
17 changes: 13 additions & 4 deletions .github/workflows/build-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,15 @@ jobs:
dist
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.ts', '**/*.js') }}

- name: Build o1js
- name: Build examples
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm ci
npm run build:examples
- name: Build o1js clean
if: steps.cache.outputs.cache-hit != 'true'
run: |
rm -fr dist
npm ci
npm run build
Expand Down Expand Up @@ -67,7 +73,8 @@ jobs:
'DEX integration tests',
'DEX integration test with proofs',
'Voting integration tests',
'Verification Key Regression Check',
'Verification Key Regression Check 1',
'Verification Key Regression Check 2',
'CommonJS test',
]
steps:
Expand Down Expand Up @@ -161,9 +168,11 @@ jobs:
shopt -s globstar
test_files=(./dist/node/**/*.unit-test.js)
set -o pipefail
for ((i=start_index; i<end_index && i<${#test_files[@]}; i++)); do
echo "Running test: ${test_files[$i]}"
node --enable-source-maps "${test_files[$i]}" | tee -a profiling.md
echo "Running test: ${test_files[$i]}"
node --enable-source-maps "${test_files[$i]}" | tee -a profiling.md
done
continue-on-error: false

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/live-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ on:
push:
branches:
- main
- v2
pull_request:
branches:
- main
- v2
workflow_dispatch: {}

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ jobs:
git checkout -b $NEW_BRANCH
git push -u origin $NEW_BRANCH
git push --tags
gh pr create --base main --head $NEW_BRANCH --title "Release $NEW_VERSION [CHECK SEMVER BEFORE MERGE]" --body "This is an automated PR to update to version $NEW_VERSION.\n\nPlease check [SemVer](https://semver.org/) for correct versioning before merging this PR."
gh pr create --base main --head $NEW_BRANCH --title "Release $NEW_VERSION [CHECK SEMVER BEFORE MERGE]" --body "This is an automated PR to update to version $NEW_VERSION. Please check [SemVer](https://semver.org/) for correct versioning before merging this PR."
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN}}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ o1js-reference
_build/
src/config/
src/config.mlh
.direnv
.rustup
result
5 changes: 4 additions & 1 deletion CHANGELOG-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ Showing all changes since the last release (v.1.5.0)

### Breaking Changes

- The `divMod32()` gadget was modified to accept `nBits` instead of `quotientBits`, and assert it is in the range [0, 2**255) to address an issue previoulsy where the bound on `quotientBits` was too low https://github.com/o1-labs/o1js/pull/1763.
- The `divMod32()` gadget was modified to accept `nBits` instead of `quotientBits`, and assert it is in the range [0, 2\*\*255) to address an issue previoulsy where the bound on `quotientBits` was too low https://github.com/o1-labs/o1js/pull/1763.

- `Provable.equal()` now turns both types into canonical form before comparing them https://github.com/o1-labs/o1js/pull/1759

- Removed implicit version `Provable.equal(x, y)` where you didn't have to pass in the type

- `zkProgram` to support `auxiliaryOutput`

### Added

- New method `toCanonical()` in the `Provable<T>` interface to protect against incompleteness of certain operations on malicious witness inputs https://github.com/o1-labs/o1js/pull/1759
31 changes: 30 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +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/d6abf1d97...HEAD)
## [Unreleased](https://github.com/o1-labs/o1js/compare/450943...HEAD)

## [1.8.0](https://github.com/o1-labs/o1js/compare/5006e4f...450943) - 2024-09-18

### Added

- Added `verifyEthers` method to verify Ethereum signatures using the EIP-191 message hashing standard https://github.com/o1-labs/o1js/pull/1815
- Added `fromEthers` method for parsing and converting Ethereum public keys into `ForeignCurve` points, supporting both compressed and uncompressed formats.
- Added `fromHex` method for converting hexadecimal strings into `ForeignCurve` points.

### Fixes

- Fix incorrect behavior of optional proving for zkPrograms where `myProgram.setProofsEnabled(false)` wouldn't work when called before `myProgram.compile()` https://github.com/o1-labs/o1js/pull/1827

## [1.7.0](https://github.com/o1-labs/o1js/compare/d6abf1d97...5006e4f) - 2024-09-04

### Added

- Added `Encryption.encryptV2()` and `Encryption.decryptV2()` for an updated encryption algorithm that guarantees cipher text integrity.
- Also added `Encryption.encryptBytes()` and `Encryption.decryptBytes()` using the same algorithm.
- New option `proofsEnabled` for `zkProgram` (default value: `true`), to quickly test circuit logic with proofs disabled https://github.com/o1-labs/o1js/pull/1805
- Additionally added `MyProgram.proofsEnabled` to get the internal value of `proofsEnabled` and `MyProgram.setProofsEnabled(proofsEnabled)` to set the value dynamically.

### Deprecated

- `this.sender.getAndRequireSignature()` / `getUnconstrained()` deprecated in favor of `V2` versions due to a vulnerability https://github.com/o1-labs/o1js/pull/1799

### Fixes

- Fix behavior of `Int64.modV2()` when the input is negative and the remainder should be 0 https://github.com/o1-labs/o1js/pull/1797

## [1.6.0](https://github.com/o1-labs/o1js/compare/1ad7333e9e...d6abf1d97) - 2024-07-23

Expand Down
14 changes: 10 additions & 4 deletions README-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ npm run build

This command compiles the TypeScript source files, making them ready for use. The compiled OCaml and WebAssembly artifacts are version-controlled to simplify the build process for end users. These artifacts are stored under `src/bindings/compiled` and contain the artifacts needed for both node and web builds. These files only have to be regenerated if there are changes to the OCaml or Rust source files.

## Building with nix

Much like the mina repo, we use the nix registry to conveniently handle git submodules.
You can enter the devshell with `./pin.sh` and `nix develop o1js#default` or by using
direnv with the `.envrc` provided. This devshell provides all the dependencies required for npm scripts including `npm run:update-bindings`.

## Building Bindings

To regenerate the OCaml and WebAssembly artifacts, you can do so within the o1js repo. The [bindings](https://github.com/o1-labs/o1js-bindings) and [Mina](https://github.com/MinaProtocol/mina) repos are both submodules of o1js so you can build them from within the o1js repo.
Expand Down Expand Up @@ -89,8 +95,8 @@ o1js uses these types to ensure that the constants used in the protocol are cons
| main | **Yes** |
| develop | No |

When you start your work on o1js, please create the feature branch off of one of the above base branches.
It's encouraged to submit your work-in-progress as a draft PR to raise visibility!
When you start your work on o1js, please create the feature branch off of one of the above base branches.
It's encouraged to submit your work-in-progress as a draft PR to raise visibility!
When working with submodules and various interconnected parts of the stack, ensure you are on the correct branches that are compatible with each other.

**Default to `main` as the base branch**.
Expand Down Expand Up @@ -202,8 +208,8 @@ docker run --rm --pull=missing -it \

See the [Docker Hub repository](https://hub.docker.com/r/o1labs/mina-local-network) for more information.

Next up, get the Mina blockchain accounts information to be used in your zkApp.
After the local network is up and running, you can use the [Lightnet](https://github.com/o1-labs/o1js/blob/ec789794b2067addef6b6f9c9a91c6511e07e37c/src/lib/fetch.ts#L1012) `o1js API namespace` to get the accounts information.
Next up, get the Mina blockchain accounts information to be used in your zkApp.
After the local network is up and running, you can use the [Lightnet](https://github.com/o1-labs/o1js/blob/ec789794b2067addef6b6f9c9a91c6511e07e37c/src/lib/fetch.ts#L1012) `o1js API namespace` to get the accounts information.
See the corresponding example in [src/examples/zkapps/hello-world/run-live.ts](https://github.com/o1-labs/o1js/blob/ec789794b2067addef6b6f9c9a91c6511e07e37c/src/examples/zkapps/hello-world/run-live.ts).

### Profiling o1js
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# o1js &nbsp; [![npm version](https://img.shields.io/npm/v/o1js.svg?style=flat)](https://www.npmjs.com/package/o1js) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/o1-labs/o1js/blob/main/CONTRIBUTING.md)
# o1js &nbsp; [![npm version](https://img.shields.io/npm/v/o1js.svg?style=flat)](https://www.npmjs.com/package/o1js) [![npm](https://img.shields.io/npm/dm/o1js)](https://www.npmjs.com/package/o1js) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/o1-labs/o1js/blob/main/CONTRIBUTING.md)

ℹ️ **o1js** is an evolution of [SnarkyJS](https://www.npmjs.com/package/snarkyjs) which saw
49 updated versions over two years of development with 43,141 downloads.
Expand Down
Binary file added audits/VAR_o1js_240318_o1js_V3.pdf
Binary file not shown.
Loading

0 comments on commit cd102fc

Please sign in to comment.