Skip to content

Commit

Permalink
chore: Recreated types package without circuits.js dependency (AztecP…
Browse files Browse the repository at this point in the history
…rotocol#3970)

This PR recreates the types package as types that do not depend on
circuits.js.
  • Loading branch information
PhilWindle authored Jan 12, 2024
1 parent 7937a26 commit 54f4ba1
Show file tree
Hide file tree
Showing 35 changed files with 181 additions and 41 deletions.
3 changes: 2 additions & 1 deletion boxes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"@aztec/foundation": "portal:../yarn-project/foundation",
"@aztec/bb.js": "portal:../barretenberg/ts",
"@aztec/circuit-types": "portal:../yarn-project/circuit-types",
"@aztec/ethereum": "portal:../yarn-project/ethereum"
"@aztec/ethereum": "portal:../yarn-project/ethereum",
"@aztec/types": "portal:../yarn-project/types"
}
}
49 changes: 22 additions & 27 deletions boxes/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ __metadata:
resolution: "@aztec/accounts@portal:../yarn-project/accounts::locator=%40aztec%2Fboxes%40workspace%3A."
dependencies:
"@aztec/aztec.js": "workspace:^"
"@aztec/circuit-types": "workspace:^"
"@aztec/circuits.js": "workspace:^"
"@aztec/ethereum": "workspace:^"
"@aztec/foundation": "workspace:^"
"@aztec/circuit-types": "workspace:^"
"@aztec/types": "workspace:^"
tslib: "npm:^2.4.0"
languageName: node
linkType: soft
Expand Down Expand Up @@ -65,12 +66,11 @@ __metadata:
version: 0.0.0-use.local
resolution: "@aztec/aztec.js@portal:../yarn-project/aztec.js::locator=%40aztec%2Fboxes%40workspace%3A."
dependencies:
"@aztec/circuit-types": "workspace:^"
"@aztec/circuits.js": "workspace:^"
"@aztec/ethereum": "workspace:^"
"@aztec/foundation": "workspace:^"
"@aztec/circuit-types": "workspace:^"
lodash.every: "npm:^4.6.0"
lodash.partition: "npm:^4.6.0"
"@aztec/types": "workspace:^"
tslib: "npm:^2.4.0"
languageName: node
linkType: soft
Expand Down Expand Up @@ -231,6 +231,22 @@ __metadata:
languageName: unknown
linkType: soft

"@aztec/circuit-types@portal:../yarn-project/circuit-types::locator=%40aztec%2Fboxes%40workspace%3A.":
version: 0.0.0-use.local
resolution: "@aztec/circuit-types@portal:../yarn-project/circuit-types::locator=%40aztec%2Fboxes%40workspace%3A."
dependencies:
"@aztec/circuits.js": "workspace:^"
"@aztec/ethereum": "workspace:^"
"@aztec/foundation": "workspace:^"
"@aztec/types": "workspace:^"
browserify-cipher: "npm:^1.0.1"
lodash.clonedeep: "npm:^4.5.0"
lodash.isequal: "npm:^4.5.0"
lodash.times: "npm:^4.3.2"
tslib: "npm:^2.5.0"
languageName: node
linkType: soft

"@aztec/circuits.js@portal:../yarn-project/circuits.js::locator=%40aztec%2Fboxes%40workspace%3A.":
version: 0.0.0-use.local
resolution: "@aztec/circuits.js@portal:../yarn-project/circuits.js::locator=%40aztec%2Fboxes%40workspace%3A."
Expand Down Expand Up @@ -281,18 +297,11 @@ __metadata:
languageName: node
linkType: soft

"@aztec/circuit-types@portal:../yarn-project/types::locator=%40aztec%2Fboxes%40workspace%3A.":
"@aztec/types@portal:../yarn-project/types::locator=%40aztec%2Fboxes%40workspace%3A.":
version: 0.0.0-use.local
resolution: "@aztec/circuit-types@portal:../yarn-project/types::locator=%40aztec%2Fboxes%40workspace%3A."
resolution: "@aztec/types@portal:../yarn-project/types::locator=%40aztec%2Fboxes%40workspace%3A."
dependencies:
"@aztec/circuits.js": "workspace:^"
"@aztec/ethereum": "workspace:^"
"@aztec/foundation": "workspace:^"
browserify-cipher: "npm:^1.0.1"
lodash.clonedeep: "npm:^4.5.0"
lodash.isequal: "npm:^4.5.0"
lodash.times: "npm:^4.3.2"
tslib: "npm:^2.5.0"
languageName: node
linkType: soft

Expand Down Expand Up @@ -9438,13 +9447,6 @@ __metadata:
languageName: node
linkType: hard

"lodash.every@npm:^4.6.0":
version: 4.6.0
resolution: "lodash.every@npm:4.6.0"
checksum: 67dd78cf01e3a4dbeaf6095d766e6868a229bb71a9a438d4a0bf5425326fd8e8ceee97c0079961697dae984e1052db6c31d4e7c54da7899f36a88702ed13cee1
languageName: node
linkType: hard

"lodash.isarguments@npm:^3.1.0":
version: 3.1.0
resolution: "lodash.isarguments@npm:3.1.0"
Expand Down Expand Up @@ -9473,13 +9475,6 @@ __metadata:
languageName: node
linkType: hard

"lodash.partition@npm:^4.6.0":
version: 4.6.0
resolution: "lodash.partition@npm:4.6.0"
checksum: a65f48f5f11a009656b3441a063948316923a48f7bfc9454064ba81f75e72ac038c61450c263f4874d8413052a20aacfc18a46dd6d8a9a287221a46e78733f45
languageName: node
linkType: hard

"lodash.times@npm:^4.3.2":
version: 4.3.2
resolution: "lodash.times@npm:4.3.2"
Expand Down
1 change: 1 addition & 0 deletions yarn-project/accounts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"@aztec/circuits.js": "workspace:^",
"@aztec/ethereum": "workspace:^",
"@aztec/foundation": "workspace:^",
"@aztec/types": "workspace:^",
"tslib": "^2.4.0"
},
"devDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion yarn-project/accounts/src/defaults/account_contract.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { AccountContract, AccountInterface, AuthWitnessProvider } from '@aztec/aztec.js/account';
import { CompleteAddress, NodeInfo } from '@aztec/circuit-types';
import { CompleteAddress } from '@aztec/circuit-types';
import { ContractArtifact } from '@aztec/foundation/abi';
import { NodeInfo } from '@aztec/types/interfaces';

import { DefaultAccountInterface } from '../defaults/account_interface.js';

Expand Down
3 changes: 2 additions & 1 deletion yarn-project/accounts/src/defaults/account_interface.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { AccountInterface, AuthWitnessProvider, EntrypointInterface } from '@aztec/aztec.js/account';
import { AuthWitness, FunctionCall, NodeInfo, TxExecutionRequest } from '@aztec/circuit-types';
import { AuthWitness, FunctionCall, TxExecutionRequest } from '@aztec/circuit-types';
import { CompleteAddress, Fr } from '@aztec/circuits.js';
import { NodeInfo } from '@aztec/types/interfaces';

import { DefaultAccountEntrypoint } from './account_entrypoint.js';

Expand Down
3 changes: 3 additions & 0 deletions yarn-project/accounts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
},
{
"path": "../foundation"
},
{
"path": "../types"
}
],
"include": ["src", "src/**/*.json"]
Expand Down
1 change: 1 addition & 0 deletions yarn-project/aztec.js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"@aztec/circuits.js": "workspace:^",
"@aztec/ethereum": "workspace:^",
"@aztec/foundation": "workspace:^",
"@aztec/types": "workspace:^",
"tslib": "^2.4.0"
},
"devDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion yarn-project/aztec.js/src/account/contract.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { CompleteAddress, NodeInfo } from '@aztec/circuit-types';
import { CompleteAddress } from '@aztec/circuit-types';
import { ContractArtifact } from '@aztec/foundation/abi';
import { NodeInfo } from '@aztec/types/interfaces';

import { AccountInterface } from './interface.js';

Expand Down
3 changes: 2 additions & 1 deletion yarn-project/aztec.js/src/contract/contract.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { ExtendedContractData, NodeInfo, Tx, TxExecutionRequest, TxHash, TxReceipt } from '@aztec/circuit-types';
import { ExtendedContractData, Tx, TxExecutionRequest, TxHash, TxReceipt } from '@aztec/circuit-types';
import { AztecAddress, CompleteAddress, EthAddress } from '@aztec/circuits.js';
import { L1ContractAddresses } from '@aztec/ethereum';
import { ABIParameterVisibility, ContractArtifact, FunctionType } from '@aztec/foundation/abi';
import { NodeInfo } from '@aztec/types/interfaces';

import { MockProxy, mock } from 'jest-mock-extended';

Expand Down
3 changes: 2 additions & 1 deletion yarn-project/aztec.js/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ export {
LogId,
LogType,
MerkleTreeId,
NodeInfo,
Note,
PXE,
PackedArguments,
Expand All @@ -110,6 +109,8 @@ export {
mockTx,
} from '@aztec/circuit-types';

export { NodeInfo } from '@aztec/types/interfaces';

// TODO: These kinds of things have no place on our public api.
// External devs will almost certainly have their own methods of doing these things.
// If we want to use them in our own "aztec.js consuming code", import them from foundation as needed.
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/aztec.js/src/wallet/base_wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
L2Block,
L2Tx,
LogFilter,
NodeInfo,
NoteFilter,
PXE,
SyncStatus,
Expand All @@ -19,6 +18,7 @@ import {
TxReceipt,
} from '@aztec/circuit-types';
import { AztecAddress, CompleteAddress, Fr, GrumpkinPrivateKey, PartialAddress } from '@aztec/circuits.js';
import { NodeInfo } from '@aztec/types/interfaces';

import { Wallet } from '../account/wallet.js';

Expand Down
3 changes: 3 additions & 0 deletions yarn-project/aztec.js/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
},
{
"path": "../foundation"
},
{
"path": "../types"
}
],
"include": ["src", "src/**/*.json"]
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/circuit-types/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Types
A package containing types which are relevant through all the Aztec Typescript codebase (L2Block, Tx etc.).
# Circuit Types
A package containing circuit dependent types which are relevant through all the Aztec Typescript codebase.
3 changes: 2 additions & 1 deletion yarn-project/circuit-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"entryPoints": [
"./src/index.ts"
],
"name": "Aztec 3 Types",
"name": "Aztec 3 Circuit Types",
"tsconfig": "./tsconfig.json"
},
"scripts": {
Expand All @@ -40,6 +40,7 @@
"@aztec/circuits.js": "workspace:^",
"@aztec/ethereum": "workspace:^",
"@aztec/foundation": "workspace:^",
"@aztec/types": "workspace:^",
"browserify-cipher": "^1.0.1",
"lodash.clonedeep": "^4.5.0",
"lodash.isequal": "^4.5.0",
Expand Down
1 change: 0 additions & 1 deletion yarn-project/circuit-types/src/interfaces/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ export * from './hasher.js';
export * from './aztec-node.js';
export * from './pxe.js';
export * from './deployed-contract.js';
export * from './node-info.js';
export * from './sync-status.js';
export * from './configs.js';
export * from './nullifier_tree.js';
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/circuit-types/src/interfaces/pxe.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { AztecAddress, CompleteAddress, Fr, GrumpkinPrivateKey, PartialAddress } from '@aztec/circuits.js';
import { NodeInfo } from '@aztec/types/interfaces';

import { AuthWitness } from '../auth_witness.js';
import { ContractData, ExtendedContractData } from '../contract_data.js';
Expand All @@ -10,7 +11,6 @@ import { NoteFilter } from '../notes/note_filter.js';
import { Tx, TxHash, TxReceipt } from '../tx/index.js';
import { TxExecutionRequest } from '../tx_execution_request.js';
import { DeployedContract } from './deployed-contract.js';
import { NodeInfo } from './node-info.js';
import { SyncStatus } from './sync-status.js';

// docs:start:pxe-interface
Expand Down
3 changes: 3 additions & 0 deletions yarn-project/circuit-types/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
},
{
"path": "../foundation"
},
{
"path": "../types"
}
],
"include": ["src"]
Expand Down
1 change: 1 addition & 0 deletions yarn-project/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"@aztec/l1-artifacts": "workspace:^",
"@aztec/noir-compiler": "workspace:^",
"@aztec/noir-contracts": "workspace:^",
"@aztec/types": "workspace:^",
"@iarna/toml": "^2.2.5",
"@libp2p/peer-id-factory": "^3.0.4",
"commander": "^9.0.0",
Expand Down
3 changes: 2 additions & 1 deletion yarn-project/cli/src/client.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { NodeInfo, PXE } from '@aztec/circuit-types';
import { PXE } from '@aztec/circuit-types';
import { NodeInfo } from '@aztec/types/interfaces';

import { MockProxy, mock } from 'jest-mock-extended';

Expand Down
2 changes: 2 additions & 0 deletions yarn-project/cli/src/cmds/unbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const resolutions: { [key: string]: string } = {
'@aztec/bb.js': 'portal:.aztec-packages/barretenberg/ts',
'@aztec/circuit-types': 'portal:.aztec-packages/yarn-project/circuit-types',
'@aztec/ethereum': 'portal:.aztec-packages/yarn-project/ethereum',
'@aztec/types': 'portal:.aztec-packages/yarn-project/types',
};

/**
Expand Down Expand Up @@ -68,6 +69,7 @@ function copyDependenciesToBox(dirName: string, destPath: string) {
'yarn-project/circuits.js',
'yarn-project/foundation',
'yarn-project/types',
'yarn-project/circuit-types',
'yarn-project/ethereum',
].forEach(path =>
cpSync(dirName + '/../../../../' + path, destPath + '/.aztec-packages/' + path, {
Expand Down
3 changes: 3 additions & 0 deletions yarn-project/cli/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
},
{
"path": "../noir-contracts"
},
{
"path": "../types"
}
],
"include": ["src"],
Expand Down
1 change: 1 addition & 0 deletions yarn-project/deploy_npm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ function deploy_package() {

# New packages here should be added after the last package that they depend on
deploy_package foundation
deploy_package types
deploy_package circuits.js
deploy_package circuit-types
deploy_package aztec.js
Expand Down
1 change: 1 addition & 0 deletions yarn-project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"rollup-provider",
"sequencer-client",
"scripts",
"types",
"world-state",
"yarn-project-base",
"kv-store"
Expand Down
1 change: 1 addition & 0 deletions yarn-project/pxe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"@aztec/kv-store": "workspace:^",
"@aztec/noir-compiler": "workspace:^",
"@aztec/noir-protocol-circuits": "workspace:^",
"@aztec/types": "workspace:^",
"koa": "^2.14.2",
"koa-router": "^12.0.0",
"lodash.omit": "^4.5.0",
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/pxe/src/pxe_service/pxe_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
L2Tx,
LogFilter,
MerkleTreeId,
NodeInfo,
NoteFilter,
PXE,
SimulationError,
Expand Down Expand Up @@ -54,6 +53,7 @@ import { SerialQueue } from '@aztec/foundation/fifo';
import { DebugLogger, createDebugLogger } from '@aztec/foundation/log';
import { Timer } from '@aztec/foundation/timer';
import { NoirWasmVersion } from '@aztec/noir-compiler/versions';
import { NodeInfo } from '@aztec/types/interfaces';

import { PXEServiceConfig, getPackageInfo } from '../config/index.js';
import { ContractDataOracle } from '../contract_data_oracle/index.js';
Expand Down
3 changes: 3 additions & 0 deletions yarn-project/pxe/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
},
{
"path": "../noir-protocol-circuits"
},
{
"path": "../types"
}
],
"include": ["src"]
Expand Down
1 change: 1 addition & 0 deletions yarn-project/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
{ "path": "p2p-bootstrap/tsconfig.json" },
{ "path": "prover-client/tsconfig.json" },
{ "path": "sequencer-client/tsconfig.json" },
{ "path": "types/tsconfig.json" },
{ "path": "world-state/tsconfig.json" },
{ "path": "scripts/tsconfig.json" }
],
Expand Down
1 change: 1 addition & 0 deletions yarn-project/types/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@aztec/foundation/eslint');
2 changes: 2 additions & 0 deletions yarn-project/types/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Types
A package containing non circuit dependent types which are relevant through all the Aztec Typescript codebase.
Loading

0 comments on commit 54f4ba1

Please sign in to comment.