From 7f0d2a7c383b506cd2d9a0b56cc7bac933a4ad3f Mon Sep 17 00:00:00 2001 From: thunkar Date: Thu, 20 Feb 2025 11:10:57 +0100 Subject: [PATCH 1/7] wip --- boxes/package.json | 3 +- yarn-project/accounts/package.json | 1 - yarn-project/accounts/tsconfig.json | 3 - yarn-project/archiver/package.json | 1 - yarn-project/archiver/tsconfig.json | 3 - yarn-project/aztec-node/package.json | 1 - yarn-project/aztec-node/tsconfig.json | 3 - yarn-project/aztec.js/package.json | 1 - yarn-project/aztec.js/tsconfig.json | 3 - yarn-project/aztec/package.json | 1 - yarn-project/aztec/src/cli/cmds/start_pxe.ts | 2 +- yarn-project/aztec/tsconfig.json | 3 - yarn-project/bb-prover/package.json | 1 - yarn-project/bb-prover/tsconfig.json | 3 - yarn-project/bot/package.json | 1 - yarn-project/bot/tsconfig.json | 3 - yarn-project/circuit-types/package.json | 1 - .../src/sibling_path/sibling_path.ts | 2 +- yarn-project/circuit-types/tsconfig.json | 3 - yarn-project/circuits.js/package.json | 1 + .../circuits.js/src/interfaces/index.ts | 20 +++++ .../src/network/index.ts | 0 yarn-project/cli/package.json | 1 - yarn-project/cli/tsconfig.json | 3 - yarn-project/end-to-end/package.json | 1 - yarn-project/end-to-end/tsconfig.json | 3 - yarn-project/ivc-integration/package.json | 1 - yarn-project/ivc-integration/tsconfig.json | 3 - yarn-project/merkle-tree/package.json | 1 - .../merkle-tree/src/hasher_with_stats.ts | 2 +- yarn-project/merkle-tree/src/load_tree.ts | 2 +- yarn-project/merkle-tree/src/new_tree.ts | 2 +- yarn-project/merkle-tree/src/pedersen.ts | 2 +- yarn-project/merkle-tree/src/poseidon.ts | 2 +- yarn-project/merkle-tree/src/sha_256.ts | 2 +- .../src/snapshots/append_only_snapshot.ts | 2 +- .../snapshots/indexed_tree_snapshot.test.ts | 2 +- .../src/sparse_tree/sparse_tree.test.ts | 2 +- .../standard_indexed_tree.ts | 2 +- .../test/standard_indexed_tree.test.ts | 2 +- .../src/standard_tree/standard_tree.test.ts | 2 +- .../src/test/standard_based_test_suite.ts | 2 +- .../merkle-tree/src/test/test_suite.ts | 2 +- yarn-project/merkle-tree/src/tree_base.ts | 2 +- .../merkle-tree/src/unbalanced_tree.test.ts | 2 +- .../merkle-tree/src/unbalanced_tree.ts | 2 +- yarn-project/merkle-tree/tsconfig.json | 3 - .../noir-protocol-circuits-types/package.json | 1 - .../tsconfig.json | 3 - yarn-project/package.json | 1 - yarn-project/protocol-contracts/package.json | 1 - yarn-project/protocol-contracts/tsconfig.json | 3 - yarn-project/prover-node/package.json | 1 - yarn-project/prover-node/tsconfig.json | 3 - yarn-project/publish_npm.sh | 2 +- yarn-project/pxe/package.json | 1 - yarn-project/pxe/src/config/index.ts | 2 +- yarn-project/pxe/tsconfig.json | 3 - yarn-project/sequencer-client/package.json | 1 - yarn-project/sequencer-client/tsconfig.json | 3 - yarn-project/simulator/package.json | 1 - yarn-project/simulator/tsconfig.json | 3 - yarn-project/txe/package.json | 1 - yarn-project/txe/tsconfig.json | 3 - yarn-project/types/.eslintrc.cjs | 1 - yarn-project/types/README.md | 2 - yarn-project/types/package.json | 90 ------------------- yarn-project/types/package.local.json | 7 -- yarn-project/types/scripts/copy-contracts.sh | 5 -- yarn-project/types/src/index.ts | 1 - yarn-project/types/src/interfaces/hasher.ts | 19 ---- yarn-project/types/src/interfaces/index.ts | 1 - yarn-project/types/tsconfig.json | 17 ---- yarn-project/validator-client/package.json | 1 - yarn-project/validator-client/tsconfig.json | 3 - yarn-project/world-state/package.json | 1 - yarn-project/world-state/tsconfig.json | 3 - yarn-project/yarn.lock | 48 ---------- 78 files changed, 43 insertions(+), 299 deletions(-) rename yarn-project/{types => circuits.js}/src/network/index.ts (100%) delete mode 100644 yarn-project/types/.eslintrc.cjs delete mode 100644 yarn-project/types/README.md delete mode 100644 yarn-project/types/package.json delete mode 100644 yarn-project/types/package.local.json delete mode 100755 yarn-project/types/scripts/copy-contracts.sh delete mode 100644 yarn-project/types/src/index.ts delete mode 100644 yarn-project/types/src/interfaces/hasher.ts delete mode 100644 yarn-project/types/src/interfaces/index.ts delete mode 100644 yarn-project/types/tsconfig.json diff --git a/boxes/package.json b/boxes/package.json index 4392c07495a6..aa0b14c99adb 100644 --- a/boxes/package.json +++ b/boxes/package.json @@ -29,8 +29,7 @@ "@aztec/pxe": "link:../yarn-project/pxe", "@aztec/simulator": "link:../yarn-project/simulator", "@aztec/ethereum": "link:../yarn-project/ethereum", - "@aztec/protocol-contracts": "link:../yarn-project/protocol-contracts", - "@aztec/types": "link:../yarn-project/types" + "@aztec/protocol-contracts": "link:../yarn-project/protocol-contracts" }, "dependencies": { "@iarna/toml": "^2.2.5", diff --git a/yarn-project/accounts/package.json b/yarn-project/accounts/package.json index bd9aafc20b91..7a49305f1153 100644 --- a/yarn-project/accounts/package.json +++ b/yarn-project/accounts/package.json @@ -79,7 +79,6 @@ "@aztec/entrypoints": "workspace:^", "@aztec/ethereum": "workspace:^", "@aztec/foundation": "workspace:^", - "@aztec/types": "workspace:^", "tslib": "^2.4.0" }, "devDependencies": { diff --git a/yarn-project/accounts/tsconfig.json b/yarn-project/accounts/tsconfig.json index 62dae97b8603..c0731172fe21 100644 --- a/yarn-project/accounts/tsconfig.json +++ b/yarn-project/accounts/tsconfig.json @@ -23,9 +23,6 @@ }, { "path": "../foundation" - }, - { - "path": "../types" } ], "include": ["src", "artifacts/*.d.json.ts"] diff --git a/yarn-project/archiver/package.json b/yarn-project/archiver/package.json index 8e89335e86e8..0aecf37a893e 100644 --- a/yarn-project/archiver/package.json +++ b/yarn-project/archiver/package.json @@ -77,7 +77,6 @@ "@aztec/noir-protocol-circuits-types": "workspace:^", "@aztec/protocol-contracts": "workspace:^", "@aztec/telemetry-client": "workspace:^", - "@aztec/types": "workspace:^", "debug": "^4.3.4", "lodash.groupby": "^4.6.0", "lodash.omit": "^4.5.0", diff --git a/yarn-project/archiver/tsconfig.json b/yarn-project/archiver/tsconfig.json index 62423ae6e0f3..1381da9634ea 100644 --- a/yarn-project/archiver/tsconfig.json +++ b/yarn-project/archiver/tsconfig.json @@ -44,9 +44,6 @@ }, { "path": "../telemetry-client" - }, - { - "path": "../types" } ], "include": ["src"] diff --git a/yarn-project/aztec-node/package.json b/yarn-project/aztec-node/package.json index f381fd80140c..358ec4b29537 100644 --- a/yarn-project/aztec-node/package.json +++ b/yarn-project/aztec-node/package.json @@ -79,7 +79,6 @@ "@aztec/sequencer-client": "workspace:^", "@aztec/simulator": "workspace:^", "@aztec/telemetry-client": "workspace:^", - "@aztec/types": "workspace:^", "@aztec/validator-client": "workspace:^", "@aztec/world-state": "workspace:^", "koa": "^2.14.2", diff --git a/yarn-project/aztec-node/tsconfig.json b/yarn-project/aztec-node/tsconfig.json index 94cbdab5df41..7483e81509ab 100644 --- a/yarn-project/aztec-node/tsconfig.json +++ b/yarn-project/aztec-node/tsconfig.json @@ -57,9 +57,6 @@ { "path": "../telemetry-client" }, - { - "path": "../types" - }, { "path": "../validator-client" }, diff --git a/yarn-project/aztec.js/package.json b/yarn-project/aztec.js/package.json index 64ca7bc153a8..6f737a5129c5 100644 --- a/yarn-project/aztec.js/package.json +++ b/yarn-project/aztec.js/package.json @@ -85,7 +85,6 @@ "@aztec/foundation": "workspace:^", "@aztec/l1-artifacts": "workspace:^", "@aztec/protocol-contracts": "workspace:^", - "@aztec/types": "workspace:^", "axios": "^1.7.2", "tslib": "^2.4.0", "viem": "2.22.8" diff --git a/yarn-project/aztec.js/tsconfig.json b/yarn-project/aztec.js/tsconfig.json index b38ebbb44a95..b1c08d033e74 100644 --- a/yarn-project/aztec.js/tsconfig.json +++ b/yarn-project/aztec.js/tsconfig.json @@ -26,9 +26,6 @@ }, { "path": "../protocol-contracts" - }, - { - "path": "../types" } ], "include": ["src", "src/**/*.json"] diff --git a/yarn-project/aztec/package.json b/yarn-project/aztec/package.json index d35398a0e1ce..ca679fb13673 100644 --- a/yarn-project/aztec/package.json +++ b/yarn-project/aztec/package.json @@ -58,7 +58,6 @@ "@aztec/pxe": "workspace:^", "@aztec/telemetry-client": "workspace:^", "@aztec/txe": "workspace:^", - "@aztec/types": "workspace:^", "@aztec/world-state": "workspace:^", "@types/chalk": "^2.2.0", "abitype": "^0.8.11", diff --git a/yarn-project/aztec/src/cli/cmds/start_pxe.ts b/yarn-project/aztec/src/cli/cmds/start_pxe.ts index 97fbf047544a..646bf0124d48 100644 --- a/yarn-project/aztec/src/cli/cmds/start_pxe.ts +++ b/yarn-project/aztec/src/cli/cmds/start_pxe.ts @@ -6,6 +6,7 @@ import { getContractClassFromArtifact, } from '@aztec/aztec.js'; import { type AztecNode, PXESchema, createAztecNodeClient } from '@aztec/circuit-types/interfaces/client'; +import { L2BasicContractsMap, Network } from '@aztec/circuits.js/network'; import { getContractArtifact } from '@aztec/cli/cli-utils'; import { type NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server'; import { type LogFn } from '@aztec/foundation/log'; @@ -18,7 +19,6 @@ import { createPXEService, } from '@aztec/pxe'; import { makeTracedFetch } from '@aztec/telemetry-client'; -import { L2BasicContractsMap, Network } from '@aztec/types/network'; import { extractRelevantOptions } from '../util.js'; import { getVersions } from '../versioning.js'; diff --git a/yarn-project/aztec/tsconfig.json b/yarn-project/aztec/tsconfig.json index 5a1ad95d66ea..370624a4caea 100644 --- a/yarn-project/aztec/tsconfig.json +++ b/yarn-project/aztec/tsconfig.json @@ -93,9 +93,6 @@ { "path": "../txe" }, - { - "path": "../types" - }, { "path": "../world-state" } diff --git a/yarn-project/bb-prover/package.json b/yarn-project/bb-prover/package.json index 56baa8ed2166..b43d32ec0bb3 100644 --- a/yarn-project/bb-prover/package.json +++ b/yarn-project/bb-prover/package.json @@ -89,7 +89,6 @@ "@aztec/kv-store": "workspace:^", "@aztec/noir-contracts.js": "workspace:^", "@aztec/protocol-contracts": "workspace:^", - "@aztec/types": "workspace:^", "@jest/globals": "^29.5.0", "@types/jest": "^29.5.0", "@types/memdown": "^3.0.0", diff --git a/yarn-project/bb-prover/tsconfig.json b/yarn-project/bb-prover/tsconfig.json index eaae99a2c447..d5a8de3c0299 100644 --- a/yarn-project/bb-prover/tsconfig.json +++ b/yarn-project/bb-prover/tsconfig.json @@ -41,9 +41,6 @@ }, { "path": "../protocol-contracts" - }, - { - "path": "../types" } ], "include": ["src"] diff --git a/yarn-project/bot/package.json b/yarn-project/bot/package.json index 1dd860c302db..541c1f8e79a3 100644 --- a/yarn-project/bot/package.json +++ b/yarn-project/bot/package.json @@ -63,7 +63,6 @@ "@aztec/noir-protocol-circuits-types": "workspace:^", "@aztec/protocol-contracts": "workspace:^", "@aztec/telemetry-client": "workspace:^", - "@aztec/types": "workspace:^", "source-map-support": "^0.5.21", "tslib": "^2.4.0", "zod": "^3.23.8" diff --git a/yarn-project/bot/tsconfig.json b/yarn-project/bot/tsconfig.json index 9c8c018c9e0e..35a55f14a7ff 100644 --- a/yarn-project/bot/tsconfig.json +++ b/yarn-project/bot/tsconfig.json @@ -38,9 +38,6 @@ }, { "path": "../telemetry-client" - }, - { - "path": "../types" } ], "include": ["src"] diff --git a/yarn-project/circuit-types/package.json b/yarn-project/circuit-types/package.json index b38870d41864..9e3e779b3f04 100644 --- a/yarn-project/circuit-types/package.json +++ b/yarn-project/circuit-types/package.json @@ -71,7 +71,6 @@ "@aztec/constants": "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", diff --git a/yarn-project/circuit-types/src/sibling_path/sibling_path.ts b/yarn-project/circuit-types/src/sibling_path/sibling_path.ts index 96738dab3686..de502e77f57f 100644 --- a/yarn-project/circuit-types/src/sibling_path/sibling_path.ts +++ b/yarn-project/circuit-types/src/sibling_path/sibling_path.ts @@ -1,3 +1,4 @@ +import { type Hasher } from '@aztec/circuits.js/interfaces'; import { makeTuple } from '@aztec/foundation/array'; import { Fr } from '@aztec/foundation/fields'; import { schemas } from '@aztec/foundation/schemas'; @@ -8,7 +9,6 @@ import { serializeArrayOfBufferableToVector, } from '@aztec/foundation/serialize'; import { bufferToHex, hexToBuffer } from '@aztec/foundation/string'; -import { type Hasher } from '@aztec/types/interfaces'; /** * Contains functionality to compute and serialize/deserialize a sibling path. diff --git a/yarn-project/circuit-types/tsconfig.json b/yarn-project/circuit-types/tsconfig.json index e19ead0239dd..b434bd56ecd1 100644 --- a/yarn-project/circuit-types/tsconfig.json +++ b/yarn-project/circuit-types/tsconfig.json @@ -17,9 +17,6 @@ }, { "path": "../foundation" - }, - { - "path": "../types" } ], "include": ["src"] diff --git a/yarn-project/circuits.js/package.json b/yarn-project/circuits.js/package.json index 9f1bbccb1656..0d315b9a89d9 100644 --- a/yarn-project/circuits.js/package.json +++ b/yarn-project/circuits.js/package.json @@ -15,6 +15,7 @@ "./testing": "./dest/tests/index.js", "./testing/fixtures": "./dest/tests/fixtures.js", "./interfaces": "./dest/interfaces/index.js", + "./network": "./dest/network/index.js", "./utils": "./dest/utils/index.js", "./types": "./dest/types/index.js", "./contract": "./dest/contract/index.js", diff --git a/yarn-project/circuits.js/src/interfaces/index.ts b/yarn-project/circuits.js/src/interfaces/index.ts index 9c6ea52ee3ab..cdfae3c5f804 100644 --- a/yarn-project/circuits.js/src/interfaces/index.ts +++ b/yarn-project/circuits.js/src/interfaces/index.ts @@ -11,3 +11,23 @@ export interface Ordered { export interface Positioned { position: Fr; } + +/** + * Defines hasher interface used by Merkle trees. + */ +export interface Hasher { + /** + * Hash two arrays. + * @param lhs - The first array. + * @param rhs - The second array. + * @returns The new 32-byte hash. + */ + hash(lhs: Uint8Array, rhs: Uint8Array): Buffer; + + /** + * Hashes an array of buffers. + * @param inputs - The array of buffers to hash. + * @returns The resulting 32-byte hash. + */ + hashInputs(inputs: Buffer[]): Buffer; +} diff --git a/yarn-project/types/src/network/index.ts b/yarn-project/circuits.js/src/network/index.ts similarity index 100% rename from yarn-project/types/src/network/index.ts rename to yarn-project/circuits.js/src/network/index.ts diff --git a/yarn-project/cli/package.json b/yarn-project/cli/package.json index 63d1dec6c870..85b940927146 100644 --- a/yarn-project/cli/package.json +++ b/yarn-project/cli/package.json @@ -73,7 +73,6 @@ "@aztec/constants": "workspace:^", "@aztec/foundation": "workspace:^", "@aztec/l1-artifacts": "workspace:^", - "@aztec/types": "workspace:^", "@aztec/world-state": "workspace:^", "@iarna/toml": "^2.2.5", "@libp2p/peer-id-factory": "^3.0.4", diff --git a/yarn-project/cli/tsconfig.json b/yarn-project/cli/tsconfig.json index fae4b7f9b86d..69321fc3ed55 100644 --- a/yarn-project/cli/tsconfig.json +++ b/yarn-project/cli/tsconfig.json @@ -24,9 +24,6 @@ { "path": "../l1-artifacts" }, - { - "path": "../types" - }, { "path": "../world-state" }, diff --git a/yarn-project/end-to-end/package.json b/yarn-project/end-to-end/package.json index e723e9cdee3d..f8243501e0fe 100644 --- a/yarn-project/end-to-end/package.json +++ b/yarn-project/end-to-end/package.json @@ -55,7 +55,6 @@ "@aztec/sequencer-client": "workspace:^", "@aztec/simulator": "workspace:^", "@aztec/telemetry-client": "workspace:^", - "@aztec/types": "workspace:^", "@aztec/validator-client": "workspace:^", "@aztec/world-state": "workspace:^", "@iarna/toml": "^2.2.5", diff --git a/yarn-project/end-to-end/tsconfig.json b/yarn-project/end-to-end/tsconfig.json index 0c4495cc43b3..21d17ad25033 100644 --- a/yarn-project/end-to-end/tsconfig.json +++ b/yarn-project/end-to-end/tsconfig.json @@ -93,9 +93,6 @@ { "path": "../telemetry-client" }, - { - "path": "../types" - }, { "path": "../validator-client" }, diff --git a/yarn-project/ivc-integration/package.json b/yarn-project/ivc-integration/package.json index 434ac4a0488f..08b542b24ed9 100644 --- a/yarn-project/ivc-integration/package.json +++ b/yarn-project/ivc-integration/package.json @@ -64,7 +64,6 @@ "@aztec/circuits.js": "workspace:^", "@aztec/constants": "workspace:^", "@aztec/foundation": "workspace:^", - "@aztec/types": "workspace:^", "@noir-lang/noir_codegen": "portal:../../noir/packages/noir_codegen", "@noir-lang/noir_js": "file:../../noir/packages/noir_js", "@noir-lang/noirc_abi": "portal:../../noir/packages/noirc_abi", diff --git a/yarn-project/ivc-integration/tsconfig.json b/yarn-project/ivc-integration/tsconfig.json index f51690eeff84..15b07a6e64a6 100644 --- a/yarn-project/ivc-integration/tsconfig.json +++ b/yarn-project/ivc-integration/tsconfig.json @@ -16,9 +16,6 @@ { "path": "../foundation" }, - { - "path": "../types" - }, { "path": "../bb-prover" }, diff --git a/yarn-project/merkle-tree/package.json b/yarn-project/merkle-tree/package.json index 979ed4720c12..1a18cfd31f8f 100644 --- a/yarn-project/merkle-tree/package.json +++ b/yarn-project/merkle-tree/package.json @@ -59,7 +59,6 @@ "@aztec/circuit-types": "workspace:^", "@aztec/foundation": "workspace:^", "@aztec/kv-store": "workspace:^", - "@aztec/types": "workspace:^", "sha256": "^0.2.0", "tslib": "^2.4.0" }, diff --git a/yarn-project/merkle-tree/src/hasher_with_stats.ts b/yarn-project/merkle-tree/src/hasher_with_stats.ts index 7c77e8cf3709..c4e24a38b056 100644 --- a/yarn-project/merkle-tree/src/hasher_with_stats.ts +++ b/yarn-project/merkle-tree/src/hasher_with_stats.ts @@ -1,4 +1,4 @@ -import { type Hasher } from '@aztec/types/interfaces'; +import { type Hasher } from '@aztec/circuits.js/interfaces'; import { createHistogram, performance } from 'perf_hooks'; diff --git a/yarn-project/merkle-tree/src/load_tree.ts b/yarn-project/merkle-tree/src/load_tree.ts index b2a1d396b49d..6b6d2b38beaa 100644 --- a/yarn-project/merkle-tree/src/load_tree.ts +++ b/yarn-project/merkle-tree/src/load_tree.ts @@ -1,6 +1,6 @@ +import { type Hasher } from '@aztec/circuits.js/interfaces'; import { type Bufferable, type FromBuffer } from '@aztec/foundation/serialize'; import { type AztecKVStore } from '@aztec/kv-store'; -import { type Hasher } from '@aztec/types/interfaces'; import { type TreeBase, getTreeMeta } from './tree_base.js'; diff --git a/yarn-project/merkle-tree/src/new_tree.ts b/yarn-project/merkle-tree/src/new_tree.ts index d8040fc9f46d..51d291da66d0 100644 --- a/yarn-project/merkle-tree/src/new_tree.ts +++ b/yarn-project/merkle-tree/src/new_tree.ts @@ -1,6 +1,6 @@ +import { type Hasher } from '@aztec/circuits.js/interfaces'; import { type Bufferable, type FromBuffer } from '@aztec/foundation/serialize'; import { type AztecKVStore } from '@aztec/kv-store'; -import { type Hasher } from '@aztec/types/interfaces'; import { type TreeBase } from './tree_base.js'; diff --git a/yarn-project/merkle-tree/src/pedersen.ts b/yarn-project/merkle-tree/src/pedersen.ts index 0305f000f5cf..0514dcd0d918 100644 --- a/yarn-project/merkle-tree/src/pedersen.ts +++ b/yarn-project/merkle-tree/src/pedersen.ts @@ -1,6 +1,6 @@ +import { type Hasher } from '@aztec/circuits.js/interfaces'; import { pedersenHash } from '@aztec/foundation/crypto/sync'; import { Fr } from '@aztec/foundation/fields'; -import { type Hasher } from '@aztec/types/interfaces'; /** * A helper class encapsulating Pedersen hash functionality. diff --git a/yarn-project/merkle-tree/src/poseidon.ts b/yarn-project/merkle-tree/src/poseidon.ts index 90a76e0af302..d2dcf1644528 100644 --- a/yarn-project/merkle-tree/src/poseidon.ts +++ b/yarn-project/merkle-tree/src/poseidon.ts @@ -1,6 +1,6 @@ +import { type Hasher } from '@aztec/circuits.js/interfaces'; import { poseidon2Hash } from '@aztec/foundation/crypto/sync'; import { Fr } from '@aztec/foundation/fields'; -import { type Hasher } from '@aztec/types/interfaces'; /** * A helper class encapsulating poseidon2 hash functionality. diff --git a/yarn-project/merkle-tree/src/sha_256.ts b/yarn-project/merkle-tree/src/sha_256.ts index a1cba65c5ae2..495012ce6292 100644 --- a/yarn-project/merkle-tree/src/sha_256.ts +++ b/yarn-project/merkle-tree/src/sha_256.ts @@ -1,6 +1,6 @@ +import { type Hasher } from '@aztec/circuits.js/interfaces'; import { sha256 } from '@aztec/foundation/crypto'; import { truncateAndPad } from '@aztec/foundation/serialize'; -import { type Hasher } from '@aztec/types/interfaces'; /** * A helper class encapsulating SHA256 hash functionality. diff --git a/yarn-project/merkle-tree/src/snapshots/append_only_snapshot.ts b/yarn-project/merkle-tree/src/snapshots/append_only_snapshot.ts index eca6d258f360..bc61916dfbf1 100644 --- a/yarn-project/merkle-tree/src/snapshots/append_only_snapshot.ts +++ b/yarn-project/merkle-tree/src/snapshots/append_only_snapshot.ts @@ -1,7 +1,7 @@ import { SiblingPath } from '@aztec/circuit-types'; +import { type Hasher } from '@aztec/circuits.js/interfaces'; import { type Bufferable, type FromBuffer, serializeToBuffer } from '@aztec/foundation/serialize'; import { type AztecKVStore, type AztecMap } from '@aztec/kv-store'; -import { type Hasher } from '@aztec/types/interfaces'; import { type AppendOnlyTree } from '../interfaces/append_only_tree.js'; import { type TreeBase } from '../tree_base.js'; diff --git a/yarn-project/merkle-tree/src/snapshots/indexed_tree_snapshot.test.ts b/yarn-project/merkle-tree/src/snapshots/indexed_tree_snapshot.test.ts index 7c454f3efd5e..69694944137c 100644 --- a/yarn-project/merkle-tree/src/snapshots/indexed_tree_snapshot.test.ts +++ b/yarn-project/merkle-tree/src/snapshots/indexed_tree_snapshot.test.ts @@ -1,8 +1,8 @@ import { Fr } from '@aztec/circuits.js'; +import { type Hasher } from '@aztec/circuits.js/interfaces'; import { NullifierLeaf, NullifierLeafPreimage } from '@aztec/circuits.js/trees'; import { type AztecKVStore } from '@aztec/kv-store'; import { openTmpStore } from '@aztec/kv-store/lmdb'; -import { type Hasher } from '@aztec/types/interfaces'; import { Pedersen, newTree } from '../index.js'; import { StandardIndexedTreeWithAppend } from '../standard_indexed_tree/test/standard_indexed_tree_with_append.js'; diff --git a/yarn-project/merkle-tree/src/sparse_tree/sparse_tree.test.ts b/yarn-project/merkle-tree/src/sparse_tree/sparse_tree.test.ts index f62434949322..f2322f7de9e0 100644 --- a/yarn-project/merkle-tree/src/sparse_tree/sparse_tree.test.ts +++ b/yarn-project/merkle-tree/src/sparse_tree/sparse_tree.test.ts @@ -1,10 +1,10 @@ import { SiblingPath } from '@aztec/circuit-types'; +import { type Hasher } from '@aztec/circuits.js/interfaces'; import { randomBigInt } from '@aztec/foundation/crypto'; import { Fr } from '@aztec/foundation/fields'; import { createLogger } from '@aztec/foundation/log'; import { type AztecKVStore } from '@aztec/kv-store'; import { openTmpStore } from '@aztec/kv-store/lmdb'; -import { type Hasher } from '@aztec/types/interfaces'; import { INITIAL_LEAF, newTree } from '../index.js'; import { type UpdateOnlyTree } from '../interfaces/update_only_tree.js'; diff --git a/yarn-project/merkle-tree/src/standard_indexed_tree/standard_indexed_tree.ts b/yarn-project/merkle-tree/src/standard_indexed_tree/standard_indexed_tree.ts index bd52886ad5cb..775b8ce4e02e 100644 --- a/yarn-project/merkle-tree/src/standard_indexed_tree/standard_indexed_tree.ts +++ b/yarn-project/merkle-tree/src/standard_indexed_tree/standard_indexed_tree.ts @@ -1,12 +1,12 @@ import { SiblingPath } from '@aztec/circuit-types'; import { type BatchInsertionResult, type LeafUpdateWitnessData } from '@aztec/circuit-types/interfaces/server'; import { type TreeInsertionStats } from '@aztec/circuit-types/stats'; +import { type Hasher } from '@aztec/circuits.js/interfaces'; import { toBufferBE } from '@aztec/foundation/bigint-buffer'; import { type FromBuffer } from '@aztec/foundation/serialize'; import { Timer } from '@aztec/foundation/timer'; import { type IndexedTreeLeaf, type IndexedTreeLeafPreimage } from '@aztec/foundation/trees'; import { type AztecKVStore, type AztecMap } from '@aztec/kv-store'; -import { type Hasher } from '@aztec/types/interfaces'; import { type IndexedTree, type PreimageFactory } from '../interfaces/indexed_tree.js'; import { IndexedTreeSnapshotBuilder } from '../snapshots/indexed_tree_snapshot.js'; diff --git a/yarn-project/merkle-tree/src/standard_indexed_tree/test/standard_indexed_tree.test.ts b/yarn-project/merkle-tree/src/standard_indexed_tree/test/standard_indexed_tree.test.ts index 85392274e659..75ef39970b51 100644 --- a/yarn-project/merkle-tree/src/standard_indexed_tree/test/standard_indexed_tree.test.ts +++ b/yarn-project/merkle-tree/src/standard_indexed_tree/test/standard_indexed_tree.test.ts @@ -1,5 +1,6 @@ import { SiblingPath } from '@aztec/circuit-types'; import { Fr } from '@aztec/circuits.js'; +import { type Hasher } from '@aztec/circuits.js/interfaces'; import { NullifierLeaf, NullifierLeafPreimage, @@ -10,7 +11,6 @@ import { toBufferBE } from '@aztec/foundation/bigint-buffer'; import { type FromBuffer } from '@aztec/foundation/serialize'; import { type AztecKVStore } from '@aztec/kv-store'; import { openTmpStore } from '@aztec/kv-store/lmdb'; -import { type Hasher } from '@aztec/types/interfaces'; import { INITIAL_LEAF, type MerkleTree, Pedersen, loadTree, newTree } from '../../index.js'; import { treeTestSuite } from '../../test/test_suite.js'; diff --git a/yarn-project/merkle-tree/src/standard_tree/standard_tree.test.ts b/yarn-project/merkle-tree/src/standard_tree/standard_tree.test.ts index 5068474e0242..14e1cce379aa 100644 --- a/yarn-project/merkle-tree/src/standard_tree/standard_tree.test.ts +++ b/yarn-project/merkle-tree/src/standard_tree/standard_tree.test.ts @@ -1,8 +1,8 @@ +import { type Hasher } from '@aztec/circuits.js/interfaces'; import { Fr } from '@aztec/foundation/fields'; import { type FromBuffer } from '@aztec/foundation/serialize'; import { type AztecKVStore } from '@aztec/kv-store'; import { openTmpStore } from '@aztec/kv-store/lmdb'; -import { type Hasher } from '@aztec/types/interfaces'; import { loadTree } from '../load_tree.js'; import { newTree } from '../new_tree.js'; diff --git a/yarn-project/merkle-tree/src/test/standard_based_test_suite.ts b/yarn-project/merkle-tree/src/test/standard_based_test_suite.ts index f11033ae76e6..d8199e492e59 100644 --- a/yarn-project/merkle-tree/src/test/standard_based_test_suite.ts +++ b/yarn-project/merkle-tree/src/test/standard_based_test_suite.ts @@ -1,8 +1,8 @@ import { SiblingPath } from '@aztec/circuit-types'; +import { type Hasher } from '@aztec/circuits.js/interfaces'; import { Fr } from '@aztec/foundation/fields'; import { type AztecKVStore } from '@aztec/kv-store'; import { openTmpStore } from '@aztec/kv-store/lmdb'; -import { type Hasher } from '@aztec/types/interfaces'; import { INITIAL_LEAF, Pedersen } from '../index.js'; import { type AppendOnlyTree } from '../interfaces/append_only_tree.js'; diff --git a/yarn-project/merkle-tree/src/test/test_suite.ts b/yarn-project/merkle-tree/src/test/test_suite.ts index 3c6b9772dcd3..aa3b4592790d 100644 --- a/yarn-project/merkle-tree/src/test/test_suite.ts +++ b/yarn-project/merkle-tree/src/test/test_suite.ts @@ -1,7 +1,7 @@ import { SiblingPath } from '@aztec/circuit-types'; +import { type Hasher } from '@aztec/circuits.js/interfaces'; import { type AztecKVStore } from '@aztec/kv-store'; import { openTmpStore } from '@aztec/kv-store/lmdb'; -import { type Hasher } from '@aztec/types/interfaces'; import { Pedersen } from '../index.js'; import { type AppendOnlyTree } from '../interfaces/append_only_tree.js'; diff --git a/yarn-project/merkle-tree/src/tree_base.ts b/yarn-project/merkle-tree/src/tree_base.ts index 395cb6b37799..1b939ba9f683 100644 --- a/yarn-project/merkle-tree/src/tree_base.ts +++ b/yarn-project/merkle-tree/src/tree_base.ts @@ -1,9 +1,9 @@ import { SiblingPath } from '@aztec/circuit-types'; +import { type Hasher } from '@aztec/circuits.js/interfaces'; import { toBigIntLE, toBufferLE } from '@aztec/foundation/bigint-buffer'; import { type Logger, createLogger } from '@aztec/foundation/log'; import { type Bufferable, type FromBuffer, serializeToBuffer } from '@aztec/foundation/serialize'; import { type AztecKVStore, type AztecMap, type AztecSingleton } from '@aztec/kv-store'; -import { type Hasher } from '@aztec/types/interfaces'; import { HasherWithStats } from './hasher_with_stats.js'; import { type MerkleTree } from './interfaces/merkle_tree.js'; diff --git a/yarn-project/merkle-tree/src/unbalanced_tree.test.ts b/yarn-project/merkle-tree/src/unbalanced_tree.test.ts index 7851151a64dc..96fd66af8ad2 100644 --- a/yarn-project/merkle-tree/src/unbalanced_tree.test.ts +++ b/yarn-project/merkle-tree/src/unbalanced_tree.test.ts @@ -1,8 +1,8 @@ +import { type Hasher } from '@aztec/circuits.js/interfaces'; import { sha256Trunc } from '@aztec/foundation/crypto'; import { Fr } from '@aztec/foundation/fields'; import { type FromBuffer } from '@aztec/foundation/serialize'; import { openTmpStore } from '@aztec/kv-store/lmdb'; -import { type Hasher } from '@aztec/types/interfaces'; import { SHA256Trunc } from './sha_256.js'; import { StandardTree } from './standard_tree/standard_tree.js'; diff --git a/yarn-project/merkle-tree/src/unbalanced_tree.ts b/yarn-project/merkle-tree/src/unbalanced_tree.ts index a55c6678c569..708fbde31cd5 100644 --- a/yarn-project/merkle-tree/src/unbalanced_tree.ts +++ b/yarn-project/merkle-tree/src/unbalanced_tree.ts @@ -1,6 +1,6 @@ import { SiblingPath } from '@aztec/circuit-types'; +import { type Hasher } from '@aztec/circuits.js/interfaces'; import { type Bufferable, type FromBuffer, serializeToBuffer } from '@aztec/foundation/serialize'; -import { type Hasher } from '@aztec/types/interfaces'; import { HasherWithStats } from './hasher_with_stats.js'; import { type MerkleTree } from './interfaces/merkle_tree.js'; diff --git a/yarn-project/merkle-tree/tsconfig.json b/yarn-project/merkle-tree/tsconfig.json index 631083e52f42..c04894113158 100644 --- a/yarn-project/merkle-tree/tsconfig.json +++ b/yarn-project/merkle-tree/tsconfig.json @@ -15,9 +15,6 @@ { "path": "../kv-store" }, - { - "path": "../types" - }, { "path": "../circuits.js" } diff --git a/yarn-project/noir-protocol-circuits-types/package.json b/yarn-project/noir-protocol-circuits-types/package.json index 85690d3db9f5..1adf97e7b40c 100644 --- a/yarn-project/noir-protocol-circuits-types/package.json +++ b/yarn-project/noir-protocol-circuits-types/package.json @@ -64,7 +64,6 @@ "@aztec/circuits.js": "workspace:^", "@aztec/constants": "workspace:^", "@aztec/foundation": "workspace:^", - "@aztec/types": "workspace:^", "@noir-lang/acvm_js": "portal:../../noir/packages/acvm_js", "@noir-lang/noir_codegen": "portal:../../noir/packages/noir_codegen", "@noir-lang/noirc_abi": "portal:../../noir/packages/noirc_abi", diff --git a/yarn-project/noir-protocol-circuits-types/tsconfig.json b/yarn-project/noir-protocol-circuits-types/tsconfig.json index f54211aa2b3d..873d36a91bc3 100644 --- a/yarn-project/noir-protocol-circuits-types/tsconfig.json +++ b/yarn-project/noir-protocol-circuits-types/tsconfig.json @@ -19,9 +19,6 @@ { "path": "../foundation" }, - { - "path": "../types" - }, { "path": "../kv-store" }, diff --git a/yarn-project/package.json b/yarn-project/package.json index 5c4a108b4e52..1d9e44d23749 100644 --- a/yarn-project/package.json +++ b/yarn-project/package.json @@ -61,7 +61,6 @@ "rollup-provider", "sequencer-client", "scripts", - "types", "txe", "world-state", "telemetry-client" diff --git a/yarn-project/protocol-contracts/package.json b/yarn-project/protocol-contracts/package.json index fddec7f97455..6169d1205e5e 100644 --- a/yarn-project/protocol-contracts/package.json +++ b/yarn-project/protocol-contracts/package.json @@ -72,7 +72,6 @@ "@aztec/circuits.js": "workspace:^", "@aztec/constants": "workspace:^", "@aztec/foundation": "workspace:^", - "@aztec/types": "workspace:^", "lodash.chunk": "^4.2.0", "lodash.omit": "^4.5.0", "tslib": "^2.4.0" diff --git a/yarn-project/protocol-contracts/tsconfig.json b/yarn-project/protocol-contracts/tsconfig.json index 24291d4d313b..037fe34443fe 100644 --- a/yarn-project/protocol-contracts/tsconfig.json +++ b/yarn-project/protocol-contracts/tsconfig.json @@ -14,9 +14,6 @@ }, { "path": "../foundation" - }, - { - "path": "../types" } ], "include": ["src", "artifacts/*.d.json.ts"], diff --git a/yarn-project/prover-node/package.json b/yarn-project/prover-node/package.json index 16b90e30cf90..a425400879fe 100644 --- a/yarn-project/prover-node/package.json +++ b/yarn-project/prover-node/package.json @@ -71,7 +71,6 @@ "@aztec/sequencer-client": "workspace:^", "@aztec/simulator": "workspace:^", "@aztec/telemetry-client": "workspace:^", - "@aztec/types": "workspace:^", "@aztec/world-state": "workspace:^", "source-map-support": "^0.5.21", "tslib": "^2.4.0", diff --git a/yarn-project/prover-node/tsconfig.json b/yarn-project/prover-node/tsconfig.json index b129a945b73a..6098ecc1b451 100644 --- a/yarn-project/prover-node/tsconfig.json +++ b/yarn-project/prover-node/tsconfig.json @@ -60,9 +60,6 @@ { "path": "../telemetry-client" }, - { - "path": "../types" - }, { "path": "../world-state" } diff --git a/yarn-project/publish_npm.sh b/yarn-project/publish_npm.sh index 924dfd0576e9..056a91fd435f 100755 --- a/yarn-project/publish_npm.sh +++ b/yarn-project/publish_npm.sh @@ -86,10 +86,10 @@ function deploy_package() { } # New packages here should be added after the last package that they depend on +deploy_package constants deploy_package foundation deploy_package blob-lib deploy_package native -deploy_package types deploy_package circuits.js deploy_package circuit-types deploy_package telemetry-client diff --git a/yarn-project/pxe/package.json b/yarn-project/pxe/package.json index 0268d619d76e..43eb947ab586 100644 --- a/yarn-project/pxe/package.json +++ b/yarn-project/pxe/package.json @@ -79,7 +79,6 @@ "@aztec/noir-protocol-circuits-types": "workspace:^", "@aztec/protocol-contracts": "workspace:^", "@aztec/simulator": "workspace:^", - "@aztec/types": "workspace:^", "@msgpack/msgpack": "^3.0.0-beta2", "@noir-lang/types": "workspace:*", "koa": "^2.14.2", diff --git a/yarn-project/pxe/src/config/index.ts b/yarn-project/pxe/src/config/index.ts index 5e9f85c5119e..0db0108437ca 100644 --- a/yarn-project/pxe/src/config/index.ts +++ b/yarn-project/pxe/src/config/index.ts @@ -1,4 +1,5 @@ import { type ChainConfig, chainConfigMappings } from '@aztec/circuit-types/config'; +import { type Network } from '@aztec/circuits.js/network'; import { INITIAL_L2_BLOCK_NUM } from '@aztec/constants'; import { type ConfigMappingsType, @@ -8,7 +9,6 @@ import { parseBooleanEnv, } from '@aztec/foundation/config'; import { type DataStoreConfig, dataConfigMappings } from '@aztec/kv-store/config'; -import { type Network } from '@aztec/types/network'; /** * Temporary configuration until WASM can be used instead of native diff --git a/yarn-project/pxe/tsconfig.json b/yarn-project/pxe/tsconfig.json index 029143616686..000e95b238aa 100644 --- a/yarn-project/pxe/tsconfig.json +++ b/yarn-project/pxe/tsconfig.json @@ -42,9 +42,6 @@ { "path": "../simulator" }, - { - "path": "../types" - }, { "path": "../noir-contracts.js" } diff --git a/yarn-project/sequencer-client/package.json b/yarn-project/sequencer-client/package.json index 9d19cef0ae10..929d5071d867 100644 --- a/yarn-project/sequencer-client/package.json +++ b/yarn-project/sequencer-client/package.json @@ -47,7 +47,6 @@ "@aztec/prover-client": "workspace:^", "@aztec/simulator": "workspace:^", "@aztec/telemetry-client": "workspace:^", - "@aztec/types": "workspace:^", "@aztec/validator-client": "workspace:^", "@aztec/world-state": "workspace:^", "@noir-lang/acvm_js": "portal:../../noir/packages/acvm_js", diff --git a/yarn-project/sequencer-client/tsconfig.json b/yarn-project/sequencer-client/tsconfig.json index de21e8a2dfe0..e23650fe7a6d 100644 --- a/yarn-project/sequencer-client/tsconfig.json +++ b/yarn-project/sequencer-client/tsconfig.json @@ -63,9 +63,6 @@ { "path": "../telemetry-client" }, - { - "path": "../types" - }, { "path": "../validator-client" }, diff --git a/yarn-project/simulator/package.json b/yarn-project/simulator/package.json index 19e5db735b36..1df55ca73e21 100644 --- a/yarn-project/simulator/package.json +++ b/yarn-project/simulator/package.json @@ -67,7 +67,6 @@ "@aztec/noir-protocol-circuits-types": "workspace:^", "@aztec/protocol-contracts": "workspace:^", "@aztec/telemetry-client": "workspace:^", - "@aztec/types": "workspace:^", "@aztec/world-state": "workspace:^", "@noir-lang/acvm_js": "portal:../../noir/packages/acvm_js", "@noir-lang/noirc_abi": "portal:../../noir/packages/noirc_abi", diff --git a/yarn-project/simulator/tsconfig.json b/yarn-project/simulator/tsconfig.json index 2f957e40b947..e911ffe00e6a 100644 --- a/yarn-project/simulator/tsconfig.json +++ b/yarn-project/simulator/tsconfig.json @@ -27,9 +27,6 @@ { "path": "../telemetry-client" }, - { - "path": "../types" - }, { "path": "../world-state" }, diff --git a/yarn-project/txe/package.json b/yarn-project/txe/package.json index 477658227cf6..e89eb46a9342 100644 --- a/yarn-project/txe/package.json +++ b/yarn-project/txe/package.json @@ -70,7 +70,6 @@ "@aztec/protocol-contracts": "workspace:^", "@aztec/pxe": "workspace:^", "@aztec/simulator": "workspace:^", - "@aztec/types": "workspace:^", "@aztec/world-state": "workspace:^", "zod": "^3.23.8" }, diff --git a/yarn-project/txe/tsconfig.json b/yarn-project/txe/tsconfig.json index d16dd596f4f2..3d3306e3f077 100644 --- a/yarn-project/txe/tsconfig.json +++ b/yarn-project/txe/tsconfig.json @@ -39,9 +39,6 @@ { "path": "../simulator" }, - { - "path": "../types" - }, { "path": "../world-state" } diff --git a/yarn-project/types/.eslintrc.cjs b/yarn-project/types/.eslintrc.cjs deleted file mode 100644 index e659927475c0..000000000000 --- a/yarn-project/types/.eslintrc.cjs +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@aztec/foundation/eslint'); diff --git a/yarn-project/types/README.md b/yarn-project/types/README.md deleted file mode 100644 index e17b76a37a44..000000000000 --- a/yarn-project/types/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# Types -A package containing non circuit dependent types which are relevant through all the Aztec Typescript codebase. \ No newline at end of file diff --git a/yarn-project/types/package.json b/yarn-project/types/package.json deleted file mode 100644 index b862210dfb0a..000000000000 --- a/yarn-project/types/package.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "name": "@aztec/types", - "version": "0.1.0", - "type": "module", - "main": "./dest/index.js", - "types": "./dest/index.d.ts", - "exports": { - "./interfaces": "./dest/interfaces/index.js", - "./network": "./dest/network/index.js" - }, - "scripts": { - "build": "yarn clean && yarn generate && tsc -b", - "build:dev": "tsc -b --watch", - "clean": "rm -rf ./dest .tsbuildinfo", - "formatting": "run -T prettier --check ./src && run -T eslint ./src", - "formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src", - "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}", - "generate": "yarn generate:noir-contracts", - "generate:noir-contracts": "./scripts/copy-contracts.sh" - }, - "inherits": [ - "../package.common.json", - "./package.local.json" - ], - "jest": { - "moduleNameMapper": { - "^(\\.{1,2}/.*)\\.[cm]?js$": "$1" - }, - "testRegex": "./src/.*\\.test\\.(js|mjs|ts)$", - "rootDir": "./src", - "transform": { - "^.+\\.tsx?$": [ - "@swc/jest", - { - "jsc": { - "parser": { - "syntax": "typescript", - "decorators": true - }, - "transform": { - "decoratorVersion": "2022-03" - } - } - } - ] - }, - "extensionsToTreatAsEsm": [ - ".ts" - ], - "reporters": [ - "default" - ], - "testTimeout": 120000, - "setupFiles": [ - "../../foundation/src/jest/setup.mjs" - ] - }, - "dependencies": { - "@aztec/ethereum": "workspace:^", - "@aztec/foundation": "workspace:^" - }, - "devDependencies": { - "@jest/globals": "^29.5.0", - "@types/debug": "^4.1.7", - "@types/detect-node": "^2.0.0", - "@types/jest": "^29.5.0", - "@types/supertest": "^2.0.12", - "@typescript-eslint/eslint-plugin": "^6.2.1", - "@typescript-eslint/parser": "^6.2.1", - "comlink": "^4.4.1", - "eslint": "^8.21.0", - "eslint-config-prettier": "^8.5.0", - "eslint-plugin-jsdoc": "^40.1.0", - "eslint-plugin-no-only-tests": "^3.1.0", - "eslint-plugin-tsdoc": "^0.2.17", - "jest": "^29.5.0", - "prettier": "^2.7.1", - "supertest": "^6.3.3", - "ts-node": "^10.9.1", - "typescript": "^5.0.4" - }, - "files": [ - "dest", - "src", - "!*.test.*" - ], - "engines": { - "node": ">=18" - } -} diff --git a/yarn-project/types/package.local.json b/yarn-project/types/package.local.json deleted file mode 100644 index 40670e322ff8..000000000000 --- a/yarn-project/types/package.local.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "scripts": { - "build": "yarn clean && yarn generate && tsc -b", - "generate": "yarn generate:noir-contracts", - "generate:noir-contracts": "./scripts/copy-contracts.sh" - } -} diff --git a/yarn-project/types/scripts/copy-contracts.sh b/yarn-project/types/scripts/copy-contracts.sh deleted file mode 100755 index d64da5b967a2..000000000000 --- a/yarn-project/types/scripts/copy-contracts.sh +++ /dev/null @@ -1,5 +0,0 @@ -#! /bin/bash -set -euo pipefail -mkdir -p ./fixtures - -cp "../../noir-projects/noir-contracts/target/benchmarking_contract-Benchmarking.json" ./fixtures/Benchmarking.test.json diff --git a/yarn-project/types/src/index.ts b/yarn-project/types/src/index.ts deleted file mode 100644 index a3df311a4691..000000000000 --- a/yarn-project/types/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './interfaces/index.js'; diff --git a/yarn-project/types/src/interfaces/hasher.ts b/yarn-project/types/src/interfaces/hasher.ts deleted file mode 100644 index 5fb1da8b3f23..000000000000 --- a/yarn-project/types/src/interfaces/hasher.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Defines hasher interface used by Merkle trees. - */ -export interface Hasher { - /** - * Hash two arrays. - * @param lhs - The first array. - * @param rhs - The second array. - * @returns The new 32-byte hash. - */ - hash(lhs: Uint8Array, rhs: Uint8Array): Buffer; - - /** - * Hashes an array of buffers. - * @param inputs - The array of buffers to hash. - * @returns The resulting 32-byte hash. - */ - hashInputs(inputs: Buffer[]): Buffer; -} diff --git a/yarn-project/types/src/interfaces/index.ts b/yarn-project/types/src/interfaces/index.ts deleted file mode 100644 index d1775c443bef..000000000000 --- a/yarn-project/types/src/interfaces/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './hasher.js'; diff --git a/yarn-project/types/tsconfig.json b/yarn-project/types/tsconfig.json deleted file mode 100644 index 9a89aafcc3a5..000000000000 --- a/yarn-project/types/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "..", - "compilerOptions": { - "outDir": "dest", - "rootDir": "src", - "tsBuildInfoFile": ".tsbuildinfo" - }, - "include": ["src"], - "references": [ - { - "path": "../ethereum" - }, - { - "path": "../foundation" - } - ] -} diff --git a/yarn-project/validator-client/package.json b/yarn-project/validator-client/package.json index 5fb295811559..b6660b520824 100644 --- a/yarn-project/validator-client/package.json +++ b/yarn-project/validator-client/package.json @@ -69,7 +69,6 @@ "@aztec/foundation": "workspace:^", "@aztec/p2p": "workspace:^", "@aztec/telemetry-client": "workspace:^", - "@aztec/types": "workspace:^", "koa": "^2.14.2", "koa-router": "^12.0.0", "tslib": "^2.4.0", diff --git a/yarn-project/validator-client/tsconfig.json b/yarn-project/validator-client/tsconfig.json index d2409d81fdba..628e2d03813b 100644 --- a/yarn-project/validator-client/tsconfig.json +++ b/yarn-project/validator-client/tsconfig.json @@ -26,9 +26,6 @@ }, { "path": "../telemetry-client" - }, - { - "path": "../types" } ], "include": ["src"] diff --git a/yarn-project/world-state/package.json b/yarn-project/world-state/package.json index 0a4f79913c46..b366aaf2420f 100644 --- a/yarn-project/world-state/package.json +++ b/yarn-project/world-state/package.json @@ -71,7 +71,6 @@ "@aztec/native": "workspace:^", "@aztec/protocol-contracts": "workspace:^", "@aztec/telemetry-client": "workspace:^", - "@aztec/types": "workspace:^", "tslib": "^2.4.0", "zod": "^3.23.8" }, diff --git a/yarn-project/world-state/tsconfig.json b/yarn-project/world-state/tsconfig.json index 2eacdd0308bb..ae662b5faaf1 100644 --- a/yarn-project/world-state/tsconfig.json +++ b/yarn-project/world-state/tsconfig.json @@ -33,9 +33,6 @@ { "path": "../telemetry-client" }, - { - "path": "../types" - }, { "path": "../archiver" } diff --git a/yarn-project/yarn.lock b/yarn-project/yarn.lock index 035a1014a61f..a38f596b8e8f 100644 --- a/yarn-project/yarn.lock +++ b/yarn-project/yarn.lock @@ -70,7 +70,6 @@ __metadata: "@aztec/entrypoints": "workspace:^" "@aztec/ethereum": "workspace:^" "@aztec/foundation": "workspace:^" - "@aztec/types": "workspace:^" "@jest/globals": "npm:^29.5.0" "@types/jest": "npm:^29.5.0" "@types/node": "npm:^18.7.23" @@ -100,7 +99,6 @@ __metadata: "@aztec/noir-protocol-circuits-types": "workspace:^" "@aztec/protocol-contracts": "workspace:^" "@aztec/telemetry-client": "workspace:^" - "@aztec/types": "workspace:^" "@jest/globals": "npm:^29.5.0" "@types/debug": "npm:^4.1.7" "@types/jest": "npm:^29.5.0" @@ -169,7 +167,6 @@ __metadata: "@aztec/sequencer-client": "workspace:^" "@aztec/simulator": "workspace:^" "@aztec/telemetry-client": "workspace:^" - "@aztec/types": "workspace:^" "@aztec/validator-client": "workspace:^" "@aztec/world-state": "workspace:^" "@jest/globals": "npm:^29.5.0" @@ -198,7 +195,6 @@ __metadata: "@aztec/foundation": "workspace:^" "@aztec/l1-artifacts": "workspace:^" "@aztec/protocol-contracts": "workspace:^" - "@aztec/types": "workspace:^" "@jest/globals": "npm:^29.5.0" "@types/jest": "npm:^29.5.0" "@types/node": "npm:^18.7.23" @@ -272,7 +268,6 @@ __metadata: "@aztec/pxe": "workspace:^" "@aztec/telemetry-client": "workspace:^" "@aztec/txe": "workspace:^" - "@aztec/types": "workspace:^" "@aztec/world-state": "workspace:^" "@jest/globals": "npm:^29.5.0" "@types/chalk": "npm:^2.2.0" @@ -335,7 +330,6 @@ __metadata: "@aztec/protocol-contracts": "workspace:^" "@aztec/simulator": "workspace:^" "@aztec/telemetry-client": "workspace:^" - "@aztec/types": "workspace:^" "@aztec/world-state": "workspace:^" "@jest/globals": "npm:^29.5.0" "@msgpack/msgpack": "npm:^3.0.0-beta2" @@ -435,7 +429,6 @@ __metadata: "@aztec/noir-protocol-circuits-types": "workspace:^" "@aztec/protocol-contracts": "workspace:^" "@aztec/telemetry-client": "workspace:^" - "@aztec/types": "workspace:^" "@jest/globals": "npm:^29.5.0" "@types/jest": "npm:^29.5.0" "@types/memdown": "npm:^3.0.0" @@ -477,7 +470,6 @@ __metadata: "@aztec/constants": "workspace:^" "@aztec/ethereum": "workspace:^" "@aztec/foundation": "workspace:^" - "@aztec/types": "workspace:^" "@jest/globals": "npm:^29.5.0" "@types/jest": "npm:^29.5.0" "@types/koa": "npm:^2.15.0" @@ -574,7 +566,6 @@ __metadata: "@aztec/foundation": "workspace:^" "@aztec/l1-artifacts": "workspace:^" "@aztec/protocol-contracts": "workspace:^" - "@aztec/types": "workspace:^" "@aztec/world-state": "workspace:^" "@iarna/toml": "npm:^2.2.5" "@jest/globals": "npm:^29.5.0" @@ -668,7 +659,6 @@ __metadata: "@aztec/sequencer-client": "workspace:^" "@aztec/simulator": "workspace:^" "@aztec/telemetry-client": "workspace:^" - "@aztec/types": "workspace:^" "@aztec/validator-client": "workspace:^" "@aztec/world-state": "workspace:^" "@iarna/toml": "npm:^2.2.5" @@ -860,7 +850,6 @@ __metadata: "@aztec/noir-contracts.js": "workspace:^" "@aztec/simulator": "workspace:^" "@aztec/telemetry-client": "workspace:^" - "@aztec/types": "workspace:^" "@aztec/world-state": "workspace:^" "@jest/globals": "npm:^29.5.0" "@msgpack/msgpack": "npm:^3.0.0-beta2" @@ -969,7 +958,6 @@ __metadata: "@aztec/circuits.js": "workspace:^" "@aztec/foundation": "workspace:^" "@aztec/kv-store": "workspace:^" - "@aztec/types": "workspace:^" "@jest/globals": "npm:^29.5.0" "@types/jest": "npm:^29.5.0" "@types/node": "npm:^18.15.3" @@ -1024,7 +1012,6 @@ __metadata: "@aztec/foundation": "workspace:^" "@aztec/kv-store": "workspace:^" "@aztec/merkle-tree": "workspace:^" - "@aztec/types": "workspace:^" "@jest/globals": "npm:^29.5.0" "@noir-lang/acvm_js": "portal:../../noir/packages/acvm_js" "@noir-lang/noir_codegen": "portal:../../noir/packages/noir_codegen" @@ -1150,7 +1137,6 @@ __metadata: "@aztec/circuits.js": "workspace:^" "@aztec/constants": "workspace:^" "@aztec/foundation": "workspace:^" - "@aztec/types": "workspace:^" "@jest/globals": "npm:^29.5.0" "@types/jest": "npm:^29.5.0" "@types/lodash.chunk": "npm:^4.2.9" @@ -1227,7 +1213,6 @@ __metadata: "@aztec/sequencer-client": "workspace:^" "@aztec/simulator": "workspace:^" "@aztec/telemetry-client": "workspace:^" - "@aztec/types": "workspace:^" "@aztec/world-state": "workspace:^" "@jest/globals": "npm:^29.5.0" "@types/jest": "npm:^29.5.0" @@ -1262,7 +1247,6 @@ __metadata: "@aztec/noir-protocol-circuits-types": "workspace:^" "@aztec/protocol-contracts": "workspace:^" "@aztec/simulator": "workspace:^" - "@aztec/types": "workspace:^" "@jest/globals": "npm:^29.5.0" "@msgpack/msgpack": "npm:^3.0.0-beta2" "@noir-lang/types": "workspace:*" @@ -1332,7 +1316,6 @@ __metadata: "@aztec/prover-client": "workspace:^" "@aztec/simulator": "workspace:^" "@aztec/telemetry-client": "workspace:^" - "@aztec/types": "workspace:^" "@aztec/validator-client": "workspace:^" "@aztec/world-state": "workspace:^" "@jest/globals": "npm:^29.5.0" @@ -1375,7 +1358,6 @@ __metadata: "@aztec/noir-protocol-circuits-types": "workspace:^" "@aztec/protocol-contracts": "workspace:^" "@aztec/telemetry-client": "workspace:^" - "@aztec/types": "workspace:^" "@aztec/world-state": "workspace:^" "@jest/globals": "npm:^29.5.0" "@noir-lang/acvm_js": "portal:../../noir/packages/acvm_js" @@ -1448,7 +1430,6 @@ __metadata: "@aztec/protocol-contracts": "workspace:^" "@aztec/pxe": "workspace:^" "@aztec/simulator": "workspace:^" - "@aztec/types": "workspace:^" "@aztec/world-state": "workspace:^" "@jest/globals": "npm:^29.5.0" "@types/jest": "npm:^29.5.0" @@ -1463,33 +1444,6 @@ __metadata: languageName: unknown linkType: soft -"@aztec/types@workspace:^, @aztec/types@workspace:types": - version: 0.0.0-use.local - resolution: "@aztec/types@workspace:types" - dependencies: - "@aztec/ethereum": "workspace:^" - "@aztec/foundation": "workspace:^" - "@jest/globals": "npm:^29.5.0" - "@types/debug": "npm:^4.1.7" - "@types/detect-node": "npm:^2.0.0" - "@types/jest": "npm:^29.5.0" - "@types/supertest": "npm:^2.0.12" - "@typescript-eslint/eslint-plugin": "npm:^6.2.1" - "@typescript-eslint/parser": "npm:^6.2.1" - comlink: "npm:^4.4.1" - eslint: "npm:^8.21.0" - eslint-config-prettier: "npm:^8.5.0" - eslint-plugin-jsdoc: "npm:^40.1.0" - eslint-plugin-no-only-tests: "npm:^3.1.0" - eslint-plugin-tsdoc: "npm:^0.2.17" - jest: "npm:^29.5.0" - prettier: "npm:^2.7.1" - supertest: "npm:^6.3.3" - ts-node: "npm:^10.9.1" - typescript: "npm:^5.0.4" - languageName: unknown - linkType: soft - "@aztec/validator-client@workspace:^, @aztec/validator-client@workspace:validator-client": version: 0.0.0-use.local resolution: "@aztec/validator-client@workspace:validator-client" @@ -1501,7 +1455,6 @@ __metadata: "@aztec/foundation": "workspace:^" "@aztec/p2p": "workspace:^" "@aztec/telemetry-client": "workspace:^" - "@aztec/types": "workspace:^" "@jest/globals": "npm:^29.5.0" "@types/jest": "npm:^29.5.0" "@types/node": "npm:^18.7.23" @@ -1532,7 +1485,6 @@ __metadata: "@aztec/native": "workspace:^" "@aztec/protocol-contracts": "workspace:^" "@aztec/telemetry-client": "workspace:^" - "@aztec/types": "workspace:^" "@jest/globals": "npm:^29.5.0" "@types/jest": "npm:^29.5.0" "@types/levelup": "npm:^5.1.2" From 1254f55f44456957ce5327622f3549c97d082f08 Mon Sep 17 00:00:00 2001 From: thunkar Date: Thu, 20 Feb 2025 11:26:39 +0000 Subject: [PATCH 2/7] fixed bootstrap --- yarn-project/bootstrap.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/yarn-project/bootstrap.sh b/yarn-project/bootstrap.sh index ab8a00cca785..c35dee30c599 100755 --- a/yarn-project/bootstrap.sh +++ b/yarn-project/bootstrap.sh @@ -48,7 +48,7 @@ function compile_all { # hack, after running prettier foundation may fail to resolve hash.js dependency. # it is only currently foundation, presumably because hash.js looks like a js file. rm -rf foundation/node_modules - compile_project ::: constants foundation circuits.js types builder ethereum l1-artifacts + compile_project ::: constants foundation circuits.js builder ethereum l1-artifacts # Call all projects that have a generation stage. parallel --joblog joblog.txt --line-buffered --tag 'cd {} && yarn generate' ::: \ @@ -61,8 +61,7 @@ function compile_all { noir-contracts.js \ noir-protocol-circuits-types \ protocol-contracts \ - pxe \ - types + pxe cat joblog.txt get_projects | compile_project From c71139d0dfa7049db17a068128099895ccb7806e Mon Sep 17 00:00:00 2001 From: thunkar Date: Thu, 20 Feb 2025 11:36:29 +0000 Subject: [PATCH 3/7] fix --- yarn-project/tsconfig.json | 1 - 1 file changed, 1 deletion(-) diff --git a/yarn-project/tsconfig.json b/yarn-project/tsconfig.json index 1f4d642aa7a0..88c1e4db2299 100644 --- a/yarn-project/tsconfig.json +++ b/yarn-project/tsconfig.json @@ -51,7 +51,6 @@ { "path": "prover-client/tsconfig.json" }, { "path": "prover-node/tsconfig.json" }, { "path": "sequencer-client/tsconfig.json" }, - { "path": "types/tsconfig.json" }, { "path": "world-state/tsconfig.json" }, { "path": "scripts/tsconfig.json" }, { "path": "entrypoints/tsconfig.json" }, From e9257a557dbfe50b6a3d59e3620be315f0d751d2 Mon Sep 17 00:00:00 2001 From: thunkar Date: Thu, 20 Feb 2025 13:57:27 +0000 Subject: [PATCH 4/7] wip --- .../accounts/src/testing/configuration.ts | 2 +- .../archiver/src/archiver/archiver.ts | 2 +- .../archiver/src/archiver/archiver_store.ts | 2 +- .../kv_archiver_store/kv_archiver_store.ts | 2 +- .../memory_archiver_store.ts | 2 +- .../aztec-node/src/aztec-node/server.ts | 2 +- yarn-project/aztec.js/src/api/addresses.ts | 2 +- .../src/api/ethereum/portal_manager.ts | 2 +- .../aztec.js/src/contract/contract.ts | 2 +- .../contract/contract_function_interaction.ts | 2 +- .../aztec.js/src/contract/deploy_proven_tx.ts | 2 +- .../aztec.js/src/fee/fee_payment_method.ts | 2 +- .../src/fee/private_fee_payment_method.ts | 2 +- .../src/fee/public_fee_payment_method.ts | 2 +- yarn-project/aztec.js/src/wallet/index.ts | 2 +- yarn-project/aztec/src/sandbox.ts | 4 +- .../avm_check_circuit1.test.ts | 2 +- .../avm_check_circuit2.test.ts | 2 +- .../avm_check_circuit3.test.ts | 2 +- .../avm_contract_updates.test.ts | 2 +- .../avm_proving_tests/avm_proven_amm.test.ts | 2 +- .../avm_proven_token.test.ts | 2 +- .../avm_proving_and_verification.test.ts | 2 +- .../avm_proving_tests/avm_proving_tester.ts | 2 +- .../avm_public_fee_payment.test.ts | 2 +- .../src/avm_proving_tests/avm_v2.test.ts | 2 +- .../src/interfaces/aztec-node.ts | 4 +- .../circuit-types/src/logs/log_filter.ts | 2 +- .../src/logs/unencrypted_l2_log.ts | 2 +- .../src/messaging/l1_to_l2_message.ts | 2 +- .../circuit-types/src/messaging/l2_actor.ts | 2 +- .../circuit-types/src/notes/notes_filter.ts | 2 +- yarn-project/circuits.js/package.json | 1 + yarn-project/circuits.js/src/abi/decoder.ts | 2 +- .../circuits.js/src/abi/encoder.test.ts | 4 +- .../src/aztec-address/aztec-address.test.ts | 3 +- .../src/aztec-address/index.ts | 11 +++-- .../src/contract/contract_address.ts | 2 +- .../src/contract/contract_instance.ts | 2 +- .../interfaces/contract_data_source.ts | 2 +- .../contract/interfaces/contract_instance.ts | 4 +- .../interfaces/contract_instance_update.ts | 5 ++- .../interfaces/protocol_contract_addresses.ts | 6 +-- yarn-project/circuits.js/src/hash/hash.ts | 2 +- .../circuits.js/src/hash/map_slot.test.ts | 2 +- ...build_note_hash_read_request_hints.test.ts | 2 +- ...build_nullifier_read_request_hints.test.ts | 2 +- .../build_nullifier_read_request_hints.ts | 2 +- .../hints/build_transient_data_hints.test.ts | 2 +- .../src/hints/scoped_value_cache.ts | 3 +- .../circuits.js/src/keys/derivation.ts | 2 +- yarn-project/circuits.js/src/schemas/index.ts | 2 + .../circuits.js/src/structs/avm/avm.ts | 2 +- .../structs/avm/avm_circuit_public_inputs.ts | 2 +- .../circuits.js/src/structs/call_context.ts | 6 +-- .../src/structs/complete_address.test.ts | 2 +- .../src/structs/complete_address.ts | 2 +- .../src/structs/contract_storage_read.ts | 3 +- .../contract_storage_update_request.ts | 3 +- .../src/structs/global_variables.ts | 4 +- yarn-project/circuits.js/src/structs/index.ts | 2 +- .../src/structs/indexed_tagging_secret.ts | 3 +- .../private_kernel_circuit_public_inputs.ts | 2 +- ...ivate_kernel_tail_circuit_public_inputs.ts | 2 +- ..._to_public_kernel_circuit_public_inputs.ts | 2 +- ..._to_rollup_kernel_circuit_public_inputs.ts | 2 +- .../src/structs/l2_to_l1_message.ts | 3 +- .../circuits.js/src/structs/log_hash.ts | 2 +- .../circuits.js/src/structs/note_hash.ts | 2 +- .../circuits.js/src/structs/nullifier.ts | 2 +- .../src/structs/private_log_data.ts | 2 +- .../src/structs/public_call_request.ts | 2 +- .../public_call_stack_item_compressed.ts | 2 +- .../src/structs/public_data_update_request.ts | 2 +- .../circuits.js/src/structs/public_log.ts | 5 ++- .../circuits.js/src/structs/read_request.ts | 3 +- ...ed_key_validation_request_and_generator.ts | 2 +- .../shared_mutable_values_with_hash.ts | 2 +- .../src/structs/tx_request.test.ts | 2 +- .../circuits.js/src/structs/tx_request.ts | 2 +- .../circuits.js/src/tests/factories.ts | 2 +- .../cli-wallet/src/cmds/bridge_fee_juice.ts | 2 +- yarn-project/cli-wallet/src/utils/accounts.ts | 2 +- yarn-project/cli/src/utils/aztec.ts | 2 +- .../src/e2e_crowdfunding_and_claim.test.ts | 2 +- .../src/fixtures/setup_l1_contracts.ts | 2 +- yarn-project/end-to-end/src/fixtures/utils.ts | 2 +- .../ethereum/src/contracts/forwarder.test.ts | 5 +-- .../ethereum/src/deploy_l1_contracts.test.ts | 5 +-- .../ethereum/src/deploy_l1_contracts.ts | 9 ++-- yarn-project/foundation/package.json | 1 - yarn-project/foundation/src/index.ts | 1 - .../foundation/src/schemas/schemas.ts | 4 -- .../src/serialize/type_registry.test.ts | 41 +++++++++++++------ .../indexed_merkle_tree_calculator.test.ts | 18 ++++---- .../src/avm_integration.test.ts | 2 +- .../src/build_protocol_contract_tree.ts | 2 +- .../protocol-contracts/src/fee-juice/index.ts | 2 +- .../contract_instance_deployed_event.ts | 2 +- .../contract_instance_updated_event.ts | 2 +- .../src/protocol_contract.ts | 2 +- .../src/protocol_contract_tree.ts | 2 +- .../src/scripts/generate_data.ts | 2 +- .../prover-client/src/mocks/test_context.ts | 2 +- ...rchestrator_multi_public_functions.test.ts | 2 +- yarn-project/pxe/src/database/pxe_database.ts | 2 +- yarn-project/pxe/src/index.ts | 2 +- .../src/kernel_prover/kernel_prover.test.ts | 2 +- .../src/kernel_prover/proving_data_oracle.ts | 2 +- .../pxe/src/pxe_service/error_enriching.ts | 2 +- .../pxe/src/pxe_service/pxe_service.ts | 2 +- .../src/sequencer/sequencer.ts | 2 +- .../simulator/src/acvm/oracle/oracle.ts | 2 +- .../simulator/src/acvm/oracle/typed_oracle.ts | 2 +- yarn-project/simulator/src/acvm/serialize.ts | 2 +- .../src/avm/avm_execution_environment.ts | 2 +- .../simulator/src/avm/avm_memory_types.ts | 2 +- .../simulator/src/avm/avm_simulator.test.ts | 2 +- .../src/avm/fixtures/avm_simulation_tester.ts | 2 +- .../fixtures/base_avm_simulation_tester.ts | 2 +- .../simulator/src/avm/fixtures/index.ts | 2 +- .../fixtures/simple_contract_data_source.ts | 2 +- .../simulator/src/avm/journal/journal.ts | 2 +- .../avm/opcodes/environment_getters.test.ts | 2 +- .../simulator/src/avm/opcodes/storage.test.ts | 2 +- .../src/client/client_execution_context.ts | 2 +- .../simulator/src/client/db_oracle.ts | 2 +- .../src/client/execution_note_cache.ts | 2 +- .../src/client/private_execution.test.ts | 2 +- .../simulator/src/client/private_execution.ts | 2 +- .../simulator/src/client/simulator.test.ts | 2 +- .../simulator/src/client/simulator.ts | 2 +- .../client/unconstrained_execution.test.ts | 2 +- .../src/client/unconstrained_execution.ts | 2 +- .../simulator/src/client/view_data_oracle.ts | 2 +- .../simulator/src/public/db_interfaces.ts | 2 +- .../fixtures/public_tx_simulation_tester.ts | 2 +- .../simulator/src/public/fixtures/utils.ts | 2 +- .../src/public/side_effect_trace_interface.ts | 2 +- yarn-project/txe/src/oracle/txe_oracle.ts | 2 +- .../txe/src/txe_service/txe_service.ts | 2 +- 141 files changed, 204 insertions(+), 185 deletions(-) rename yarn-project/{foundation => circuits.js}/src/aztec-address/aztec-address.test.ts (97%) rename yarn-project/{foundation => circuits.js}/src/aztec-address/index.ts (93%) diff --git a/yarn-project/accounts/src/testing/configuration.ts b/yarn-project/accounts/src/testing/configuration.ts index 3c355807df25..b18cdfa9c090 100644 --- a/yarn-project/accounts/src/testing/configuration.ts +++ b/yarn-project/accounts/src/testing/configuration.ts @@ -1,7 +1,7 @@ import { type PXE } from '@aztec/aztec.js'; import { type AccountWalletWithSecretKey } from '@aztec/aztec.js/wallet'; +import { type AztecAddress } from '@aztec/circuits.js/aztec-address'; import { deriveMasterIncomingViewingSecretKey } from '@aztec/circuits.js/keys'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr, type GrumpkinScalar } from '@aztec/foundation/fields'; import { diff --git a/yarn-project/archiver/src/archiver/archiver.ts b/yarn-project/archiver/src/archiver/archiver.ts index c78c257a3d54..d191c9a4ce5c 100644 --- a/yarn-project/archiver/src/archiver/archiver.ts +++ b/yarn-project/archiver/src/archiver/archiver.ts @@ -38,8 +38,8 @@ import { isValidPrivateFunctionMembershipProof, isValidUnconstrainedFunctionMembershipProof, } from '@aztec/circuits.js'; +import { type AztecAddress } from '@aztec/circuits.js/aztec-address'; import { createEthereumChain } from '@aztec/ethereum'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { type EthAddress } from '@aztec/foundation/eth-address'; import { Fr } from '@aztec/foundation/fields'; import { type Logger, createLogger } from '@aztec/foundation/log'; diff --git a/yarn-project/archiver/src/archiver/archiver_store.ts b/yarn-project/archiver/src/archiver/archiver_store.ts index b82c9b2cf021..28d3a5a07600 100644 --- a/yarn-project/archiver/src/archiver/archiver_store.ts +++ b/yarn-project/archiver/src/archiver/archiver_store.ts @@ -21,7 +21,7 @@ import { type UnconstrainedFunctionWithMembershipProof, } from '@aztec/circuits.js'; import { type FunctionSelector } from '@aztec/circuits.js/abi'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; +import { type AztecAddress } from '@aztec/circuits.js/aztec-address'; import { type DataRetrieval } from './structs/data_retrieval.js'; import { type L1Published } from './structs/published.js'; diff --git a/yarn-project/archiver/src/archiver/kv_archiver_store/kv_archiver_store.ts b/yarn-project/archiver/src/archiver/kv_archiver_store/kv_archiver_store.ts index 5e72401c38e3..9749922d7460 100644 --- a/yarn-project/archiver/src/archiver/kv_archiver_store/kv_archiver_store.ts +++ b/yarn-project/archiver/src/archiver/kv_archiver_store/kv_archiver_store.ts @@ -20,7 +20,7 @@ import { type UnconstrainedFunctionWithMembershipProof, } from '@aztec/circuits.js'; import { FunctionSelector } from '@aztec/circuits.js/abi'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; +import { type AztecAddress } from '@aztec/circuits.js/aztec-address'; import { toArray } from '@aztec/foundation/iterable'; import { createLogger } from '@aztec/foundation/log'; import { type AztecAsyncKVStore, type StoreSize } from '@aztec/kv-store'; diff --git a/yarn-project/archiver/src/archiver/memory_archiver_store/memory_archiver_store.ts b/yarn-project/archiver/src/archiver/memory_archiver_store/memory_archiver_store.ts index 5dba1cb4782b..9d2cce95ea70 100644 --- a/yarn-project/archiver/src/archiver/memory_archiver_store/memory_archiver_store.ts +++ b/yarn-project/archiver/src/archiver/memory_archiver_store/memory_archiver_store.ts @@ -29,13 +29,13 @@ import { type UnconstrainedFunctionWithMembershipProof, } from '@aztec/circuits.js'; import { FunctionSelector } from '@aztec/circuits.js/abi'; +import { type AztecAddress } from '@aztec/circuits.js/aztec-address'; import { INITIAL_L2_BLOCK_NUM, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, PUBLIC_LOG_DATA_SIZE_IN_FIELDS, } from '@aztec/constants'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { createLogger } from '@aztec/foundation/log'; import { type ArchiverDataStore, type ArchiverL1SynchPoint } from '../archiver_store.js'; diff --git a/yarn-project/aztec-node/src/aztec-node/server.ts b/yarn-project/aztec-node/src/aztec-node/server.ts index 92a82847c55e..2d951a931ebf 100644 --- a/yarn-project/aztec-node/src/aztec-node/server.ts +++ b/yarn-project/aztec-node/src/aztec-node/server.ts @@ -45,6 +45,7 @@ import { type PrivateLog, type ProtocolContractAddresses, } from '@aztec/circuits.js'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { computePublicDataTreeLeafSlot, siloNullifier } from '@aztec/circuits.js/hash'; import { type NullifierLeafPreimage, @@ -62,7 +63,6 @@ import { } from '@aztec/constants'; import { EpochCache } from '@aztec/epoch-cache'; import { type L1ContractAddresses, createEthereumChain } from '@aztec/ethereum'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { compactArray } from '@aztec/foundation/collection'; import { type Logger, createLogger } from '@aztec/foundation/log'; import { DateProvider, Timer } from '@aztec/foundation/timer'; diff --git a/yarn-project/aztec.js/src/api/addresses.ts b/yarn-project/aztec.js/src/api/addresses.ts index 5b7111416c97..6dad47acba58 100644 --- a/yarn-project/aztec.js/src/api/addresses.ts +++ b/yarn-project/aztec.js/src/api/addresses.ts @@ -1,2 +1,2 @@ -export { AztecAddress } from '@aztec/foundation/aztec-address'; +export { AztecAddress } from '@aztec/circuits.js/aztec-address'; export { CompleteAddress } from '@aztec/circuits.js'; diff --git a/yarn-project/aztec.js/src/api/ethereum/portal_manager.ts b/yarn-project/aztec.js/src/api/ethereum/portal_manager.ts index 238dc36dfc79..29548f3fabdc 100644 --- a/yarn-project/aztec.js/src/api/ethereum/portal_manager.ts +++ b/yarn-project/aztec.js/src/api/ethereum/portal_manager.ts @@ -1,8 +1,8 @@ import { type SiblingPath } from '@aztec/circuit-types'; import { type PXE } from '@aztec/circuit-types/interfaces/client'; +import type { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { computeSecretHash } from '@aztec/circuits.js/hash'; import { extractEvent } from '@aztec/ethereum/utils'; -import type { AztecAddress } from '@aztec/foundation/aztec-address'; import { sha256ToField } from '@aztec/foundation/crypto'; import { EthAddress } from '@aztec/foundation/eth-address'; import { Fr } from '@aztec/foundation/fields'; diff --git a/yarn-project/aztec.js/src/contract/contract.ts b/yarn-project/aztec.js/src/contract/contract.ts index 93bc2042e7ad..74056425cc72 100644 --- a/yarn-project/aztec.js/src/contract/contract.ts +++ b/yarn-project/aztec.js/src/contract/contract.ts @@ -1,6 +1,6 @@ import { PublicKeys, getContractClassFromArtifact } from '@aztec/circuits.js'; import { type ContractArtifact } from '@aztec/circuits.js/abi'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; +import { type AztecAddress } from '@aztec/circuits.js/aztec-address'; import { type Wallet } from '../account/index.js'; import { ContractBase } from './contract_base.js'; diff --git a/yarn-project/aztec.js/src/contract/contract_function_interaction.ts b/yarn-project/aztec.js/src/contract/contract_function_interaction.ts index 5e8def9a1b19..37b35f35a442 100644 --- a/yarn-project/aztec.js/src/contract/contract_function_interaction.ts +++ b/yarn-project/aztec.js/src/contract/contract_function_interaction.ts @@ -7,7 +7,7 @@ import { decodeFromAbi, encodeArguments, } from '@aztec/circuits.js/abi'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { type Wallet } from '../account/wallet.js'; import { FeeJuicePaymentMethod } from '../fee/fee_juice_payment_method.js'; diff --git a/yarn-project/aztec.js/src/contract/deploy_proven_tx.ts b/yarn-project/aztec.js/src/contract/deploy_proven_tx.ts index 0f9e831fb404..5046c0a202c3 100644 --- a/yarn-project/aztec.js/src/contract/deploy_proven_tx.ts +++ b/yarn-project/aztec.js/src/contract/deploy_proven_tx.ts @@ -1,7 +1,7 @@ import { type Tx } from '@aztec/circuit-types'; import { type PXE } from '@aztec/circuit-types/interfaces/client'; +import { type AztecAddress } from '@aztec/circuits.js/aztec-address'; import { type ContractInstanceWithAddress } from '@aztec/circuits.js/contract'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { type Wallet } from '../account/index.js'; import { type Contract } from './contract.js'; diff --git a/yarn-project/aztec.js/src/fee/fee_payment_method.ts b/yarn-project/aztec.js/src/fee/fee_payment_method.ts index 6cdf795cd56c..6d982e195e49 100644 --- a/yarn-project/aztec.js/src/fee/fee_payment_method.ts +++ b/yarn-project/aztec.js/src/fee/fee_payment_method.ts @@ -1,6 +1,6 @@ import { type FunctionCall } from '@aztec/circuit-types'; import { type GasSettings } from '@aztec/circuits.js'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; +import { type AztecAddress } from '@aztec/circuits.js/aztec-address'; /** * Holds information about how the fee for a transaction is to be paid. diff --git a/yarn-project/aztec.js/src/fee/private_fee_payment_method.ts b/yarn-project/aztec.js/src/fee/private_fee_payment_method.ts index e8c899697813..86096aa25f74 100644 --- a/yarn-project/aztec.js/src/fee/private_fee_payment_method.ts +++ b/yarn-project/aztec.js/src/fee/private_fee_payment_method.ts @@ -1,7 +1,7 @@ import { type FunctionCall } from '@aztec/circuit-types'; import { type GasSettings } from '@aztec/circuits.js'; import { FunctionSelector, FunctionType, U128 } from '@aztec/circuits.js/abi'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; +import { type AztecAddress } from '@aztec/circuits.js/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { type Wallet } from '../account/wallet.js'; diff --git a/yarn-project/aztec.js/src/fee/public_fee_payment_method.ts b/yarn-project/aztec.js/src/fee/public_fee_payment_method.ts index 161418328dd4..5a2aff514374 100644 --- a/yarn-project/aztec.js/src/fee/public_fee_payment_method.ts +++ b/yarn-project/aztec.js/src/fee/public_fee_payment_method.ts @@ -1,7 +1,7 @@ import { type FunctionCall } from '@aztec/circuit-types'; import { type GasSettings } from '@aztec/circuits.js'; import { FunctionSelector, FunctionType, U128 } from '@aztec/circuits.js/abi'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; +import { type AztecAddress } from '@aztec/circuits.js/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { ContractFunctionInteraction } from '../contract/contract_function_interaction.js'; diff --git a/yarn-project/aztec.js/src/wallet/index.ts b/yarn-project/aztec.js/src/wallet/index.ts index 30ac7f6c86da..feb8ea0a724d 100644 --- a/yarn-project/aztec.js/src/wallet/index.ts +++ b/yarn-project/aztec.js/src/wallet/index.ts @@ -1,5 +1,5 @@ import { type PXE } from '@aztec/circuit-types/interfaces/client'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; +import { type AztecAddress } from '@aztec/circuits.js/aztec-address'; import { type AccountContract } from '../account/contract.js'; import { AccountWallet } from './account_wallet.js'; diff --git a/yarn-project/aztec/src/sandbox.ts b/yarn-project/aztec/src/sandbox.ts index 031c56df5c31..c0938083b263 100644 --- a/yarn-project/aztec/src/sandbox.ts +++ b/yarn-project/aztec/src/sandbox.ts @@ -6,6 +6,7 @@ import { AnvilTestWatcher, EthCheatCodes, SignerlessWallet, type Wallet } from ' import { type BlobSinkClientInterface, createBlobSinkClient } from '@aztec/blob-sink/client'; import { type AztecNode, type PXE } from '@aztec/circuit-types/interfaces/client'; import { type ContractInstanceWithAddress, getContractInstanceFromDeployParams } from '@aztec/circuits.js'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { type PublicDataTreeLeaf } from '@aztec/circuits.js/trees'; import { setupCanonicalL2FeeJuice } from '@aztec/cli/setup-contracts'; import { GENESIS_ARCHIVE_ROOT, GENESIS_BLOCK_HASH } from '@aztec/constants'; @@ -16,7 +17,6 @@ import { getL1ContractsConfigEnvVars, waitForPublicClient, } from '@aztec/ethereum'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { type LogFn, createLogger } from '@aztec/foundation/log'; import { FPCContract } from '@aztec/noir-contracts.js/FPC'; @@ -67,7 +67,7 @@ export async function deployContractsToL1( { ...getL1ContractsConfigEnvVars(), // TODO: We should not need to be loading config from env again, caller should handle this ...aztecNodeConfig, - l2FeeJuiceAddress: ProtocolContractAddress.FeeJuice, + l2FeeJuiceAddress: ProtocolContractAddress.FeeJuice.toField(), vkTreeRoot: getVKTreeRoot(), protocolContractTreeRoot, genesisArchiveRoot: opts.genesisArchiveRoot ?? new Fr(GENESIS_ARCHIVE_ROOT), diff --git a/yarn-project/bb-prover/src/avm_proving_tests/avm_check_circuit1.test.ts b/yarn-project/bb-prover/src/avm_proving_tests/avm_check_circuit1.test.ts index 5c83a755f42d..464709fcb6a1 100644 --- a/yarn-project/bb-prover/src/avm_proving_tests/avm_check_circuit1.test.ts +++ b/yarn-project/bb-prover/src/avm_proving_tests/avm_check_circuit1.test.ts @@ -1,4 +1,5 @@ import { type ContractInstanceWithAddress } from '@aztec/circuits.js'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { MAX_L2_TO_L1_MSGS_PER_TX, MAX_NOTE_HASHES_PER_TX, @@ -6,7 +7,6 @@ import { MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, MAX_PUBLIC_LOGS_PER_TX, } from '@aztec/constants'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { AvmTestContractArtifact } from '@aztec/noir-contracts.js/AvmTest'; diff --git a/yarn-project/bb-prover/src/avm_proving_tests/avm_check_circuit2.test.ts b/yarn-project/bb-prover/src/avm_proving_tests/avm_check_circuit2.test.ts index c22727d2cbbc..de036120110f 100644 --- a/yarn-project/bb-prover/src/avm_proving_tests/avm_check_circuit2.test.ts +++ b/yarn-project/bb-prover/src/avm_proving_tests/avm_check_circuit2.test.ts @@ -1,5 +1,5 @@ import { type ContractInstanceWithAddress } from '@aztec/circuits.js'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { AvmTestContractArtifact } from '@aztec/noir-contracts.js/AvmTest'; diff --git a/yarn-project/bb-prover/src/avm_proving_tests/avm_check_circuit3.test.ts b/yarn-project/bb-prover/src/avm_proving_tests/avm_check_circuit3.test.ts index 23fabf38df98..9a3a6c763bbc 100644 --- a/yarn-project/bb-prover/src/avm_proving_tests/avm_check_circuit3.test.ts +++ b/yarn-project/bb-prover/src/avm_proving_tests/avm_check_circuit3.test.ts @@ -1,5 +1,5 @@ import { type ContractInstanceWithAddress } from '@aztec/circuits.js'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { AvmTestContractArtifact } from '@aztec/noir-contracts.js/AvmTest'; diff --git a/yarn-project/bb-prover/src/avm_proving_tests/avm_contract_updates.test.ts b/yarn-project/bb-prover/src/avm_proving_tests/avm_contract_updates.test.ts index 8d2b5b3b4737..7d16dc36520b 100644 --- a/yarn-project/bb-prover/src/avm_proving_tests/avm_contract_updates.test.ts +++ b/yarn-project/bb-prover/src/avm_proving_tests/avm_contract_updates.test.ts @@ -1,10 +1,10 @@ import { type ContractInstanceWithAddress } from '@aztec/circuits.js'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { ScheduledDelayChange, ScheduledValueChange, SharedMutableValuesWithHash, } from '@aztec/circuits.js/shared-mutable'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { AvmTestContractArtifact } from '@aztec/noir-contracts.js/AvmTest'; import { ProtocolContractAddress } from '@aztec/protocol-contracts'; diff --git a/yarn-project/bb-prover/src/avm_proving_tests/avm_proven_amm.test.ts b/yarn-project/bb-prover/src/avm_proving_tests/avm_proven_amm.test.ts index 96a0bec65e63..9e3035bd668f 100644 --- a/yarn-project/bb-prover/src/avm_proving_tests/avm_proven_amm.test.ts +++ b/yarn-project/bb-prover/src/avm_proving_tests/avm_proven_amm.test.ts @@ -1,5 +1,5 @@ import { type ContractInstanceWithAddress } from '@aztec/circuits.js'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { AMMContractArtifact } from '@aztec/noir-contracts.js/AMM'; import { TokenContractArtifact } from '@aztec/noir-contracts.js/Token'; diff --git a/yarn-project/bb-prover/src/avm_proving_tests/avm_proven_token.test.ts b/yarn-project/bb-prover/src/avm_proving_tests/avm_proven_token.test.ts index 61fe47660a4e..6d3eee065de6 100644 --- a/yarn-project/bb-prover/src/avm_proving_tests/avm_proven_token.test.ts +++ b/yarn-project/bb-prover/src/avm_proving_tests/avm_proven_token.test.ts @@ -1,5 +1,5 @@ import { type ContractInstanceWithAddress } from '@aztec/circuits.js'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { TokenContractArtifact } from '@aztec/noir-contracts.js/Token'; import { type PublicTxResult } from '@aztec/simulator/server'; diff --git a/yarn-project/bb-prover/src/avm_proving_tests/avm_proving_and_verification.test.ts b/yarn-project/bb-prover/src/avm_proving_tests/avm_proving_and_verification.test.ts index c45f21084e9d..8db613b60631 100644 --- a/yarn-project/bb-prover/src/avm_proving_tests/avm_proving_and_verification.test.ts +++ b/yarn-project/bb-prover/src/avm_proving_tests/avm_proving_and_verification.test.ts @@ -1,5 +1,5 @@ import { type ContractInstanceWithAddress } from '@aztec/circuits.js'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { AvmTestContractArtifact } from '@aztec/noir-contracts.js/AvmTest'; diff --git a/yarn-project/bb-prover/src/avm_proving_tests/avm_proving_tester.ts b/yarn-project/bb-prover/src/avm_proving_tests/avm_proving_tester.ts index 083f1f89ca02..123e0e534de8 100644 --- a/yarn-project/bb-prover/src/avm_proving_tests/avm_proving_tester.ts +++ b/yarn-project/bb-prover/src/avm_proving_tests/avm_proving_tester.ts @@ -1,7 +1,7 @@ import { type MerkleTreeWriteOperations } from '@aztec/circuit-types/interfaces/server'; import { VerificationKeyData } from '@aztec/circuits.js'; import { type AvmCircuitInputs } from '@aztec/circuits.js/avm'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { PublicTxSimulationTester, type TestEnqueuedCall } from '@aztec/simulator/public/fixtures'; import { WorldStateDB } from '@aztec/simulator/server'; import { NativeWorldStateService } from '@aztec/world-state'; diff --git a/yarn-project/bb-prover/src/avm_proving_tests/avm_public_fee_payment.test.ts b/yarn-project/bb-prover/src/avm_proving_tests/avm_public_fee_payment.test.ts index 70240787aa54..d5c2c60e1501 100644 --- a/yarn-project/bb-prover/src/avm_proving_tests/avm_public_fee_payment.test.ts +++ b/yarn-project/bb-prover/src/avm_proving_tests/avm_public_fee_payment.test.ts @@ -1,5 +1,5 @@ import { type ContractInstanceWithAddress } from '@aztec/circuits.js'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { AvmTestContractArtifact } from '@aztec/noir-contracts.js/AvmTest'; diff --git a/yarn-project/bb-prover/src/avm_proving_tests/avm_v2.test.ts b/yarn-project/bb-prover/src/avm_proving_tests/avm_v2.test.ts index 257e2d529ea6..92a43de94419 100644 --- a/yarn-project/bb-prover/src/avm_proving_tests/avm_v2.test.ts +++ b/yarn-project/bb-prover/src/avm_proving_tests/avm_v2.test.ts @@ -1,5 +1,5 @@ import { type ContractInstanceWithAddress } from '@aztec/circuits.js'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { AvmTestContractArtifact } from '@aztec/noir-contracts.js/AvmTest'; diff --git a/yarn-project/circuit-types/src/interfaces/aztec-node.ts b/yarn-project/circuit-types/src/interfaces/aztec-node.ts index 5a55ee0730f8..4b114f49a48a 100644 --- a/yarn-project/circuit-types/src/interfaces/aztec-node.ts +++ b/yarn-project/circuit-types/src/interfaces/aztec-node.ts @@ -11,6 +11,8 @@ import { type ProtocolContractAddresses, ProtocolContractAddressesSchema, } from '@aztec/circuits.js'; +import type { AztecAddress } from '@aztec/circuits.js/aztec-address'; +import { type ApiSchemaFor, optional, schemas } from '@aztec/circuits.js/schemas'; import { ARCHIVE_HEIGHT, L1_TO_L2_MSG_TREE_HEIGHT, @@ -19,10 +21,8 @@ import { PUBLIC_DATA_TREE_HEIGHT, } from '@aztec/constants'; import { type L1ContractAddresses, L1ContractAddressesSchema } from '@aztec/ethereum/l1-contract-addresses'; -import type { AztecAddress } from '@aztec/foundation/aztec-address'; import type { Fr } from '@aztec/foundation/fields'; import { createSafeJsonRpcClient, defaultFetch } from '@aztec/foundation/json-rpc/client'; -import { type ApiSchemaFor, optional, schemas } from '@aztec/foundation/schemas'; import { z } from 'zod'; diff --git a/yarn-project/circuit-types/src/logs/log_filter.ts b/yarn-project/circuit-types/src/logs/log_filter.ts index 0ac97ee5da5b..3dcb47c6df16 100644 --- a/yarn-project/circuit-types/src/logs/log_filter.ts +++ b/yarn-project/circuit-types/src/logs/log_filter.ts @@ -1,5 +1,5 @@ import { type AztecAddress } from '@aztec/circuits.js'; -import { schemas } from '@aztec/foundation/schemas'; +import { schemas } from '@aztec/circuits.js/schemas'; import { z } from 'zod'; diff --git a/yarn-project/circuit-types/src/logs/unencrypted_l2_log.ts b/yarn-project/circuit-types/src/logs/unencrypted_l2_log.ts index 449befe8bf36..9828025da4b4 100644 --- a/yarn-project/circuit-types/src/logs/unencrypted_l2_log.ts +++ b/yarn-project/circuit-types/src/logs/unencrypted_l2_log.ts @@ -1,6 +1,6 @@ import { AztecAddress } from '@aztec/circuits.js'; +import { schemas } from '@aztec/circuits.js/schemas'; import { randomBytes, sha256Trunc } from '@aztec/foundation/crypto'; -import { schemas } from '@aztec/foundation/schemas'; import { BufferReader, prefixBufferWithLength, toHumanReadable } from '@aztec/foundation/serialize'; import { z } from 'zod'; diff --git a/yarn-project/circuit-types/src/messaging/l1_to_l2_message.ts b/yarn-project/circuit-types/src/messaging/l1_to_l2_message.ts index 713a854903d0..40a6478017a1 100644 --- a/yarn-project/circuit-types/src/messaging/l1_to_l2_message.ts +++ b/yarn-project/circuit-types/src/messaging/l1_to_l2_message.ts @@ -1,6 +1,6 @@ +import { type AztecAddress } from '@aztec/circuits.js/aztec-address'; import { computeL1ToL2MessageNullifier } from '@aztec/circuits.js/hash'; import { type L1_TO_L2_MSG_TREE_HEIGHT } from '@aztec/constants'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { sha256ToField } from '@aztec/foundation/crypto'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize'; diff --git a/yarn-project/circuit-types/src/messaging/l2_actor.ts b/yarn-project/circuit-types/src/messaging/l2_actor.ts index 07d6af7cc822..4a3a2ebc1a4c 100644 --- a/yarn-project/circuit-types/src/messaging/l2_actor.ts +++ b/yarn-project/circuit-types/src/messaging/l2_actor.ts @@ -1,4 +1,4 @@ -import { AztecAddress } from '@aztec/foundation/aztec-address'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { randomInt } from '@aztec/foundation/crypto'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize'; diff --git a/yarn-project/circuit-types/src/notes/notes_filter.ts b/yarn-project/circuit-types/src/notes/notes_filter.ts index f2ce6696aeba..a316befb8f10 100644 --- a/yarn-project/circuit-types/src/notes/notes_filter.ts +++ b/yarn-project/circuit-types/src/notes/notes_filter.ts @@ -1,5 +1,5 @@ import { type AztecAddress, type Fr } from '@aztec/circuits.js'; -import { type ZodFor, schemas } from '@aztec/foundation/schemas'; +import { type ZodFor, schemas } from '@aztec/circuits.js/schemas'; import { z } from 'zod'; diff --git a/yarn-project/circuits.js/package.json b/yarn-project/circuits.js/package.json index 0d315b9a89d9..be527a80a653 100644 --- a/yarn-project/circuits.js/package.json +++ b/yarn-project/circuits.js/package.json @@ -8,6 +8,7 @@ ], "exports": { ".": "./dest/index.js", + "./aztec-address": "./dest/aztec-address/index.js", "./abi": "./dest/abi/index.js", "./hash": "./dest/hash/index.js", "./keys": "./dest/keys/index.js", diff --git a/yarn-project/circuits.js/src/abi/decoder.ts b/yarn-project/circuits.js/src/abi/decoder.ts index 4aff1fde8059..2fd0e4b2245f 100644 --- a/yarn-project/circuits.js/src/abi/decoder.ts +++ b/yarn-project/circuits.js/src/abi/decoder.ts @@ -1,6 +1,6 @@ -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; +import { AztecAddress } from '../aztec-address/index.js'; import { type ABIParameter, type ABIVariable, type AbiType } from './abi.js'; import { U128 } from './u128.js'; import { isAztecAddressStruct, isU128Struct, parseSignedInt } from './utils.js'; diff --git a/yarn-project/circuits.js/src/abi/encoder.test.ts b/yarn-project/circuits.js/src/abi/encoder.test.ts index 4475b36e45ac..9f8a8b45b3a1 100644 --- a/yarn-project/circuits.js/src/abi/encoder.test.ts +++ b/yarn-project/circuits.js/src/abi/encoder.test.ts @@ -1,8 +1,8 @@ -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr, Point } from '@aztec/foundation/fields'; import { jsonParseWithSchema, jsonStringify } from '@aztec/foundation/json-rpc'; -import { schemas } from '@aztec/foundation/schemas'; +import { AztecAddress } from '../aztec-address/index.js'; +import { schemas } from '../schemas/index.js'; import { type FunctionAbi, FunctionType } from './abi.js'; import { encodeArguments } from './encoder.js'; diff --git a/yarn-project/foundation/src/aztec-address/aztec-address.test.ts b/yarn-project/circuits.js/src/aztec-address/aztec-address.test.ts similarity index 97% rename from yarn-project/foundation/src/aztec-address/aztec-address.test.ts rename to yarn-project/circuits.js/src/aztec-address/aztec-address.test.ts index 8c1b0b0f9d24..a26fa7ca28b5 100644 --- a/yarn-project/foundation/src/aztec-address/aztec-address.test.ts +++ b/yarn-project/circuits.js/src/aztec-address/aztec-address.test.ts @@ -1,4 +1,5 @@ -import { Fr } from '../fields/fields.js'; +import { Fr } from '@aztec/foundation/fields'; + import { AztecAddress } from './index.js'; describe('aztec-address', () => { diff --git a/yarn-project/foundation/src/aztec-address/index.ts b/yarn-project/circuits.js/src/aztec-address/index.ts similarity index 93% rename from yarn-project/foundation/src/aztec-address/index.ts rename to yarn-project/circuits.js/src/aztec-address/index.ts index 48024ba159eb..02c32b931c39 100644 --- a/yarn-project/foundation/src/aztec-address/index.ts +++ b/yarn-project/circuits.js/src/aztec-address/index.ts @@ -1,11 +1,10 @@ /* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */ -import { inspect } from 'util'; +import { Fr, Point, fromBuffer } from '@aztec/foundation/fields'; +import { hexSchemaFor } from '@aztec/foundation/schemas'; +import { type BufferReader, FieldReader, TypeRegistry } from '@aztec/foundation/serialize'; +import { hexToBuffer } from '@aztec/foundation/string'; -import { Fr, Point, fromBuffer } from '../fields/index.js'; -import { hexSchemaFor } from '../schemas/utils.js'; -import { type BufferReader, FieldReader } from '../serialize/index.js'; -import { TypeRegistry } from '../serialize/type_registry.js'; -import { hexToBuffer } from '../string/index.js'; +import { inspect } from 'util'; /** Branding to ensure fields are not interchangeable types. */ export interface AztecAddress { diff --git a/yarn-project/circuits.js/src/contract/contract_address.ts b/yarn-project/circuits.js/src/contract/contract_address.ts index 1601dafdb004..75436678fb65 100644 --- a/yarn-project/circuits.js/src/contract/contract_address.ts +++ b/yarn-project/circuits.js/src/contract/contract_address.ts @@ -1,9 +1,9 @@ import { GeneratorIndex } from '@aztec/constants'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto'; import { Fr } from '@aztec/foundation/fields'; import { type FunctionAbi, FunctionSelector, encodeArguments } from '../abi/index.js'; +import { type AztecAddress } from '../aztec-address/index.js'; import { computeVarArgsHash } from '../hash/hash.js'; import { computeAddress } from '../keys/index.js'; import { type ContractInstance } from './interfaces/contract_instance.js'; diff --git a/yarn-project/circuits.js/src/contract/contract_instance.ts b/yarn-project/circuits.js/src/contract/contract_instance.ts index 67850b360338..12e371ec54d2 100644 --- a/yarn-project/circuits.js/src/contract/contract_instance.ts +++ b/yarn-project/circuits.js/src/contract/contract_instance.ts @@ -1,9 +1,9 @@ -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader, numToUInt8, serializeToBuffer } from '@aztec/foundation/serialize'; import { type FieldsOf } from '@aztec/foundation/types'; import { type ContractArtifact, type FunctionArtifact, FunctionSelector, getDefaultInitializer } from '../abi/index.js'; +import { AztecAddress } from '../aztec-address/index.js'; import { getContractClassFromArtifact } from '../contract/contract_class.js'; import { PublicKeys } from '../types/public_keys.js'; import { diff --git a/yarn-project/circuits.js/src/contract/interfaces/contract_data_source.ts b/yarn-project/circuits.js/src/contract/interfaces/contract_data_source.ts index 537bcd84921c..39b997e463b0 100644 --- a/yarn-project/circuits.js/src/contract/interfaces/contract_data_source.ts +++ b/yarn-project/circuits.js/src/contract/interfaces/contract_data_source.ts @@ -1,7 +1,7 @@ -import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { type Fr } from '@aztec/foundation/fields'; import { FunctionSelector } from '../../abi/index.js'; +import { type AztecAddress } from '../../aztec-address/index.js'; import { type ContractClassPublic, type PublicFunction } from './contract_class.js'; import { type ContractInstanceWithAddress } from './contract_instance.js'; diff --git a/yarn-project/circuits.js/src/contract/interfaces/contract_instance.ts b/yarn-project/circuits.js/src/contract/interfaces/contract_instance.ts index 31d66372284a..32b147506d02 100644 --- a/yarn-project/circuits.js/src/contract/interfaces/contract_instance.ts +++ b/yarn-project/circuits.js/src/contract/interfaces/contract_instance.ts @@ -1,9 +1,9 @@ -import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { type Fr } from '@aztec/foundation/fields'; -import { type ZodFor, schemas } from '@aztec/foundation/schemas'; import { z } from 'zod'; +import { type AztecAddress } from '../../aztec-address/index.js'; +import { type ZodFor, schemas } from '../../schemas/index.js'; import { PublicKeys } from '../../types/public_keys.js'; const VERSION = 1 as const; diff --git a/yarn-project/circuits.js/src/contract/interfaces/contract_instance_update.ts b/yarn-project/circuits.js/src/contract/interfaces/contract_instance_update.ts index 55d0abee6d30..00b972c10f89 100644 --- a/yarn-project/circuits.js/src/contract/interfaces/contract_instance_update.ts +++ b/yarn-project/circuits.js/src/contract/interfaces/contract_instance_update.ts @@ -1,9 +1,10 @@ -import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { type Fr } from '@aztec/foundation/fields'; -import { type ZodFor, schemas } from '@aztec/foundation/schemas'; import { z } from 'zod'; +import { type AztecAddress } from '../../aztec-address/index.js'; +import { type ZodFor, schemas } from '../../schemas/index.js'; + /** * An update to a contract instance, changing its contract class. */ diff --git a/yarn-project/circuits.js/src/contract/interfaces/protocol_contract_addresses.ts b/yarn-project/circuits.js/src/contract/interfaces/protocol_contract_addresses.ts index c2309918e919..4c3037a09c33 100644 --- a/yarn-project/circuits.js/src/contract/interfaces/protocol_contract_addresses.ts +++ b/yarn-project/circuits.js/src/contract/interfaces/protocol_contract_addresses.ts @@ -1,8 +1,8 @@ -import { type AztecAddress } from '@aztec/foundation/aztec-address'; -import { schemas } from '@aztec/foundation/schemas'; - import { z } from 'zod'; +import { type AztecAddress } from '../../aztec-address/index.js'; +import { schemas } from '../../schemas/index.js'; + export const ProtocolContractsNames = [ 'classRegisterer', 'feeJuice', diff --git a/yarn-project/circuits.js/src/hash/hash.ts b/yarn-project/circuits.js/src/hash/hash.ts index 8a1601f6fdb4..b3f445a78a82 100644 --- a/yarn-project/circuits.js/src/hash/hash.ts +++ b/yarn-project/circuits.js/src/hash/hash.ts @@ -1,8 +1,8 @@ import { GeneratorIndex } from '@aztec/constants'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { poseidon2Hash, poseidon2HashWithSeparator, sha256Trunc } from '@aztec/foundation/crypto'; import { Fr } from '@aztec/foundation/fields'; +import { type AztecAddress } from '../aztec-address/index.js'; import { type ScopedL2ToL1Message } from '../structs/l2_to_l1_message.js'; /** diff --git a/yarn-project/circuits.js/src/hash/map_slot.test.ts b/yarn-project/circuits.js/src/hash/map_slot.test.ts index a0974bef74a4..3a683d117d24 100644 --- a/yarn-project/circuits.js/src/hash/map_slot.test.ts +++ b/yarn-project/circuits.js/src/hash/map_slot.test.ts @@ -1,7 +1,7 @@ -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { updateInlineTestData } from '@aztec/foundation/testing/files'; +import { AztecAddress } from '../aztec-address/index.js'; import { deriveStorageSlotInMap } from './index.js'; describe('Map slot', () => { diff --git a/yarn-project/circuits.js/src/hints/build_note_hash_read_request_hints.test.ts b/yarn-project/circuits.js/src/hints/build_note_hash_read_request_hints.test.ts index caafb38f45e7..306abe4f0249 100644 --- a/yarn-project/circuits.js/src/hints/build_note_hash_read_request_hints.test.ts +++ b/yarn-project/circuits.js/src/hints/build_note_hash_read_request_hints.test.ts @@ -1,9 +1,9 @@ import { MAX_NOTE_HASHES_PER_TX, MAX_NOTE_HASH_READ_REQUESTS_PER_TX } from '@aztec/constants'; import { makeTuple } from '@aztec/foundation/array'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { type Tuple } from '@aztec/foundation/serialize'; +import { AztecAddress } from '../aztec-address/index.js'; import { NoteHash, type NoteHashReadRequestHints, diff --git a/yarn-project/circuits.js/src/hints/build_nullifier_read_request_hints.test.ts b/yarn-project/circuits.js/src/hints/build_nullifier_read_request_hints.test.ts index 84fbf68be7d7..35dd9a883b3e 100644 --- a/yarn-project/circuits.js/src/hints/build_nullifier_read_request_hints.test.ts +++ b/yarn-project/circuits.js/src/hints/build_nullifier_read_request_hints.test.ts @@ -1,9 +1,9 @@ import { MAX_NULLIFIERS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX } from '@aztec/constants'; import { makeTuple } from '@aztec/foundation/array'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { type Tuple } from '@aztec/foundation/serialize'; +import { AztecAddress } from '../aztec-address/index.js'; import { Nullifier, type NullifierReadRequestHints, diff --git a/yarn-project/circuits.js/src/hints/build_nullifier_read_request_hints.ts b/yarn-project/circuits.js/src/hints/build_nullifier_read_request_hints.ts index dd46f9889c19..ed0352089f59 100644 --- a/yarn-project/circuits.js/src/hints/build_nullifier_read_request_hints.ts +++ b/yarn-project/circuits.js/src/hints/build_nullifier_read_request_hints.ts @@ -3,12 +3,12 @@ import { MAX_NULLIFIER_READ_REQUESTS_PER_TX, type NULLIFIER_TREE_HEIGHT, } from '@aztec/constants'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { padArrayEnd } from '@aztec/foundation/collection'; import { type Fr } from '@aztec/foundation/fields'; import { type Tuple } from '@aztec/foundation/serialize'; import { type IndexedTreeLeafPreimage, MembershipWitness } from '@aztec/foundation/trees'; +import { AztecAddress } from '../aztec-address/index.js'; import { siloNullifier } from '../hash/hash.js'; import { Nullifier, diff --git a/yarn-project/circuits.js/src/hints/build_transient_data_hints.test.ts b/yarn-project/circuits.js/src/hints/build_transient_data_hints.test.ts index f0c6679775d1..2cf314e0f041 100644 --- a/yarn-project/circuits.js/src/hints/build_transient_data_hints.test.ts +++ b/yarn-project/circuits.js/src/hints/build_transient_data_hints.test.ts @@ -1,6 +1,6 @@ -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; +import { AztecAddress } from '../aztec-address/index.js'; import { NoteHash, Nullifier, diff --git a/yarn-project/circuits.js/src/hints/scoped_value_cache.ts b/yarn-project/circuits.js/src/hints/scoped_value_cache.ts index 8dbb8b717716..05f1c2f9de20 100644 --- a/yarn-project/circuits.js/src/hints/scoped_value_cache.ts +++ b/yarn-project/circuits.js/src/hints/scoped_value_cache.ts @@ -1,6 +1,7 @@ -import type { AztecAddress } from '@aztec/foundation/aztec-address'; import type { Fr } from '@aztec/foundation/fields'; +import type { AztecAddress } from '../aztec-address/index.js'; + export class ScopedValueCache { private cache: Map = new Map(); constructor(items: T[]) { diff --git a/yarn-project/circuits.js/src/keys/derivation.ts b/yarn-project/circuits.js/src/keys/derivation.ts index 910a07e1c75a..36b354319d19 100644 --- a/yarn-project/circuits.js/src/keys/derivation.ts +++ b/yarn-project/circuits.js/src/keys/derivation.ts @@ -1,8 +1,8 @@ import { GeneratorIndex } from '@aztec/constants'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Grumpkin, poseidon2HashWithSeparator, sha512ToGrumpkinScalar } from '@aztec/foundation/crypto'; import { Fq, Fr, GrumpkinScalar } from '@aztec/foundation/fields'; +import { AztecAddress } from '../aztec-address/index.js'; import { type CompleteAddress } from '../index.js'; import { PublicKeys } from '../types/public_keys.js'; import { type KeyPrefix } from './key_types.js'; diff --git a/yarn-project/circuits.js/src/schemas/index.ts b/yarn-project/circuits.js/src/schemas/index.ts index 51d2d73dab73..cc501952f769 100644 --- a/yarn-project/circuits.js/src/schemas/index.ts +++ b/yarn-project/circuits.js/src/schemas/index.ts @@ -8,8 +8,10 @@ import type { AbiDecoded } from '../abi/decoder.js'; import { EventSelector } from '../abi/event_selector.js'; import { FunctionSelector } from '../abi/function_selector.js'; import { NoteSelector } from '../abi/note_selector.js'; +import { AztecAddress } from '../aztec-address/index.js'; export const schemas = { + AztecAddress: AztecAddress.schema, NoteSelector: NoteSelector.schema, FunctionSelector: FunctionSelector.schema, EventSelector: EventSelector.schema, diff --git a/yarn-project/circuits.js/src/structs/avm/avm.ts b/yarn-project/circuits.js/src/structs/avm/avm.ts index 57dd61f5aa0a..03e20a3c6a55 100644 --- a/yarn-project/circuits.js/src/structs/avm/avm.ts +++ b/yarn-project/circuits.js/src/structs/avm/avm.ts @@ -1,4 +1,3 @@ -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fq, Fr, Point } from '@aztec/foundation/fields'; import { bufferSchemaFor } from '@aztec/foundation/schemas'; import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize'; @@ -8,6 +7,7 @@ import { type FieldsOf } from '@aztec/foundation/types'; import { strict as assert } from 'assert'; import { Encoder, addExtension } from 'msgpackr'; +import { AztecAddress } from '../../aztec-address/index.js'; import { type ContractClassIdPreimage } from '../../contract/contract_class_id.js'; import { PublicKeys } from '../../types/public_keys.js'; import { Vector } from '../../types/shared.js'; diff --git a/yarn-project/circuits.js/src/structs/avm/avm_circuit_public_inputs.ts b/yarn-project/circuits.js/src/structs/avm/avm_circuit_public_inputs.ts index bade4d429dfc..715e9b2a60ca 100644 --- a/yarn-project/circuits.js/src/structs/avm/avm_circuit_public_inputs.ts +++ b/yarn-project/circuits.js/src/structs/avm/avm_circuit_public_inputs.ts @@ -1,12 +1,12 @@ import { MAX_ENQUEUED_CALLS_PER_TX } from '@aztec/constants'; import { makeTuple } from '@aztec/foundation/array'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader, FieldReader, type Tuple, serializeToBuffer } from '@aztec/foundation/serialize'; import { bufferToHex, hexToBuffer } from '@aztec/foundation/string'; import { inspect } from 'util'; +import { AztecAddress } from '../../aztec-address/index.js'; import { Gas } from '../gas.js'; import { GasSettings } from '../gas_settings.js'; import { GlobalVariables } from '../global_variables.js'; diff --git a/yarn-project/circuits.js/src/structs/call_context.ts b/yarn-project/circuits.js/src/structs/call_context.ts index c9a9280a7249..231ef6bdb416 100644 --- a/yarn-project/circuits.js/src/structs/call_context.ts +++ b/yarn-project/circuits.js/src/structs/call_context.ts @@ -1,7 +1,5 @@ import { CALL_CONTEXT_LENGTH } from '@aztec/constants'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { type Fr } from '@aztec/foundation/fields'; -import { schemas } from '@aztec/foundation/schemas'; import { BufferReader, FieldReader, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize'; import { type FieldsOf } from '@aztec/foundation/types'; @@ -9,6 +7,8 @@ import { inspect } from 'util'; import { z } from 'zod'; import { FunctionSelector } from '../abi/index.js'; +import { AztecAddress } from '../aztec-address/index.js'; +import { schemas } from '../schemas/index.js'; /** * Call context. @@ -55,7 +55,7 @@ export class CallContext { .object({ msgSender: schemas.AztecAddress, contractAddress: schemas.AztecAddress, - functionSelector: FunctionSelector.schema, + functionSelector: schemas.FunctionSelector, isStaticCall: z.boolean(), }) .transform(CallContext.from); diff --git a/yarn-project/circuits.js/src/structs/complete_address.test.ts b/yarn-project/circuits.js/src/structs/complete_address.test.ts index 064ebe460a38..88669abcebaa 100644 --- a/yarn-project/circuits.js/src/structs/complete_address.test.ts +++ b/yarn-project/circuits.js/src/structs/complete_address.test.ts @@ -1,6 +1,6 @@ -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr, Point } from '@aztec/foundation/fields'; +import { AztecAddress } from '../aztec-address/index.js'; import { PublicKeys } from '../types/public_keys.js'; import { CompleteAddress } from './complete_address.js'; diff --git a/yarn-project/circuits.js/src/structs/complete_address.ts b/yarn-project/circuits.js/src/structs/complete_address.ts index e8ee455dd08c..821614919a13 100644 --- a/yarn-project/circuits.js/src/structs/complete_address.ts +++ b/yarn-project/circuits.js/src/structs/complete_address.ts @@ -1,9 +1,9 @@ -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { hexSchemaFor } from '@aztec/foundation/schemas'; import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize'; import { bufferToHex } from '@aztec/foundation/string'; +import { AztecAddress } from '../aztec-address/index.js'; import { computePartialAddress } from '../contract/contract_address.js'; import { computeAddress, computePreaddress, deriveKeys } from '../keys/index.js'; import { type PartialAddress } from '../types/partial_address.js'; diff --git a/yarn-project/circuits.js/src/structs/contract_storage_read.ts b/yarn-project/circuits.js/src/structs/contract_storage_read.ts index 90cb54b1e69f..329c209b0408 100644 --- a/yarn-project/circuits.js/src/structs/contract_storage_read.ts +++ b/yarn-project/circuits.js/src/structs/contract_storage_read.ts @@ -1,8 +1,9 @@ import { CONTRACT_STORAGE_READ_LENGTH } from '@aztec/constants'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/serialize'; +import { type AztecAddress } from '../aztec-address/index.js'; + /** * Contract storage read operation on a specific contract. * diff --git a/yarn-project/circuits.js/src/structs/contract_storage_update_request.ts b/yarn-project/circuits.js/src/structs/contract_storage_update_request.ts index 86398475be60..8c4b6d1f6f37 100644 --- a/yarn-project/circuits.js/src/structs/contract_storage_update_request.ts +++ b/yarn-project/circuits.js/src/structs/contract_storage_update_request.ts @@ -1,9 +1,10 @@ import { CONTRACT_STORAGE_UPDATE_REQUEST_LENGTH } from '@aztec/constants'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/serialize'; import { type FieldsOf } from '@aztec/foundation/types'; +import { type AztecAddress } from '../aztec-address/index.js'; + /** * Contract storage update request for a slot on a specific contract. * diff --git a/yarn-project/circuits.js/src/structs/global_variables.ts b/yarn-project/circuits.js/src/structs/global_variables.ts index e630947106f0..c32b8c2b2927 100644 --- a/yarn-project/circuits.js/src/structs/global_variables.ts +++ b/yarn-project/circuits.js/src/structs/global_variables.ts @@ -1,15 +1,15 @@ import { GLOBAL_VARIABLES_LENGTH } from '@aztec/constants'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { EthAddress } from '@aztec/foundation/eth-address'; import { Fr } from '@aztec/foundation/fields'; import { jsonStringify } from '@aztec/foundation/json-rpc'; -import { schemas } from '@aztec/foundation/schemas'; import { BufferReader, FieldReader, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize'; import { type FieldsOf } from '@aztec/foundation/types'; import { inspect } from 'util'; import { z } from 'zod'; +import { AztecAddress } from '../aztec-address/index.js'; +import { schemas } from '../schemas/index.js'; import { GasFees } from './gas_fees.js'; /** diff --git a/yarn-project/circuits.js/src/structs/index.ts b/yarn-project/circuits.js/src/structs/index.ts index 4ad6cea547da..d7e87bf03c93 100644 --- a/yarn-project/circuits.js/src/structs/index.ts +++ b/yarn-project/circuits.js/src/structs/index.ts @@ -55,5 +55,5 @@ export * from './verification_key.js'; export * from './vk_witness_data.js'; export { EventSelector, FunctionSelector } from '../abi/index.js'; -export * from '@aztec/foundation/aztec-address'; +export * from '../aztec-address/index.js'; export * from '@aztec/foundation/fields'; diff --git a/yarn-project/circuits.js/src/structs/indexed_tagging_secret.ts b/yarn-project/circuits.js/src/structs/indexed_tagging_secret.ts index 57b7995c1f4e..63f8aadd428b 100644 --- a/yarn-project/circuits.js/src/structs/indexed_tagging_secret.ts +++ b/yarn-project/circuits.js/src/structs/indexed_tagging_secret.ts @@ -1,7 +1,8 @@ -import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { poseidon2Hash } from '@aztec/foundation/crypto'; import { Fr } from '@aztec/foundation/fields'; +import { type AztecAddress } from '../aztec-address/index.js'; + export class IndexedTaggingSecret { constructor(public appTaggingSecret: Fr, public index: number) { if (index < 0) { diff --git a/yarn-project/circuits.js/src/structs/kernel/private_kernel_circuit_public_inputs.ts b/yarn-project/circuits.js/src/structs/kernel/private_kernel_circuit_public_inputs.ts index a1de0f496c48..d37c5e3ce2ca 100644 --- a/yarn-project/circuits.js/src/structs/kernel/private_kernel_circuit_public_inputs.ts +++ b/yarn-project/circuits.js/src/structs/kernel/private_kernel_circuit_public_inputs.ts @@ -1,8 +1,8 @@ -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { bufferSchemaFor } from '@aztec/foundation/schemas'; import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize'; +import { AztecAddress } from '../../aztec-address/index.js'; import { PrivateValidationRequests } from '../private_validation_requests.js'; import { PublicCallRequest } from '../public_call_request.js'; import { PrivateAccumulatedData } from './private_accumulated_data.js'; diff --git a/yarn-project/circuits.js/src/structs/kernel/private_kernel_tail_circuit_public_inputs.ts b/yarn-project/circuits.js/src/structs/kernel/private_kernel_tail_circuit_public_inputs.ts index 9b389874bde4..4bfaa1e97211 100644 --- a/yarn-project/circuits.js/src/structs/kernel/private_kernel_tail_circuit_public_inputs.ts +++ b/yarn-project/circuits.js/src/structs/kernel/private_kernel_tail_circuit_public_inputs.ts @@ -1,8 +1,8 @@ -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { bufferSchemaFor } from '@aztec/foundation/schemas'; import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize'; +import { AztecAddress } from '../../aztec-address/index.js'; import { countAccumulatedItems, mergeAccumulatedData } from '../../utils/index.js'; import { Gas } from '../gas.js'; import { PublicCallRequest } from '../public_call_request.js'; diff --git a/yarn-project/circuits.js/src/structs/kernel/private_to_public_kernel_circuit_public_inputs.ts b/yarn-project/circuits.js/src/structs/kernel/private_to_public_kernel_circuit_public_inputs.ts index 6c98d727f375..3134a6c7ff56 100644 --- a/yarn-project/circuits.js/src/structs/kernel/private_to_public_kernel_circuit_public_inputs.ts +++ b/yarn-project/circuits.js/src/structs/kernel/private_to_public_kernel_circuit_public_inputs.ts @@ -1,11 +1,11 @@ import { GeneratorIndex, PRIVATE_TO_PUBLIC_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH } from '@aztec/constants'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto'; import { type Fr } from '@aztec/foundation/fields'; import { BufferReader, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize'; import { bufferToHex, hexToBuffer } from '@aztec/foundation/string'; import { type FieldsOf } from '@aztec/foundation/types'; +import { AztecAddress } from '../../aztec-address/index.js'; import { Gas } from '../gas.js'; import { PublicCallRequest } from '../public_call_request.js'; import { RollupValidationRequests } from '../rollup_validation_requests.js'; diff --git a/yarn-project/circuits.js/src/structs/kernel/private_to_rollup_kernel_circuit_public_inputs.ts b/yarn-project/circuits.js/src/structs/kernel/private_to_rollup_kernel_circuit_public_inputs.ts index c8144e377c81..d50585f6b0e7 100644 --- a/yarn-project/circuits.js/src/structs/kernel/private_to_rollup_kernel_circuit_public_inputs.ts +++ b/yarn-project/circuits.js/src/structs/kernel/private_to_rollup_kernel_circuit_public_inputs.ts @@ -1,5 +1,4 @@ import { GeneratorIndex, PRIVATE_TO_ROLLUP_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH } from '@aztec/constants'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto'; import { type Fr } from '@aztec/foundation/fields'; import { bufferSchemaFor } from '@aztec/foundation/schemas'; @@ -7,6 +6,7 @@ import { BufferReader, serializeToBuffer, serializeToFields } from '@aztec/found import { bufferToHex, hexToBuffer } from '@aztec/foundation/string'; import { type FieldsOf } from '@aztec/foundation/types'; +import { AztecAddress } from '../../aztec-address/index.js'; import { Gas } from '../gas.js'; import { RollupValidationRequests } from '../rollup_validation_requests.js'; import { PrivateToRollupAccumulatedData } from './private_to_rollup_accumulated_data.js'; diff --git a/yarn-project/circuits.js/src/structs/l2_to_l1_message.ts b/yarn-project/circuits.js/src/structs/l2_to_l1_message.ts index 8fa11f3fa646..46f5f7aa2693 100644 --- a/yarn-project/circuits.js/src/structs/l2_to_l1_message.ts +++ b/yarn-project/circuits.js/src/structs/l2_to_l1_message.ts @@ -1,10 +1,11 @@ import { L2_TO_L1_MESSAGE_LENGTH, SCOPED_L2_TO_L1_MESSAGE_LENGTH } from '@aztec/constants'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { EthAddress } from '@aztec/foundation/eth-address'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader, FieldReader, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize'; import { type FieldsOf } from '@aztec/foundation/types'; +import { AztecAddress } from '../aztec-address/index.js'; + export class L2ToL1Message { constructor(public recipient: EthAddress, public content: Fr, public counter: number) {} diff --git a/yarn-project/circuits.js/src/structs/log_hash.ts b/yarn-project/circuits.js/src/structs/log_hash.ts index de06c7c02b4f..7498852b5807 100644 --- a/yarn-project/circuits.js/src/structs/log_hash.ts +++ b/yarn-project/circuits.js/src/structs/log_hash.ts @@ -1,10 +1,10 @@ -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { sha256Trunc } from '@aztec/foundation/crypto'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/serialize'; import { inspect } from 'util'; +import { AztecAddress } from '../aztec-address/index.js'; import { type Ordered } from '../interfaces/index.js'; export class LogHash implements Ordered { diff --git a/yarn-project/circuits.js/src/structs/note_hash.ts b/yarn-project/circuits.js/src/structs/note_hash.ts index 0ddd44a80217..dba6cc7be6f6 100644 --- a/yarn-project/circuits.js/src/structs/note_hash.ts +++ b/yarn-project/circuits.js/src/structs/note_hash.ts @@ -1,7 +1,7 @@ -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/serialize'; +import { AztecAddress } from '../aztec-address/index.js'; import { type Ordered } from '../interfaces/index.js'; export class NoteHash { diff --git a/yarn-project/circuits.js/src/structs/nullifier.ts b/yarn-project/circuits.js/src/structs/nullifier.ts index 7f1e73477e1d..202163d91727 100644 --- a/yarn-project/circuits.js/src/structs/nullifier.ts +++ b/yarn-project/circuits.js/src/structs/nullifier.ts @@ -1,7 +1,7 @@ -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/serialize'; +import { AztecAddress } from '../aztec-address/index.js'; import { type Ordered } from '../interfaces/index.js'; export class Nullifier implements Ordered { diff --git a/yarn-project/circuits.js/src/structs/private_log_data.ts b/yarn-project/circuits.js/src/structs/private_log_data.ts index 13d8f60cc10d..4bf2aae5bc19 100644 --- a/yarn-project/circuits.js/src/structs/private_log_data.ts +++ b/yarn-project/circuits.js/src/structs/private_log_data.ts @@ -1,11 +1,11 @@ import { PRIVATE_LOG_DATA_LENGTH } from '@aztec/constants'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { type Fr } from '@aztec/foundation/fields'; import { BufferReader, FieldReader, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize'; import { type FieldsOf } from '@aztec/foundation/types'; import { inspect } from 'util'; +import { AztecAddress } from '../aztec-address/index.js'; import { type UInt32 } from '../types/shared.js'; import { PrivateLog } from './private_log.js'; diff --git a/yarn-project/circuits.js/src/structs/public_call_request.ts b/yarn-project/circuits.js/src/structs/public_call_request.ts index f0e0e001572f..829317b7ddda 100644 --- a/yarn-project/circuits.js/src/structs/public_call_request.ts +++ b/yarn-project/circuits.js/src/structs/public_call_request.ts @@ -1,5 +1,4 @@ import { COUNTED_PUBLIC_CALL_REQUEST_LENGTH, PUBLIC_CALL_REQUEST_LENGTH } from '@aztec/constants'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader, FieldReader, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize'; import { type FieldsOf } from '@aztec/foundation/types'; @@ -7,6 +6,7 @@ import { type FieldsOf } from '@aztec/foundation/types'; import { inspect } from 'util'; import { FunctionSelector } from '../abi/index.js'; +import { AztecAddress } from '../aztec-address/index.js'; import { type UInt32 } from '../types/shared.js'; /** diff --git a/yarn-project/circuits.js/src/structs/public_call_stack_item_compressed.ts b/yarn-project/circuits.js/src/structs/public_call_stack_item_compressed.ts index 75c326bbec78..b10af60c2bf7 100644 --- a/yarn-project/circuits.js/src/structs/public_call_stack_item_compressed.ts +++ b/yarn-project/circuits.js/src/structs/public_call_stack_item_compressed.ts @@ -1,9 +1,9 @@ import { PUBLIC_CALL_STACK_ITEM_COMPRESSED_LENGTH } from '@aztec/constants'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader, FieldReader, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize'; import { type FieldsOf } from '@aztec/foundation/types'; +import { AztecAddress } from '../aztec-address/index.js'; import { CallContext } from './call_context.js'; import { Gas } from './gas.js'; import { RevertCode } from './revert_code.js'; diff --git a/yarn-project/circuits.js/src/structs/public_data_update_request.ts b/yarn-project/circuits.js/src/structs/public_data_update_request.ts index 1ef117bfbd8e..301d6f5e2158 100644 --- a/yarn-project/circuits.js/src/structs/public_data_update_request.ts +++ b/yarn-project/circuits.js/src/structs/public_data_update_request.ts @@ -1,9 +1,9 @@ -import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/serialize'; import { inspect } from 'util'; +import { type AztecAddress } from '../aztec-address/index.js'; import { computePublicDataTreeLeafSlot } from '../hash/hash.js'; import { type ContractStorageUpdateRequest } from './contract_storage_update_request.js'; diff --git a/yarn-project/circuits.js/src/structs/public_log.ts b/yarn-project/circuits.js/src/structs/public_log.ts index 1049b59bd254..8eaa97bd05f6 100644 --- a/yarn-project/circuits.js/src/structs/public_log.ts +++ b/yarn-project/circuits.js/src/structs/public_log.ts @@ -1,8 +1,6 @@ import { PUBLIC_LOG_DATA_SIZE_IN_FIELDS, PUBLIC_LOG_SIZE_IN_FIELDS } from '@aztec/constants'; import { type FieldsOf, makeTuple } from '@aztec/foundation/array'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; -import { schemas } from '@aztec/foundation/schemas'; import { BufferReader, FieldReader, @@ -14,6 +12,9 @@ import { import { inspect } from 'util'; import { z } from 'zod'; +import { AztecAddress } from '../aztec-address/index.js'; +import { schemas } from '../schemas/index.js'; + export class PublicLog { static SIZE_IN_BYTES = Fr.SIZE_IN_BYTES * PUBLIC_LOG_SIZE_IN_FIELDS; diff --git a/yarn-project/circuits.js/src/structs/read_request.ts b/yarn-project/circuits.js/src/structs/read_request.ts index 60127af7c0d8..7081de15109b 100644 --- a/yarn-project/circuits.js/src/structs/read_request.ts +++ b/yarn-project/circuits.js/src/structs/read_request.ts @@ -1,7 +1,8 @@ -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/serialize'; +import { AztecAddress } from '../aztec-address/index.js'; + export class ReadRequest { constructor( /** diff --git a/yarn-project/circuits.js/src/structs/scoped_key_validation_request_and_generator.ts b/yarn-project/circuits.js/src/structs/scoped_key_validation_request_and_generator.ts index 70e9cffa5756..af5d556969d8 100644 --- a/yarn-project/circuits.js/src/structs/scoped_key_validation_request_and_generator.ts +++ b/yarn-project/circuits.js/src/structs/scoped_key_validation_request_and_generator.ts @@ -1,8 +1,8 @@ import { SCOPED_KEY_VALIDATION_REQUEST_AND_GENERATOR_LENGTH } from '@aztec/constants'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { type Fr } from '@aztec/foundation/fields'; import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/serialize'; +import { AztecAddress } from '../aztec-address/index.js'; import { KeyValidationRequestAndGenerator } from './key_validation_request_and_generator.js'; /** diff --git a/yarn-project/circuits.js/src/structs/shared_mutable/shared_mutable_values_with_hash.ts b/yarn-project/circuits.js/src/structs/shared_mutable/shared_mutable_values_with_hash.ts index bf7fbbb7f09c..8131abf3a4dc 100644 --- a/yarn-project/circuits.js/src/structs/shared_mutable/shared_mutable_values_with_hash.ts +++ b/yarn-project/circuits.js/src/structs/shared_mutable/shared_mutable_values_with_hash.ts @@ -1,7 +1,7 @@ import { UPDATED_CLASS_IDS_SLOT } from '@aztec/constants'; -import type { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; +import type { AztecAddress } from '../../aztec-address/index.js'; import { deriveStorageSlotInMap } from '../../hash/map_slot.js'; import { ScheduledDelayChange } from './scheduled_delay_change.js'; import { ScheduledValueChange } from './scheduled_value_change.js'; diff --git a/yarn-project/circuits.js/src/structs/tx_request.test.ts b/yarn-project/circuits.js/src/structs/tx_request.test.ts index 9b148059aacc..593ecaba0024 100644 --- a/yarn-project/circuits.js/src/structs/tx_request.test.ts +++ b/yarn-project/circuits.js/src/structs/tx_request.test.ts @@ -1,11 +1,11 @@ import { TX_REQUEST_LENGTH } from '@aztec/constants'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { randomInt } from '@aztec/foundation/crypto'; import { Fr } from '@aztec/foundation/fields'; import { setupCustomSnapshotSerializers } from '@aztec/foundation/testing'; import { updateInlineTestData } from '@aztec/foundation/testing/files'; import { FunctionSelector } from '../abi/index.js'; +import { AztecAddress } from '../aztec-address/index.js'; import { makeTxRequest } from '../tests/factories.js'; import { FunctionData } from './function_data.js'; import { Gas } from './gas.js'; diff --git a/yarn-project/circuits.js/src/structs/tx_request.ts b/yarn-project/circuits.js/src/structs/tx_request.ts index 3879c1cf53c1..35aba6097ea6 100644 --- a/yarn-project/circuits.js/src/structs/tx_request.ts +++ b/yarn-project/circuits.js/src/structs/tx_request.ts @@ -1,10 +1,10 @@ import { GeneratorIndex, TX_REQUEST_LENGTH } from '@aztec/constants'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize'; import { type FieldsOf } from '@aztec/foundation/types'; +import { AztecAddress } from '../aztec-address/index.js'; import { FunctionData } from './function_data.js'; import { TxContext } from './tx_context.js'; diff --git a/yarn-project/circuits.js/src/tests/factories.ts b/yarn-project/circuits.js/src/tests/factories.ts index 8695a4dd4650..d304534bbc12 100644 --- a/yarn-project/circuits.js/src/tests/factories.ts +++ b/yarn-project/circuits.js/src/tests/factories.ts @@ -39,7 +39,6 @@ import { VK_TREE_HEIGHT, } from '@aztec/constants'; import { type FieldsOf, makeHalfFullTuple, makeTuple } from '@aztec/foundation/array'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { toBufferBE } from '@aztec/foundation/bigint-buffer'; import { compact } from '@aztec/foundation/collection'; import { SchnorrSignature, poseidon2HashWithSeparator } from '@aztec/foundation/crypto'; @@ -47,6 +46,7 @@ import { EthAddress } from '@aztec/foundation/eth-address'; import { type Bufferable } from '@aztec/foundation/serialize'; import { MembershipWitness } from '@aztec/foundation/trees'; +import { AztecAddress } from '../aztec-address/index.js'; import { type ContractClassPublic, type ContractInstanceWithAddress, diff --git a/yarn-project/cli-wallet/src/cmds/bridge_fee_juice.ts b/yarn-project/cli-wallet/src/cmds/bridge_fee_juice.ts index 71537d581167..a57dc7c846fe 100644 --- a/yarn-project/cli-wallet/src/cmds/bridge_fee_juice.ts +++ b/yarn-project/cli-wallet/src/cmds/bridge_fee_juice.ts @@ -1,7 +1,7 @@ import { L1FeeJuicePortalManager, type PXE } from '@aztec/aztec.js'; +import { type AztecAddress } from '@aztec/circuits.js/aztec-address'; import { prettyPrintJSON } from '@aztec/cli/utils'; import { createEthereumChain, createL1Clients } from '@aztec/ethereum'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { type LogFn, type Logger } from '@aztec/foundation/log'; diff --git a/yarn-project/cli-wallet/src/utils/accounts.ts b/yarn-project/cli-wallet/src/utils/accounts.ts index 827943e78359..7e268be9d667 100644 --- a/yarn-project/cli-wallet/src/utils/accounts.ts +++ b/yarn-project/cli-wallet/src/utils/accounts.ts @@ -1,8 +1,8 @@ import { getIdentities } from '@aztec/accounts/utils'; import { type AccountManager, type AccountWalletWithSecretKey } from '@aztec/aztec.js'; import { type PXE } from '@aztec/circuit-types/interfaces/client'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { deriveSigningKey } from '@aztec/circuits.js/keys'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { type WalletDB } from '../storage/wallet_db.js'; diff --git a/yarn-project/cli/src/utils/aztec.ts b/yarn-project/cli/src/utils/aztec.ts index 04804667dcf7..ff353c1d3e55 100644 --- a/yarn-project/cli/src/utils/aztec.ts +++ b/yarn-project/cli/src/utils/aztec.ts @@ -74,7 +74,7 @@ export async function deployAztecContracts( chain.chainInfo, debugLogger, { - l2FeeJuiceAddress: ProtocolContractAddress.FeeJuice, + l2FeeJuiceAddress: ProtocolContractAddress.FeeJuice.toField(), vkTreeRoot: getVKTreeRoot(), protocolContractTreeRoot, genesisArchiveRoot, diff --git a/yarn-project/end-to-end/src/e2e_crowdfunding_and_claim.test.ts b/yarn-project/end-to-end/src/e2e_crowdfunding_and_claim.test.ts index 51af73757e2f..383ebbb4e72f 100644 --- a/yarn-project/end-to-end/src/e2e_crowdfunding_and_claim.test.ts +++ b/yarn-project/end-to-end/src/e2e_crowdfunding_and_claim.test.ts @@ -10,7 +10,7 @@ import { deriveKeys, } from '@aztec/aztec.js'; import { GasSettings, TxContext, computePartialAddress } from '@aztec/circuits.js'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { ClaimContract } from '@aztec/noir-contracts.js/Claim'; import { CrowdfundingContract } from '@aztec/noir-contracts.js/Crowdfunding'; import { InclusionProofsContract } from '@aztec/noir-contracts.js/InclusionProofs'; diff --git a/yarn-project/end-to-end/src/fixtures/setup_l1_contracts.ts b/yarn-project/end-to-end/src/fixtures/setup_l1_contracts.ts index db7788eaac31..288133a6b16d 100644 --- a/yarn-project/end-to-end/src/fixtures/setup_l1_contracts.ts +++ b/yarn-project/end-to-end/src/fixtures/setup_l1_contracts.ts @@ -19,7 +19,7 @@ export const setupL1Contracts = async ( L1ContractsConfig, ) => { const l1Data = await deployL1Contracts(l1RpcUrl, account, foundry, logger, { - l2FeeJuiceAddress: ProtocolContractAddress.FeeJuice, + l2FeeJuiceAddress: ProtocolContractAddress.FeeJuice.toField(), vkTreeRoot: getVKTreeRoot(), protocolContractTreeRoot, salt: undefined, diff --git a/yarn-project/end-to-end/src/fixtures/utils.ts b/yarn-project/end-to-end/src/fixtures/utils.ts index 54e62f1b0781..21cfdab1206d 100644 --- a/yarn-project/end-to-end/src/fixtures/utils.ts +++ b/yarn-project/end-to-end/src/fixtures/utils.ts @@ -126,7 +126,7 @@ export const setupL1Contracts = async ( chain: Chain = foundry, ) => { const l1Data = await deployL1Contracts(l1RpcUrl, account, chain, logger, { - l2FeeJuiceAddress: ProtocolContractAddress.FeeJuice, + l2FeeJuiceAddress: ProtocolContractAddress.FeeJuice.toField(), vkTreeRoot: getVKTreeRoot(), protocolContractTreeRoot, genesisArchiveRoot: args.genesisArchiveRoot ?? new Fr(GENESIS_ARCHIVE_ROOT), diff --git a/yarn-project/ethereum/src/contracts/forwarder.test.ts b/yarn-project/ethereum/src/contracts/forwarder.test.ts index 04048dfa6272..ce1fadca9afb 100644 --- a/yarn-project/ethereum/src/contracts/forwarder.test.ts +++ b/yarn-project/ethereum/src/contracts/forwarder.test.ts @@ -1,4 +1,3 @@ -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { EthAddress } from '@aztec/foundation/eth-address'; import { Fr } from '@aztec/foundation/fields'; import { type Logger, createLogger } from '@aztec/foundation/log'; @@ -34,7 +33,7 @@ describe('Forwarder', () => { let vkTreeRoot: Fr; let protocolContractTreeRoot: Fr; - let l2FeeJuiceAddress: AztecAddress; + let l2FeeJuiceAddress: Fr; let walletClient: L1Clients['walletClient']; let publicClient: L1Clients['publicClient']; let forwarder: ForwarderContract; @@ -48,7 +47,7 @@ describe('Forwarder', () => { privateKey = privateKeyToAccount('0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba'); vkTreeRoot = Fr.random(); protocolContractTreeRoot = Fr.random(); - l2FeeJuiceAddress = await AztecAddress.random(); + l2FeeJuiceAddress = await Fr.random(); ({ anvil, rpcUrl } = await startAnvil()); diff --git a/yarn-project/ethereum/src/deploy_l1_contracts.test.ts b/yarn-project/ethereum/src/deploy_l1_contracts.test.ts index e70d8135d8d1..cd866bb880e9 100644 --- a/yarn-project/ethereum/src/deploy_l1_contracts.test.ts +++ b/yarn-project/ethereum/src/deploy_l1_contracts.test.ts @@ -1,4 +1,3 @@ -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { times } from '@aztec/foundation/collection'; import { EthAddress } from '@aztec/foundation/eth-address'; import { Fr } from '@aztec/foundation/fields'; @@ -22,7 +21,7 @@ describe('deploy_l1_contracts', () => { let genesisArchiveRoot: Fr; let genesisBlockHash: Fr; let initialValidators: EthAddress[]; - let l2FeeJuiceAddress: AztecAddress; + let l2FeeJuiceAddress: Fr; // Use these environment variables to run against a live node. Eg to test against spartan's eth-devnet: // BLOCK_TIME=1 spartan/aztec-network/eth-devnet/run-locally.sh @@ -39,7 +38,7 @@ describe('deploy_l1_contracts', () => { genesisArchiveRoot = Fr.random(); genesisBlockHash = Fr.random(); initialValidators = times(3, EthAddress.random); - l2FeeJuiceAddress = await AztecAddress.random(); + l2FeeJuiceAddress = await Fr.random(); if (!rpcUrl) { ({ stop, rpcUrl } = await startAnvil()); diff --git a/yarn-project/ethereum/src/deploy_l1_contracts.ts b/yarn-project/ethereum/src/deploy_l1_contracts.ts index 90193bd045de..285c2d4ee20b 100644 --- a/yarn-project/ethereum/src/deploy_l1_contracts.ts +++ b/yarn-project/ethereum/src/deploy_l1_contracts.ts @@ -1,4 +1,3 @@ -import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { EthAddress } from '@aztec/foundation/eth-address'; import { type Fr } from '@aztec/foundation/fields'; import { type Logger } from '@aztec/foundation/log'; @@ -186,8 +185,12 @@ export const l1Artifacts = { }; export interface DeployL1ContractsArgs extends L1ContractsConfig { - /** The address of the L2 Fee Juice contract. */ - l2FeeJuiceAddress: AztecAddress; + /** + * The address of the L2 Fee Juice contract. + * It should be an AztecAddress, but the type is defined in circuits.js, + * which would create a circular import + * */ + l2FeeJuiceAddress: Fr; /** The vk tree root. */ vkTreeRoot: Fr; /** The protocol contract tree root. */ diff --git a/yarn-project/foundation/package.json b/yarn-project/foundation/package.json index d284594f165d..4c357f6748bc 100644 --- a/yarn-project/foundation/package.json +++ b/yarn-project/foundation/package.json @@ -11,7 +11,6 @@ "./abi": "./dest/abi/index.js", "./async-map": "./dest/async-map/index.js", "./async-pool": "./dest/async-pool/index.js", - "./aztec-address": "./dest/aztec-address/index.js", "./collection": "./dest/collection/index.js", "./config": "./dest/config/index.js", "./crypto": "./dest/crypto/index.js", diff --git a/yarn-project/foundation/src/index.ts b/yarn-project/foundation/src/index.ts index fe42539cbe60..ae226835a7de 100644 --- a/yarn-project/foundation/src/index.ts +++ b/yarn-project/foundation/src/index.ts @@ -1,6 +1,5 @@ // Reexport all folders at the root for packages targeting CommonJS export * as asyncMap from './async-map/index.js'; -export * as aztecAddress from './aztec-address/index.js'; export * as bigintBuffer from './bigint-buffer/index.js'; export * as collection from './collection/index.js'; export * as committable from './committable/index.js'; diff --git a/yarn-project/foundation/src/schemas/schemas.ts b/yarn-project/foundation/src/schemas/schemas.ts index a290e0bf67bc..4b17a75ba43a 100644 --- a/yarn-project/foundation/src/schemas/schemas.ts +++ b/yarn-project/foundation/src/schemas/schemas.ts @@ -1,6 +1,5 @@ import { z } from 'zod'; -import { AztecAddress } from '../aztec-address/index.js'; import { Buffer32 } from '../buffer/buffer32.js'; import { EthAddress } from '../eth-address/index.js'; import { Fq, Fr } from '../fields/fields.js'; @@ -13,9 +12,6 @@ export const schemas = { /** Accepts a hex string. */ EthAddress: EthAddress.schema, - /** Accepts a hex string. */ - AztecAddress: AztecAddress.schema, - /** Accepts a hex string. */ Fr: Fr.schema, diff --git a/yarn-project/foundation/src/serialize/type_registry.test.ts b/yarn-project/foundation/src/serialize/type_registry.test.ts index e8af2ff2d297..c98a3c2de064 100644 --- a/yarn-project/foundation/src/serialize/type_registry.test.ts +++ b/yarn-project/foundation/src/serialize/type_registry.test.ts @@ -1,8 +1,28 @@ -import { AztecAddress } from '../aztec-address/index.js'; import { EthAddress } from '../eth-address/index.js'; import { Fq, Fr } from '../fields/fields.js'; import { resolver, reviver } from './type_registry.js'; +class NonRegisteredType { + constructor(private value: number) {} + + toString() { + return this.value.toString(); + } + + toJSON() { + return this.toString(); + } + + fromString(value: string) { + return new NonRegisteredType(parseInt(value)); + } + + static random() { + // Determined by a fair dice roll. + return new NonRegisteredType(4); + } +} + describe('TypeRegistry', () => { it('serializes registered type with type info', () => { const data = { fr: Fr.random() }; @@ -15,7 +35,6 @@ describe('TypeRegistry', () => { const data = { fr: Fr.random(), fq: Fq.random(), - aztecAddress: await AztecAddress.random(), ethAddress: EthAddress.random(), }; @@ -25,12 +44,11 @@ describe('TypeRegistry', () => { expect(parsed).toEqual(data); expect(parsed.fr).toBeInstanceOf(Fr); expect(parsed.fq).toBeInstanceOf(Fq); - expect(parsed.aztecAddress).toBeInstanceOf(AztecAddress); expect(parsed.ethAddress).toBeInstanceOf(EthAddress); }); it('deserializes registered types in arrays', async () => { - const data = [Fr.random(), Fq.random(), await AztecAddress.random(), EthAddress.random()]; + const data = [Fr.random(), Fq.random(), EthAddress.random()]; const json = JSON.stringify(data, resolver); const parsed = JSON.parse(json, reviver); @@ -38,16 +56,15 @@ describe('TypeRegistry', () => { expect(parsed).toEqual(data); expect(parsed[0]).toBeInstanceOf(Fr); expect(parsed[1]).toBeInstanceOf(Fq); - expect(parsed[2]).toBeInstanceOf(AztecAddress); - expect(parsed[3]).toBeInstanceOf(EthAddress); + expect(parsed[2]).toBeInstanceOf(EthAddress); }); - // it('ignores unregistered types', () => { - // const data = { eventSelector: EventSelector.random() }; - // const json = JSON.stringify(data, resolver); - // const parsed = JSON.parse(json); - // expect(parsed.eventSelector).toEqual(data.eventSelector.toString()); - // }); + it('ignores unregistered types', () => { + const data = { test: NonRegisteredType.random() }; + const json = JSON.stringify(data, resolver); + const parsed = JSON.parse(json); + expect(parsed.test).toEqual(data.test.toString()); + }); it('handles plain objects', () => { const data = { obj: { number: 10, string: 'string', fr: Fr.random() } }; diff --git a/yarn-project/foundation/src/trees/indexed_merkle_tree_calculator.test.ts b/yarn-project/foundation/src/trees/indexed_merkle_tree_calculator.test.ts index 7266b017f596..f2fb31771295 100644 --- a/yarn-project/foundation/src/trees/indexed_merkle_tree_calculator.test.ts +++ b/yarn-project/foundation/src/trees/indexed_merkle_tree_calculator.test.ts @@ -1,4 +1,3 @@ -import { AztecAddress } from '../aztec-address/index.js'; import { toBigIntBE } from '../bigint-buffer/index.js'; import { poseidon2Hash } from '../crypto/poseidon/index.js'; import { Fr } from '../fields/fields.js'; @@ -191,9 +190,9 @@ describe('indexed merkle tree root calculator', () => { it('should correctly get a membership witness for addresses', async () => { const hasher = new TestHasher(); const calculator = await IndexedMerkleTreeCalculator.create(3, hasher, TestLeafPreimage); - let values: AztecAddress[] = await Promise.all(Array.from({ length: 7 }).map(() => AztecAddress.random())); + let values: Fr[] = await Promise.all(Array.from({ length: 7 }).map(() => Fr.random())); // Manually add the zero leaf here, so the below recalcs are easier. - values = [AztecAddress.ZERO, ...values]; + values = [Fr.ZERO, ...values]; const tree = await calculator.computeTree(values.map(a => a.toBuffer())); // Pick some value to find a witness for... @@ -201,7 +200,7 @@ describe('indexed merkle tree root calculator', () => { const testValue = values[testIndex]; const sortedValues = [...values].sort((a, b) => Number(a.toBigInt() - b.toBigInt())); // ...and find its next value. - const nextValue = sortedValues[sortedValues.indexOf(testValue) + 1] || AztecAddress.ZERO; + const nextValue = sortedValues[sortedValues.indexOf(testValue) + 1] || Fr.ZERO; // Reconstruct its leaf preimage. const testLeafPreimage = new TestLeafPreimage( @@ -224,13 +223,13 @@ describe('indexed merkle tree root calculator', () => { it('should correctly get a non membership witness for addresses', async () => { const hasher = new TestHasher(); const calculator = await IndexedMerkleTreeCalculator.create(3, hasher, TestLeafPreimage); - let values: AztecAddress[] = await Promise.all(Array.from({ length: 7 }).map(() => AztecAddress.random())); + let values: Fr[] = await Promise.all(Array.from({ length: 7 }).map(() => Fr.random())); // Manually add the zero leaf here, so the below recalcs are easier. - values = [AztecAddress.ZERO, ...values]; + values = [Fr.ZERO, ...values]; const tree = await calculator.computeTree(values.map(a => a.toBuffer())); // Pick some value to find a low leaf for... - const testValue = await AztecAddress.random(); + const testValue = await Fr.random(); const sortedValues = [...values].sort((a, b) => Number(a.toBigInt() - b.toBigInt())); // ...and find its 'sandwich' values. const previousIndex = sortedValues.findIndex( @@ -238,10 +237,7 @@ describe('indexed merkle tree root calculator', () => { a.toBigInt() <= testValue.toBigInt() && (i == sortedValues.length - 1 || sortedValues[i + 1].toBigInt() > testValue.toBigInt()), ); - const [previousValue, nextValue] = [ - sortedValues[previousIndex], - sortedValues[previousIndex + 1] || AztecAddress.ZERO, - ]; + const [previousValue, nextValue] = [sortedValues[previousIndex], sortedValues[previousIndex + 1] || Fr.ZERO]; // Reconstruct the low leaf preimage. const expectedLowLeaf = new TestLeafPreimage( diff --git a/yarn-project/ivc-integration/src/avm_integration.test.ts b/yarn-project/ivc-integration/src/avm_integration.test.ts index 2c548bde63be..927abab8729f 100644 --- a/yarn-project/ivc-integration/src/avm_integration.test.ts +++ b/yarn-project/ivc-integration/src/avm_integration.test.ts @@ -1,6 +1,7 @@ import { type BBSuccess, BB_RESULT, generateAvmProof, generateProof, verifyProof } from '@aztec/bb-prover'; import { type ContractInstanceWithAddress } from '@aztec/circuits.js'; import { type AvmCircuitInputs } from '@aztec/circuits.js/avm'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { AVM_PROOF_LENGTH_IN_FIELDS, AVM_PUBLIC_COLUMN_MAX_SIZE, @@ -8,7 +9,6 @@ import { AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS, PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH, } from '@aztec/constants'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { createLogger } from '@aztec/foundation/log'; import { BufferReader } from '@aztec/foundation/serialize'; diff --git a/yarn-project/protocol-contracts/src/build_protocol_contract_tree.ts b/yarn-project/protocol-contracts/src/build_protocol_contract_tree.ts index 834fdaf6327d..772883b36ed1 100644 --- a/yarn-project/protocol-contracts/src/build_protocol_contract_tree.ts +++ b/yarn-project/protocol-contracts/src/build_protocol_contract_tree.ts @@ -1,6 +1,6 @@ +import { type AztecAddress } from '@aztec/circuits.js/aztec-address'; import { ProtocolContractLeafPreimage } from '@aztec/circuits.js/trees'; import { MAX_PROTOCOL_CONTRACTS, PROTOCOL_CONTRACT_TREE_HEIGHT } from '@aztec/constants'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { poseidon2Hash } from '@aztec/foundation/crypto'; import { type Fr } from '@aztec/foundation/fields'; import { type IndexedMerkleTree, IndexedMerkleTreeCalculator } from '@aztec/foundation/trees'; diff --git a/yarn-project/protocol-contracts/src/fee-juice/index.ts b/yarn-project/protocol-contracts/src/fee-juice/index.ts index 77e5c9b31212..49357dbc051b 100644 --- a/yarn-project/protocol-contracts/src/fee-juice/index.ts +++ b/yarn-project/protocol-contracts/src/fee-juice/index.ts @@ -1,7 +1,7 @@ import { loadContractArtifact } from '@aztec/circuits.js/abi'; +import { type AztecAddress } from '@aztec/circuits.js/aztec-address'; import { computePublicDataTreeLeafSlot, deriveStorageSlotInMap } from '@aztec/circuits.js/hash'; import { type NoirCompiledContract } from '@aztec/circuits.js/noir'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { type Fr } from '@aztec/foundation/fields'; import FeeJuiceJson from '../../artifacts/FeeJuice.json' assert { type: 'json' }; diff --git a/yarn-project/protocol-contracts/src/instance-deployer/contract_instance_deployed_event.ts b/yarn-project/protocol-contracts/src/instance-deployer/contract_instance_deployed_event.ts index 163cf5b3778a..36b1da29aa8c 100644 --- a/yarn-project/protocol-contracts/src/instance-deployer/contract_instance_deployed_event.ts +++ b/yarn-project/protocol-contracts/src/instance-deployer/contract_instance_deployed_event.ts @@ -1,5 +1,5 @@ import { type ContractInstanceWithAddress, type PrivateLog, PublicKeys } from '@aztec/circuits.js'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader } from '@aztec/foundation/serialize'; diff --git a/yarn-project/protocol-contracts/src/instance-deployer/contract_instance_updated_event.ts b/yarn-project/protocol-contracts/src/instance-deployer/contract_instance_updated_event.ts index 4fb32f3fbe49..1b1c54aca19d 100644 --- a/yarn-project/protocol-contracts/src/instance-deployer/contract_instance_updated_event.ts +++ b/yarn-project/protocol-contracts/src/instance-deployer/contract_instance_updated_event.ts @@ -1,5 +1,5 @@ import { type ContractInstanceUpdateWithAddress, type PublicLog } from '@aztec/circuits.js'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader } from '@aztec/foundation/serialize'; diff --git a/yarn-project/protocol-contracts/src/protocol_contract.ts b/yarn-project/protocol-contracts/src/protocol_contract.ts index 331801c6f5bc..a0bd9095d3ec 100644 --- a/yarn-project/protocol-contracts/src/protocol_contract.ts +++ b/yarn-project/protocol-contracts/src/protocol_contract.ts @@ -1,10 +1,10 @@ import { type ContractArtifact } from '@aztec/circuits.js/abi'; +import { type AztecAddress } from '@aztec/circuits.js/aztec-address'; import { type ContractClassIdPreimage, type ContractClassWithId, type ContractInstanceWithAddress, } from '@aztec/circuits.js/contract'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { ProtocolContractAddress } from './protocol_contract_data.js'; diff --git a/yarn-project/protocol-contracts/src/protocol_contract_tree.ts b/yarn-project/protocol-contracts/src/protocol_contract_tree.ts index a8e87ad24499..9eb43a30a1a1 100644 --- a/yarn-project/protocol-contracts/src/protocol_contract_tree.ts +++ b/yarn-project/protocol-contracts/src/protocol_contract_tree.ts @@ -1,6 +1,6 @@ +import type { AztecAddress } from '@aztec/circuits.js/aztec-address'; import type { ProtocolContractLeafPreimage } from '@aztec/circuits.js/trees'; import { type PROTOCOL_CONTRACT_TREE_HEIGHT } from '@aztec/constants'; -import type { AztecAddress } from '@aztec/foundation/aztec-address'; import { poseidon2Hash } from '@aztec/foundation/crypto'; import { type IndexedMerkleTree } from '@aztec/foundation/trees'; diff --git a/yarn-project/protocol-contracts/src/scripts/generate_data.ts b/yarn-project/protocol-contracts/src/scripts/generate_data.ts index 17df472ea518..aa46f7c332c2 100644 --- a/yarn-project/protocol-contracts/src/scripts/generate_data.ts +++ b/yarn-project/protocol-contracts/src/scripts/generate_data.ts @@ -145,7 +145,7 @@ async function generateOutputFile(names: string[], leaves: Fr[]) { const content = ` // GENERATED FILE - DO NOT EDIT. RUN \`yarn generate\` or \`yarn generate:data\` import { Fr } from '@aztec/foundation/fields'; - import { AztecAddress } from '@aztec/foundation/aztec-address'; + import { AztecAddress } from '@aztec/circuits.js/aztec-address'; ${generateNames(names)} diff --git a/yarn-project/prover-client/src/mocks/test_context.ts b/yarn-project/prover-client/src/mocks/test_context.ts index 9d294a7f7d6f..873b4c269c03 100644 --- a/yarn-project/prover-client/src/mocks/test_context.ts +++ b/yarn-project/prover-client/src/mocks/test_context.ts @@ -3,8 +3,8 @@ import { type L2Block, type ProcessedTx, type Tx } from '@aztec/circuit-types'; import { type ServerCircuitProver } from '@aztec/circuit-types/interfaces/server'; import { makeBloatedProcessedTx } from '@aztec/circuit-types/testing'; import { type BlockHeader, type GlobalVariables, PublicDataWrite, TreeSnapshots } from '@aztec/circuits.js'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { type AppendOnlyTreeSnapshot, PublicDataTreeLeaf } from '@aztec/circuits.js/trees'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { times, timesParallel } from '@aztec/foundation/collection'; import { Fr } from '@aztec/foundation/fields'; import { type Logger } from '@aztec/foundation/log'; diff --git a/yarn-project/prover-client/src/orchestrator/orchestrator_multi_public_functions.test.ts b/yarn-project/prover-client/src/orchestrator/orchestrator_multi_public_functions.test.ts index 8c88e2c3d964..14876f5b181e 100644 --- a/yarn-project/prover-client/src/orchestrator/orchestrator_multi_public_functions.test.ts +++ b/yarn-project/prover-client/src/orchestrator/orchestrator_multi_public_functions.test.ts @@ -1,8 +1,8 @@ import { Tx } from '@aztec/circuit-types'; import { type ContractInstanceWithAddress } from '@aztec/circuits.js'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { siloNullifier } from '@aztec/circuits.js/hash'; import { DEPLOYER_CONTRACT_ADDRESS } from '@aztec/constants'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { createLogger } from '@aztec/foundation/log'; import { TokenContractArtifact } from '@aztec/noir-contracts.js/Token'; diff --git a/yarn-project/pxe/src/database/pxe_database.ts b/yarn-project/pxe/src/database/pxe_database.ts index 5b6e493a5bc7..4c15446681a1 100644 --- a/yarn-project/pxe/src/database/pxe_database.ts +++ b/yarn-project/pxe/src/database/pxe_database.ts @@ -7,7 +7,7 @@ import { type PublicKey, } from '@aztec/circuits.js'; import { type ContractArtifact } from '@aztec/circuits.js/abi'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; +import { type AztecAddress } from '@aztec/circuits.js/aztec-address'; import { type Fr } from '@aztec/foundation/fields'; import { type ContractArtifactDatabase } from './contracts/contract_artifact_db.js'; diff --git a/yarn-project/pxe/src/index.ts b/yarn-project/pxe/src/index.ts index fbdaa0c4bbc5..a944e80eff31 100644 --- a/yarn-project/pxe/src/index.ts +++ b/yarn-project/pxe/src/index.ts @@ -9,7 +9,7 @@ export { Tx, TxHash } from '@aztec/circuit-types'; export { TxRequest } from '@aztec/circuits.js'; export * from '@aztec/foundation/fields'; export * from '@aztec/foundation/eth-address'; -export * from '@aztec/foundation/aztec-address'; +export * from '@aztec/circuits.js/aztec-address'; export * from '@aztec/key-store'; export * from './database/index.js'; export { ContractDataOracle } from './contract_data_oracle/index.js'; diff --git a/yarn-project/pxe/src/kernel_prover/kernel_prover.test.ts b/yarn-project/pxe/src/kernel_prover/kernel_prover.test.ts index 7813e52a1de6..ea0dd5c26a6c 100644 --- a/yarn-project/pxe/src/kernel_prover/kernel_prover.test.ts +++ b/yarn-project/pxe/src/kernel_prover/kernel_prover.test.ts @@ -16,6 +16,7 @@ import { VerificationKeyAsFields, } from '@aztec/circuits.js'; import { NoteSelector } from '@aztec/circuits.js/abi'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { PrivateKernelCircuitPublicInputs, PrivateKernelTailCircuitPublicInputs } from '@aztec/circuits.js/kernel'; import { makeTxRequest } from '@aztec/circuits.js/testing'; import { @@ -25,7 +26,6 @@ import { VK_TREE_HEIGHT, } from '@aztec/constants'; import { makeTuple } from '@aztec/foundation/array'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { MembershipWitness } from '@aztec/foundation/trees'; diff --git a/yarn-project/pxe/src/kernel_prover/proving_data_oracle.ts b/yarn-project/pxe/src/kernel_prover/proving_data_oracle.ts index 891a6db580f6..927c25964e74 100644 --- a/yarn-project/pxe/src/kernel_prover/proving_data_oracle.ts +++ b/yarn-project/pxe/src/kernel_prover/proving_data_oracle.ts @@ -7,9 +7,9 @@ import { type PublicKeys, type VerificationKeyAsFields, } from '@aztec/circuits.js'; +import { type AztecAddress } from '@aztec/circuits.js/aztec-address'; import { UpdatedClassIdHints } from '@aztec/circuits.js/kernel'; import { type FUNCTION_TREE_HEIGHT, type NOTE_HASH_TREE_HEIGHT, type VK_TREE_HEIGHT } from '@aztec/constants'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; import type { MembershipWitness } from '@aztec/foundation/trees'; /** diff --git a/yarn-project/pxe/src/pxe_service/error_enriching.ts b/yarn-project/pxe/src/pxe_service/error_enriching.ts index 38d96d3721b3..fc980738cedf 100644 --- a/yarn-project/pxe/src/pxe_service/error_enriching.ts +++ b/yarn-project/pxe/src/pxe_service/error_enriching.ts @@ -1,7 +1,7 @@ import { type SimulationError, isNoirCallStackUnresolved } from '@aztec/circuit-types'; import { FunctionSelector } from '@aztec/circuits.js/abi'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { PUBLIC_DISPATCH_SELECTOR } from '@aztec/constants'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { type Logger } from '@aztec/foundation/log'; import { resolveAssertionMessageFromRevertData, resolveOpcodeLocations } from '@aztec/simulator/client'; diff --git a/yarn-project/pxe/src/pxe_service/pxe_service.ts b/yarn-project/pxe/src/pxe_service/pxe_service.ts index 274d58773963..67d714d551c5 100644 --- a/yarn-project/pxe/src/pxe_service/pxe_service.ts +++ b/yarn-project/pxe/src/pxe_service/pxe_service.ts @@ -51,12 +51,12 @@ import { decodeFunctionSignature, encodeArguments, } from '@aztec/circuits.js/abi'; +import { type AztecAddress } from '@aztec/circuits.js/aztec-address'; import { computeContractAddressFromInstance, getContractClassFromArtifact } from '@aztec/circuits.js/contract'; import { computeNoteHashNonce, siloNullifier } from '@aztec/circuits.js/hash'; import { PrivateKernelTailCircuitPublicInputs } from '@aztec/circuits.js/kernel'; import { computeAddressSecret } from '@aztec/circuits.js/keys'; import { L1_TO_L2_MSG_TREE_HEIGHT } from '@aztec/constants'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr, type Point } from '@aztec/foundation/fields'; import { type Logger, createLogger } from '@aztec/foundation/log'; import { Timer } from '@aztec/foundation/timer'; diff --git a/yarn-project/sequencer-client/src/sequencer/sequencer.ts b/yarn-project/sequencer-client/src/sequencer/sequencer.ts index 2843926f9339..36d83166571d 100644 --- a/yarn-project/sequencer-client/src/sequencer/sequencer.ts +++ b/yarn-project/sequencer-client/src/sequencer/sequencer.ts @@ -22,9 +22,9 @@ import { type GlobalVariables, StateReference, } from '@aztec/circuits.js'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { AppendOnlyTreeSnapshot } from '@aztec/circuits.js/trees'; import { INITIAL_L2_BLOCK_NUM } from '@aztec/constants'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { omit } from '@aztec/foundation/collection'; import { EthAddress } from '@aztec/foundation/eth-address'; import type { Signature } from '@aztec/foundation/eth-signature'; diff --git a/yarn-project/simulator/src/acvm/oracle/oracle.ts b/yarn-project/simulator/src/acvm/oracle/oracle.ts index 3f1f3eaf9e79..61189188ae0c 100644 --- a/yarn-project/simulator/src/acvm/oracle/oracle.ts +++ b/yarn-project/simulator/src/acvm/oracle/oracle.ts @@ -1,6 +1,6 @@ import { MerkleTreeId, UnencryptedL2Log } from '@aztec/circuit-types'; import { FunctionSelector, NoteSelector } from '@aztec/circuits.js/abi'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { type ACVMField } from '../acvm_types.js'; diff --git a/yarn-project/simulator/src/acvm/oracle/typed_oracle.ts b/yarn-project/simulator/src/acvm/oracle/typed_oracle.ts index 5fda45816c98..a5101e7c6622 100644 --- a/yarn-project/simulator/src/acvm/oracle/typed_oracle.ts +++ b/yarn-project/simulator/src/acvm/oracle/typed_oracle.ts @@ -14,8 +14,8 @@ import { type KeyValidationRequest, } from '@aztec/circuits.js'; import { type FunctionSelector, type NoteSelector } from '@aztec/circuits.js/abi'; +import { type AztecAddress } from '@aztec/circuits.js/aztec-address'; import { type L1_TO_L2_MSG_TREE_HEIGHT } from '@aztec/constants'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { type MessageLoadOracleInputs } from '../../common/message_load_oracle_inputs.js'; diff --git a/yarn-project/simulator/src/acvm/serialize.ts b/yarn-project/simulator/src/acvm/serialize.ts index 0ae28ed6ce5c..54c4de4ff07d 100644 --- a/yarn-project/simulator/src/acvm/serialize.ts +++ b/yarn-project/simulator/src/acvm/serialize.ts @@ -1,4 +1,4 @@ -import { type AztecAddress } from '@aztec/foundation/aztec-address'; +import { type AztecAddress } from '@aztec/circuits.js/aztec-address'; import { type EthAddress } from '@aztec/foundation/eth-address'; import { Fr } from '@aztec/foundation/fields'; diff --git a/yarn-project/simulator/src/avm/avm_execution_environment.ts b/yarn-project/simulator/src/avm/avm_execution_environment.ts index ead85afbfc4e..15e87d307fc1 100644 --- a/yarn-project/simulator/src/avm/avm_execution_environment.ts +++ b/yarn-project/simulator/src/avm/avm_execution_environment.ts @@ -1,5 +1,5 @@ import { type GlobalVariables } from '@aztec/circuits.js'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; +import { type AztecAddress } from '@aztec/circuits.js/aztec-address'; import { Fr } from '@aztec/foundation/fields'; /** diff --git a/yarn-project/simulator/src/avm/avm_memory_types.ts b/yarn-project/simulator/src/avm/avm_memory_types.ts index 0b00215d5a17..a29487b55d12 100644 --- a/yarn-project/simulator/src/avm/avm_memory_types.ts +++ b/yarn-project/simulator/src/avm/avm_memory_types.ts @@ -1,3 +1,4 @@ +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { MEM_TAG_FF, MEM_TAG_U1, @@ -7,7 +8,6 @@ import { MEM_TAG_U64, MEM_TAG_U128, } from '@aztec/constants'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { toBufferBE } from '@aztec/foundation/bigint-buffer'; import { Fr } from '@aztec/foundation/fields'; import { type Logger, createLogger } from '@aztec/foundation/log'; diff --git a/yarn-project/simulator/src/avm/avm_simulator.test.ts b/yarn-project/simulator/src/avm/avm_simulator.test.ts index a9738432366d..41a8151a5623 100644 --- a/yarn-project/simulator/src/avm/avm_simulator.test.ts +++ b/yarn-project/simulator/src/avm/avm_simulator.test.ts @@ -2,6 +2,7 @@ import { MerkleTreeId } from '@aztec/circuit-types'; import { type MerkleTreeWriteOperations } from '@aztec/circuit-types/interfaces/server'; import { GasFees, PublicKeys, SerializableContractInstance } from '@aztec/circuits.js'; import { FunctionSelector } from '@aztec/circuits.js/abi'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { computeNoteHashNonce, computePublicDataTreeLeafSlot, @@ -13,7 +14,6 @@ import { import { makeContractClassPublic, makeContractInstanceFromClassId } from '@aztec/circuits.js/testing'; import { PublicDataTreeLeafPreimage } from '@aztec/circuits.js/trees'; import { DEPLOYER_CONTRACT_ADDRESS } from '@aztec/constants'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Grumpkin, keccak256, diff --git a/yarn-project/simulator/src/avm/fixtures/avm_simulation_tester.ts b/yarn-project/simulator/src/avm/fixtures/avm_simulation_tester.ts index 1360e04eb74c..4e715a08c2d6 100644 --- a/yarn-project/simulator/src/avm/fixtures/avm_simulation_tester.ts +++ b/yarn-project/simulator/src/avm/fixtures/avm_simulation_tester.ts @@ -1,7 +1,7 @@ import { type MerkleTreeWriteOperations } from '@aztec/circuit-types/interfaces/server'; import { GasFees, GlobalVariables } from '@aztec/circuits.js'; import { encodeArguments } from '@aztec/circuits.js/abi'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; +import { type AztecAddress } from '@aztec/circuits.js/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { NativeWorldStateService } from '@aztec/world-state'; diff --git a/yarn-project/simulator/src/avm/fixtures/base_avm_simulation_tester.ts b/yarn-project/simulator/src/avm/fixtures/base_avm_simulation_tester.ts index 0f00889a2b5a..9e6f4bb64daf 100644 --- a/yarn-project/simulator/src/avm/fixtures/base_avm_simulation_tester.ts +++ b/yarn-project/simulator/src/avm/fixtures/base_avm_simulation_tester.ts @@ -2,9 +2,9 @@ import { MerkleTreeId } from '@aztec/circuit-types'; import { type MerkleTreeWriteOperations } from '@aztec/circuit-types/interfaces/server'; import { type ContractClassPublic, type ContractInstanceWithAddress, PublicDataWrite } from '@aztec/circuits.js'; import { type ContractArtifact } from '@aztec/circuits.js/abi'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { computePublicDataTreeLeafSlot, siloNullifier } from '@aztec/circuits.js/hash'; import { DEPLOYER_CONTRACT_ADDRESS } from '@aztec/constants'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { createLogger } from '@aztec/foundation/log'; import { ProtocolContractAddress } from '@aztec/protocol-contracts'; diff --git a/yarn-project/simulator/src/avm/fixtures/index.ts b/yarn-project/simulator/src/avm/fixtures/index.ts index bea6e34c9ab1..fbe93b221a5b 100644 --- a/yarn-project/simulator/src/avm/fixtures/index.ts +++ b/yarn-project/simulator/src/avm/fixtures/index.ts @@ -1,8 +1,8 @@ import { isNoirCallStackUnresolved } from '@aztec/circuit-types'; import { GasFees, GlobalVariables } from '@aztec/circuits.js'; import { type ContractArtifact, type FunctionArtifact, FunctionSelector } from '@aztec/circuits.js/abi'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { MAX_L2_GAS_PER_TX_PUBLIC_PORTION } from '@aztec/constants'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { EthAddress } from '@aztec/foundation/eth-address'; import { Fr } from '@aztec/foundation/fields'; import { AvmGadgetsTestContractArtifact } from '@aztec/noir-contracts.js/AvmGadgetsTest'; diff --git a/yarn-project/simulator/src/avm/fixtures/simple_contract_data_source.ts b/yarn-project/simulator/src/avm/fixtures/simple_contract_data_source.ts index 59ebc179a3f2..d669011c957a 100644 --- a/yarn-project/simulator/src/avm/fixtures/simple_contract_data_source.ts +++ b/yarn-project/simulator/src/avm/fixtures/simple_contract_data_source.ts @@ -8,9 +8,9 @@ import { computePublicBytecodeCommitment, } from '@aztec/circuits.js'; import { type ContractArtifact } from '@aztec/circuits.js/abi'; +import { type AztecAddress } from '@aztec/circuits.js/aztec-address'; import { makeContractClassPublic, makeContractInstanceFromClassId } from '@aztec/circuits.js/testing'; import { PUBLIC_DISPATCH_SELECTOR } from '@aztec/constants'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { type Fr } from '@aztec/foundation/fields'; import { createLogger } from '@aztec/foundation/log'; import { getCanonicalFeeJuice } from '@aztec/protocol-contracts/fee-juice'; diff --git a/yarn-project/simulator/src/avm/journal/journal.ts b/yarn-project/simulator/src/avm/journal/journal.ts index 0aed18332bdd..955d30a20775 100644 --- a/yarn-project/simulator/src/avm/journal/journal.ts +++ b/yarn-project/simulator/src/avm/journal/journal.ts @@ -1,6 +1,7 @@ import { MerkleTreeId } from '@aztec/circuit-types'; import { type PublicCallRequest, SerializableContractInstance } from '@aztec/circuits.js'; import { AvmNullifierReadTreeHint, AvmPublicDataReadTreeHint } from '@aztec/circuits.js/avm'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { computeNoteHashNonce, computePublicDataTreeLeafSlot, @@ -18,7 +19,6 @@ import { REGISTERER_CONTRACT_ADDRESS, ROUTER_ADDRESS, } from '@aztec/constants'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { poseidon2Hash } from '@aztec/foundation/crypto'; import { Fr } from '@aztec/foundation/fields'; import { jsonStringify } from '@aztec/foundation/json-rpc'; diff --git a/yarn-project/simulator/src/avm/opcodes/environment_getters.test.ts b/yarn-project/simulator/src/avm/opcodes/environment_getters.test.ts index d0661db24173..081f0a9a01d7 100644 --- a/yarn-project/simulator/src/avm/opcodes/environment_getters.test.ts +++ b/yarn-project/simulator/src/avm/opcodes/environment_getters.test.ts @@ -1,5 +1,5 @@ import { GasFees } from '@aztec/circuits.js'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { randomInt } from 'crypto'; diff --git a/yarn-project/simulator/src/avm/opcodes/storage.test.ts b/yarn-project/simulator/src/avm/opcodes/storage.test.ts index 7d9b435fd54a..74bee4eae6d9 100644 --- a/yarn-project/simulator/src/avm/opcodes/storage.test.ts +++ b/yarn-project/simulator/src/avm/opcodes/storage.test.ts @@ -1,4 +1,4 @@ -import { AztecAddress } from '@aztec/foundation/aztec-address'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { type MockProxy, mock } from 'jest-mock-extended'; diff --git a/yarn-project/simulator/src/client/client_execution_context.ts b/yarn-project/simulator/src/client/client_execution_context.ts index c205527c0042..41dd7b0de2c9 100644 --- a/yarn-project/simulator/src/client/client_execution_context.ts +++ b/yarn-project/simulator/src/client/client_execution_context.ts @@ -21,9 +21,9 @@ import { type TxContext, } from '@aztec/circuits.js'; import { type FunctionAbi, type FunctionArtifact, type NoteSelector, countArgumentsSize } from '@aztec/circuits.js/abi'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { computeUniqueNoteHash, siloNoteHash } from '@aztec/circuits.js/hash'; import { PRIVATE_CONTEXT_INPUTS_LENGTH, PUBLIC_DISPATCH_SELECTOR } from '@aztec/constants'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { createLogger } from '@aztec/foundation/log'; diff --git a/yarn-project/simulator/src/client/db_oracle.ts b/yarn-project/simulator/src/client/db_oracle.ts index 811f38d08a11..23e0173df5cb 100644 --- a/yarn-project/simulator/src/client/db_oracle.ts +++ b/yarn-project/simulator/src/client/db_oracle.ts @@ -14,7 +14,7 @@ import { type KeyValidationRequest, } from '@aztec/circuits.js'; import { type FunctionArtifact, type FunctionSelector } from '@aztec/circuits.js/abi'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; +import { type AztecAddress } from '@aztec/circuits.js/aztec-address'; import { type Fr } from '@aztec/foundation/fields'; import { type NoteData } from '../acvm/index.js'; diff --git a/yarn-project/simulator/src/client/execution_note_cache.ts b/yarn-project/simulator/src/client/execution_note_cache.ts index 7d6f6e12533b..f871c41fee67 100644 --- a/yarn-project/simulator/src/client/execution_note_cache.ts +++ b/yarn-project/simulator/src/client/execution_note_cache.ts @@ -1,5 +1,5 @@ +import { type AztecAddress } from '@aztec/circuits.js/aztec-address'; import { computeNoteHashNonce, computeUniqueNoteHash, siloNoteHash, siloNullifier } from '@aztec/circuits.js/hash'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { type NoteData } from '../acvm/index.js'; diff --git a/yarn-project/simulator/src/client/private_execution.test.ts b/yarn-project/simulator/src/client/private_execution.test.ts index 84ef3be96dba..3945fcf98f7c 100644 --- a/yarn-project/simulator/src/client/private_execution.test.ts +++ b/yarn-project/simulator/src/client/private_execution.test.ts @@ -38,6 +38,7 @@ import { getFunctionArtifact, getFunctionArtifactByName, } from '@aztec/circuits.js/abi'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { computeNoteHashNonce, computeSecretHash, @@ -55,7 +56,6 @@ import { PUBLIC_DISPATCH_SELECTOR, } from '@aztec/constants'; import { asyncMap } from '@aztec/foundation/async-map'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { times } from '@aztec/foundation/collection'; import { poseidon2Hash, poseidon2HashWithSeparator, randomInt } from '@aztec/foundation/crypto'; import { EthAddress } from '@aztec/foundation/eth-address'; diff --git a/yarn-project/simulator/src/client/private_execution.ts b/yarn-project/simulator/src/client/private_execution.ts index cac1dccc040d..49571b8deab6 100644 --- a/yarn-project/simulator/src/client/private_execution.ts +++ b/yarn-project/simulator/src/client/private_execution.ts @@ -2,9 +2,9 @@ import { type AztecNode, PrivateCallExecutionResult } from '@aztec/circuit-types import { type CircuitWitnessGenerationStats } from '@aztec/circuit-types/stats'; import { type ContractInstance, Fr, PrivateCircuitPublicInputs } from '@aztec/circuits.js'; import { type FunctionArtifact, type FunctionSelector, countArgumentsSize } from '@aztec/circuits.js/abi'; +import { type AztecAddress } from '@aztec/circuits.js/aztec-address'; import { SharedMutableValues, SharedMutableValuesWithHash } from '@aztec/circuits.js/shared-mutable'; import { PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH, PRIVATE_CONTEXT_INPUTS_LENGTH } from '@aztec/constants'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { createLogger } from '@aztec/foundation/log'; import { Timer } from '@aztec/foundation/timer'; import { ProtocolContractAddress } from '@aztec/protocol-contracts'; diff --git a/yarn-project/simulator/src/client/simulator.test.ts b/yarn-project/simulator/src/client/simulator.test.ts index 086e622b5a52..33d9402e7e67 100644 --- a/yarn-project/simulator/src/client/simulator.test.ts +++ b/yarn-project/simulator/src/client/simulator.test.ts @@ -2,7 +2,7 @@ import { CompleteAddress, Note } from '@aztec/circuit-types'; import { type AztecNode } from '@aztec/circuit-types/interfaces/client'; import { KeyValidationRequest, computeAppNullifierSecretKey, deriveKeys } from '@aztec/circuits.js'; import { type FunctionArtifact, getFunctionArtifactByName } from '@aztec/circuits.js/abi'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { Fr, type Point } from '@aztec/foundation/fields'; import { TokenBlacklistContractArtifact } from '@aztec/noir-contracts.js/TokenBlacklist'; diff --git a/yarn-project/simulator/src/client/simulator.ts b/yarn-project/simulator/src/client/simulator.ts index 615992c064b5..345fa6be5eb3 100644 --- a/yarn-project/simulator/src/client/simulator.ts +++ b/yarn-project/simulator/src/client/simulator.ts @@ -9,7 +9,7 @@ import { type NoteSelector, encodeArguments, } from '@aztec/circuits.js/abi'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { type Logger, createLogger } from '@aztec/foundation/log'; diff --git a/yarn-project/simulator/src/client/unconstrained_execution.test.ts b/yarn-project/simulator/src/client/unconstrained_execution.test.ts index 3c1c09bc02e4..4545ffe97f38 100644 --- a/yarn-project/simulator/src/client/unconstrained_execution.test.ts +++ b/yarn-project/simulator/src/client/unconstrained_execution.test.ts @@ -2,7 +2,7 @@ import { type FunctionCall, Note } from '@aztec/circuit-types'; import { type AztecNode } from '@aztec/circuit-types/interfaces/client'; import { BlockHeader, CompleteAddress, type ContractInstance } from '@aztec/circuits.js'; import { FunctionSelector, FunctionType, encodeArguments } from '@aztec/circuits.js/abi'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { StatefulTestContractArtifact } from '@aztec/noir-contracts.js/StatefulTest'; diff --git a/yarn-project/simulator/src/client/unconstrained_execution.ts b/yarn-project/simulator/src/client/unconstrained_execution.ts index 6eb98d113d6f..04328f697956 100644 --- a/yarn-project/simulator/src/client/unconstrained_execution.ts +++ b/yarn-project/simulator/src/client/unconstrained_execution.ts @@ -1,5 +1,5 @@ import { type AbiDecoded, type FunctionArtifact, type FunctionSelector, decodeFromAbi } from '@aztec/circuits.js/abi'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; +import { type AztecAddress } from '@aztec/circuits.js/aztec-address'; import { type Fr } from '@aztec/foundation/fields'; import { createLogger } from '@aztec/foundation/log'; diff --git a/yarn-project/simulator/src/client/view_data_oracle.ts b/yarn-project/simulator/src/client/view_data_oracle.ts index c7b36b3ca861..921c16d463ed 100644 --- a/yarn-project/simulator/src/client/view_data_oracle.ts +++ b/yarn-project/simulator/src/client/view_data_oracle.ts @@ -13,8 +13,8 @@ import { type IndexedTaggingSecret, type KeyValidationRequest, } from '@aztec/circuits.js'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { siloNullifier } from '@aztec/circuits.js/hash'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Aes128 } from '@aztec/foundation/crypto'; import { Fr } from '@aztec/foundation/fields'; import { applyStringFormatting, createLogger } from '@aztec/foundation/log'; diff --git a/yarn-project/simulator/src/public/db_interfaces.ts b/yarn-project/simulator/src/public/db_interfaces.ts index f4885ad061bd..76735e1ef274 100644 --- a/yarn-project/simulator/src/public/db_interfaces.ts +++ b/yarn-project/simulator/src/public/db_interfaces.ts @@ -1,7 +1,7 @@ import { type NullifierMembershipWitness } from '@aztec/circuit-types/interfaces/server'; import { type ContractInstanceWithAddress, type FunctionSelector } from '@aztec/circuits.js'; +import { type AztecAddress } from '@aztec/circuits.js/aztec-address'; import { type L1_TO_L2_MSG_TREE_HEIGHT } from '@aztec/constants'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { type Fr } from '@aztec/foundation/fields'; import { type MessageLoadOracleInputs } from '../common/message_load_oracle_inputs.js'; diff --git a/yarn-project/simulator/src/public/fixtures/public_tx_simulation_tester.ts b/yarn-project/simulator/src/public/fixtures/public_tx_simulation_tester.ts index 53681a9788e6..963886548d3f 100644 --- a/yarn-project/simulator/src/public/fixtures/public_tx_simulation_tester.ts +++ b/yarn-project/simulator/src/public/fixtures/public_tx_simulation_tester.ts @@ -3,6 +3,7 @@ import { type MerkleTreeWriteOperations } from '@aztec/circuit-types/interfaces/ import { CallContext, FunctionSelector, GasFees, GlobalVariables } from '@aztec/circuits.js'; import { type ContractArtifact, encodeArguments } from '@aztec/circuits.js/abi'; import { type AvmCircuitPublicInputs } from '@aztec/circuits.js/avm'; +import { type AztecAddress } from '@aztec/circuits.js/aztec-address'; import { MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, @@ -10,7 +11,6 @@ import { PUBLIC_DATA_TREE_HEIGHT, PUBLIC_DISPATCH_SELECTOR, } from '@aztec/constants'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { padArrayEnd } from '@aztec/foundation/collection'; import { Fr } from '@aztec/foundation/fields'; import { AvmTestContractArtifact } from '@aztec/noir-contracts.js/AvmTest'; diff --git a/yarn-project/simulator/src/public/fixtures/utils.ts b/yarn-project/simulator/src/public/fixtures/utils.ts index 4fcc343fd5f1..f681370580dd 100644 --- a/yarn-project/simulator/src/public/fixtures/utils.ts +++ b/yarn-project/simulator/src/public/fixtures/utils.ts @@ -1,12 +1,12 @@ import { type PublicExecutionRequest, Tx } from '@aztec/circuit-types'; import { BlockHeader, Gas, GasFees, GasSettings, RollupValidationRequests, TxContext } from '@aztec/circuits.js'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { PartialPrivateTailPublicInputsForPublic, PrivateKernelTailCircuitPublicInputs, TxConstantData, } from '@aztec/circuits.js/kernel'; import { DEFAULT_GAS_LIMIT, MAX_L2_GAS_PER_TX_PUBLIC_PORTION } from '@aztec/constants'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { strict as assert } from 'assert'; diff --git a/yarn-project/simulator/src/public/side_effect_trace_interface.ts b/yarn-project/simulator/src/public/side_effect_trace_interface.ts index ea978c843aec..05f5bb5e9e58 100644 --- a/yarn-project/simulator/src/public/side_effect_trace_interface.ts +++ b/yarn-project/simulator/src/public/side_effect_trace_interface.ts @@ -5,8 +5,8 @@ import { type SerializableContractInstance, } from '@aztec/circuits.js'; import { type AvmNullifierReadTreeHint, type AvmPublicDataReadTreeHint } from '@aztec/circuits.js/avm'; +import { type AztecAddress } from '@aztec/circuits.js/aztec-address'; import { type NullifierLeafPreimage, type PublicDataTreeLeafPreimage } from '@aztec/circuits.js/trees'; -import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { type Fr } from '@aztec/foundation/fields'; export interface PublicSideEffectTraceInterface { diff --git a/yarn-project/txe/src/oracle/txe_oracle.ts b/yarn-project/txe/src/oracle/txe_oracle.ts index 65a350d3f8e3..5000ed21df1f 100644 --- a/yarn-project/txe/src/oracle/txe_oracle.ts +++ b/yarn-project/txe/src/oracle/txe_oracle.ts @@ -42,6 +42,7 @@ import { type NoteSelector, countArgumentsSize, } from '@aztec/circuits.js/abi'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { computeNoteHashNonce, computePublicDataTreeLeafSlot, @@ -72,7 +73,6 @@ import { type PUBLIC_DATA_TREE_HEIGHT, PUBLIC_DISPATCH_SELECTOR, } from '@aztec/constants'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { padArrayEnd } from '@aztec/foundation/collection'; import { Schnorr, poseidon2Hash } from '@aztec/foundation/crypto'; import { Fr } from '@aztec/foundation/fields'; diff --git a/yarn-project/txe/src/txe_service/txe_service.ts b/yarn-project/txe/src/txe_service/txe_service.ts index 6a0c54de3918..0546c30585b0 100644 --- a/yarn-project/txe/src/txe_service/txe_service.ts +++ b/yarn-project/txe/src/txe_service/txe_service.ts @@ -7,9 +7,9 @@ import { computePartialAddress, } from '@aztec/circuits.js'; import { type ContractArtifact, NoteSelector } from '@aztec/circuits.js/abi'; +import { AztecAddress } from '@aztec/circuits.js/aztec-address'; import { computePublicDataTreeLeafSlot, siloNullifier } from '@aztec/circuits.js/hash'; import { DEPLOYER_CONTRACT_ADDRESS } from '@aztec/constants'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { type Logger } from '@aztec/foundation/log'; import { KeyStore } from '@aztec/key-store'; import { openTmpStore } from '@aztec/kv-store/lmdb'; From 99a6ad5030f24d3ef7b555d4bd94784fc6f0eace Mon Sep 17 00:00:00 2001 From: thunkar Date: Thu, 20 Feb 2025 14:40:21 +0000 Subject: [PATCH 5/7] fmt --- yarn-project/ethereum/src/contracts/forwarder.test.ts | 2 +- yarn-project/ethereum/src/deploy_l1_contracts.test.ts | 2 +- yarn-project/foundation/src/serialize/type_registry.test.ts | 4 ++-- .../src/trees/indexed_merkle_tree_calculator.test.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/yarn-project/ethereum/src/contracts/forwarder.test.ts b/yarn-project/ethereum/src/contracts/forwarder.test.ts index ce1fadca9afb..a983f596e021 100644 --- a/yarn-project/ethereum/src/contracts/forwarder.test.ts +++ b/yarn-project/ethereum/src/contracts/forwarder.test.ts @@ -47,7 +47,7 @@ describe('Forwarder', () => { privateKey = privateKeyToAccount('0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba'); vkTreeRoot = Fr.random(); protocolContractTreeRoot = Fr.random(); - l2FeeJuiceAddress = await Fr.random(); + l2FeeJuiceAddress = Fr.random(); ({ anvil, rpcUrl } = await startAnvil()); diff --git a/yarn-project/ethereum/src/deploy_l1_contracts.test.ts b/yarn-project/ethereum/src/deploy_l1_contracts.test.ts index cd866bb880e9..2bdf02a79684 100644 --- a/yarn-project/ethereum/src/deploy_l1_contracts.test.ts +++ b/yarn-project/ethereum/src/deploy_l1_contracts.test.ts @@ -38,7 +38,7 @@ describe('deploy_l1_contracts', () => { genesisArchiveRoot = Fr.random(); genesisBlockHash = Fr.random(); initialValidators = times(3, EthAddress.random); - l2FeeJuiceAddress = await Fr.random(); + l2FeeJuiceAddress = Fr.random(); if (!rpcUrl) { ({ stop, rpcUrl } = await startAnvil()); diff --git a/yarn-project/foundation/src/serialize/type_registry.test.ts b/yarn-project/foundation/src/serialize/type_registry.test.ts index c98a3c2de064..39d46e5bf82f 100644 --- a/yarn-project/foundation/src/serialize/type_registry.test.ts +++ b/yarn-project/foundation/src/serialize/type_registry.test.ts @@ -31,7 +31,7 @@ describe('TypeRegistry', () => { expect(parsed.fr).toEqual({ type: 'Fr', value: data.fr.toString() }); }); - it('deserializes registered types in objects', async () => { + it('deserializes registered types in objects', () => { const data = { fr: Fr.random(), fq: Fq.random(), @@ -47,7 +47,7 @@ describe('TypeRegistry', () => { expect(parsed.ethAddress).toBeInstanceOf(EthAddress); }); - it('deserializes registered types in arrays', async () => { + it('deserializes registered types in arrays', () => { const data = [Fr.random(), Fq.random(), EthAddress.random()]; const json = JSON.stringify(data, resolver); diff --git a/yarn-project/foundation/src/trees/indexed_merkle_tree_calculator.test.ts b/yarn-project/foundation/src/trees/indexed_merkle_tree_calculator.test.ts index f2fb31771295..9f2f9ea456f0 100644 --- a/yarn-project/foundation/src/trees/indexed_merkle_tree_calculator.test.ts +++ b/yarn-project/foundation/src/trees/indexed_merkle_tree_calculator.test.ts @@ -229,7 +229,7 @@ describe('indexed merkle tree root calculator', () => { const tree = await calculator.computeTree(values.map(a => a.toBuffer())); // Pick some value to find a low leaf for... - const testValue = await Fr.random(); + const testValue = Fr.random(); const sortedValues = [...values].sort((a, b) => Number(a.toBigInt() - b.toBigInt())); // ...and find its 'sandwich' values. const previousIndex = sortedValues.findIndex( From 3873865cde02612d54bfb19c977611055241cecc Mon Sep 17 00:00:00 2001 From: thunkar Date: Thu, 20 Feb 2025 15:30:02 +0000 Subject: [PATCH 6/7] fix --- yarn-project/circuits.js/src/structs/avm/avm.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/yarn-project/circuits.js/src/structs/avm/avm.test.ts b/yarn-project/circuits.js/src/structs/avm/avm.test.ts index 8599c0da1031..d252b2e67f94 100644 --- a/yarn-project/circuits.js/src/structs/avm/avm.test.ts +++ b/yarn-project/circuits.js/src/structs/avm/avm.test.ts @@ -1,8 +1,10 @@ -import { AztecAddress, Fr, Point, PublicKeys } from '@aztec/circuits.js'; import { randomInt } from '@aztec/foundation/crypto'; +import { Fr, Point } from '@aztec/foundation/fields'; import { readTestData, writeTestData } from '@aztec/foundation/testing/files'; +import { AztecAddress } from '../../aztec-address/index.js'; import { makeAvmCircuitInputs } from '../../tests/factories.js'; +import { PublicKeys } from '../../types/public_keys.js'; import { AvmCircuitInputs, serializeWithMessagePack } from './avm.js'; describe('Avm circuit inputs', () => { From ab192e495f1d3e43ac552c139990d1e5b394b6c1 Mon Sep 17 00:00:00 2001 From: thunkar Date: Thu, 20 Feb 2025 16:36:01 +0000 Subject: [PATCH 7/7] added hardcoded address to tests --- yarn-project/ethereum/src/contracts/forwarder.test.ts | 3 ++- yarn-project/ethereum/src/deploy_l1_contracts.test.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/yarn-project/ethereum/src/contracts/forwarder.test.ts b/yarn-project/ethereum/src/contracts/forwarder.test.ts index a983f596e021..ee98c2b9f938 100644 --- a/yarn-project/ethereum/src/contracts/forwarder.test.ts +++ b/yarn-project/ethereum/src/contracts/forwarder.test.ts @@ -47,7 +47,8 @@ describe('Forwarder', () => { privateKey = privateKeyToAccount('0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba'); vkTreeRoot = Fr.random(); protocolContractTreeRoot = Fr.random(); - l2FeeJuiceAddress = Fr.random(); + // Valid AztecAddress represented by its xCoord as a Fr + l2FeeJuiceAddress = Fr.fromHexString('0x302dbc2f9b50a73283d5fb2f35bc01eae8935615817a0b4219a057b2ba8a5a3f'); ({ anvil, rpcUrl } = await startAnvil()); diff --git a/yarn-project/ethereum/src/deploy_l1_contracts.test.ts b/yarn-project/ethereum/src/deploy_l1_contracts.test.ts index 2bdf02a79684..cfd59e928adb 100644 --- a/yarn-project/ethereum/src/deploy_l1_contracts.test.ts +++ b/yarn-project/ethereum/src/deploy_l1_contracts.test.ts @@ -38,7 +38,8 @@ describe('deploy_l1_contracts', () => { genesisArchiveRoot = Fr.random(); genesisBlockHash = Fr.random(); initialValidators = times(3, EthAddress.random); - l2FeeJuiceAddress = Fr.random(); + // Valid AztecAddress represented by its xCoord as a Fr + l2FeeJuiceAddress = Fr.fromHexString('0x302dbc2f9b50a73283d5fb2f35bc01eae8935615817a0b4219a057b2ba8a5a3f'); if (!rpcUrl) { ({ stop, rpcUrl } = await startAnvil());