Skip to content

Commit fa1c456

Browse files
authored
chore: build protocol circuits on CI and stop committing artifacts (AztecProtocol#3816)
This makes the process consistent with how the noir contracts and other artifacts are built.
1 parent 9a55e57 commit fa1c456

14 files changed

+17
-1525
lines changed

yarn-project/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ RUN yarn workspace @aztec/noir-compiler build
1515
RUN yarn workspace @aztec/noir-contracts build:contracts
1616
# We need to build accounts as it needs to copy in account contracts from noir-contracts.
1717
RUN yarn workspace @aztec/accounts build:copy-contracts
18-
RUN yarn workspace @aztec/noir-protocol-circuits noir:build
18+
RUN yarn workspace @aztec/noir-protocol-circuits build
1919
RUN yarn tsc -b
2020

2121
ENTRYPOINT ["yarn"]

yarn-project/bootstrap.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ yarn workspace @aztec/noir-compiler build
3636
yarn workspace @aztec/noir-contracts build:contracts
3737
yarn workspace @aztec/accounts build:copy-contracts
3838
# Build protocol circuits. TODO: move pre yarn-project.
39-
yarn workspace @aztec/noir-protocol-circuits noir:build
39+
yarn workspace @aztec/noir-protocol-circuits build
4040

4141
yarn build
4242

yarn-project/noir-protocol-circuits/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ Prover.toml
33
Verifier.toml
44
src/target
55
src/crs
6+
src/types

yarn-project/noir-protocol-circuits/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
"./types": "./dest/types/index.js"
88
},
99
"scripts": {
10-
"build": "yarn clean && tsc -b",
11-
"build:dev": "tsc -b --watch",
12-
"clean": "rm -rf ./dest .tsbuildinfo",
10+
"build": "yarn clean && yarn noir:build && yarn noir:types",
11+
"clean": "rm -rf ./dest .tsbuildinfo src/types src/target",
1312
"formatting": "run -T prettier --check ./src && run -T eslint ./src",
1413
"formatting:fix": "NODE_OPTIONS='--max-old-space-size=8096' run -T eslint --fix ./src && run -T prettier -w ./src",
14+
"formatting:fix:types": "NODE_OPTIONS='--max-old-space-size=8096' run -T eslint --fix ./src/types && run -T prettier -w ./src/types",
1515
"noir:build": "cd src && ../../../noir/target/release/nargo compile --silence-warnings && rm -rf ./target/debug_*",
16-
"noir:types": "node --loader ts-node/esm src/scripts/generate_ts_from_abi.ts && yarn formatting:fix",
16+
"noir:types": "node --loader ts-node/esm src/scripts/generate_ts_from_abi.ts && yarn formatting:fix:types",
1717
"noir:test": "cd src && ../../../noir/target/release/nargo test",
1818
"test": "yarn test:js && yarn noir:test",
1919
"test:js": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --passWithNoTests"

yarn-project/noir-protocol-circuits/src/scripts/generate_ts_from_abi.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,19 @@ const circuits = [
209209
];
210210

211211
const main = async () => {
212+
try {
213+
await fs.access('./src/types/');
214+
} catch (error) {
215+
await fs.mkdir('./src/types', { recursive: true });
216+
}
217+
212218
for (const circuit of circuits) {
213219
const rawData = await fs.readFile(`./src/target/${circuit}.json`, 'utf-8');
214220
const abiObj: NoirCompiledCircuit = JSON.parse(rawData);
215221
const generatedInterface = generateTsInterface(abiObj.abi);
216-
await fs.writeFile(`./src/types/${circuit}_types.ts`, generatedInterface);
222+
223+
const outputFile = `./src/types/${circuit}_types.ts`;
224+
await fs.writeFile(outputFile, generatedInterface);
217225
}
218226
};
219227

yarn-project/noir-protocol-circuits/src/type_conversion.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ import {
8787
AztecAddress as NoirAztecAddress,
8888
EthAddress as NoirEthAddress,
8989
Field as NoirField,
90-
Point as NoirPoint,
90+
GrumpkinPoint as NoirPoint,
9191
OptionallyRevealedData as OptionallyRevealedDataNoir,
9292
PrivateCallData as PrivateCallDataNoir,
9393
PrivateCallStackItem as PrivateCallStackItemNoir,

yarn-project/noir-protocol-circuits/src/types/private_kernel_init_types.ts

-233
This file was deleted.

0 commit comments

Comments
 (0)