Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: build protocol circuits on CI and stop committing artifacts #3816

Merged
merged 21 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
035a8a6
add contract compilation and typescript generation to yarn build
dan-aztec Jan 3, 2024
243a77e
Merge branch 'master' into dan/build-protocol-artifacts-on-ci
dan-aztec Jan 3, 2024
1d2e663
also generate types on bootstrap
dan-aztec Jan 3, 2024
f2913c2
also do tsc -b to generate JS files
dan-aztec Jan 4, 2024
144af27
update point to grumpkin point
dan-aztec Jan 4, 2024
4fa2c29
update dockerfile to match bootstrap.sh change
dan-aztec Jan 4, 2024
6ab13de
make directory in noir:types
dan-aztec Jan 4, 2024
b0d20d1
move mkdir to ts script, not sure why merkle tree dep issue though
dan-aztec Jan 4, 2024
935c50f
try without formatting:fix
dan-aztec Jan 4, 2024
f449ccf
just format src/types
dan-aztec Jan 4, 2024
b88e2d1
format inside the typescript generator
dan-aztec Jan 4, 2024
4296afa
pr feedback
dan-aztec Jan 4, 2024
ba0bec7
Merge branch 'master' into dan/build-protocol-artifacts-on-ci
dan-aztec Jan 4, 2024
1548a57
move formatting out of typescript back into yarn command
dan-aztec Jan 4, 2024
0ca1a37
Merge branch 'dan/build-protocol-artifacts-on-ci' of https://github.c…
dan-aztec Jan 4, 2024
9d79c0c
unused import
dan-aztec Jan 4, 2024
6372bcb
commit deletion
dan-aztec Jan 4, 2024
cdc1089
hmm didnt actually delete the files on last merge conflict
dan-aztec Jan 5, 2024
fb1cb49
Merge branch 'master' into dan/build-protocol-artifacts-on-ci
dan-aztec Jan 5, 2024
caa0d39
Merge branch 'master' into dan/build-protocol-artifacts-on-ci
dan-aztec Jan 5, 2024
379a995
Merge branch 'master' into dan/build-protocol-artifacts-on-ci
dan-aztec Jan 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion yarn-project/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN yarn workspace @aztec/noir-contracts build:contracts
# We need to build aztec.js as it needs to copy in account contracts from noir-contracts.
# TODO: Contracts should not be baked into aztec.js.
RUN yarn workspace @aztec/aztec.js build
RUN yarn workspace @aztec/noir-protocol-circuits noir:build
RUN yarn workspace @aztec/noir-protocol-circuits build
RUN yarn tsc -b

ENTRYPOINT ["yarn"]
2 changes: 1 addition & 1 deletion yarn-project/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ yarn workspace @aztec/noir-contracts build:contracts
# TODO: Contracts should not be baked into aztec.js.
yarn workspace @aztec/aztec.js build:copy-contracts
# Build protocol circuits. TODO: move pre yarn-project.
yarn workspace @aztec/noir-protocol-circuits noir:build
yarn workspace @aztec/noir-protocol-circuits build

yarn build

Expand Down
1 change: 1 addition & 0 deletions yarn-project/noir-protocol-circuits/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ Prover.toml
Verifier.toml
src/target
src/crs
src/types
8 changes: 4 additions & 4 deletions yarn-project/noir-protocol-circuits/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
"./types": "./dest/types/index.js"
},
"scripts": {
"build": "yarn clean && tsc -b",
"build:dev": "tsc -b --watch",
"clean": "rm -rf ./dest .tsbuildinfo",
"build": "yarn clean && yarn noir:build && yarn noir:types",
"clean": "rm -rf ./dest .tsbuildinfo src/types src/target",
"formatting": "run -T prettier --check ./src && run -T eslint ./src",
"formatting:fix": "NODE_OPTIONS='--max-old-space-size=8096' run -T eslint --fix ./src && run -T prettier -w ./src",
"formatting:fix:types": "NODE_OPTIONS='--max-old-space-size=8096' run -T eslint --fix ./src/types && run -T prettier -w ./src/types",
"noir:build": "cd src && ../../../noir/target/release/nargo compile --silence-warnings && rm -rf ./target/debug_*",
"noir:types": "node --loader ts-node/esm src/scripts/generate_ts_from_abi.ts && yarn formatting:fix",
"noir:types": "node --loader ts-node/esm src/scripts/generate_ts_from_abi.ts && yarn formatting:fix:types",
"noir:test": "cd src && ../../../noir/target/release/nargo test",
"test": "yarn test:js && yarn noir:test",
"test:js": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,19 @@ const circuits = [
];

const main = async () => {
try {
await fs.access('./src/types/');
} catch (error) {
await fs.mkdir('./src/types', { recursive: true });
}

for (const circuit of circuits) {
const rawData = await fs.readFile(`./src/target/${circuit}.json`, 'utf-8');
const abiObj: NoirCompiledCircuit = JSON.parse(rawData);
const generatedInterface = generateTsInterface(abiObj.abi);
await fs.writeFile(`./src/types/${circuit}_types.ts`, generatedInterface);

const outputFile = `./src/types/${circuit}_types.ts`;
await fs.writeFile(outputFile, generatedInterface);
}
};

Expand Down
2 changes: 1 addition & 1 deletion yarn-project/noir-protocol-circuits/src/type_conversion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ import {
AztecAddress as NoirAztecAddress,
EthAddress as NoirEthAddress,
Field as NoirField,
Point as NoirPoint,
GrumpkinPoint as NoirPoint,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does it suddenly become GrumpkinPoint?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OptionallyRevealedData as OptionallyRevealedDataNoir,
PrivateCallData as PrivateCallDataNoir,
PrivateCallStackItem as PrivateCallStackItemNoir,
Expand Down
dan-aztec marked this conversation as resolved.
Show resolved Hide resolved

This file was deleted.