Skip to content

Commit

Permalink
chore: build protocol circuits on CI and stop committing artifacts (A…
Browse files Browse the repository at this point in the history
…ztecProtocol#3816)

This makes the process consistent with how the noir contracts and other
artifacts are built.
  • Loading branch information
dan-aztec authored Jan 8, 2024
1 parent d0051c5 commit 436807d
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 1,525 deletions.
2 changes: 1 addition & 1 deletion yarn-project/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN yarn workspace @aztec/noir-compiler build
RUN yarn workspace @aztec/noir-contracts build:contracts
# We need to build accounts as it needs to copy in account contracts from noir-contracts.
RUN yarn workspace @aztec/accounts build:copy-contracts
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 @@ -36,7 +36,7 @@ yarn workspace @aztec/noir-compiler build
yarn workspace @aztec/noir-contracts build:contracts
yarn workspace @aztec/accounts 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,
OptionallyRevealedData as OptionallyRevealedDataNoir,
PrivateCallData as PrivateCallDataNoir,
PrivateCallStackItem as PrivateCallStackItemNoir,
Expand Down

This file was deleted.

Loading

0 comments on commit 436807d

Please sign in to comment.