diff --git a/.github/workflows/build-bindings.yml b/.github/workflows/build-bindings.yml index d1b6772a0..38e8f821e 100644 --- a/.github/workflows/build-bindings.yml +++ b/.github/workflows/build-bindings.yml @@ -27,10 +27,15 @@ jobs: run: | set -Eeu ./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 + 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-env --delete-generations old - nix-collect-garbage -d --quiet nix-store --gc --print-dead nix-store --optimise diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a43cb368..75a146fc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,12 +15,13 @@ 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) -### Added +## [2.2.0](https://github.com/o1-labs/o1js/compare/e1bac02...b857516) - 2024-12-10 --`ZkProgram` to support non-pure provable types as inputs and outputs https://github.com/o1-labs/o1js/pull/1828 +### Added +- `ZkProgram` to support non-pure provable types as inputs and outputs https://github.com/o1-labs/o1js/pull/1828 - 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 @@ -65,7 +66,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 diff --git a/README-dev.md b/README-dev.md index 7d8e1c8f5..8d1ec0fbb 100644 --- a/README-dev.md +++ b/README-dev.md @@ -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: diff --git a/README-nix.md b/README-nix.md new file mode 100644 index 000000000..6ff38494c --- /dev/null +++ b/README-nix.md @@ -0,0 +1,308 @@ +# o1js README-nix + +[Nix](https://nixos.org/) is a tool for package management and system +configuration that can help developers build a project in a reproducible and +reliable manner, without messing up versions during upgrades. + +Much like the `mina` repository, you can use Nix to +handle the dependencies required across the codebase, including npm scripts. + +> **When should I use Nix?** +> If you cannot build the codebase locally (due to untrusty package manager, +> faulty versioning, or unavailable libraries), it is a good idea to try the Nix +> build instead. This can happen especially if you're using a Mac–and even more +> likely–with non-Intel chips. + +## Installing Nix + +The following command will install Nix on your machine. + +```console +sh <(curl -L https://nixos.org/nix/install) --daemon +``` + +If you're unsure about your Nix setup, the assistant will guide you towards a +clean installation. It will involve backing up your old `/etc/X` and `/etc/X.backup-before-nix` for `X = {bash.bashrc, bashrc, zshrc}`, and finally +uninstalling and reinstalling Nix from scratch. + +> **warning for macOS users**: macOS updates will often break your nix +> installation. To prevent that, you can add the following to your `~/.bashrc` +> or `~/.zshrc`: +> +> ```bash +> # avoid macOS updates to destroy nix +> if [ -e '/nix/var/nix/profiles/default/etc/profile.d/>nix-daemon.sh' ]; then +> source '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' +> fi +> ``` + +After installing, the current shell won't be a Nix shell. To create one, open a +new shell and type + +```console +nix-shell -p nix-info --run "nix-info -m" +``` + +That should output some basic information about the configuration parameters for Nix. + +## Enabling Flakes (recommended) + +Mina is packaged using [Nix Flakes](https://nixos.wiki/wiki/Flakes), +which are an experimental feature of Nix. However, compatibility with +pre-flake Nix is provided. If you wish to contribute the Nix +expressions in this repository, or want to get some convenience +features and speed improvements, **it is advisable to enable flakes**. For +this, you'll want to make sure you're running recent Nix (⩾2.5) and +have enabled the relevant experimental features, either in +`/etc/nix/nix.conf` or (recommended) in `~/.config/nix/nix.conf` (meaning to add +`experimental-features = nix-command flakes` in that file): + +```console +mkdir -p "${XDG_CONFIG_HOME-${HOME}/.config}/nix" +echo 'experimental-features = nix-command flakes' > "${XDG_CONFIG_HOME-${HOME}/.config}/nix/nix.conf" +``` + +Verify your flake support is working by running: + +```console +nix flake metadata github:nixos/nixpkgs +``` + +## Building with Nix + +Start by cloning the repository. Optionally, you can install dependencies with +`npm i`, but Nix should take care of all the packages. + +```bash +git clone --recurse-submodules git@github.com:o1-labs/o1js.git +cd o1js +# npm install +``` + +From a new shell, go to `{REPO_PATH}/o1js` and from there execute `./pin.sh` to +update the submodules and add the flakes entries. Then, you can open a Nix shell +with all the dependencies required executing `nix develop o1js#default`, or +alternatively `nix develop o1js#mina-shell` (which works better from MacOS). + +```console +./pin.sh +nix develop o1js#default +``` + +The first time you run this command, you can expect it to take hours (or even a full day) to complete. Then, you will observe that the current devshell becomes a Nix shell with the right +configuration for `o1js` and `mina`. + +In order to make sure that the bindings will be regenerated in the case that you +are modifying them, make sure to comment out the conditionals in +`src/mina/src/lib/crypto/kimchi_bindings/js/node_js/build.sh` and `src/mina/src/lib/crypto/kimchi_bindings/js/web/build.sh` locally. That's because otherwise the +PLONK_WASM_WEB check prevents `proof-systems` from compiling with each build. + +```sh +if true; then # [[ -z "${PLONK_WASM_WEB-}" ]]; then + export RUSTFLAGS="-C target-feature=+atomics,+bulk-memory,+mutable-globals -C link-arg=--no-check-features -C link-arg=--max-memory=4294967296" + rustup run nightly-2023-09-01 wasm-pack build --target web --out-dir ../js/web ../../wasm -- -Z build-std=panic_abort,std +else + cp "$PLONK_WASM_WEB"/* -R . +fi +``` + +Then, you can build o1js and update the bindings. + +```console +npm run build +npm run build:update-bindings +``` + +If you need to update the underlying `mina` code, you can also do so with Nix, +but from the corresopnding subdirectory. In particular, you should build Mina +from the o1js subdirectory from a Nix shell. That means, + +```console +cd ./src/mina +./nix/pin.sh +nix develop mina +``` + +## Desirable configurations + +### Storage handling + +Using Nix can take up a lot of disk space if not optimized. Every time you run `nix develop {SOMETHING}`, Nix will create new generations taking gigabytes of data instead of replacing the old ones. This can soon become a problem in your hard disk if you don't handle it carefully. Here are a few indications that can help with this. + +Nix has a garbage collector that **is not used by default** after every run. Instead, artifacts get accumulated in your disk unless configured otherwise. But if the full gargabe collector is executed (`nix-store --gc`), it will get the dependencies removed completely, and you can expect that the next time executing the Nix build will take hours to complete. + +Instead, you can try to run `nix-env --delete-generations old` or any other time bound like `7d`. This will not have any effect on MacOS though. Alternatively, the [direnv](https://github.com/direnv/direnv) / [nix-direnv](https://github.com/nix-community/nix-direnv) tool can create garbage collector roots that won't be collected for removal. It just keeps one gc-root to the latest build of the dev shell so that `nix-store --gc` only removes older generations. + +On top of that, adding `auto-optimise-store = true` to `/etc/nix/nix.conf` and running `nix-store --optimize` shoud help with disk usage, as it replaces duplicated files with symlinks. + +### Runtime optimization + +Other configurations are worth adding into your `/etc/nix/nix.conf`: + +```bash +keep-otuputs = true +max-jobs = 20 +extra-substituters = https://storage.googleapis.com/mina-nix-cache +extra-trusted-public-keys = nix-cache.minaprotocol.org:fdcuDzmnM0Kbf7yU4yywBuUEJWClySc1WIF6t6Mm8h4= nix-cache.minaprotocol.org:D3B1W+V7ND1Fmfii8EhbAbF1JXoe2Ct4N34OKChwk2c= mina-nix-cache-1:djtioLfv2oxuK2lqPUgmZbf8bY8sK/BnYZCU2iU5Q10= +``` + +The first of those flags tells the garbage collector to keep build time dependencies of current gc-roots, which should help reduce the amount of data that gets removed and rebuilt. + +The second flag increases the default number of jobs being 1, so that rebuilding from scratch will take shorter time. + +The last two lines tell Nix to use the Mina Foundation's cache whenever possible, which should as well speed things up when building code that has been build in Mina's CI before. + +## Common errors + +Errors while using Nix have been reported. This section collects a set of common +errors and proposes fixes for them. + +```console +DISCLAIMER! + +The proposed solutions might not work universally, and could vary depending on your local environment. +This section should be read as a starting roadmap, and engineers are highly encouraged to add any new error found +and possible fixes to improve the helpfulness of this document. +``` + +### Compiling _export_test_vectors_ + +When trying to update the bindings for o1js in MacOS, Nix might fail at +compiling the `export_test_vectors` with the following error log: + +```console +error: linking with `cc` failed: exit status: 1 + = note: ld: library not found for -liconv + collect2: error: ld returned 1 exit status + +error: could not compile `export_test_vectors` (bin "export_test_vectors") due to previous error +``` + +That is because this library is not symlinked into `/opt/homebrew` since macOS +already provides this software and installing another version could cause +problems. + +#### Fix for MacOS + +Install `libiconv` with + +```console +brew install libiconv +``` + +and update your `~/.zshrc` with the following lines + +```bash +# libiconv config +export PATH="/opt/homebrew/opt/libiconv/bin:$PATH" +export LDFLAGS="-L/opt/homebrew/opt/libiconv/lib" +export CPPFLAGS="-I/opt/homebrew/opt/libiconv/include" +export LIBRARY_PATH="/opt/homebrew/opt/libiconv/lib:$LIBRARY_PATH" +``` + +Alternatively, try this change in the `src/mina/flake.nix` file: + +``` +- devShellPackages = with pkgs; [ rosetta-cli wasm-pack nodejs binaryen ]; ++ devShellPackages = with pkgs; [ rosetta-cli wasm-pack nodejs binaryen cargo libiconvI]; +``` + +### wasm32-unknown-unknown + +The rust compiler and/or Wasm-pack might not be correctly setup in the Nix shell. + +```console +Error: wasm32-unknown-unknown target not found in sysroot: "/nix/store/w30zw23kmgks77d870i502a3185hjycv-rust" + +Used rustc from the following path: "/nix/store/wcm8caqd6g7bcbddpyxan1jzj3apkmxy-rustup-1.26.0/bin/rustc" +It looks like Rustup is not being used. For non-Rustup setups, the wasm32-unknown-unknown target needs to be installed manually. See https://rustwasm.github.io/wasm-pack/book/prerequisites/non-rustup-setups.html on how to do this. + +Caused by: wasm32-unknown-unknown target not found in sysroot: "/nix/store/w30zw23kmgks77d870i502a3185hjycv-rust" +``` + +#### Fix + +This is caused because the Rust compiler in Nix does not have access to the +corresponding `wasm32-unknown-unknown` target. Let `{RUSTDIR}` be the directory +of the Rust location inside Nix, as shown in the error code; e.g. +`/nix/store/wcm8caqd6g7bcbddpyxan1jzj3apkmxy-rustup-1.26.0/bin`, then you can +check the version of the compiler used by typing: + +```bash +{RUSTDIR}/rustc --version +``` + +Which will reply with something like + +```bash +rustc 1.82.0 (f6e511eec 2024-10-15) +``` + +Then the Wasm target can be automatically installed using + +```console +{RUSTDIR}/rustup target add wasm32-unknown-unknown +``` + +Alternatively, this can be done manually downloading the right version of the +target with + +```console +wget https://static.rust-lang.org/dist/rust-std-x.xx.x-wasm32-unknown-unknown.tar.gz +``` + +where _`x.xx.x`_ corresponds to the version of `rustc` (in the example, 1.82.0). +Once unpacked, you should see a similar structure: + +```console +rust-std-1.82.0-wasm32-unknown-unknown +├── components +├── install.sh +├── rust-installer-version +└── rust-std-wasm32-unknown-unknown + ├── lib + │   └── rustlib + │   └── wasm32-unknown-unknown +``` + +Finally, the `wasm32-unknown-unknown` folder must be moved into the +`./lib/rustlib/` directory in the sysroot like so: + +Let `{SYSROOT}` be the directory of the Rust in Nix shown in the error code; +e.g. `/nix/store/w30zw23kmgks77d870i502a3185hjycv-rust`, then the Wasm target +can be automatically installed downloading it from + +```bash +mv rust-std-1.82.0-wasm32-unknown-unknown/rust-std-wasm32-unknown-unknown/lib/rustlib/wasm32-unknown-unknown {SYSROOT}/lib/rustlib/wasm32-unknown-unknown/ +``` + +### Cargo not found + +```console +error: "/nix/store/w30zw23kmgks77d870i502a3185hjycv-rust/lib/rustlib/src/rust/Cargo.lock" + does not exist, unable to build with the standard library, try: + rustup component add rust-src --toolchain nix +``` + +#### Fix + +Install `cargo` on your host machine. If doing so does not solve the problem, it +is very likely that the whole Nix setup has gone wrong and it is very advisable +to install it from scratch. + +### Old path + +When several clones of the repository are present in the system and both have +used Nix (or if it has been moved from one location to another), Nix might cache +an old path, breaking builds. For example, typing `nix develop mina` +would complain and produce the following error: + +```console +error: resolving Git reference 'master': revspec 'master' not found +``` + +Then, the error message would still contain old directories. + +#### Fix + +Create a new environment for Nix and start from scratch. In particular, run the garbage collector which will remove old dependencies. diff --git a/flake.lock b/flake.lock index 79916af26..49061b354 100644 --- a/flake.lock +++ b/flake.lock @@ -265,8 +265,8 @@ "utils": "utils" }, "locked": { - "lastModified": 1731611028, - "narHash": "sha256-sehBPO+H9mtShGb3KNhdDVHj0pogt/tmiL9tc2ICkaU=", + "lastModified": 1733429866, + "narHash": "sha256-/ZEGYdZ2hLjBwdEzG/BIjlDehOjuGWmBqzD55nXfZoY=", "path": "src/mina", "type": "path" }, diff --git a/flake.nix b/flake.nix index dd7e4d3d4..74f10868a 100644 --- a/flake.nix +++ b/flake.nix @@ -84,6 +84,42 @@ { targets = ["wasm32-unknown-unknown" "x86_64-unknown-linux-gnu" ]; extensions = [ "rust-src" ]; }); + rust-platform = pkgs.makeRustPlatform + { cargo = rust-channel; + rustc = rust-channel; + }; + + bindings-pkgs = with pkgs; + [ nodejs + nodePackages.npm + typescript + nodePackages.typescript-language-server + + #Rustup doesn't allow local toolchains to contain 'nightly' in the name + #so the toolchain is linked with the name nix and rustup is wrapped in a shellscript + #which calls the nix toolchain instead of the nightly one + (writeShellApplication + { name = "rustup"; + text = + '' + if [ "$1" = run ] && { [ "$2" = nightly-2023-09-01 ] || [ "$2" = 1.72-x86_64-unknowl-linux-gnu ]; } + then + echo using nix toolchain + ${rustup}/bin/rustup run nix "''${@:3}" + else + echo using plain rustup "$@" + ${rustup}/bin/rustup "$@" + fi + ''; + } + ) + rustup + wasm-pack + binaryen # provides wasm-opt + + dune_3 + ] ++ commonOverrides.buildInputs ; + inherit (nixpkgs) lib; # All the submodules required by .gitmodules submodules = map builtins.head (builtins.filter lib.isList @@ -111,6 +147,56 @@ command "nix-shell" }. ''; + + o1js-npm-deps = pkgs.buildNpmPackage + { name = "o1js"; + src = with pkgs.lib.fileset; + (toSource { + root = ./.; + fileset = unions [ + ./package.json + ./package-lock.json + ]; + }); + # If you see 'ERROR: npmDepsHash is out of date' in ci + # set this to blank run ``nix build o1js#o1js-bindings` + # If you don't want to install nix you can also set it to "" and run ci to get the new hash + # You should get an output like this: + + # error: hash mismatch in fixed-output derivation '/nix/store/a03cg2az0b2cvjsp1wnr89clf31i79c1-o1js-npm-deps.drv': + # specified: sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + # got: sha256-8EPvXpOgn0nvm/pFKN3h6EMjabOeBqfy5optIfe8E8Q= + # replace npmDepsHash bellow with the new hash + + npmDepsHash = "sha256-QLnSfX6JwYQXyHGNSxXdzqbhkbFl67sDrmlW/F6D/pw="; + # The prepack script runs the build script, which we'd rather do in the build phase. + npmPackFlags = [ "--ignore-scripts" ]; + dontNpmBuild = true; + installPhase = '' + runHook preInstall + + mkdir -p $out/lib + cp -r node_modules $out/lib + + runHook postInstall + ''; + }; + test-vectors = rust-platform.buildRustPackage { + src = pkgs.lib.sourceByRegex ./src/mina/src + [ + "^lib(/crypto(/proof-systems(/.*)?)?)?$" + ]; + sourceRoot = "source/lib/crypto/proof-systems/poseidon/export_test_vectors"; + patchPhase = + '' + cp ${./src/mina/src/lib/crypto/proof-systems/Cargo.lock} . + ''; + name = "export_test_vectors"; + version = "0.1.0"; + cargoSha256 = ""; + CARGO_TARGET_DIR = "./target"; + cargoLock = { lockFile = ./src/mina/src/lib/crypto/proof-systems/Cargo.lock ; }; + }; in { formatter = pkgs.nixfmt; inherit mina; @@ -124,48 +210,96 @@ export RUSTUP_HOME rustup toolchain link nix ${rust-channel} ''; - packages = with pkgs; - [ nodejs - nodePackages.npm - typescript - nodePackages.typescript-language-server + packages = bindings-pkgs; + }); - #Rustup doesn't allow local toolchains to contain 'nightly' in the name - #so the toolchain is linked with the name nix and rustup is wrapped in a shellscript - #which calls the nix toolchain instead of the nightly one - (writeShellApplication - { name = "rustup"; - text = - '' - if [ "$1" = run ] && [ "$2" = nightly-2023-09-01 ] - then - ${rustup}/bin/rustup run nix "''${@:3}" - else - ${rustup}/bin/rustup "$@" - fi - ''; - } - ) - rustup - wasm-pack - binaryen # provides wasm-opt - dune_3 - ] ++ commonOverrides.buildInputs ; - }); }; # TODO build from ./ocaml root, not ./. (after fixing a bug in dune-nix) packages = { - kim = pkgs.kimchi-rust-wasm; inherit dune-description; - bindings = prj.pkgs.o1js_bindings; + o1js-bindings = pkgs.stdenv.mkDerivation { + name = "o1js_bindings"; + src = with pkgs.lib.fileset; + (toSource { + root = ./.; + fileset = unions [ + ./src/mina + ./src/bindings/scripts + ./src/bindings/js + ./src/bindings/crypto + ./src/bindings/lib + ./src/bindings/mina-transaction/gen/dune + (fileFilter (file: file.hasExt "js") ./src/bindings/mina-transaction) + ./src/bindings/ocaml/lib + ./src/bindings/ocaml/dune + ./src/bindings/ocaml/dune-project + (fileFilter (file: file.hasExt "ml") ./src/bindings/ocaml) + ./package.json + ./package-lock.json + ./src/bindings/ocaml/jsoo_exports + ./dune-project + ./.prettierrc.cjs + ./src/build + ./src/snarky.d.ts + ]; + }); + inherit (inputs.mina.devShells."${system}".default) + PLONK_WASM_NODEJS + PLONK_WASM_WEB + MARLIN_PLONK_STUBS + ; + PREBUILT_KIMCHI_BINDINGS_JS_WEB = + "${mina.files.src-lib-crypto-kimchi_bindings-js-web}/src/lib/crypto/kimchi_bindings/js/web"; + PREBUILT_KIMCHI_BINDINGS_JS_NODE_JS = + "${mina.files.src-lib-crypto-kimchi_bindings-js-node_js}/src/lib/crypto/kimchi_bindings/js/node_js"; + EXPORT_TEST_VECTORS = "${test-vectors}/bin/export_test_vectors"; + buildInputs = bindings-pkgs ++ [ pkgs.bash ]; + SKIP_MINA_COMMIT = true; + JUST_BINDINGS = true; + patchPhase = '' + patchShebangs ./src/bindings/scripts/ + patchShebangs ./src/bindings/crypto/test-vectors/ + ''; + buildPhase = + '' + RUSTUP_HOME=$(pwd)/.rustup + export RUSTUP_HOME + rustup toolchain link nix ${rust-channel} + cp -r ${o1js-npm-deps}/lib/node_modules/ . + + mkdir -p src/bindings/compiled/node_bindings + echo '// this file exists to prevent TS from type-checking `o1js_node.bc.cjs`' \ + > src/bindings/compiled/node_bindings/o1js_node.bc.d.cts + + npm run build:update-bindings + + mkdir -p $out/mina-transaction + pushd ./src/bindings + rm -rf ./compiled/_node_bindings + cp -Lr ./compiled $out + cp -Lr ./mina-transaction/gen $out/mina-transaction/ + popd + ''; + }; + kimchi = pkgs.kimchi-rust-wasm; ocaml-js = prj.pkgs.__ocaml-js__; - default = pkgs.buildNpmPackage - { name = "o1js"; - src = ./.; - npmDepsHash = "sha256-++MTGDUVBccYN8LA2Xb0FkbrZ14ZyVCrDPESXa52AwQ="; - # TODO ideally re-build bindings here - }; + }; + apps = { + update-bindings = { + type = "app"; + program = "${pkgs.writeShellApplication + { name = "update-bindings"; + text = + '' + cp -r ${self.packages."${system}".o1js-bindings}/* ./src/bindings + chmod +w -R src/bindings/compiled + MINA_COMMIT=$(git -C src/mina rev-parse HEAD) + echo "The mina commit used to generate the backends for node and web is" "$MINA_COMMIT" \ + > src/bindings/MINA_COMMIT + ''; + }}/bin/update-bindings"; + }; }; }); } diff --git a/package-lock.json b/package-lock.json index ab82906a4..621dfa483 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "o1js", - "version": "2.1.0", + "version": "2.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "o1js", - "version": "2.1.0", + "version": "2.2.0", "license": "Apache-2.0", "dependencies": { "blakejs": "1.2.1", diff --git a/package.json b/package.json index e6043658c..617bd77c7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "o1js", "description": "TypeScript framework for zk-SNARKs and zkApps", - "version": "2.1.0", + "version": "2.2.0", "license": "Apache-2.0", "homepage": "https://github.com/o1-labs/o1js/", "repository": { diff --git a/pin.sh b/pin.sh index 6815dbac8..4007b0d18 100755 --- a/pin.sh +++ b/pin.sh @@ -9,5 +9,6 @@ git submodule sync && git submodule update --init --recursive # Add the flake registry entry nix registry add o1js "git+file://$ROOT?submodules=1" # update mina input to local submodule +# --override-input seems redundant but fixes a caching issue with local paths nix flake update mina --override-input mina 'path:src/mina' --flake '.?submodules=1' popd diff --git a/src/lib/mina/account-update.ts b/src/lib/mina/account-update.ts index 83ad58537..8bfcd71d6 100644 --- a/src/lib/mina/account-update.ts +++ b/src/lib/mina/account-update.ts @@ -552,7 +552,7 @@ interface Body extends AccountUpdateBody { * Events can be collected by archive nodes. * * [Check out our documentation about - * Events!](https://docs.minaprotocol.com/zkapps/advanced-o1js/events) + * Events!](https://docs.minaprotocol.com/zkapps/writing-a-zkapp/feature-overview/events) */ events: Events; /** @@ -561,7 +561,7 @@ interface Body extends AccountUpdateBody { * a {@link Reducer}. * * [Check out our documentation about - * Actions!](https://docs.minaprotocol.com/zkapps/advanced-o1js/actions-and-reducer) + * Actions!](https://docs.minaprotocol.com/zkapps/writing-a-zkapp/feature-overview/actions-and-reducer) */ actions: Events; /**