Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 14 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:
- run:
name: "Build"
command: cond_spot_run_build aztec3-circuits-wasm-linux-clang 64

yarn-project-base:
machine:
image: ubuntu-2004:202010-01
Expand All @@ -91,6 +92,17 @@ jobs:
name: "Build and test"
command: build ethereum.js

circuits-js:
machine:
image: ubuntu-2004:202010-01
resource_class: large
steps:
- *checkout
- *setup_env
- run:
name: "Build and test"
command: build circuits.js

foundation:
machine:
image: ubuntu-2004:202010-01
Expand Down Expand Up @@ -231,13 +243,15 @@ workflows:
- aztec-js: *yarn_project
- end-to-end: *yarn_project
- foundation: *yarn_project
- circuits-js: *yarn_project
- e2e-join:
requires:
- ethereum-js
- aztec-js
- end-to-end
- noir-contracts
- foundation
- circuits-js
<<: *defaults
- e2e-deploy-contract: *e2e_test
- world-state: *yarn_project
Expand Down
7 changes: 7 additions & 0 deletions build_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@
"rebuildPatterns": ["^yarn-project/aztec.js/"],
"dependencies": ["aztec-rpc"]
},
"circuits.js": {
"buildDir": "yarn-project",
"projectDir": "yarn-project/circuits.js",
"dockerfile": "circuits.js/Dockerfile",
"rebuildPatterns": ["^yarn-project/circuits.js/"],
"dependencies": ["aztec-rpc"]
},
"barretenberg.js": {
"buildDir": "yarn-project",
"projectDir": "yarn-project/barretenberg.js",
Expand Down
20 changes: 20 additions & 0 deletions yarn-project/circuits.js/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/yarn-project-base AS builder

COPY foundation foundation
COPY circuits.js circuits.js

WORKDIR /usr/src/yarn-project/foundation
RUN yarn build

WORKDIR /usr/src/yarn-project/circuits.js
RUN cp /usr/src/aztec3-circuits/cpp/build-wasm/bin/aztec3-circuits.wasm src/wasm/aztec3-circuits.wasm
RUN yarn build && yarn formatting && yarn test

# Prune dev dependencies. See comment in base image.
RUN yarn cache clean
RUN yarn workspaces focus --production > /dev/null

FROM alpine:latest
COPY --from=builder /usr/src/yarn-project/circuits.js /usr/src/yarn-project/circuits.js
WORKDIR /usr/src/yarn-project/merkle-tree
ENTRYPOINT ["yarn", "test"]
2 changes: 1 addition & 1 deletion yarn-project/circuits.js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"clean": "rm -rf ./dest .tsbuildinfo",
"formatting": "prettier --check ./src && eslint --max-warnings 278 ./src",
"formatting:fix": "prettier -w ./src",
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --no-cache --passWithNoTests",
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --no-cache --passWithNoTests --maxWorkers=2",
"test-debug": "NODE_NO_WARNINGS=1 node --inspect-brk --experimental-vm-modules $(yarn bin jest) --no-cache --passWithNoTests --runInBand"
},
"jest": {
Expand Down
3 changes: 1 addition & 2 deletions yarn-project/circuits.js/src/structs/merge_rollup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ export class PreviousRollupData {
*/
public vkIndex: UInt32,
public vkSiblingPath: MembershipWitness<typeof ROLLUP_VK_TREE_HEIGHT>,
) {
}
) {}

toBuffer() {
return serializeToBuffer(this.publicInputs, this.proof, this.vk, this.vkIndex, this.vkSiblingPath);
Expand Down
16 changes: 11 additions & 5 deletions yarn-project/circuits.js/src/tests/factories.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { AztecAddress, EthAddress, Fq, Fr } from '@aztec/foundation';
import { CallContext, PreviousRollupData, PrivateCircuitPublicInputs, RootRollupInputs, RootRollupPublicInputs } from '../index.js';
import {
CallContext,
PreviousRollupData,
PrivateCircuitPublicInputs,
RootRollupInputs,
RootRollupPublicInputs,
} from '../index.js';
import { AppendOnlyTreeSnapshot, BaseRollupPublicInputs, ConstantBaseRollupData } from '../structs/base_rollup.js';
import {
ARGS_LENGTH,
Expand All @@ -22,7 +28,7 @@ import {
PUBLIC_CALL_STACK_LENGTH,
RETURN_VALUES_LENGTH,
ROLLUP_VK_TREE_HEIGHT,
VK_TREE_HEIGHT
VK_TREE_HEIGHT,
} from '../structs/constants.js';
import { FunctionData } from '../structs/function_data.js';
import {
Expand All @@ -34,7 +40,7 @@ import {
PreviousKernelData,
PrivateCallData,
PrivateKernelInputs,
PrivateKernelPublicInputs
PrivateKernelPublicInputs,
} from '../structs/kernel.js';
import { PrivateCallStackItem } from '../structs/private_call_stack_item.js';
import {
Expand All @@ -43,7 +49,7 @@ import {
ComposerType,
EcdsaSignature,
MembershipWitness,
UInt8Vector
UInt8Vector,
} from '../structs/shared.js';
import { ContractDeploymentData, SignedTxRequest, TxContext, TxRequest } from '../structs/tx.js';
import { CommitmentMap, G1AffineElement, VerificationKey } from '../structs/verification_key.js';
Expand Down Expand Up @@ -260,7 +266,7 @@ export function makePreviousBaseRollupData(seed = 0) {
makeVerificationKey(),
seed + 0x110,
makeMembershipWitness(ROLLUP_VK_TREE_HEIGHT, seed + 0x120),
)
);
}

export function makeRootRollupInputs(seed = 0) {
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/circuits.js/src/utils/serialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export type Bufferable =
}
| Bufferable[];

function isSerializableToBuffer32(obj: Object): obj is { toBuffer32: () => Buffer } {
function isSerializableToBuffer32(obj: object): obj is { toBuffer32: () => Buffer } {
return !!(obj as { toBuffer32: () => Buffer }).toBuffer32;
}

Expand Down