Skip to content

Commit dec0558

Browse files
committed
Merge branch 'main' into feature/conditional-recursive-proving
2 parents 8383bb6 + f7d522e commit dec0558

24 files changed

+522
-37
lines changed

.github/workflows/build-bindings.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
nix run o1js#update-bindings --max-jobs 4
3131
#fail if this changes any files
3232
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"
3335
git diff --exit-code
3436
- name: add build to gc-root if on main
3537
if: github.ref == 'refs/heads/main'
@@ -39,3 +41,18 @@ jobs:
3941
run: |
4042
nix-store --gc --print-dead
4143
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

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
4141

4242
- Compiling stuck in the browser for recursive zkprograms https://github.com/o1-labs/o1js/pull/1906
4343
- Error message in `rangeCheck16` gadget https://github.com/o1-labs/o1js/pull/1920
44+
- Deprecate `testnet` `networkId` in favor of `devnet` https://github.com/o1-labs/o1js/pull/1938
4445

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

README-dev.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

flake.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generate-keys.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env node
22
import Client from './dist/node/mina-signer/mina-signer.js';
33

4-
let client = new Client({ network: 'testnet' });
4+
let client = new Client({ network: 'devnet' });
55

66
console.log(client.genKeys());

src/lib/mina/local-blockchain.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ async function LocalBlockchain({
106106
const originalProofsEnabled = proofsEnabled;
107107

108108
return {
109-
getNetworkId: () => 'testnet' as NetworkId,
109+
getNetworkId: () => 'devnet' as NetworkId,
110110
proofsEnabled,
111111
getNetworkConstants() {
112112
return {

src/lib/mina/mina-instance.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ let activeInstance: Mina = {
117117
fetchActions: noActiveInstance,
118118
getActions: noActiveInstance,
119119
proofsEnabled: true,
120-
getNetworkId: () => 'testnet',
120+
getNetworkId: () => 'devnet',
121121
};
122122

123123
/**

src/lib/mina/mina.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ function Network(
117117
}
118118
| string
119119
): Mina {
120-
let minaNetworkId: NetworkId = 'testnet';
120+
let minaNetworkId: NetworkId = 'devnet';
121121
let minaGraphqlEndpoint: string;
122122
let archiveEndpoint: string;
123123
let lightnetAccountManagerEndpoint: string;

src/lib/mina/token/forest-iterator.unit-test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
import assert from 'assert';
1717
import { Field, Bool } from '../../provable/wrapped.js';
1818
import { PublicKey } from '../../provable/crypto/signature.js';
19+
import { NetworkId } from '../../../mina-signer/index.js';
1920

2021
// RANDOM NUMBER GENERATORS for account updates
2122

@@ -56,7 +57,7 @@ test.custom({ timeBudget: 1000 })(
5657
(flatUpdatesBigint) => {
5758
// reference: bigint callforest hash from mina-signer
5859
let forestBigint = accountUpdatesToCallForest(flatUpdatesBigint);
59-
let expectedHash = callForestHash(forestBigint, 'testnet');
60+
let expectedHash = callForestHash(forestBigint, 'devnet');
6061

6162
let flatUpdates = flatUpdatesBigint.map(accountUpdateFromBigint);
6263
let forest = AccountUpdateForest.fromFlatArray(flatUpdates);

0 commit comments

Comments
 (0)