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
35 changes: 23 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ parameters:
workflow:
type: string
default: "system"
target:
type: enum
default: "dev"
description: The environment to trigger redeploys to
enum: ["dev", "stage", "testnet"]

# This build step checks out the code from the repository. It has a hardcoded readonly key to allow the checkout.
# Initially it just fetches the repo metadata for the current commit hash to a depth of 50 commits.
Expand Down Expand Up @@ -99,6 +94,17 @@ jobs:
name: "Build and test"
command: build aztec.js

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

end-to-end:
machine:
image: ubuntu-2004:202010-01
Expand Down Expand Up @@ -132,32 +138,37 @@ jobs:

# Repeatable config for defining the workflow below.
tag_regex: &tag_regex /v[0-9]+(\.[0-9]+)*(-[a-zA-Z-]+\.[0-9]+)?/
tag_filter: &tag_filter
tags:
only: *tag_regex
defaults: &defaults
filters:
tags:
only: *tag_regex
context:
- build
yarn_project: &yarn_project
requires:
- yarn-project-base
filters: *tag_filter
<<: *defaults
e2e_test: &e2e_test
requires:
- e2e-join
filters: *tag_filter
<<: *defaults

workflows:
system:
when:
equal: [system, << pipeline.parameters.workflow >>]
jobs:
- yarn-project-base:
filters: *tag_filter
<<: *defaults
- ethereum-js: *yarn_project
- aztec-js: *yarn_project
- acir-simulator: *yarn_project
- end-to-end: *yarn_project
- e2e-join:
requires:
- ethereum-js
- aztec-js
- acir-simulator
- end-to-end
filters: *tag_filter
<<: *defaults
- e2e-deploy-contract: *e2e_test
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ The Aztec 3 system consists of the following sub projects.
- `archiver`
- `aztec-cli`
- `aztec.js`
- `barretenberg.js`
- `circuit.js`
- `ethereum.js`
- `kernel-simulator`
- `key-store`
Expand Down
2 changes: 0 additions & 2 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ PROJECTS=(
# "yarn-project/acir-simulator:yarn build"
# "yarn-project/aztec-cli:yarn build"
"yarn-project/aztec.js:yarn build"
# "yarn-project/barretenberg.js:yarn build"
# "yarn-project/circuit.js:yarn build"
"yarn-project/archiver:yarn build"
# "yarn-project/ethereum.js:yarn build"
# "yarn-project/kernel-simulator:yarn build"
Expand Down
14 changes: 0 additions & 14 deletions build_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,6 @@
"rebuildPatterns": ["^yarn-project/aztec.js/"],
"dependencies": ["yarn-project-base"]
},
"barretenberg.js": {
"buildDir": "yarn-project",
"projectDir": "yarn-project/barretenberg.js",
"dockerfile": "barretenberg.js/Dockerfile",
"rebuildPatterns": ["^yarn-project/barretenberg.js/"],
"dependencies": ["yarn-project-base"]
},
"circuit.js": {
"buildDir": "yarn-project",
"projectDir": "yarn-project/circuit.js",
"dockerfile": "circuit.js/Dockerfile",
"rebuildPatterns": ["^yarn-project/circuit.js/"],
"dependencies": ["yarn-project-base"]
},
"end-to-end": {
"buildDir": "yarn-project",
"projectDir": "yarn-project/end-to-end",
Expand Down
2 changes: 0 additions & 2 deletions build_manifest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ PROJECTS=(
# archiver:yarn-project
# aztec-cli:yarn-project
# aztec.js:yarn-project
# barretenberg.js:yarn-project
# circuit.js:yarn-project
# end-to-end:yarn-project
# ethereum.js:yarn-project
# kernel-simulator:yarn-project
Expand Down
3 changes: 3 additions & 0 deletions yarn-project/acir-simulator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@
"devDependencies": {
"@aztec/eslint-config": "workspace:^",
"@jest/globals": "^29.4.3",
"@noir-lang/noir-source-resolver": "^1.1.0",
"@noir-lang/noir_wasm": "0.3.2-29b1f7df",
"@rushstack/eslint-patch": "^1.1.4",
"@types/jest": "^29.4.0",
"@types/node": "^18.7.23",
"jest": "^28.1.3",
"toml": "^3.0.0",
"ts-jest": "^28.0.7",
"ts-node": "^10.9.1",
"typescript": "^4.9.5"
Expand Down
1 change: 1 addition & 0 deletions yarn-project/acir-simulator/src/declarations.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module '@noir-lang/noir-source-resolver';
9 changes: 9 additions & 0 deletions yarn-project/acir-simulator/src/fixtures/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { compileCircuit } from './index.js';

test('it should compile the constructor circuit', () => {
const { circuit, abi } = compileCircuit('constructor');

expect(circuit.length).toBeGreaterThan(0);
expect(abi.parameters.length).toBe(4);
expect(abi.return_type).toBe(null);
});
121 changes: 121 additions & 0 deletions yarn-project/acir-simulator/src/fixtures/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
import { compile } from '@noir-lang/noir_wasm';
import { dirname, join as pathJoin } from 'path';
import { fileURLToPath } from 'url';
import fs from 'fs';
import { initialiseResolver } from '@noir-lang/noir-source-resolver';
import toml from 'toml';

const circuitsPath = pathJoin(dirname(fileURLToPath(import.meta.url)), 'circuits');

/**
* A dependency entry of Nargo.toml.
*/
interface Dependency {
/**
* Path to the dependency.
*/
path?: string;
/**
* Git repository of the dependency.
*/
git?: string;
}

/**
* A circuit type.
*/
interface CircuitType {
/**
* The actual type.
*/
kind: any;
}

/**
* A parameter to the circuit.
*/
interface Parameter {
/**
* The name of the parameter.
*/
name: string;
/**
* The type of the parameter.
*/
type: CircuitType;
/**
* The visibility of the parameter.
*/
visibility: 'private' | 'public';
}

/**
* The representation of a compiled circuit.
*/
interface CompiledCircuit {
/**
* The bytecode of the circuit.
*/
circuit: Array<number>;
/**
* The Noir ABI of the circuit.
*/
abi: {
/**
* The circuit parameters.
*/
parameters: Array<Parameter>;
/**
* The witness indices for the parameters.
*/
param_witnesses: Record<string, Array<number>>;
/**
* The circuit return type.
*/
return_type: CircuitType | null;
/**
* The witness indices for the return value.
*/
return_witnesses: Array<number>;
};
}

/**
*
* @param circuitPath - Path to the circuit crate.
* @returns The dependencies of the circuit as a map of name to dependency entry.
*/
function readDependencies(circuitPath: string) {
const { dependencies } = toml.parse(fs.readFileSync(pathJoin(circuitPath, 'Nargo.toml'), { encoding: 'utf8' }));
return dependencies as Record<string, Dependency>;
}

/**
* Compiles a noir circuit fixture by name.
* @param circuitName - Name of the circuit fixture to compile.
* @returns The compiled circuit.
*/
export function compileCircuit(circuitName: string) {
const circuitPath = pathJoin(circuitsPath, circuitName);
const dependenciesMap = readDependencies(circuitPath);

initialiseResolver((id: `${string}/lib.nr` | 'main.nr') => {
let path;
if (id === 'main.nr') {
path = pathJoin(circuitPath, 'src/main.nr');
} else {
const [dependencyName] = id.split('/');
const dependency = dependenciesMap[dependencyName];
if (!dependency.path) {
throw new Error(`Don't know how to resolve dependency ${dependencyName}`);
}
path = pathJoin(circuitPath, dependency.path, 'src/lib.nr');
}
const result = fs.readFileSync(path, { encoding: 'utf8' });
return result;
});

return compile({
optional_dependencies_set: Object.keys(dependenciesMap), // eslint-disable-line camelcase
}) as CompiledCircuit;
}
17 changes: 2 additions & 15 deletions yarn-project/archiver/src/l2_block/l2_block.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { numToUInt32BE } from '@aztec/foundation';

/**
* A snapshot of an append only tree.
*/
Expand Down Expand Up @@ -236,21 +238,6 @@ export function bufferToAppendOnlyTreeSnapshot(buffer: Buffer): AppendOnlyTreeSn
};
}

/**
* FUNCTIONS THAT SHOULD NOT BE HERE.
*/

/**
* For serializing numbers to 32 byte big-endian form.
* @param n - The number to serialize.
* @param bufferSize - The size of the buffer to serialize to, defaults to 4.
*/
export function numToUInt32BE(n: number, bufferSize = 4): Buffer {
const buf = Buffer.alloc(bufferSize);
buf.writeUInt32BE(n, bufferSize - 4);
return buf;
}

/**
* UNUSED TYPED THAT COULD BE USEFUL.
*/
Expand Down
42 changes: 0 additions & 42 deletions yarn-project/archiver/src/running_promise.ts

This file was deleted.

6 changes: 0 additions & 6 deletions yarn-project/barretenberg.js/.eslintrc.cjs

This file was deleted.

12 changes: 0 additions & 12 deletions yarn-project/barretenberg.js/Dockerfile

This file was deleted.

1 change: 0 additions & 1 deletion yarn-project/barretenberg.js/README.md

This file was deleted.

Loading