diff --git a/.yarn/install-state.gz b/.yarn/install-state.gz deleted file mode 100644 index 3c5726bddda6..000000000000 Binary files a/.yarn/install-state.gz and /dev/null differ diff --git a/bootstrap.sh b/bootstrap.sh index ca7e7a55a2c4..fd806cbcf908 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -100,7 +100,7 @@ function install_hooks { echo "(cd barretenberg/cpp && ./format.sh staged)" >$hooks_dir/pre-commit echo "./yarn-project/precommit.sh" >>$hooks_dir/pre-commit echo "./noir-projects/precommit.sh" >>$hooks_dir/pre-commit - echo "./yarn-project/circuits.js/precommit.sh" >>$hooks_dir/pre-commit + echo "./yarn-project/constants/precommit.sh" >>$hooks_dir/pre-commit chmod +x $hooks_dir/pre-commit } diff --git a/playground/src/components/common/fnParameter.tsx b/playground/src/components/common/fnParameter.tsx index 67eab2bae064..dbbc170d52a3 100644 --- a/playground/src/components/common/fnParameter.tsx +++ b/playground/src/components/common/fnParameter.tsx @@ -3,7 +3,7 @@ import { type AbiType, isAddressStruct, isU128Struct, -} from "@aztec/foundation/abi"; +} from "@aztec/circuits.js/abi"; import { Autocomplete, CircularProgress, diff --git a/playground/src/components/contract/components/deployContractDialog.tsx b/playground/src/components/contract/components/deployContractDialog.tsx index 5ac010080416..165cdd6388f9 100644 --- a/playground/src/components/contract/components/deployContractDialog.tsx +++ b/playground/src/components/contract/components/deployContractDialog.tsx @@ -24,7 +24,7 @@ import { encodeArguments, getDefaultInitializer, getInitializer, -} from "@aztec/foundation/abi"; +} from "@aztec/circuits.js/abi"; import { AztecContext } from "../../../aztecEnv"; import { parseAliasedBuffersAsString } from "../../../utils/conversion"; import { FunctionParameter } from "../../common/fnParameter"; diff --git a/yarn-project/accounts/scripts/copy-contracts.sh b/yarn-project/accounts/scripts/copy-contracts.sh index d7f19e13c10c..a44b410b75d0 100755 --- a/yarn-project/accounts/scripts/copy-contracts.sh +++ b/yarn-project/accounts/scripts/copy-contracts.sh @@ -5,7 +5,7 @@ mkdir -p ./artifacts contracts=(schnorr_account_contract-SchnorrAccount ecdsa_k_account_contract-EcdsaKAccount ecdsa_r_account_contract-EcdsaRAccount schnorr_single_key_account_contract-SchnorrSingleKeyAccount) decl=$(cat < ./artifacts/${contract#*-}.d.json.ts -done \ No newline at end of file +done diff --git a/yarn-project/accounts/src/dapp/dapp_interface.ts b/yarn-project/accounts/src/dapp/dapp_interface.ts index 3752492d26c1..8d8aad37864d 100644 --- a/yarn-project/accounts/src/dapp/dapp_interface.ts +++ b/yarn-project/accounts/src/dapp/dapp_interface.ts @@ -1,5 +1,5 @@ import { type AccountWallet, type AuthWitnessProvider } from '@aztec/aztec.js'; -import { type AztecAddress, type CompleteAddress, type NodeInfo } from '@aztec/circuits.js'; +import type { AztecAddress, CompleteAddress, NodeInfo } from '@aztec/circuits.js'; import { DefaultDappEntrypoint } from '@aztec/entrypoints/dapp'; import { DefaultAccountInterface } from '../defaults/account_interface.js'; diff --git a/yarn-project/accounts/src/defaults/account_contract.ts b/yarn-project/accounts/src/defaults/account_contract.ts index e71238ef83e6..e0dc292d65c4 100644 --- a/yarn-project/accounts/src/defaults/account_contract.ts +++ b/yarn-project/accounts/src/defaults/account_contract.ts @@ -1,7 +1,7 @@ import { type AccountContract, type AccountInterface, type AuthWitnessProvider } from '@aztec/aztec.js/account'; import { type CompleteAddress } from '@aztec/circuit-types'; import { type NodeInfo } from '@aztec/circuits.js'; -import { type ContractArtifact } from '@aztec/foundation/abi'; +import { type ContractArtifact } from '@aztec/circuits.js/abi'; import { DefaultAccountInterface } from '../defaults/account_interface.js'; diff --git a/yarn-project/accounts/src/defaults/account_interface.ts b/yarn-project/accounts/src/defaults/account_interface.ts index 914d21d85ccf..4630d1bd3617 100644 --- a/yarn-project/accounts/src/defaults/account_interface.ts +++ b/yarn-project/accounts/src/defaults/account_interface.ts @@ -1,8 +1,9 @@ import { type AccountInterface, type AuthWitnessProvider } from '@aztec/aztec.js/account'; import { type EntrypointInterface, type ExecutionRequestInit } from '@aztec/aztec.js/entrypoint'; import { type AuthWitness, type TxExecutionRequest } from '@aztec/circuit-types'; -import { type AztecAddress, type CompleteAddress, Fr, type NodeInfo } from '@aztec/circuits.js'; +import { type AztecAddress, type CompleteAddress, type NodeInfo } from '@aztec/circuits.js'; import { DefaultAccountEntrypoint } from '@aztec/entrypoints/account'; +import { Fr } from '@aztec/foundation/fields'; /** * Default implementation for an account interface. Requires that the account uses the default diff --git a/yarn-project/accounts/src/ecdsa/ecdsa_k/account_contract.ts b/yarn-project/accounts/src/ecdsa/ecdsa_k/account_contract.ts index de1cfaca3b8d..872e042d903b 100644 --- a/yarn-project/accounts/src/ecdsa/ecdsa_k/account_contract.ts +++ b/yarn-project/accounts/src/ecdsa/ecdsa_k/account_contract.ts @@ -1,7 +1,7 @@ import { type AuthWitnessProvider } from '@aztec/aztec.js/account'; import { AuthWitness, type CompleteAddress } from '@aztec/circuit-types'; -import { Ecdsa } from '@aztec/circuits.js/barretenberg'; -import { type ContractArtifact } from '@aztec/foundation/abi'; +import { type ContractArtifact } from '@aztec/circuits.js/abi'; +import { Ecdsa } from '@aztec/foundation/crypto'; import { type Fr } from '@aztec/foundation/fields'; import { DefaultAccountContract } from '../../defaults/account_contract.js'; diff --git a/yarn-project/accounts/src/ecdsa/ecdsa_k/index.ts b/yarn-project/accounts/src/ecdsa/ecdsa_k/index.ts index ab35d9cb8b0c..1239b8763200 100644 --- a/yarn-project/accounts/src/ecdsa/ecdsa_k/index.ts +++ b/yarn-project/accounts/src/ecdsa/ecdsa_k/index.ts @@ -6,7 +6,7 @@ */ import { AccountManager, type Salt } from '@aztec/aztec.js/account'; import { type AccountWallet, getWallet } from '@aztec/aztec.js/wallet'; -import { type PXE } from '@aztec/circuit-types'; +import { type PXE } from '@aztec/circuit-types/interfaces/client'; import { type AztecAddress, type Fr } from '@aztec/circuits.js'; import { EcdsaKAccountContract } from './account_contract.js'; diff --git a/yarn-project/accounts/src/ecdsa/ssh_ecdsa_r/account_contract.ts b/yarn-project/accounts/src/ecdsa/ssh_ecdsa_r/account_contract.ts index f897a6e414f5..0ce499717ded 100644 --- a/yarn-project/accounts/src/ecdsa/ssh_ecdsa_r/account_contract.ts +++ b/yarn-project/accounts/src/ecdsa/ssh_ecdsa_r/account_contract.ts @@ -1,7 +1,7 @@ import { type AuthWitnessProvider } from '@aztec/aztec.js/account'; import { AuthWitness, type CompleteAddress } from '@aztec/circuit-types'; -import { EcdsaSignature } from '@aztec/circuits.js/barretenberg'; -import { type ContractArtifact } from '@aztec/foundation/abi'; +import { type ContractArtifact } from '@aztec/circuits.js/abi'; +import { EcdsaSignature } from '@aztec/foundation/crypto'; import { type Fr } from '@aztec/foundation/fields'; import { DefaultAccountContract } from '../../defaults/account_contract.js'; diff --git a/yarn-project/accounts/src/ecdsa/ssh_ecdsa_r/index.ts b/yarn-project/accounts/src/ecdsa/ssh_ecdsa_r/index.ts index 98d5fce02b95..e116c641b0ca 100644 --- a/yarn-project/accounts/src/ecdsa/ssh_ecdsa_r/index.ts +++ b/yarn-project/accounts/src/ecdsa/ssh_ecdsa_r/index.ts @@ -6,7 +6,7 @@ */ import { AccountManager, type Salt } from '@aztec/aztec.js/account'; import { type AccountWallet, getWallet } from '@aztec/aztec.js/wallet'; -import { type PXE } from '@aztec/circuit-types'; +import { type PXE } from '@aztec/circuit-types/interfaces/client'; import { type AztecAddress, type Fr } from '@aztec/circuits.js'; import { EcdsaRSSHAccountContract } from './account_contract.js'; diff --git a/yarn-project/accounts/src/schnorr/account_contract.ts b/yarn-project/accounts/src/schnorr/account_contract.ts index 0df543f001e1..20ee508acad3 100644 --- a/yarn-project/accounts/src/schnorr/account_contract.ts +++ b/yarn-project/accounts/src/schnorr/account_contract.ts @@ -1,9 +1,9 @@ import { getAccountContractAddress } from '@aztec/aztec.js'; import { type AuthWitnessProvider } from '@aztec/aztec.js/account'; import { AuthWitness, type CompleteAddress, type GrumpkinScalar } from '@aztec/circuit-types'; -import { Schnorr } from '@aztec/circuits.js/barretenberg'; +import { type ContractArtifact } from '@aztec/circuits.js/abi'; import { deriveSigningKey } from '@aztec/circuits.js/keys'; -import { type ContractArtifact } from '@aztec/foundation/abi'; +import { Schnorr } from '@aztec/foundation/crypto'; import { type Fr } from '@aztec/foundation/fields'; import { DefaultAccountContract } from '../defaults/account_contract.js'; diff --git a/yarn-project/accounts/src/schnorr/index.ts b/yarn-project/accounts/src/schnorr/index.ts index 9b93541650cc..02f711b40934 100644 --- a/yarn-project/accounts/src/schnorr/index.ts +++ b/yarn-project/accounts/src/schnorr/index.ts @@ -6,7 +6,8 @@ */ import { AccountManager, type Salt } from '@aztec/aztec.js/account'; import { type AccountWallet, type AccountWalletWithSecretKey, getWallet } from '@aztec/aztec.js/wallet'; -import { type GrumpkinScalar, type PXE } from '@aztec/circuit-types'; +import { type GrumpkinScalar } from '@aztec/circuit-types'; +import { type PXE } from '@aztec/circuit-types/interfaces/client'; import { type AztecAddress, type Fr } from '@aztec/circuits.js'; import { SchnorrAccountContract } from './account_contract.js'; diff --git a/yarn-project/accounts/src/single_key/account_contract.ts b/yarn-project/accounts/src/single_key/account_contract.ts index 39509a7d1dfd..960e4ce5f4de 100644 --- a/yarn-project/accounts/src/single_key/account_contract.ts +++ b/yarn-project/accounts/src/single_key/account_contract.ts @@ -1,7 +1,7 @@ import { type AuthWitnessProvider } from '@aztec/aztec.js/account'; import { AuthWitness, type CompleteAddress, type GrumpkinScalar } from '@aztec/circuit-types'; -import { Schnorr } from '@aztec/circuits.js/barretenberg'; -import { type ContractArtifact } from '@aztec/foundation/abi'; +import { type ContractArtifact } from '@aztec/circuits.js/abi'; +import { Schnorr } from '@aztec/foundation/crypto'; import { type Fr } from '@aztec/foundation/fields'; import { DefaultAccountContract } from '../defaults/account_contract.js'; diff --git a/yarn-project/accounts/src/single_key/index.ts b/yarn-project/accounts/src/single_key/index.ts index 3908156d75fb..a872a883ce67 100644 --- a/yarn-project/accounts/src/single_key/index.ts +++ b/yarn-project/accounts/src/single_key/index.ts @@ -6,8 +6,10 @@ */ import { AccountManager, type Salt } from '@aztec/aztec.js/account'; import { type AccountWallet, getWallet } from '@aztec/aztec.js/wallet'; -import { type GrumpkinScalar, type PXE } from '@aztec/circuit-types'; -import { type AztecAddress, type Fr, deriveMasterIncomingViewingSecretKey } from '@aztec/circuits.js'; +import { type GrumpkinScalar } from '@aztec/circuit-types'; +import { type PXE } from '@aztec/circuit-types/interfaces/client'; +import { type AztecAddress, type Fr } from '@aztec/circuits.js'; +import { deriveMasterIncomingViewingSecretKey } from '@aztec/circuits.js/keys'; import { SingleKeyAccountContract } from './account_contract.js'; diff --git a/yarn-project/accounts/src/testing/configuration.ts b/yarn-project/accounts/src/testing/configuration.ts index f47984fe7405..3c355807df25 100644 --- a/yarn-project/accounts/src/testing/configuration.ts +++ b/yarn-project/accounts/src/testing/configuration.ts @@ -1,5 +1,5 @@ +import { type PXE } from '@aztec/aztec.js'; import { type AccountWalletWithSecretKey } from '@aztec/aztec.js/wallet'; -import { type PXE } from '@aztec/circuit-types'; import { deriveMasterIncomingViewingSecretKey } from '@aztec/circuits.js/keys'; import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr, type GrumpkinScalar } from '@aztec/foundation/fields'; diff --git a/yarn-project/accounts/src/testing/create_account.ts b/yarn-project/accounts/src/testing/create_account.ts index 508dbe86fd9b..feaa530337b7 100644 --- a/yarn-project/accounts/src/testing/create_account.ts +++ b/yarn-project/accounts/src/testing/create_account.ts @@ -1,6 +1,6 @@ -import { type AccountManager, FeeJuicePaymentMethod, type WaitOpts } from '@aztec/aztec.js'; -import { type PXE } from '@aztec/circuit-types'; -import { Fr, deriveSigningKey } from '@aztec/circuits.js'; +import { type AccountManager, FeeJuicePaymentMethod, type PXE, type WaitOpts } from '@aztec/aztec.js'; +import { deriveSigningKey } from '@aztec/circuits.js/keys'; +import { Fr } from '@aztec/foundation/fields'; import { getSchnorrAccountContractAddress } from '../schnorr/account_contract.js'; import { getSchnorrAccount } from '../schnorr/index.js'; diff --git a/yarn-project/archiver/package.json b/yarn-project/archiver/package.json index 58e62db1693b..8e89335e86e8 100644 --- a/yarn-project/archiver/package.json +++ b/yarn-project/archiver/package.json @@ -68,6 +68,7 @@ "@aztec/blob-sink": "workspace:^", "@aztec/circuit-types": "workspace:^", "@aztec/circuits.js": "workspace:^", + "@aztec/constants": "workspace:^", "@aztec/ethereum": "workspace:^", "@aztec/foundation": "workspace:^", "@aztec/kv-store": "workspace:^", diff --git a/yarn-project/archiver/src/archiver/archiver.test.ts b/yarn-project/archiver/src/archiver/archiver.test.ts index 82d8b32072d0..f14de62a373c 100644 --- a/yarn-project/archiver/src/archiver/archiver.test.ts +++ b/yarn-project/archiver/src/archiver/archiver.test.ts @@ -1,7 +1,8 @@ import { Blob } from '@aztec/blob-lib'; import { type BlobSinkClientInterface } from '@aztec/blob-sink/client'; import { InboxLeaf, type L1RollupConstants, L2Block } from '@aztec/circuit-types'; -import { GENESIS_ARCHIVE_ROOT, PrivateLog } from '@aztec/circuits.js'; +import { PrivateLog } from '@aztec/circuits.js'; +import { GENESIS_ARCHIVE_ROOT } from '@aztec/constants'; import { DefaultL1ContractsConfig } from '@aztec/ethereum'; import { EthAddress } from '@aztec/foundation/eth-address'; import { Fr } from '@aztec/foundation/fields'; diff --git a/yarn-project/archiver/src/archiver/archiver_store.ts b/yarn-project/archiver/src/archiver/archiver_store.ts index 95e324095423..b82c9b2cf021 100644 --- a/yarn-project/archiver/src/archiver/archiver_store.ts +++ b/yarn-project/archiver/src/archiver/archiver_store.ts @@ -20,7 +20,7 @@ import { type PrivateLog, type UnconstrainedFunctionWithMembershipProof, } from '@aztec/circuits.js'; -import { type FunctionSelector } from '@aztec/foundation/abi'; +import { type FunctionSelector } from '@aztec/circuits.js/abi'; import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { type DataRetrieval } from './structs/data_retrieval.js'; diff --git a/yarn-project/archiver/src/archiver/archiver_store_test_suite.ts b/yarn-project/archiver/src/archiver/archiver_store_test_suite.ts index 39df377b9395..f8a42484201e 100644 --- a/yarn-project/archiver/src/archiver/archiver_store_test_suite.ts +++ b/yarn-project/archiver/src/archiver/archiver_store_test_suite.ts @@ -5,11 +5,6 @@ import { type ContractClassPublic, type ContractInstanceWithAddress, Fr, - INITIAL_L2_BLOCK_NUM, - L1_TO_L2_MSG_SUBTREE_HEIGHT, - MAX_NULLIFIERS_PER_TX, - PRIVATE_LOG_SIZE_IN_FIELDS, - PUBLIC_LOG_DATA_SIZE_IN_FIELDS, PrivateLog, PublicLog, SerializableContractInstance, @@ -20,6 +15,13 @@ import { makeExecutablePrivateFunctionWithMembershipProof, makeUnconstrainedFunctionWithMembershipProof, } from '@aztec/circuits.js/testing'; +import { + INITIAL_L2_BLOCK_NUM, + L1_TO_L2_MSG_SUBTREE_HEIGHT, + MAX_NULLIFIERS_PER_TX, + PRIVATE_LOG_SIZE_IN_FIELDS, + PUBLIC_LOG_DATA_SIZE_IN_FIELDS, +} from '@aztec/constants'; import { times, timesParallel } from '@aztec/foundation/collection'; import { randomInt } from '@aztec/foundation/crypto'; diff --git a/yarn-project/archiver/src/archiver/data_retrieval.ts b/yarn-project/archiver/src/archiver/data_retrieval.ts index e832e0befd93..930dea9ad54d 100644 --- a/yarn-project/archiver/src/archiver/data_retrieval.ts +++ b/yarn-project/archiver/src/archiver/data_retrieval.ts @@ -1,7 +1,8 @@ import { Blob, BlobDeserializationError } from '@aztec/blob-lib'; import { type BlobSinkClientInterface } from '@aztec/blob-sink/client'; import { Body, InboxLeaf, L2Block } from '@aztec/circuit-types'; -import { AppendOnlyTreeSnapshot, BlockHeader, Fr, Proof } from '@aztec/circuits.js'; +import { BlockHeader, Fr, Proof } from '@aztec/circuits.js'; +import { AppendOnlyTreeSnapshot } from '@aztec/circuits.js/trees'; import { asyncPool } from '@aztec/foundation/async-pool'; import { type EthAddress } from '@aztec/foundation/eth-address'; import { type ViemSignature } from '@aztec/foundation/eth-signature'; diff --git a/yarn-project/archiver/src/archiver/kv_archiver_store/block_store.ts b/yarn-project/archiver/src/archiver/kv_archiver_store/block_store.ts index 2cf6b46b3d39..b49ca5527f5b 100644 --- a/yarn-project/archiver/src/archiver/kv_archiver_store/block_store.ts +++ b/yarn-project/archiver/src/archiver/kv_archiver_store/block_store.ts @@ -1,5 +1,7 @@ import { Body, type InBlock, L2Block, L2BlockHash, type TxEffect, type TxHash, TxReceipt } from '@aztec/circuit-types'; -import { AppendOnlyTreeSnapshot, type AztecAddress, BlockHeader, INITIAL_L2_BLOCK_NUM } from '@aztec/circuits.js'; +import { type AztecAddress, BlockHeader } from '@aztec/circuits.js'; +import { AppendOnlyTreeSnapshot } from '@aztec/circuits.js/trees'; +import { INITIAL_L2_BLOCK_NUM } from '@aztec/constants'; import { toArray } from '@aztec/foundation/iterable'; import { createLogger } from '@aztec/foundation/log'; import type { AztecAsyncKVStore, AztecAsyncMap, AztecAsyncSingleton, Range } from '@aztec/kv-store'; 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 8df0355bc907..5e72401c38e3 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 @@ -19,7 +19,7 @@ import { type PrivateLog, type UnconstrainedFunctionWithMembershipProof, } from '@aztec/circuits.js'; -import { FunctionSelector } from '@aztec/foundation/abi'; +import { FunctionSelector } from '@aztec/circuits.js/abi'; import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { toArray } from '@aztec/foundation/iterable'; import { createLogger } from '@aztec/foundation/log'; diff --git a/yarn-project/archiver/src/archiver/kv_archiver_store/log_store.ts b/yarn-project/archiver/src/archiver/kv_archiver_store/log_store.ts index 2c9d6d8a04a7..fae926bcd5ff 100644 --- a/yarn-project/archiver/src/archiver/kv_archiver_store/log_store.ts +++ b/yarn-project/archiver/src/archiver/kv_archiver_store/log_store.ts @@ -11,11 +11,7 @@ import { UnencryptedL2Log, } from '@aztec/circuit-types'; import { type Fr, PrivateLog, PublicLog } from '@aztec/circuits.js'; -import { - INITIAL_L2_BLOCK_NUM, - MAX_NOTE_HASHES_PER_TX, - PUBLIC_LOG_DATA_SIZE_IN_FIELDS, -} from '@aztec/circuits.js/constants'; +import { INITIAL_L2_BLOCK_NUM, MAX_NOTE_HASHES_PER_TX, PUBLIC_LOG_DATA_SIZE_IN_FIELDS } from '@aztec/constants'; import { createLogger } from '@aztec/foundation/log'; import { BufferReader, numToUInt32BE } from '@aztec/foundation/serialize'; import type { AztecAsyncKVStore, AztecAsyncMap } from '@aztec/kv-store'; diff --git a/yarn-project/archiver/src/archiver/kv_archiver_store/message_store.ts b/yarn-project/archiver/src/archiver/kv_archiver_store/message_store.ts index 2b0be80df61c..7ba77d2d90c7 100644 --- a/yarn-project/archiver/src/archiver/kv_archiver_store/message_store.ts +++ b/yarn-project/archiver/src/archiver/kv_archiver_store/message_store.ts @@ -1,5 +1,6 @@ import { InboxLeaf } from '@aztec/circuit-types'; -import { Fr, L1_TO_L2_MSG_SUBTREE_HEIGHT } from '@aztec/circuits.js'; +import { Fr } from '@aztec/circuits.js'; +import { L1_TO_L2_MSG_SUBTREE_HEIGHT } from '@aztec/constants'; import { createLogger } from '@aztec/foundation/log'; import type { AztecAsyncKVStore, AztecAsyncMap, AztecAsyncSingleton } from '@aztec/kv-store'; diff --git a/yarn-project/archiver/src/archiver/kv_archiver_store/nullifier_store.ts b/yarn-project/archiver/src/archiver/kv_archiver_store/nullifier_store.ts index 1f70bd14a0cd..706844ceb308 100644 --- a/yarn-project/archiver/src/archiver/kv_archiver_store/nullifier_store.ts +++ b/yarn-project/archiver/src/archiver/kv_archiver_store/nullifier_store.ts @@ -1,5 +1,6 @@ import { type InBlock, type L2Block } from '@aztec/circuit-types'; -import { type Fr, MAX_NULLIFIERS_PER_TX } from '@aztec/circuits.js'; +import { type Fr } from '@aztec/circuits.js'; +import { MAX_NULLIFIERS_PER_TX } from '@aztec/constants'; import { createLogger } from '@aztec/foundation/log'; import type { AztecAsyncKVStore, AztecAsyncMap } from '@aztec/kv-store'; diff --git a/yarn-project/archiver/src/archiver/memory_archiver_store/l1_to_l2_message_store.test.ts b/yarn-project/archiver/src/archiver/memory_archiver_store/l1_to_l2_message_store.test.ts index ace754823820..60ff3f9cf18a 100644 --- a/yarn-project/archiver/src/archiver/memory_archiver_store/l1_to_l2_message_store.test.ts +++ b/yarn-project/archiver/src/archiver/memory_archiver_store/l1_to_l2_message_store.test.ts @@ -1,5 +1,5 @@ import { InboxLeaf } from '@aztec/circuit-types'; -import { INITIAL_L2_BLOCK_NUM, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/circuits.js'; +import { INITIAL_L2_BLOCK_NUM, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants'; import { Fr } from '@aztec/foundation/fields'; import { L1ToL2MessageStore } from './l1_to_l2_message_store.js'; diff --git a/yarn-project/archiver/src/archiver/memory_archiver_store/l1_to_l2_message_store.ts b/yarn-project/archiver/src/archiver/memory_archiver_store/l1_to_l2_message_store.ts index c33c841d8da4..0194e389aaeb 100644 --- a/yarn-project/archiver/src/archiver/memory_archiver_store/l1_to_l2_message_store.ts +++ b/yarn-project/archiver/src/archiver/memory_archiver_store/l1_to_l2_message_store.ts @@ -1,5 +1,5 @@ import { InboxLeaf } from '@aztec/circuit-types'; -import { L1_TO_L2_MSG_SUBTREE_HEIGHT } from '@aztec/circuits.js/constants'; +import { L1_TO_L2_MSG_SUBTREE_HEIGHT } from '@aztec/constants'; import { type Fr } from '@aztec/foundation/fields'; /** 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 c5b0381a38e7..5dba1cb4782b 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 @@ -24,15 +24,17 @@ import { type ContractInstanceWithAddress, type ExecutablePrivateFunctionWithMembershipProof, Fr, - INITIAL_L2_BLOCK_NUM, - MAX_NOTE_HASHES_PER_TX, - MAX_NULLIFIERS_PER_TX, - PUBLIC_LOG_DATA_SIZE_IN_FIELDS, type PrivateLog, type PublicLog, type UnconstrainedFunctionWithMembershipProof, } from '@aztec/circuits.js'; -import { FunctionSelector } from '@aztec/foundation/abi'; +import { FunctionSelector } from '@aztec/circuits.js/abi'; +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'; diff --git a/yarn-project/archiver/src/factory.ts b/yarn-project/archiver/src/factory.ts index cd1660a51825..6f9c0a7bd523 100644 --- a/yarn-project/archiver/src/factory.ts +++ b/yarn-project/archiver/src/factory.ts @@ -1,11 +1,12 @@ import { type BlobSinkClientInterface } from '@aztec/blob-sink/client'; -import { type ArchiverApi, type Service, getComponentsVersionsFromConfig } from '@aztec/circuit-types'; +import { getComponentsVersionsFromConfig } from '@aztec/circuit-types'; +import { type ArchiverApi, type Service } from '@aztec/circuit-types/interfaces/server'; import { type ContractClassPublic, computePublicBytecodeCommitment, getContractClassFromArtifact, } from '@aztec/circuits.js'; -import { FunctionType, decodeFunctionSignature } from '@aztec/foundation/abi'; +import { FunctionType, decodeFunctionSignature } from '@aztec/circuits.js/abi'; import { createLogger } from '@aztec/foundation/log'; import { type Maybe } from '@aztec/foundation/types'; import { type DataStoreConfig } from '@aztec/kv-store/config'; diff --git a/yarn-project/archiver/src/rpc/index.ts b/yarn-project/archiver/src/rpc/index.ts index c51da0a4335b..ae9051491a16 100644 --- a/yarn-project/archiver/src/rpc/index.ts +++ b/yarn-project/archiver/src/rpc/index.ts @@ -1,9 +1,5 @@ -import { - type ArchiverApi, - ArchiverApiSchema, - type ComponentsVersions, - getVersioningResponseHandler, -} from '@aztec/circuit-types'; +import { type ComponentsVersions, getVersioningResponseHandler } from '@aztec/circuit-types'; +import { type ArchiverApi, ArchiverApiSchema } from '@aztec/circuit-types/interfaces/server'; import { createSafeJsonRpcClient } from '@aztec/foundation/json-rpc/client'; import { createTracedJsonRpcServer, makeTracedFetch } from '@aztec/telemetry-client'; diff --git a/yarn-project/archiver/tsconfig.json b/yarn-project/archiver/tsconfig.json index 1b0928c365ed..62423ae6e0f3 100644 --- a/yarn-project/archiver/tsconfig.json +++ b/yarn-project/archiver/tsconfig.json @@ -18,6 +18,9 @@ { "path": "../circuits.js" }, + { + "path": "../constants" + }, { "path": "../ethereum" }, diff --git a/yarn-project/aztec-node/package.json b/yarn-project/aztec-node/package.json index b57833cd1f92..f381fd80140c 100644 --- a/yarn-project/aztec-node/package.json +++ b/yarn-project/aztec-node/package.json @@ -67,6 +67,7 @@ "@aztec/blob-sink": "workspace:^", "@aztec/circuit-types": "workspace:^", "@aztec/circuits.js": "workspace:^", + "@aztec/constants": "workspace:^", "@aztec/epoch-cache": "workspace:^", "@aztec/ethereum": "workspace:^", "@aztec/foundation": "workspace:^", diff --git a/yarn-project/aztec-node/src/aztec-node/http_rpc_server.ts b/yarn-project/aztec-node/src/aztec-node/http_rpc_server.ts index 04b21424e61b..27a000de140f 100644 --- a/yarn-project/aztec-node/src/aztec-node/http_rpc_server.ts +++ b/yarn-project/aztec-node/src/aztec-node/http_rpc_server.ts @@ -1,4 +1,4 @@ -import { type AztecNode, AztecNodeApiSchema } from '@aztec/circuit-types'; +import { type AztecNode, AztecNodeApiSchema } from '@aztec/circuit-types/interfaces/client'; import { createTracedJsonRpcServer } from '@aztec/telemetry-client'; /** diff --git a/yarn-project/aztec-node/src/aztec-node/server.test.ts b/yarn-project/aztec-node/src/aztec-node/server.test.ts index d1309b82e1ce..dea7ed4432ec 100644 --- a/yarn-project/aztec-node/src/aztec-node/server.test.ts +++ b/yarn-project/aztec-node/src/aztec-node/server.test.ts @@ -1,15 +1,14 @@ import { TestCircuitVerifier } from '@aztec/bb-prover'; import { - type AztecNode, type L1ToL2MessageSource, type L2BlockSource, type L2LogsSource, MerkleTreeId, - type MerkleTreeReadOperations, type NullifierWithBlockSource, - type WorldStateSynchronizer, - mockTx, } from '@aztec/circuit-types'; +import { type AztecNode } from '@aztec/circuit-types/interfaces/client'; +import { type MerkleTreeReadOperations, type WorldStateSynchronizer } from '@aztec/circuit-types/interfaces/server'; +import { mockTx } from '@aztec/circuit-types/testing'; import { AztecAddress, type ContractDataSource, @@ -17,9 +16,9 @@ import { Fr, GasFees, MaxBlockNumber, - PublicDataTreeLeafPreimage, RollupValidationRequests, } from '@aztec/circuits.js'; +import { PublicDataTreeLeafPreimage } from '@aztec/circuits.js/trees'; import { type P2P } from '@aztec/p2p'; import { computeFeePayerBalanceLeafSlot } from '@aztec/protocol-contracts/fee-juice'; import { type GlobalVariableBuilder } from '@aztec/sequencer-client'; diff --git a/yarn-project/aztec-node/src/aztec-node/server.ts b/yarn-project/aztec-node/src/aztec-node/server.ts index 8c07c81fdc6f..92a82847c55e 100644 --- a/yarn-project/aztec-node/src/aztec-node/server.ts +++ b/yarn-project/aztec-node/src/aztec-node/server.ts @@ -2,26 +2,19 @@ import { createArchiver } from '@aztec/archiver'; import { BBCircuitVerifier, TestCircuitVerifier } from '@aztec/bb-prover'; import { type BlobSinkClientInterface, createBlobSinkClient } from '@aztec/blob-sink/client'; import { - type AztecNode, - type ClientProtocolCircuitVerifier, type GetContractClassLogsResponse, type GetPublicLogsResponse, type InBlock, type L1ToL2MessageSource, type L2Block, - type L2BlockNumber, type L2BlockSource, type L2LogsSource, type LogFilter, MerkleTreeId, - NullifierMembershipWitness, type NullifierWithBlockSource, P2PClientType, - type ProverConfig, PublicDataWitness, PublicSimulationOutput, - type SequencerConfig, - type Service, SiblingPath, type Tx, type TxEffect, @@ -30,11 +23,17 @@ import { type TxScopedL2Log, TxStatus, type TxValidationResult, +} from '@aztec/circuit-types'; +import { type AztecNode, type L2BlockNumber, NullifierMembershipWitness } from '@aztec/circuit-types/interfaces/client'; +import { + type ClientProtocolCircuitVerifier, + type ProverConfig, + type SequencerConfig, + type Service, type WorldStateSynchronizer, tryStop, -} from '@aztec/circuit-types'; +} from '@aztec/circuit-types/interfaces/server'; import { - type ARCHIVE_HEIGHT, type BlockHeader, type ContractClassPublic, type ContractDataSource, @@ -42,20 +41,25 @@ import { EthAddress, Fr, type GasFees, - INITIAL_L2_BLOCK_NUM, - type L1_TO_L2_MSG_TREE_HEIGHT, - type NOTE_HASH_TREE_HEIGHT, - type NULLIFIER_TREE_HEIGHT, type NodeInfo, - type NullifierLeafPreimage, - type PUBLIC_DATA_TREE_HEIGHT, type PrivateLog, type ProtocolContractAddresses, +} from '@aztec/circuits.js'; +import { computePublicDataTreeLeafSlot, siloNullifier } from '@aztec/circuits.js/hash'; +import { + type NullifierLeafPreimage, type PublicDataTreeLeaf, type PublicDataTreeLeafPreimage, +} from '@aztec/circuits.js/trees'; +import { + type ARCHIVE_HEIGHT, + INITIAL_L2_BLOCK_NUM, + type L1_TO_L2_MSG_TREE_HEIGHT, + type NOTE_HASH_TREE_HEIGHT, + type NULLIFIER_TREE_HEIGHT, + type PUBLIC_DATA_TREE_HEIGHT, REGISTERER_CONTRACT_ADDRESS, -} from '@aztec/circuits.js'; -import { computePublicDataTreeLeafSlot, siloNullifier } from '@aztec/circuits.js/hash'; +} from '@aztec/constants'; import { EpochCache } from '@aztec/epoch-cache'; import { type L1ContractAddresses, createEthereumChain } from '@aztec/ethereum'; import { AztecAddress } from '@aztec/foundation/aztec-address'; diff --git a/yarn-project/aztec-node/tsconfig.json b/yarn-project/aztec-node/tsconfig.json index be7bdcc3550d..94cbdab5df41 100644 --- a/yarn-project/aztec-node/tsconfig.json +++ b/yarn-project/aztec-node/tsconfig.json @@ -21,6 +21,9 @@ { "path": "../circuits.js" }, + { + "path": "../constants" + }, { "path": "../epoch-cache" }, diff --git a/yarn-project/aztec.js/package.json b/yarn-project/aztec.js/package.json index b79acbc5353e..64ca7bc153a8 100644 --- a/yarn-project/aztec.js/package.json +++ b/yarn-project/aztec.js/package.json @@ -80,6 +80,7 @@ "dependencies": { "@aztec/circuit-types": "workspace:^", "@aztec/circuits.js": "workspace:^", + "@aztec/constants": "workspace:^", "@aztec/ethereum": "workspace:^", "@aztec/foundation": "workspace:^", "@aztec/l1-artifacts": "workspace:^", diff --git a/yarn-project/aztec.js/src/account/contract.ts b/yarn-project/aztec.js/src/account/contract.ts index 9e6e89fae7e5..1559e704cbf9 100644 --- a/yarn-project/aztec.js/src/account/contract.ts +++ b/yarn-project/aztec.js/src/account/contract.ts @@ -1,6 +1,8 @@ -import { type CompleteAddress } from '@aztec/circuit-types'; -import { type Fr, type NodeInfo, deriveKeys, getContractInstanceFromDeployParams } from '@aztec/circuits.js'; -import { type ContractArtifact } from '@aztec/foundation/abi'; +import type { CompleteAddress, NodeInfo } from '@aztec/circuits.js'; +import { type ContractArtifact } from '@aztec/circuits.js/abi'; +import { getContractInstanceFromDeployParams } from '@aztec/circuits.js/contract'; +import { deriveKeys } from '@aztec/circuits.js/keys'; +import { Fr } from '@aztec/foundation/fields'; import { type AccountInterface, type AuthWitnessProvider } from './interface.js'; diff --git a/yarn-project/aztec.js/src/account/wallet.ts b/yarn-project/aztec.js/src/account/wallet.ts index 3d7a2b7407a4..138b5d0b194f 100644 --- a/yarn-project/aztec.js/src/account/wallet.ts +++ b/yarn-project/aztec.js/src/account/wallet.ts @@ -1,4 +1,5 @@ -import { type AuthWitness, type PXE } from '@aztec/circuit-types'; +import { type AuthWitness } from '@aztec/circuit-types'; +import { type PXE } from '@aztec/circuit-types/interfaces/client'; import { type IntentAction, type IntentInnerHash } from '../utils/authwit.js'; import { type AccountInterface } from './interface.js'; diff --git a/yarn-project/aztec.js/src/account_manager/deploy_account_method.ts b/yarn-project/aztec.js/src/account_manager/deploy_account_method.ts index 3e80ae202581..7c70b1d6fff0 100644 --- a/yarn-project/aztec.js/src/account_manager/deploy_account_method.ts +++ b/yarn-project/aztec.js/src/account_manager/deploy_account_method.ts @@ -5,7 +5,7 @@ import { FunctionSelector, encodeArguments, getFunctionArtifactByName, -} from '@aztec/foundation/abi'; +} from '@aztec/circuits.js/abi'; import { type AuthWitnessProvider } from '../account/interface.js'; import { type Wallet } from '../account/wallet.js'; diff --git a/yarn-project/aztec.js/src/account_manager/deploy_account_sent_tx.ts b/yarn-project/aztec.js/src/account_manager/deploy_account_sent_tx.ts index 3ffdfe4ebaaf..f172ee5b22b0 100644 --- a/yarn-project/aztec.js/src/account_manager/deploy_account_sent_tx.ts +++ b/yarn-project/aztec.js/src/account_manager/deploy_account_sent_tx.ts @@ -1,4 +1,5 @@ -import { type PXE, type TxHash, type TxReceipt } from '@aztec/circuit-types'; +import { type TxHash, type TxReceipt } from '@aztec/circuit-types'; +import { type PXE } from '@aztec/circuit-types/interfaces/client'; import { type FieldsOf } from '@aztec/foundation/types'; import { type Wallet } from '../account/index.js'; diff --git a/yarn-project/aztec.js/src/account_manager/index.ts b/yarn-project/aztec.js/src/account_manager/index.ts index 1cd30f5aa4ae..36f46ab16c94 100644 --- a/yarn-project/aztec.js/src/account_manager/index.ts +++ b/yarn-project/aztec.js/src/account_manager/index.ts @@ -1,5 +1,8 @@ -import { CompleteAddress, type PXE } from '@aztec/circuit-types'; -import { type ContractInstanceWithAddress, deriveKeys, getContractInstanceFromDeployParams } from '@aztec/circuits.js'; +import { CompleteAddress } from '@aztec/circuit-types'; +import { type PXE } from '@aztec/circuit-types/interfaces/client'; +import { type ContractInstanceWithAddress } from '@aztec/circuits.js'; +import { getContractInstanceFromDeployParams } from '@aztec/circuits.js/contract'; +import { deriveKeys } from '@aztec/circuits.js/keys'; import { Fr } from '@aztec/foundation/fields'; import { type AccountContract } from '../account/contract.js'; diff --git a/yarn-project/aztec.js/src/api/abi.ts b/yarn-project/aztec.js/src/api/abi.ts index 2f76188c5cde..64ca2a611f75 100644 --- a/yarn-project/aztec.js/src/api/abi.ts +++ b/yarn-project/aztec.js/src/api/abi.ts @@ -1,3 +1,10 @@ -export { type ContractArtifact, type FunctionArtifact, EventSelector, FunctionSelector } from '@aztec/foundation/abi'; -export { loadContractArtifact, contractArtifactToBuffer, contractArtifactFromBuffer } from '@aztec/types/abi'; -export { type NoirCompiledContract } from '@aztec/types/noir'; +export { + type ContractArtifact, + type FunctionArtifact, + EventSelector, + FunctionSelector, + loadContractArtifact, + contractArtifactToBuffer, + contractArtifactFromBuffer, +} from '@aztec/circuits.js/abi'; +export { type NoirCompiledContract } from '@aztec/circuits.js/noir'; diff --git a/yarn-project/aztec.js/src/api/cheat_codes.ts b/yarn-project/aztec.js/src/api/cheat_codes.ts index 3a8c1cde9307..e373776c4bc1 100644 --- a/yarn-project/aztec.js/src/api/cheat_codes.ts +++ b/yarn-project/aztec.js/src/api/cheat_codes.ts @@ -1,4 +1,4 @@ -import { type PXE } from '@aztec/circuit-types'; +import { type PXE } from '@aztec/circuit-types/interfaces/client'; import { EthCheatCodes } from '@aztec/ethereum/eth-cheatcodes'; import { type L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses'; 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 6f159912f79f..238dc36dfc79 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,11 @@ -import { type PXE, type SiblingPath } from '@aztec/circuit-types'; -import { type AztecAddress, EthAddress, Fr } from '@aztec/circuits.js'; +import { type SiblingPath } from '@aztec/circuit-types'; +import { type PXE } from '@aztec/circuit-types/interfaces/client'; 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'; import { type Logger } from '@aztec/foundation/log'; import { FeeJuicePortalAbi, OutboxAbi, TestERC20Abi, TokenPortalAbi } from '@aztec/l1-artifacts'; diff --git a/yarn-project/aztec.js/src/api/interfaces/pxe.ts b/yarn-project/aztec.js/src/api/interfaces/pxe.ts index 296499ae9aee..333ff07a4936 100644 --- a/yarn-project/aztec.js/src/api/interfaces/pxe.ts +++ b/yarn-project/aztec.js/src/api/interfaces/pxe.ts @@ -1 +1 @@ -export type { PXE } from '@aztec/circuit-types/interfaces'; +export type { PXE } from '@aztec/circuit-types/interfaces/client'; diff --git a/yarn-project/aztec.js/src/contract/batch_call.ts b/yarn-project/aztec.js/src/contract/batch_call.ts index 462083a1c99b..5e05d3675c3f 100644 --- a/yarn-project/aztec.js/src/contract/batch_call.ts +++ b/yarn-project/aztec.js/src/contract/batch_call.ts @@ -1,5 +1,5 @@ import { type FunctionCall, type TxExecutionRequest } from '@aztec/circuit-types'; -import { FunctionType, decodeFromAbi } from '@aztec/foundation/abi'; +import { FunctionType, decodeFromAbi } from '@aztec/circuits.js/abi'; import { type Wallet } from '../account/index.js'; import { BaseContractInteraction, type SendMethodOptions } from './base_contract_interaction.js'; diff --git a/yarn-project/aztec.js/src/contract/checker.ts b/yarn-project/aztec.js/src/contract/checker.ts index e6c449cfb750..68690682910a 100644 --- a/yarn-project/aztec.js/src/contract/checker.ts +++ b/yarn-project/aztec.js/src/contract/checker.ts @@ -1,4 +1,4 @@ -import { type AbiType, type BasicType, type ContractArtifact, type StructType } from '@aztec/foundation/abi'; +import { type AbiType, type BasicType, type ContractArtifact, type StructType } from '@aztec/circuits.js/abi'; /** * Represents a type derived from input type T with the 'kind' property removed. diff --git a/yarn-project/aztec.js/src/contract/contract.test.ts b/yarn-project/aztec.js/src/contract/contract.test.ts index 191dff629a14..60023e4b5bb4 100644 --- a/yarn-project/aztec.js/src/contract/contract.test.ts +++ b/yarn-project/aztec.js/src/contract/contract.test.ts @@ -15,8 +15,8 @@ import { type NodeInfo, getContractClassFromArtifact, } from '@aztec/circuits.js'; +import { type AbiDecoded, type ContractArtifact, FunctionType } from '@aztec/circuits.js/abi'; import { type L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses'; -import { type AbiDecoded, type ContractArtifact, FunctionType } from '@aztec/foundation/abi'; import { type MockProxy, mock } from 'jest-mock-extended'; diff --git a/yarn-project/aztec.js/src/contract/contract.ts b/yarn-project/aztec.js/src/contract/contract.ts index 71d61dee8bce..93bc2042e7ad 100644 --- a/yarn-project/aztec.js/src/contract/contract.ts +++ b/yarn-project/aztec.js/src/contract/contract.ts @@ -1,5 +1,5 @@ import { PublicKeys, getContractClassFromArtifact } from '@aztec/circuits.js'; -import { type ContractArtifact } from '@aztec/foundation/abi'; +import { type ContractArtifact } from '@aztec/circuits.js/abi'; import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { type Wallet } from '../account/index.js'; diff --git a/yarn-project/aztec.js/src/contract/contract_base.ts b/yarn-project/aztec.js/src/contract/contract_base.ts index 5d0ef204b583..9a4d0ce57d26 100644 --- a/yarn-project/aztec.js/src/contract/contract_base.ts +++ b/yarn-project/aztec.js/src/contract/contract_base.ts @@ -1,11 +1,11 @@ -import { type ContractInstanceWithAddress, computePartialAddress } from '@aztec/circuits.js'; import { type ContractArtifact, type ContractNote, type FieldLayout, type FunctionArtifact, FunctionSelector, -} from '@aztec/foundation/abi'; +} from '@aztec/circuits.js/abi'; +import { type ContractInstanceWithAddress, computePartialAddress } from '@aztec/circuits.js/contract'; import { type Wallet } from '../account/index.js'; import { ContractFunctionInteraction } from './contract_function_interaction.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 b15016558f9a..5e8def9a1b19 100644 --- a/yarn-project/aztec.js/src/contract/contract_function_interaction.ts +++ b/yarn-project/aztec.js/src/contract/contract_function_interaction.ts @@ -1,12 +1,13 @@ -import type { FunctionCall, PrivateKernelProverProfileResult, TxExecutionRequest } from '@aztec/circuit-types'; -import { AztecAddress } from '@aztec/circuits.js'; +import type { FunctionCall, TxExecutionRequest } from '@aztec/circuit-types'; +import type { PrivateKernelProverProfileResult } from '@aztec/circuit-types/interfaces/client'; import { type FunctionAbi, FunctionSelector, FunctionType, decodeFromAbi, encodeArguments, -} from '@aztec/foundation/abi'; +} from '@aztec/circuits.js/abi'; +import { AztecAddress } from '@aztec/foundation/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_method.ts b/yarn-project/aztec.js/src/contract/deploy_method.ts index 3c32b5d73f2a..997a7912614c 100644 --- a/yarn-project/aztec.js/src/contract/deploy_method.ts +++ b/yarn-project/aztec.js/src/contract/deploy_method.ts @@ -7,7 +7,7 @@ import { getContractClassFromArtifact, getContractInstanceFromDeployParams, } from '@aztec/circuits.js'; -import { type ContractArtifact, type FunctionArtifact, getInitializer } from '@aztec/foundation/abi'; +import { type ContractArtifact, type FunctionArtifact, getInitializer } from '@aztec/circuits.js/abi'; import { type Fr } from '@aztec/foundation/fields'; import { type Wallet } from '../account/index.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 e07f7c1e0f33..0f9e831fb404 100644 --- a/yarn-project/aztec.js/src/contract/deploy_proven_tx.ts +++ b/yarn-project/aztec.js/src/contract/deploy_proven_tx.ts @@ -1,5 +1,7 @@ -import { type PXE, type Tx } from '@aztec/circuit-types'; -import { type AztecAddress, type ContractInstanceWithAddress } from '@aztec/circuits.js'; +import { type Tx } from '@aztec/circuit-types'; +import { type PXE } from '@aztec/circuit-types/interfaces/client'; +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/contract/deploy_sent_tx.ts b/yarn-project/aztec.js/src/contract/deploy_sent_tx.ts index fb87f00f2c45..c479f2ae9cae 100644 --- a/yarn-project/aztec.js/src/contract/deploy_sent_tx.ts +++ b/yarn-project/aztec.js/src/contract/deploy_sent_tx.ts @@ -1,4 +1,5 @@ -import { type PXE, type TxHash, type TxReceipt } from '@aztec/circuit-types'; +import { type TxHash, type TxReceipt } from '@aztec/circuit-types'; +import { type PXE } from '@aztec/circuit-types/interfaces/client'; import { type AztecAddress, type ContractInstanceWithAddress } from '@aztec/circuits.js'; import { createLogger } from '@aztec/foundation/log'; import { type FieldsOf } from '@aztec/foundation/types'; diff --git a/yarn-project/aztec.js/src/contract/get_gas_limits.test.ts b/yarn-project/aztec.js/src/contract/get_gas_limits.test.ts index 610d0f0e51e6..71c30c860264 100644 --- a/yarn-project/aztec.js/src/contract/get_gas_limits.test.ts +++ b/yarn-project/aztec.js/src/contract/get_gas_limits.test.ts @@ -1,4 +1,5 @@ -import { type TxSimulationResult, mockSimulatedTx, mockTxForRollup } from '@aztec/circuit-types'; +import { type TxSimulationResult } from '@aztec/circuit-types'; +import { mockSimulatedTx, mockTxForRollup } from '@aztec/circuit-types/testing'; import { Gas } from '@aztec/circuits.js'; import { getGasLimits } from './get_gas_limits.js'; diff --git a/yarn-project/aztec.js/src/contract/proven_tx.ts b/yarn-project/aztec.js/src/contract/proven_tx.ts index b024d4ca86ed..c1efb94c3b3e 100644 --- a/yarn-project/aztec.js/src/contract/proven_tx.ts +++ b/yarn-project/aztec.js/src/contract/proven_tx.ts @@ -1,4 +1,5 @@ -import { type PXE, Tx } from '@aztec/circuit-types'; +import { Tx } from '@aztec/circuit-types'; +import { type PXE } from '@aztec/circuit-types/interfaces/client'; import { type Wallet } from '../account/index.js'; import { SentTx } from './sent_tx.js'; diff --git a/yarn-project/aztec.js/src/contract/sent_tx.test.ts b/yarn-project/aztec.js/src/contract/sent_tx.test.ts index 2d03462f19f3..d9269dca70af 100644 --- a/yarn-project/aztec.js/src/contract/sent_tx.test.ts +++ b/yarn-project/aztec.js/src/contract/sent_tx.test.ts @@ -1,4 +1,5 @@ -import { type PXE, TxHash, type TxReceipt, TxStatus } from '@aztec/circuit-types'; +import { TxHash, type TxReceipt, TxStatus } from '@aztec/circuit-types'; +import { type PXE } from '@aztec/circuit-types/interfaces/client'; import { Fr } from '@aztec/circuits.js'; import { type MockProxy, mock } from 'jest-mock-extended'; diff --git a/yarn-project/aztec.js/src/contract/sent_tx.ts b/yarn-project/aztec.js/src/contract/sent_tx.ts index 6d9ad2ddc32d..9c50b8d0c429 100644 --- a/yarn-project/aztec.js/src/contract/sent_tx.ts +++ b/yarn-project/aztec.js/src/contract/sent_tx.ts @@ -1,4 +1,5 @@ -import { type GetPublicLogsResponse, type PXE, type TxHash, type TxReceipt, TxStatus } from '@aztec/circuit-types'; +import { type GetPublicLogsResponse, type TxHash, type TxReceipt, TxStatus } from '@aztec/circuit-types'; +import { type PXE } from '@aztec/circuit-types/interfaces/client'; import { retryUntil } from '@aztec/foundation/retry'; import { type FieldsOf } from '@aztec/foundation/types'; diff --git a/yarn-project/aztec.js/src/contract/unsafe_contract.ts b/yarn-project/aztec.js/src/contract/unsafe_contract.ts index b848e1079864..4f8981391448 100644 --- a/yarn-project/aztec.js/src/contract/unsafe_contract.ts +++ b/yarn-project/aztec.js/src/contract/unsafe_contract.ts @@ -1,5 +1,5 @@ -import { type ContractInstanceWithAddress } from '@aztec/circuits.js'; -import { type ContractArtifact } from '@aztec/foundation/abi'; +import { type ContractArtifact } from '@aztec/circuits.js/abi'; +import { type ContractInstanceWithAddress } from '@aztec/circuits.js/contract'; import { type Wallet } from '../wallet/index.js'; import { ContractBase } from './contract_base.js'; diff --git a/yarn-project/aztec.js/src/deployment/broadcast_function.ts b/yarn-project/aztec.js/src/deployment/broadcast_function.ts index 0b5e06c7d4ad..e447d3602284 100644 --- a/yarn-project/aztec.js/src/deployment/broadcast_function.ts +++ b/yarn-project/aztec.js/src/deployment/broadcast_function.ts @@ -1,14 +1,16 @@ import { Capsule } from '@aztec/circuit-types'; +import { type ContractArtifact, FunctionSelector, FunctionType, bufferAsFields } from '@aztec/circuits.js/abi'; import { - ARTIFACT_FUNCTION_TREE_MAX_HEIGHT, - MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS, - REGISTERER_CONTRACT_BYTECODE_CAPSULE_SLOT, computeVerificationKeyHash, createPrivateFunctionMembershipProof, createUnconstrainedFunctionMembershipProof, getContractClassFromArtifact, -} from '@aztec/circuits.js'; -import { type ContractArtifact, FunctionSelector, FunctionType, bufferAsFields } from '@aztec/foundation/abi'; +} from '@aztec/circuits.js/contract'; +import { + ARTIFACT_FUNCTION_TREE_MAX_HEIGHT, + MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS, + REGISTERER_CONTRACT_BYTECODE_CAPSULE_SLOT, +} from '@aztec/constants'; import { padArrayEnd } from '@aztec/foundation/collection'; import { Fr } from '@aztec/foundation/fields'; import { ProtocolContractAddress } from '@aztec/protocol-contracts'; diff --git a/yarn-project/aztec.js/src/deployment/contract_deployer.ts b/yarn-project/aztec.js/src/deployment/contract_deployer.ts index f45dfd186e29..f48b63bdc65f 100644 --- a/yarn-project/aztec.js/src/deployment/contract_deployer.ts +++ b/yarn-project/aztec.js/src/deployment/contract_deployer.ts @@ -1,5 +1,5 @@ import { type AztecAddress, PublicKeys } from '@aztec/circuits.js'; -import { type ContractArtifact } from '@aztec/foundation/abi'; +import { type ContractArtifact } from '@aztec/circuits.js/abi'; import { type Wallet } from '../account/wallet.js'; import { Contract } from '../contract/contract.js'; diff --git a/yarn-project/aztec.js/src/deployment/deploy_instance.ts b/yarn-project/aztec.js/src/deployment/deploy_instance.ts index 4b49fbbfc8c7..093f5f4e8168 100644 --- a/yarn-project/aztec.js/src/deployment/deploy_instance.ts +++ b/yarn-project/aztec.js/src/deployment/deploy_instance.ts @@ -1,4 +1,4 @@ -import { type ContractInstanceWithAddress } from '@aztec/circuits.js'; +import { type ContractInstanceWithAddress } from '@aztec/circuits.js/contract'; import { type ContractFunctionInteraction } from '../contract/contract_function_interaction.js'; import { type Wallet } from '../wallet/index.js'; diff --git a/yarn-project/aztec.js/src/deployment/register_class.ts b/yarn-project/aztec.js/src/deployment/register_class.ts index 3a5ef7c19acf..39fff1cad317 100644 --- a/yarn-project/aztec.js/src/deployment/register_class.ts +++ b/yarn-project/aztec.js/src/deployment/register_class.ts @@ -1,11 +1,7 @@ import { Capsule } from '@aztec/circuit-types'; -import { - Fr, - MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS, - REGISTERER_CONTRACT_BYTECODE_CAPSULE_SLOT, - getContractClassFromArtifact, -} from '@aztec/circuits.js'; -import { type ContractArtifact, bufferAsFields } from '@aztec/foundation/abi'; +import { Fr, getContractClassFromArtifact } from '@aztec/circuits.js'; +import { type ContractArtifact, bufferAsFields } from '@aztec/circuits.js/abi'; +import { MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS, REGISTERER_CONTRACT_BYTECODE_CAPSULE_SLOT } from '@aztec/constants'; import { ProtocolContractAddress } from '@aztec/protocol-contracts'; import { type ContractFunctionInteraction } from '../contract/contract_function_interaction.js'; diff --git a/yarn-project/aztec.js/src/entrypoint/default_entrypoint.ts b/yarn-project/aztec.js/src/entrypoint/default_entrypoint.ts index 61ccf2fe2ad0..78bd3be70e28 100644 --- a/yarn-project/aztec.js/src/entrypoint/default_entrypoint.ts +++ b/yarn-project/aztec.js/src/entrypoint/default_entrypoint.ts @@ -1,6 +1,6 @@ import { HashedValues, TxExecutionRequest } from '@aztec/circuit-types'; import { TxContext } from '@aztec/circuits.js'; -import { FunctionType } from '@aztec/foundation/abi'; +import { FunctionType } from '@aztec/circuits.js/abi'; import { type EntrypointInterface, type ExecutionRequestInit } from './entrypoint.js'; diff --git a/yarn-project/aztec.js/src/entrypoint/default_multi_call_entrypoint.ts b/yarn-project/aztec.js/src/entrypoint/default_multi_call_entrypoint.ts index a7c3cec8bbf4..24af4a7275a2 100644 --- a/yarn-project/aztec.js/src/entrypoint/default_multi_call_entrypoint.ts +++ b/yarn-project/aztec.js/src/entrypoint/default_multi_call_entrypoint.ts @@ -1,6 +1,6 @@ import { HashedValues, TxExecutionRequest } from '@aztec/circuit-types'; import { type AztecAddress, TxContext } from '@aztec/circuits.js'; -import { type FunctionAbi, FunctionSelector, encodeArguments } from '@aztec/foundation/abi'; +import { type FunctionAbi, FunctionSelector, encodeArguments } from '@aztec/circuits.js/abi'; import { ProtocolContractAddress } from '@aztec/protocol-contracts'; import { type EntrypointInterface, EntrypointPayload, type ExecutionRequestInit } from './entrypoint.js'; diff --git a/yarn-project/aztec.js/src/entrypoint/payload.ts b/yarn-project/aztec.js/src/entrypoint/payload.ts index ca64245092c5..d4e6e83cedd9 100644 --- a/yarn-project/aztec.js/src/entrypoint/payload.ts +++ b/yarn-project/aztec.js/src/entrypoint/payload.ts @@ -1,6 +1,7 @@ import { FunctionCall, HashedValues } from '@aztec/circuit-types'; -import { type AztecAddress, Fr, type GasSettings, GeneratorIndex } from '@aztec/circuits.js'; -import { FunctionType } from '@aztec/foundation/abi'; +import { type AztecAddress, Fr, type GasSettings } from '@aztec/circuits.js'; +import { FunctionType } from '@aztec/circuits.js/abi'; +import { GeneratorIndex } from '@aztec/constants'; import { padArrayEnd } from '@aztec/foundation/collection'; import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto'; import { type Tuple } from '@aztec/foundation/serialize'; diff --git a/yarn-project/aztec.js/src/fee/fee_juice_payment_method_with_claim.ts b/yarn-project/aztec.js/src/fee/fee_juice_payment_method_with_claim.ts index 40f6f26f2295..2095d73b0ea3 100644 --- a/yarn-project/aztec.js/src/fee/fee_juice_payment_method_with_claim.ts +++ b/yarn-project/aztec.js/src/fee/fee_juice_payment_method_with_claim.ts @@ -1,6 +1,6 @@ import { type FunctionCall } from '@aztec/circuit-types'; import { type AztecAddress, Fr, FunctionSelector } from '@aztec/circuits.js'; -import { FunctionType, U128 } from '@aztec/foundation/abi'; +import { FunctionType, U128 } from '@aztec/circuits.js/abi'; import { ProtocolContractAddress } from '@aztec/protocol-contracts'; import { getCanonicalFeeJuice } from '@aztec/protocol-contracts/fee-juice'; 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 db40ad162001..e8c899697813 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,6 +1,6 @@ import { type FunctionCall } from '@aztec/circuit-types'; import { type GasSettings } from '@aztec/circuits.js'; -import { FunctionSelector, FunctionType, U128 } from '@aztec/foundation/abi'; +import { FunctionSelector, FunctionType, U128 } from '@aztec/circuits.js/abi'; import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; 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 8d725d3e0ce1..161418328dd4 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,6 +1,6 @@ import { type FunctionCall } from '@aztec/circuit-types'; import { type GasSettings } from '@aztec/circuits.js'; -import { FunctionSelector, FunctionType, U128 } from '@aztec/foundation/abi'; +import { FunctionSelector, FunctionType, U128 } from '@aztec/circuits.js/abi'; import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; diff --git a/yarn-project/aztec.js/src/index.ts b/yarn-project/aztec.js/src/index.ts index 53aae9e7a654..e02b3b2fa945 100644 --- a/yarn-project/aztec.js/src/index.ts +++ b/yarn-project/aztec.js/src/index.ts @@ -22,7 +22,7 @@ export { ContractDeployer } from './deployment/index.js'; -export { NoteSelector } from '@aztec/foundation/abi'; +export { NoteSelector } from '@aztec/circuits.js/abi'; export { createCompatibleClient, createPXEClient } from './rpc_clients/index.js'; @@ -45,12 +45,13 @@ export { getContractInstanceFromDeployParams, GlobalVariables, GrumpkinScalar, - INITIAL_L2_BLOCK_NUM, type NodeInfo, Point, PublicKeys, } from '@aztec/circuits.js'; +export { INITIAL_L2_BLOCK_NUM } from '@aztec/constants'; + export { computeSecretHash } from '@aztec/circuits.js/hash'; export { @@ -60,8 +61,6 @@ export { deriveMasterNullifierSecretKey, } from '@aztec/circuits.js/keys'; -export { Grumpkin, Schnorr } from '@aztec/circuits.js/barretenberg'; - export { AuthWitness, Body, @@ -70,7 +69,6 @@ export { ContractClass2BlockL2Logs, EncryptedLogPayload, EventMetadata, - EventType, ExtendedNote, FunctionCall, getTimestampRangeForEpoch, @@ -84,7 +82,6 @@ export { LogId, MerkleTreeId, merkleTreeIds, - mockTx, Note, SiblingPath, Tx, @@ -97,15 +94,16 @@ export { type LogFilter, type PartialAddress, type PublicKey, - type PXE, } from '@aztec/circuit-types'; +export { type PXE, EventType } from '@aztec/circuit-types/interfaces/client'; + // TODO: These kinds of things have no place on our public api. // External devs will almost certainly have their own methods of doing these things. // If we want to use them in our own "aztec.js consuming code", import them from foundation as needed. -export { decodeFromAbi, encodeArguments, type AbiType } from '@aztec/foundation/abi'; +export { decodeFromAbi, encodeArguments, type AbiType } from '@aztec/circuits.js/abi'; export { toBigIntBE } from '@aztec/foundation/bigint-buffer'; -export { sha256 } from '@aztec/foundation/crypto'; +export { sha256, Grumpkin, Schnorr } from '@aztec/foundation/crypto'; export { makeFetch } from '@aztec/foundation/json-rpc/client'; export { retry, retryUntil } from '@aztec/foundation/retry'; export { to2Fields, toBigInt } from '@aztec/foundation/serialize'; diff --git a/yarn-project/aztec.js/src/rpc_clients/node/index.ts b/yarn-project/aztec.js/src/rpc_clients/node/index.ts index 2baede9b38e8..cc2da0f503db 100644 --- a/yarn-project/aztec.js/src/rpc_clients/node/index.ts +++ b/yarn-project/aztec.js/src/rpc_clients/node/index.ts @@ -1,4 +1,5 @@ -import { type ComponentsVersions, type PXE } from '@aztec/circuit-types'; +import { type ComponentsVersions } from '@aztec/circuit-types'; +import { type PXE } from '@aztec/circuit-types/interfaces/client'; import { jsonStringify } from '@aztec/foundation/json-rpc'; import { type Logger, createLogger } from '@aztec/foundation/log'; import { NoRetryError, makeBackoff, retry } from '@aztec/foundation/retry'; diff --git a/yarn-project/aztec.js/src/rpc_clients/pxe_client.ts b/yarn-project/aztec.js/src/rpc_clients/pxe_client.ts index fb32a4ee823e..f48cd83fc5bc 100644 --- a/yarn-project/aztec.js/src/rpc_clients/pxe_client.ts +++ b/yarn-project/aztec.js/src/rpc_clients/pxe_client.ts @@ -1,5 +1,5 @@ import { type ComponentsVersions, getVersioningResponseHandler } from '@aztec/circuit-types'; -import { type PXE, PXESchema } from '@aztec/circuit-types/interfaces'; +import { type PXE, PXESchema } from '@aztec/circuit-types/interfaces/client'; import { createSafeJsonRpcClient, makeFetch } from '@aztec/foundation/json-rpc/client'; import { protocolContractTreeRoot } from '@aztec/protocol-contracts'; diff --git a/yarn-project/aztec.js/src/utils/authwit.ts b/yarn-project/aztec.js/src/utils/authwit.ts index 0f2f17f563ec..f2788a46d8a8 100644 --- a/yarn-project/aztec.js/src/utils/authwit.ts +++ b/yarn-project/aztec.js/src/utils/authwit.ts @@ -1,5 +1,6 @@ import { type FunctionCall, HashedValues } from '@aztec/circuit-types'; -import { type AztecAddress, Fr, GeneratorIndex } from '@aztec/circuits.js'; +import { type AztecAddress, Fr } from '@aztec/circuits.js'; +import { GeneratorIndex } from '@aztec/constants'; import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto'; import { ContractFunctionInteraction } from '../contract/contract_function_interaction.js'; diff --git a/yarn-project/aztec.js/src/utils/aztec_cheatcodes.ts b/yarn-project/aztec.js/src/utils/aztec_cheatcodes.ts index 002a77a5cfd3..c4a778dc2568 100644 --- a/yarn-project/aztec.js/src/utils/aztec_cheatcodes.ts +++ b/yarn-project/aztec.js/src/utils/aztec_cheatcodes.ts @@ -1,4 +1,5 @@ -import { type Note, type PXE } from '@aztec/circuit-types'; +import { type Note } from '@aztec/circuit-types'; +import { type PXE } from '@aztec/circuit-types/interfaces/client'; import { type AztecAddress, Fr } from '@aztec/circuits.js'; import { deriveStorageSlotInMap } from '@aztec/circuits.js/hash'; import { createLogger } from '@aztec/foundation/log'; diff --git a/yarn-project/aztec.js/src/utils/node.ts b/yarn-project/aztec.js/src/utils/node.ts index 5ebf7a4649a5..34f2b82bb8ac 100644 --- a/yarn-project/aztec.js/src/utils/node.ts +++ b/yarn-project/aztec.js/src/utils/node.ts @@ -1,4 +1,4 @@ -import { type AztecNode } from '@aztec/circuit-types'; +import { type AztecNode } from '@aztec/circuit-types/interfaces/client'; import { type Logger } from '@aztec/foundation/log'; import { retryUntil } from '@aztec/foundation/retry'; @@ -16,4 +16,4 @@ export const waitForNode = async (node: AztecNode, logger?: Logger) => { }, 'RPC Get Node Info'); }; -export { createAztecNodeClient, type AztecNode } from '@aztec/circuit-types'; +export { createAztecNodeClient, type AztecNode } from '@aztec/circuit-types/interfaces/client'; diff --git a/yarn-project/aztec.js/src/utils/pub_key.ts b/yarn-project/aztec.js/src/utils/pub_key.ts index f61df0b154bd..213c76799c95 100644 --- a/yarn-project/aztec.js/src/utils/pub_key.ts +++ b/yarn-project/aztec.js/src/utils/pub_key.ts @@ -1,5 +1,5 @@ import { type GrumpkinScalar, type PublicKey } from '@aztec/circuits.js'; -import { Grumpkin } from '@aztec/circuits.js/barretenberg'; +import { Grumpkin } from '@aztec/foundation/crypto'; /** * Method for generating a public grumpkin key from a private key. diff --git a/yarn-project/aztec.js/src/utils/pxe.ts b/yarn-project/aztec.js/src/utils/pxe.ts index 2eb165411d23..6a3bc0c36679 100644 --- a/yarn-project/aztec.js/src/utils/pxe.ts +++ b/yarn-project/aztec.js/src/utils/pxe.ts @@ -1,4 +1,4 @@ -import { type PXE } from '@aztec/circuit-types'; +import { type PXE } from '@aztec/circuit-types/interfaces/client'; import { type Logger } from '@aztec/foundation/log'; import { retryUntil } from '@aztec/foundation/retry'; diff --git a/yarn-project/aztec.js/src/wallet/account_wallet.ts b/yarn-project/aztec.js/src/wallet/account_wallet.ts index 15136fb10d13..724133e213b7 100644 --- a/yarn-project/aztec.js/src/wallet/account_wallet.ts +++ b/yarn-project/aztec.js/src/wallet/account_wallet.ts @@ -1,6 +1,7 @@ -import { type AuthWitness, type PXE, type TxExecutionRequest } from '@aztec/circuit-types'; +import { type AuthWitness, type TxExecutionRequest } from '@aztec/circuit-types'; +import { type PXE } from '@aztec/circuit-types/interfaces/client'; import { type AztecAddress, Fr } from '@aztec/circuits.js'; -import { type ABIParameterVisibility, type FunctionAbi, FunctionType } from '@aztec/foundation/abi'; +import { type ABIParameterVisibility, type FunctionAbi, FunctionType } from '@aztec/circuits.js/abi'; import { ProtocolContractAddress } from '@aztec/protocol-contracts'; import { type AccountInterface } from '../account/interface.js'; diff --git a/yarn-project/aztec.js/src/wallet/account_wallet_with_private_key.ts b/yarn-project/aztec.js/src/wallet/account_wallet_with_private_key.ts index 1d72dfac5a3d..7ea96622a2d1 100644 --- a/yarn-project/aztec.js/src/wallet/account_wallet_with_private_key.ts +++ b/yarn-project/aztec.js/src/wallet/account_wallet_with_private_key.ts @@ -1,4 +1,4 @@ -import { type PXE } from '@aztec/circuit-types'; +import { type PXE } from '@aztec/circuit-types/interfaces/client'; import { type Fr, computeAddressSecret, deriveMasterIncomingViewingSecretKey } from '@aztec/circuits.js'; import { type Salt } from '../account/index.js'; diff --git a/yarn-project/aztec.js/src/wallet/base_wallet.ts b/yarn-project/aztec.js/src/wallet/base_wallet.ts index 986202c98ce6..c7e05f205bc5 100644 --- a/yarn-project/aztec.js/src/wallet/base_wallet.ts +++ b/yarn-project/aztec.js/src/wallet/base_wallet.ts @@ -1,17 +1,11 @@ import { type AuthWitness, - type ContractClassMetadata, - type ContractMetadata, - type EventMetadataDefinition, type ExtendedNote, type GetContractClassLogsResponse, type GetPublicLogsResponse, type L2Block, type LogFilter, type NotesFilter, - type PXE, - type PXEInfo, - type PrivateExecutionResult, type SiblingPath, type Tx, type TxExecutionRequest, @@ -21,18 +15,26 @@ import { type TxSimulationResult, type UniqueNote, } from '@aztec/circuit-types'; +import { + type ContractClassMetadata, + type ContractMetadata, + type EventMetadataDefinition, + type PXE, + type PXEInfo, + type PrivateExecutionResult, +} from '@aztec/circuit-types/interfaces/client'; import { type AztecAddress, type CompleteAddress, type ContractInstanceWithAddress, type Fr, type GasFees, - type L1_TO_L2_MSG_TREE_HEIGHT, type NodeInfo, type PartialAddress, type Point, } from '@aztec/circuits.js'; -import type { AbiDecoded, ContractArtifact } from '@aztec/foundation/abi'; +import type { AbiDecoded, ContractArtifact } from '@aztec/circuits.js/abi'; +import { type L1_TO_L2_MSG_TREE_HEIGHT } from '@aztec/constants'; import { type Wallet } from '../account/wallet.js'; import { type ExecutionRequestInit } from '../entrypoint/entrypoint.js'; diff --git a/yarn-project/aztec.js/src/wallet/index.ts b/yarn-project/aztec.js/src/wallet/index.ts index 443d83120255..30ac7f6c86da 100644 --- a/yarn-project/aztec.js/src/wallet/index.ts +++ b/yarn-project/aztec.js/src/wallet/index.ts @@ -1,4 +1,4 @@ -import { type PXE } from '@aztec/circuit-types/interfaces'; +import { type PXE } from '@aztec/circuit-types/interfaces/client'; import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { type AccountContract } from '../account/contract.js'; diff --git a/yarn-project/aztec.js/src/wallet/signerless_wallet.ts b/yarn-project/aztec.js/src/wallet/signerless_wallet.ts index 2912d65e1d14..4ccf7fbabd36 100644 --- a/yarn-project/aztec.js/src/wallet/signerless_wallet.ts +++ b/yarn-project/aztec.js/src/wallet/signerless_wallet.ts @@ -1,4 +1,5 @@ -import { type AuthWitness, type PXE, type TxExecutionRequest } from '@aztec/circuit-types'; +import { type AuthWitness, type TxExecutionRequest } from '@aztec/circuit-types'; +import { type PXE } from '@aztec/circuit-types/interfaces/client'; import { type CompleteAddress, type Fr } from '@aztec/circuits.js'; import { DefaultEntrypoint } from '../entrypoint/default_entrypoint.js'; diff --git a/yarn-project/aztec.js/tsconfig.json b/yarn-project/aztec.js/tsconfig.json index d404aff8c2f5..b38ebbb44a95 100644 --- a/yarn-project/aztec.js/tsconfig.json +++ b/yarn-project/aztec.js/tsconfig.json @@ -12,6 +12,9 @@ { "path": "../circuits.js" }, + { + "path": "../constants" + }, { "path": "../ethereum" }, diff --git a/yarn-project/aztec/package.json b/yarn-project/aztec/package.json index 7a11c30d8540..d35398a0e1ce 100644 --- a/yarn-project/aztec/package.json +++ b/yarn-project/aztec/package.json @@ -42,6 +42,7 @@ "@aztec/circuits.js": "workspace:^", "@aztec/cli": "workspace:^", "@aztec/cli-wallet": "workspace:^", + "@aztec/constants": "workspace:^", "@aztec/entrypoints": "workspace:^", "@aztec/ethereum": "workspace:^", "@aztec/foundation": "workspace:^", diff --git a/yarn-project/aztec/src/cli/aztec_start_action.ts b/yarn-project/aztec/src/cli/aztec_start_action.ts index 6fceb30ca33e..680710bad112 100644 --- a/yarn-project/aztec/src/cli/aztec_start_action.ts +++ b/yarn-project/aztec/src/cli/aztec_start_action.ts @@ -1,5 +1,6 @@ -import { AztecNodeApiSchema, PXESchema, getVersioningMiddleware } from '@aztec/circuit-types'; +import { getVersioningMiddleware } from '@aztec/circuit-types'; import { type ChainConfig } from '@aztec/circuit-types/config'; +import { AztecNodeApiSchema, PXESchema } from '@aztec/circuit-types/interfaces/client'; import { type NamespacedApiHandlers, createNamespacedSafeJsonRpcServer, diff --git a/yarn-project/aztec/src/cli/cmds/start_archiver.ts b/yarn-project/aztec/src/cli/cmds/start_archiver.ts index 6468f2bd638b..5d561698902e 100644 --- a/yarn-project/aztec/src/cli/cmds/start_archiver.ts +++ b/yarn-project/aztec/src/cli/cmds/start_archiver.ts @@ -7,7 +7,7 @@ import { } from '@aztec/archiver'; import { createLogger } from '@aztec/aztec.js'; import { createBlobSinkClient } from '@aztec/blob-sink/client'; -import { ArchiverApiSchema } from '@aztec/circuit-types'; +import { ArchiverApiSchema } from '@aztec/circuit-types/interfaces/server'; import { type NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server'; import { type DataStoreConfig, dataConfigMappings } from '@aztec/kv-store/config'; import { createStore } from '@aztec/kv-store/lmdb-v2'; diff --git a/yarn-project/aztec/src/cli/cmds/start_bot.ts b/yarn-project/aztec/src/cli/cmds/start_bot.ts index 2c6abf0d9f8a..487bc136571a 100644 --- a/yarn-project/aztec/src/cli/cmds/start_bot.ts +++ b/yarn-project/aztec/src/cli/cmds/start_bot.ts @@ -1,5 +1,5 @@ import { type BotConfig, BotRunner, botConfigMappings, getBotRunnerApiHandler } from '@aztec/bot'; -import { type AztecNode, type PXE } from '@aztec/circuit-types'; +import { type AztecNode, type PXE } from '@aztec/circuit-types/interfaces/client'; import { type NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server'; import { type LogFn } from '@aztec/foundation/log'; import { type TelemetryClient } from '@aztec/telemetry-client'; diff --git a/yarn-project/aztec/src/cli/cmds/start_node.ts b/yarn-project/aztec/src/cli/cmds/start_node.ts index 981c90799821..de600632d34b 100644 --- a/yarn-project/aztec/src/cli/cmds/start_node.ts +++ b/yarn-project/aztec/src/cli/cmds/start_node.ts @@ -1,6 +1,7 @@ import { getInitialTestAccounts } from '@aztec/accounts/testing'; import { aztecNodeConfigMappings, getConfigEnvVars as getNodeConfigEnvVars } from '@aztec/aztec-node'; -import { AztecNodeApiSchema, P2PApiSchema, type PXE } from '@aztec/circuit-types'; +import { AztecNodeApiSchema, type PXE } from '@aztec/circuit-types/interfaces/client'; +import { P2PApiSchema } from '@aztec/circuit-types/interfaces/server'; import { NULL_KEY } from '@aztec/ethereum'; import { type NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server'; import { type LogFn } from '@aztec/foundation/log'; diff --git a/yarn-project/aztec/src/cli/cmds/start_p2p_bootstrap.ts b/yarn-project/aztec/src/cli/cmds/start_p2p_bootstrap.ts index 5b7a79e908d9..06a050f5b4e7 100644 --- a/yarn-project/aztec/src/cli/cmds/start_p2p_bootstrap.ts +++ b/yarn-project/aztec/src/cli/cmds/start_p2p_bootstrap.ts @@ -1,4 +1,4 @@ -import { P2PBootstrapApiSchema } from '@aztec/circuit-types'; +import { P2PBootstrapApiSchema } from '@aztec/circuit-types/interfaces/server'; import { type NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server'; import { type LogFn, createLogger } from '@aztec/foundation/log'; import { createStore } from '@aztec/kv-store/lmdb-v2'; diff --git a/yarn-project/aztec/src/cli/cmds/start_prover_broker.ts b/yarn-project/aztec/src/cli/cmds/start_prover_broker.ts index e49add6359ec..8112021fe2bc 100644 --- a/yarn-project/aztec/src/cli/cmds/start_prover_broker.ts +++ b/yarn-project/aztec/src/cli/cmds/start_prover_broker.ts @@ -1,4 +1,4 @@ -import { type ProvingJobBroker } from '@aztec/circuit-types'; +import { type ProvingJobBroker } from '@aztec/circuit-types/interfaces/server'; import { type NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server'; import { type LogFn } from '@aztec/foundation/log'; import { diff --git a/yarn-project/aztec/src/cli/cmds/start_prover_node.ts b/yarn-project/aztec/src/cli/cmds/start_prover_node.ts index d537fef369c0..35f9c67539e9 100644 --- a/yarn-project/aztec/src/cli/cmds/start_prover_node.ts +++ b/yarn-project/aztec/src/cli/cmds/start_prover_node.ts @@ -1,5 +1,6 @@ import { getInitialTestAccounts } from '@aztec/accounts/testing'; -import { P2PApiSchema, ProverNodeApiSchema, type ProvingJobBroker, createAztecNodeClient } from '@aztec/circuit-types'; +import { createAztecNodeClient } from '@aztec/circuit-types/interfaces/client'; +import { P2PApiSchema, ProverNodeApiSchema, type ProvingJobBroker } from '@aztec/circuit-types/interfaces/server'; import { NULL_KEY } from '@aztec/ethereum'; import { type NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server'; import { Agent, makeUndiciFetch } from '@aztec/foundation/json-rpc/undici'; diff --git a/yarn-project/aztec/src/cli/cmds/start_pxe.ts b/yarn-project/aztec/src/cli/cmds/start_pxe.ts index f0986afc77a8..97fbf047544a 100644 --- a/yarn-project/aztec/src/cli/cmds/start_pxe.ts +++ b/yarn-project/aztec/src/cli/cmds/start_pxe.ts @@ -5,7 +5,7 @@ import { PublicKeys, getContractClassFromArtifact, } from '@aztec/aztec.js'; -import { type AztecNode, PXESchema, createAztecNodeClient } from '@aztec/circuit-types'; +import { type AztecNode, PXESchema, createAztecNodeClient } from '@aztec/circuit-types/interfaces/client'; import { getContractArtifact } from '@aztec/cli/cli-utils'; import { type NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server'; import { type LogFn } from '@aztec/foundation/log'; diff --git a/yarn-project/aztec/src/sandbox.ts b/yarn-project/aztec/src/sandbox.ts index 463183773ad2..031c56df5c31 100644 --- a/yarn-project/aztec/src/sandbox.ts +++ b/yarn-project/aztec/src/sandbox.ts @@ -4,14 +4,11 @@ import { deployFundedSchnorrAccounts, getInitialTestAccounts } from '@aztec/acco import { type AztecNodeConfig, AztecNodeService, getConfigEnvVars } from '@aztec/aztec-node'; import { AnvilTestWatcher, EthCheatCodes, SignerlessWallet, type Wallet } from '@aztec/aztec.js'; import { type BlobSinkClientInterface, createBlobSinkClient } from '@aztec/blob-sink/client'; -import { type AztecNode, type PXE } from '@aztec/circuit-types'; -import { - type ContractInstanceWithAddress, - type PublicDataTreeLeaf, - getContractInstanceFromDeployParams, -} from '@aztec/circuits.js'; -import { GENESIS_ARCHIVE_ROOT, GENESIS_BLOCK_HASH } from '@aztec/circuits.js/constants'; +import { type AztecNode, type PXE } from '@aztec/circuit-types/interfaces/client'; +import { type ContractInstanceWithAddress, getContractInstanceFromDeployParams } from '@aztec/circuits.js'; +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'; import { NULL_KEY, createEthereumChain, diff --git a/yarn-project/aztec/tsconfig.json b/yarn-project/aztec/tsconfig.json index 34b10c214c08..5a1ad95d66ea 100644 --- a/yarn-project/aztec/tsconfig.json +++ b/yarn-project/aztec/tsconfig.json @@ -45,6 +45,9 @@ { "path": "../cli-wallet" }, + { + "path": "../constants" + }, { "path": "../entrypoints" }, diff --git a/yarn-project/bb-prover/package.json b/yarn-project/bb-prover/package.json index e467a1afe4ac..56baa8ed2166 100644 --- a/yarn-project/bb-prover/package.json +++ b/yarn-project/bb-prover/package.json @@ -70,6 +70,7 @@ "@aztec/bb.js": "portal:../../barretenberg/ts", "@aztec/circuit-types": "workspace:^", "@aztec/circuits.js": "workspace:^", + "@aztec/constants": "workspace:^", "@aztec/foundation": "workspace:^", "@aztec/noir-protocol-circuits-types": "workspace:^", "@aztec/simulator": "workspace:^", 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 6833b8786f68..534292fe18f4 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,15 +1,13 @@ +import { type ContractClassPublic, type ContractInstanceWithAddress, FunctionSelector } from '@aztec/circuits.js'; +import { makeContractClassPublic, makeContractInstanceFromClassId } from '@aztec/circuits.js/testing'; import { - type ContractClassPublic, - type ContractInstanceWithAddress, - FunctionSelector, MAX_L2_TO_L1_MSGS_PER_TX, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, MAX_PUBLIC_LOGS_PER_TX, PUBLIC_DISPATCH_SELECTOR, -} from '@aztec/circuits.js'; -import { makeContractClassPublic, makeContractInstanceFromClassId } from '@aztec/circuits.js/testing'; +} from '@aztec/constants'; import { Fr } from '@aztec/foundation/fields'; import { AvmTestContractArtifact } from '@aztec/noir-contracts.js/AvmTest'; import { getAvmTestContractBytecode } from '@aztec/simulator/public/fixtures'; 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 7cdccc0adcb3..62d4ed1f7737 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 @@ -3,9 +3,9 @@ import { type ContractClassPublic, type ContractInstanceWithAddress, FunctionSelector, - PUBLIC_DISPATCH_SELECTOR, } from '@aztec/circuits.js'; import { makeContractClassPublic, makeContractInstanceFromClassId } from '@aztec/circuits.js/testing'; +import { PUBLIC_DISPATCH_SELECTOR } from '@aztec/constants'; import { Fr } from '@aztec/foundation/fields'; import { AvmTestContractArtifact } from '@aztec/noir-contracts.js/AvmTest'; import { getAvmTestContractBytecode } from '@aztec/simulator/public/fixtures'; 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 034c8b2dce2c..a4785595bebe 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 @@ -3,9 +3,9 @@ import { type ContractClassPublic, type ContractInstanceWithAddress, FunctionSelector, - PUBLIC_DISPATCH_SELECTOR, } from '@aztec/circuits.js'; import { makeContractClassPublic, makeContractInstanceFromClassId } from '@aztec/circuits.js/testing'; +import { PUBLIC_DISPATCH_SELECTOR } from '@aztec/constants'; import { Fr } from '@aztec/foundation/fields'; import { AvmTestContractArtifact } from '@aztec/noir-contracts.js/AvmTest'; import { getAvmTestContractBytecode } from '@aztec/simulator/public/fixtures'; diff --git a/yarn-project/bb-prover/src/avm_proving_tests/avm_contract_class_limits.test.ts b/yarn-project/bb-prover/src/avm_proving_tests/avm_contract_class_limits.test.ts index 98daadbc0a87..5ec83252d025 100644 --- a/yarn-project/bb-prover/src/avm_proving_tests/avm_contract_class_limits.test.ts +++ b/yarn-project/bb-prover/src/avm_proving_tests/avm_contract_class_limits.test.ts @@ -1,9 +1,6 @@ -import { - AztecAddress, - type ContractInstanceWithAddress, - MAX_PUBLIC_CALLS_TO_UNIQUE_CONTRACT_CLASS_IDS, -} from '@aztec/circuits.js'; +import { AztecAddress, type ContractInstanceWithAddress } from '@aztec/circuits.js'; import { makeContractInstanceFromClassId } from '@aztec/circuits.js/testing'; +import { MAX_PUBLIC_CALLS_TO_UNIQUE_CONTRACT_CLASS_IDS } from '@aztec/constants'; import { AvmTestContractArtifact } from '@aztec/noir-contracts.js/AvmTest'; import { AvmProvingTester } from './avm_proving_tester.js'; 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 04e21bd3b88e..07f9e55ba2a9 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 @@ -3,15 +3,15 @@ import { type ContractClassPublic, type ContractInstanceWithAddress, FunctionSelector, - PUBLIC_DISPATCH_SELECTOR, +} from '@aztec/circuits.js'; +import { deriveStorageSlotInMap } from '@aztec/circuits.js/hash'; +import { ScheduledDelayChange, ScheduledValueChange, - UPDATED_CLASS_IDS_SLOT, - UPDATES_SCHEDULED_VALUE_CHANGE_LEN, computeSharedMutableHashSlot, -} from '@aztec/circuits.js'; -import { deriveStorageSlotInMap } from '@aztec/circuits.js/hash'; +} from '@aztec/circuits.js/shared-mutable'; import { makeContractClassPublic, makeContractInstanceFromClassId } from '@aztec/circuits.js/testing'; +import { PUBLIC_DISPATCH_SELECTOR, UPDATED_CLASS_IDS_SLOT, UPDATES_SCHEDULED_VALUE_CHANGE_LEN } from '@aztec/constants'; import { poseidon2Hash } from '@aztec/foundation/crypto'; 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_and_verification.test.ts b/yarn-project/bb-prover/src/avm_proving_tests/avm_proving_and_verification.test.ts index 73298d5b9757..26d68473d59f 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,10 +1,6 @@ -import { - type ContractClassPublic, - type ContractInstanceWithAddress, - FunctionSelector, - PUBLIC_DISPATCH_SELECTOR, -} from '@aztec/circuits.js'; +import { type ContractClassPublic, type ContractInstanceWithAddress, FunctionSelector } from '@aztec/circuits.js'; import { makeContractClassPublic, makeContractInstanceFromClassId } from '@aztec/circuits.js/testing'; +import { PUBLIC_DISPATCH_SELECTOR } from '@aztec/constants'; import { Fr } from '@aztec/foundation/fields'; import { AvmTestContractArtifact } from '@aztec/noir-contracts.js/AvmTest'; import { getAvmTestContractBytecode } from '@aztec/simulator/public/fixtures'; 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 994f2fb34e03..ab7d14f06e68 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,5 +1,6 @@ -import { type MerkleTreeWriteOperations } from '@aztec/circuit-types'; -import { type AvmCircuitInputs, AztecAddress, VerificationKeyData } from '@aztec/circuits.js'; +import { type MerkleTreeWriteOperations } from '@aztec/circuit-types/interfaces/server'; +import { AztecAddress, VerificationKeyData } from '@aztec/circuits.js'; +import { type AvmCircuitInputs } from '@aztec/circuits.js/avm'; 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 90997ce9314b..5435902b50fe 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 @@ -3,9 +3,9 @@ import { type ContractClassPublic, type ContractInstanceWithAddress, FunctionSelector, - PUBLIC_DISPATCH_SELECTOR, } from '@aztec/circuits.js'; import { makeContractClassPublic, makeContractInstanceFromClassId } from '@aztec/circuits.js/testing'; +import { PUBLIC_DISPATCH_SELECTOR } from '@aztec/constants'; import { Fr } from '@aztec/foundation/fields'; import { AvmTestContractArtifact } from '@aztec/noir-contracts.js/AvmTest'; import { type ProtocolContract } from '@aztec/protocol-contracts'; 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 81901f2f9177..ee1245ce0a51 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 @@ -3,9 +3,9 @@ import { type ContractClassPublic, type ContractInstanceWithAddress, FunctionSelector, - PUBLIC_DISPATCH_SELECTOR, } from '@aztec/circuits.js'; import { makeContractClassPublic, makeContractInstanceFromClassId } from '@aztec/circuits.js/testing'; +import { PUBLIC_DISPATCH_SELECTOR } from '@aztec/constants'; import { Fr } from '@aztec/foundation/fields'; import { AvmTestContractArtifact } from '@aztec/noir-contracts.js/AvmTest'; import { getAvmTestContractBytecode } from '@aztec/simulator/public/fixtures'; diff --git a/yarn-project/bb-prover/src/bb/cli.ts b/yarn-project/bb-prover/src/bb/cli.ts index 1d382928df8d..c36d8a4ebb12 100644 --- a/yarn-project/bb-prover/src/bb/cli.ts +++ b/yarn-project/bb-prover/src/bb/cli.ts @@ -1,8 +1,8 @@ +import { type NoirCompiledCircuit } from '@aztec/circuits.js/noir'; import { type LogFn } from '@aztec/foundation/log'; import { ClientCircuitArtifacts } from '@aztec/noir-protocol-circuits-types/client/bundle'; import { ServerCircuitArtifacts } from '@aztec/noir-protocol-circuits-types/server'; import { type ProtocolArtifact } from '@aztec/noir-protocol-circuits-types/types'; -import { type NoirCompiledCircuit } from '@aztec/types/noir'; import { Command } from 'commander'; diff --git a/yarn-project/bb-prover/src/bb/execute.ts b/yarn-project/bb-prover/src/bb/execute.ts index 567b4f321122..6a1bfdf5e160 100644 --- a/yarn-project/bb-prover/src/bb/execute.ts +++ b/yarn-project/bb-prover/src/bb/execute.ts @@ -1,4 +1,4 @@ -import { type AvmCircuitInputs, serializeWithMessagePack } from '@aztec/circuits.js'; +import { type AvmCircuitInputs, serializeWithMessagePack } from '@aztec/circuits.js/avm'; import { sha256 } from '@aztec/foundation/crypto'; import { type LogFn, type Logger } from '@aztec/foundation/log'; import { Timer } from '@aztec/foundation/timer'; diff --git a/yarn-project/bb-prover/src/index.ts b/yarn-project/bb-prover/src/index.ts index 0ea93e762630..d1bd14b0f7f7 100644 --- a/yarn-project/bb-prover/src/index.ts +++ b/yarn-project/bb-prover/src/index.ts @@ -5,4 +5,4 @@ export * from './config.js'; export * from './bb/execute.js'; export * from './honk.js'; -export { type ClientProtocolCircuitVerifier } from '@aztec/circuit-types'; +export { type ClientProtocolCircuitVerifier } from '@aztec/circuit-types/interfaces/server'; diff --git a/yarn-project/bb-prover/src/prover/bb_private_kernel_prover.ts b/yarn-project/bb-prover/src/prover/bb_private_kernel_prover.ts index 320c07c09d85..8f49599f83c2 100644 --- a/yarn-project/bb-prover/src/prover/bb_private_kernel_prover.ts +++ b/yarn-project/bb-prover/src/prover/bb_private_kernel_prover.ts @@ -1,14 +1,15 @@ -import { type PrivateKernelProver, type PrivateKernelSimulateOutput } from '@aztec/circuit-types'; +import { type PrivateKernelProver, type PrivateKernelSimulateOutput } from '@aztec/circuit-types/interfaces/client'; import { type CircuitSimulationStats, type CircuitWitnessGenerationStats } from '@aztec/circuit-types/stats'; +import { type ClientIvcProof } from '@aztec/circuits.js'; import { - type ClientIvcProof, type PrivateKernelCircuitPublicInputs, type PrivateKernelInitCircuitPrivateInputs, type PrivateKernelInnerCircuitPrivateInputs, type PrivateKernelResetCircuitPrivateInputs, type PrivateKernelTailCircuitPrivateInputs, type PrivateKernelTailCircuitPublicInputs, -} from '@aztec/circuits.js'; +} from '@aztec/circuits.js/kernel'; +import { type NoirCompiledCircuit } from '@aztec/circuits.js/noir'; import { createLogger } from '@aztec/foundation/log'; import { Timer } from '@aztec/foundation/timer'; import { @@ -28,7 +29,6 @@ import { import { type ArtifactProvider, type ClientProtocolArtifact } from '@aztec/noir-protocol-circuits-types/types'; import { ClientCircuitVks } from '@aztec/noir-protocol-circuits-types/vks'; import { type SimulationProvider } from '@aztec/simulator/client'; -import { type NoirCompiledCircuit } from '@aztec/types/noir'; import { type Abi, type WitnessMap } from '@noir-lang/types'; diff --git a/yarn-project/bb-prover/src/prover/bb_prover.ts b/yarn-project/bb-prover/src/prover/bb_prover.ts index 602ba14e358b..594bd690126f 100644 --- a/yarn-project/bb-prover/src/prover/bb_prover.ts +++ b/yarn-project/bb-prover/src/prover/bb_prover.ts @@ -1,31 +1,24 @@ /* eslint-disable require-await */ +import { ProvingError } from '@aztec/circuit-types'; import { type ProofAndVerificationKey, - ProvingError, type PublicInputsAndRecursiveProof, type ServerCircuitProver, makeProofAndVerificationKey, makePublicInputsAndRecursiveProof, -} from '@aztec/circuit-types'; +} from '@aztec/circuit-types/interfaces/server'; import { type CircuitProvingStats, type CircuitWitnessGenerationStats } from '@aztec/circuit-types/stats'; import { - AGGREGATION_OBJECT_LENGTH, - AVM_PROOF_LENGTH_IN_FIELDS, - type AvmCircuitInputs, type BaseParityInputs, Fr, - IPA_CLAIM_LENGTH, - NESTED_RECURSIVE_PROOF_LENGTH, - NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, type ParityPublicInputs, Proof, - RECURSIVE_PROOF_LENGTH, RecursiveProof, type RootParityInputs, - TUBE_PROOF_LENGTH, type VerificationKeyData, makeRecursiveProofFromBinary, } from '@aztec/circuits.js'; +import { type AvmCircuitInputs } from '@aztec/circuits.js/avm'; import { type BaseOrMergeRollupPublicInputs, type BlockMergeRollupInputs, @@ -40,6 +33,15 @@ import { type SingleTxBlockRootRollupInputs, type TubeInputs, } from '@aztec/circuits.js/rollup'; +import { + AGGREGATION_OBJECT_LENGTH, + AVM_PROOF_LENGTH_IN_FIELDS, + IPA_CLAIM_LENGTH, + NESTED_RECURSIVE_PROOF_LENGTH, + NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, + RECURSIVE_PROOF_LENGTH, + TUBE_PROOF_LENGTH, +} from '@aztec/constants'; import { runInDirectory } from '@aztec/foundation/fs'; import { createLogger } from '@aztec/foundation/log'; import { BufferReader } from '@aztec/foundation/serialize'; diff --git a/yarn-project/bb-prover/src/test/test_circuit_prover.ts b/yarn-project/bb-prover/src/test/test_circuit_prover.ts index 04b4a77bfa01..ab898ab650a7 100644 --- a/yarn-project/bb-prover/src/test/test_circuit_prover.ts +++ b/yarn-project/bb-prover/src/test/test_circuit_prover.ts @@ -4,23 +4,17 @@ import { type ServerCircuitProver, makeProofAndVerificationKey, makePublicInputsAndRecursiveProof, -} from '@aztec/circuit-types'; +} from '@aztec/circuit-types/interfaces/server'; import { - AVM_PROOF_LENGTH_IN_FIELDS, - AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS, - type AvmCircuitInputs, type BaseParityInputs, - NESTED_RECURSIVE_PROOF_LENGTH, - NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, type ParityPublicInputs, type Proof, - RECURSIVE_PROOF_LENGTH, type RootParityInputs, - TUBE_PROOF_LENGTH, VerificationKeyData, makeEmptyRecursiveProof, makeRecursiveProof, } from '@aztec/circuits.js'; +import { type AvmCircuitInputs } from '@aztec/circuits.js/avm'; import { type BaseOrMergeRollupPublicInputs, type BlockMergeRollupInputs, @@ -35,6 +29,14 @@ import { type SingleTxBlockRootRollupInputs, type TubeInputs, } from '@aztec/circuits.js/rollup'; +import { + AVM_PROOF_LENGTH_IN_FIELDS, + AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS, + NESTED_RECURSIVE_PROOF_LENGTH, + NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, + RECURSIVE_PROOF_LENGTH, + TUBE_PROOF_LENGTH, +} from '@aztec/constants'; import { createLogger } from '@aztec/foundation/log'; import { sleep } from '@aztec/foundation/sleep'; import { Timer } from '@aztec/foundation/timer'; diff --git a/yarn-project/bb-prover/src/test/test_verifier.ts b/yarn-project/bb-prover/src/test/test_verifier.ts index f6c7a72e88f2..7720d0fdee39 100644 --- a/yarn-project/bb-prover/src/test/test_verifier.ts +++ b/yarn-project/bb-prover/src/test/test_verifier.ts @@ -1,4 +1,5 @@ -import { type ClientProtocolCircuitVerifier, type Tx } from '@aztec/circuit-types'; +import { type Tx } from '@aztec/circuit-types'; +import { type ClientProtocolCircuitVerifier } from '@aztec/circuit-types/interfaces/server'; export class TestCircuitVerifier implements ClientProtocolCircuitVerifier { verifyProof(_tx: Tx): Promise { diff --git a/yarn-project/bb-prover/src/verification_key/verification_key_data.ts b/yarn-project/bb-prover/src/verification_key/verification_key_data.ts index 7cad7b86401e..ac891217b46d 100644 --- a/yarn-project/bb-prover/src/verification_key/verification_key_data.ts +++ b/yarn-project/bb-prover/src/verification_key/verification_key_data.ts @@ -1,10 +1,6 @@ -import { - AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS, - Fr, - VerificationKeyAsFields, - VerificationKeyData, -} from '@aztec/circuits.js'; +import { Fr, VerificationKeyAsFields, VerificationKeyData } from '@aztec/circuits.js'; import { hashVK } from '@aztec/circuits.js/hash'; +import { AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS } from '@aztec/constants'; import { strict as assert } from 'assert'; import { promises as fs } from 'fs'; diff --git a/yarn-project/bb-prover/src/verifier/bb_verifier.ts b/yarn-project/bb-prover/src/verifier/bb_verifier.ts index 7fca42c7c472..ace85ac292a1 100644 --- a/yarn-project/bb-prover/src/verifier/bb_verifier.ts +++ b/yarn-project/bb-prover/src/verifier/bb_verifier.ts @@ -1,4 +1,5 @@ -import { type ClientProtocolCircuitVerifier, Tx } from '@aztec/circuit-types'; +import { Tx } from '@aztec/circuit-types'; +import { type ClientProtocolCircuitVerifier } from '@aztec/circuit-types/interfaces/server'; import { type CircuitVerificationStats } from '@aztec/circuit-types/stats'; import { type Proof, type VerificationKeyData } from '@aztec/circuits.js'; import { runInDirectory } from '@aztec/foundation/fs'; diff --git a/yarn-project/bb-prover/tsconfig.json b/yarn-project/bb-prover/tsconfig.json index f5fca8a14377..eaae99a2c447 100644 --- a/yarn-project/bb-prover/tsconfig.json +++ b/yarn-project/bb-prover/tsconfig.json @@ -12,6 +12,9 @@ { "path": "../circuits.js" }, + { + "path": "../constants" + }, { "path": "../foundation" }, diff --git a/yarn-project/blob-lib/package.json b/yarn-project/blob-lib/package.json index 64afae4d63dc..272e26539c85 100644 --- a/yarn-project/blob-lib/package.json +++ b/yarn-project/blob-lib/package.json @@ -3,7 +3,8 @@ "version": "0.1.0", "type": "module", "exports": { - ".": "./dest/index.js" + ".": "./dest/index.js", + "./testing": "./dest/testing.js" }, "typedocOptions": { "entryPoints": [ @@ -26,6 +27,7 @@ "../package.common.json" ], "dependencies": { + "@aztec/constants": "workspace:^", "@aztec/foundation": "workspace:^", "c-kzg": "4.0.0-alpha.1", "tslib": "^2.4.0" diff --git a/yarn-project/blob-lib/src/blob.test.ts b/yarn-project/blob-lib/src/blob.test.ts index 94e83e2c1559..f56669775793 100644 --- a/yarn-project/blob-lib/src/blob.test.ts +++ b/yarn-project/blob-lib/src/blob.test.ts @@ -4,7 +4,8 @@ import { Fr } from '@aztec/foundation/fields'; import cKzg from 'c-kzg'; import type { Blob as BlobBuffer, Bytes48, KZGProof } from 'c-kzg'; -import { Blob, makeEncodedBlob } from './index.js'; +import { Blob } from './index.js'; +import { makeEncodedBlob } from './testing.js'; // Importing directly from 'c-kzg' does not work, ignoring import/no-named-as-default-member err: /* eslint-disable import/no-named-as-default-member */ diff --git a/yarn-project/circuits.js/src/structs/blobs/blob_public_inputs.test.ts b/yarn-project/blob-lib/src/blob_public_inputs.test.ts similarity index 95% rename from yarn-project/circuits.js/src/structs/blobs/blob_public_inputs.test.ts rename to yarn-project/blob-lib/src/blob_public_inputs.test.ts index def32b893cd5..151858902c62 100644 --- a/yarn-project/circuits.js/src/structs/blobs/blob_public_inputs.test.ts +++ b/yarn-project/blob-lib/src/blob_public_inputs.test.ts @@ -1,11 +1,11 @@ import { Blob } from '@aztec/blob-lib'; +import { BLOBS_PER_BLOCK, BLOB_PUBLIC_INPUTS } from '@aztec/constants'; import { timesParallel } from '@aztec/foundation/collection'; import { randomInt } from '@aztec/foundation/crypto'; +import { Fr } from '@aztec/foundation/fields'; -import { BLOBS_PER_BLOCK, BLOB_PUBLIC_INPUTS } from '../../constants.gen.js'; -import { makeBlobPublicInputs, makeBlockBlobPublicInputs } from '../../tests/factories.js'; -import { Fr } from '../index.js'; import { BlobPublicInputs, BlockBlobPublicInputs } from './blob_public_inputs.js'; +import { makeBlobPublicInputs, makeBlockBlobPublicInputs } from './testing.js'; describe('BlobPublicInputs', () => { let blobPI: BlobPublicInputs; diff --git a/yarn-project/circuits.js/src/structs/blobs/blob_public_inputs.ts b/yarn-project/blob-lib/src/blob_public_inputs.ts similarity index 94% rename from yarn-project/circuits.js/src/structs/blobs/blob_public_inputs.ts rename to yarn-project/blob-lib/src/blob_public_inputs.ts index c3429a310b24..74d9be993f63 100644 --- a/yarn-project/circuits.js/src/structs/blobs/blob_public_inputs.ts +++ b/yarn-project/blob-lib/src/blob_public_inputs.ts @@ -1,4 +1,4 @@ -import { type Blob } from '@aztec/blob-lib'; +import { BLOBS_PER_BLOCK } from '@aztec/constants'; import { makeTuple } from '@aztec/foundation/array'; import { toBigIntBE, toBufferBE, toHex } from '@aztec/foundation/bigint-buffer'; import { sha256, sha256Trunc } from '@aztec/foundation/crypto'; @@ -6,11 +6,7 @@ import { Fr } from '@aztec/foundation/fields'; import { BufferReader, FieldReader, type Tuple, serializeToBuffer } from '@aztec/foundation/serialize'; import { type FieldsOf } from '@aztec/foundation/types'; -import { BLOBS_PER_BLOCK } from '../../constants.gen.js'; - -// The prefix to the EVM blobHash, defined here: https://eips.ethereum.org/EIPS/eip-4844#specification -// Also defined in yarn-project/foundation/src/blob/index.ts, which can't take in our circuits.js constants -export const VERSIONED_HASH_VERSION_KZG = 0x01; +import { type Blob, VERSIONED_HASH_VERSION_KZG } from './blob.js'; /** * Public inputs required to be passed from our rollup circuits to verify a blob. diff --git a/yarn-project/blob-lib/src/index.ts b/yarn-project/blob-lib/src/index.ts index c1e0b9bd7852..05fd46a44a50 100644 --- a/yarn-project/blob-lib/src/index.ts +++ b/yarn-project/blob-lib/src/index.ts @@ -4,10 +4,11 @@ import cKzg from 'c-kzg'; const { loadTrustedSetup } = cKzg; export * from './blob.js'; -export * from './mocks.js'; export * from './encoding.js'; export * from './interface.js'; export * from './errors.js'; +export * from './blob_public_inputs.js'; +export * from './sponge_blob.js'; try { loadTrustedSetup(); diff --git a/yarn-project/blob-lib/src/mocks.ts b/yarn-project/blob-lib/src/mocks.ts deleted file mode 100644 index 5ce53b0485b7..000000000000 --- a/yarn-project/blob-lib/src/mocks.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { toBufferBE } from '@aztec/foundation/bigint-buffer'; -import { Fr } from '@aztec/foundation/fields'; - -import { Blob } from './blob.js'; -import { TX_START_PREFIX, TX_START_PREFIX_BYTES_LENGTH } from './encoding.js'; - -// TODO: copied form circuit-types tx effect -function encodeFirstField(length: number): Fr { - const lengthBuf = Buffer.alloc(2); - lengthBuf.writeUInt16BE(length, 0); - return new Fr( - Buffer.concat([ - toBufferBE(TX_START_PREFIX, TX_START_PREFIX_BYTES_LENGTH), - Buffer.alloc(1), - lengthBuf, - Buffer.alloc(1), - Buffer.from([1]), - Buffer.alloc(1), - Buffer.alloc(1), - ]), - ); -} - -/** - * Make an encoded blob with the given length - * - * This will deserialise correctly in the archiver - * @param length - * @returns - */ -export function makeEncodedBlob(length: number): Promise { - return Blob.fromFields([encodeFirstField(length + 1), ...Array.from({ length: length }, () => Fr.random())]); -} - -/** - * Make an unencoded blob with the given length - * - * This will fail deserialisation in the archiver - * @param length - * @returns - */ -export function makeUnencodedBlob(length: number): Promise { - return Blob.fromFields([...Array.from({ length: length }, () => Fr.random())]); -} - -export function makeEncodedBlobFields(fields: Fr[]): Promise { - return Blob.fromFields([encodeFirstField(fields.length + 1), ...fields]); -} diff --git a/yarn-project/circuits.js/src/structs/blobs/sponge_blob.test.ts b/yarn-project/blob-lib/src/sponge_blob.test.ts similarity index 93% rename from yarn-project/circuits.js/src/structs/blobs/sponge_blob.test.ts rename to yarn-project/blob-lib/src/sponge_blob.test.ts index 55a7b59990c6..9d45498b71f0 100644 --- a/yarn-project/circuits.js/src/structs/blobs/sponge_blob.test.ts +++ b/yarn-project/blob-lib/src/sponge_blob.test.ts @@ -1,9 +1,9 @@ +import { SPONGE_BLOB_LENGTH } from '@aztec/constants'; import { poseidon2Hash } from '@aztec/foundation/crypto'; import { Fr } from '@aztec/foundation/fields'; -import { SPONGE_BLOB_LENGTH } from '../../constants.gen.js'; -import { makeSpongeBlob } from '../../tests/factories.js'; import { SpongeBlob } from './sponge_blob.js'; +import { makeSpongeBlob } from './testing.js'; describe('SpongeBlob', () => { let spongeBlob: SpongeBlob; diff --git a/yarn-project/circuits.js/src/structs/blobs/sponge_blob.ts b/yarn-project/blob-lib/src/sponge_blob.ts similarity index 100% rename from yarn-project/circuits.js/src/structs/blobs/sponge_blob.ts rename to yarn-project/blob-lib/src/sponge_blob.ts diff --git a/yarn-project/blob-lib/src/testing.ts b/yarn-project/blob-lib/src/testing.ts new file mode 100644 index 000000000000..d3b936869a44 --- /dev/null +++ b/yarn-project/blob-lib/src/testing.ts @@ -0,0 +1,95 @@ +import { BLOBS_PER_BLOCK } from '@aztec/constants'; +import { makeTuple } from '@aztec/foundation/array'; +import { toBufferBE } from '@aztec/foundation/bigint-buffer'; +import { Fr } from '@aztec/foundation/fields'; + +import { Blob } from './blob.js'; +import { BlobPublicInputs, BlockBlobPublicInputs } from './blob_public_inputs.js'; +import { TX_START_PREFIX, TX_START_PREFIX_BYTES_LENGTH } from './encoding.js'; +import { Poseidon2Sponge, SpongeBlob } from './sponge_blob.js'; + +/** + * Makes arbitrary poseidon sponge for blob inputs. + * Note: will not verify inside the circuit. + * @param seed - The seed to use for generating the sponge. + * @returns A sponge blob instance. + */ +export function makeSpongeBlob(seed = 1): SpongeBlob { + return new SpongeBlob( + new Poseidon2Sponge( + makeTuple(3, i => new Fr(i)), + makeTuple(4, i => new Fr(i)), + 1, + false, + ), + seed, + seed + 1, + ); +} + +/** + * Makes arbitrary blob public inputs. + * Note: will not verify inside the circuit. + * @param seed - The seed to use for generating the blob inputs. + * @returns A blob public inputs instance. + */ +export function makeBlobPublicInputs(seed = 1): BlobPublicInputs { + return new BlobPublicInputs( + new Fr(seed), + BigInt(seed + 1), + makeTuple(2, i => new Fr(i)), + ); +} + +/** + * Makes arbitrary block blob public inputs. + * Note: will not verify inside the circuit. + * @param seed - The seed to use for generating the blob inputs. + * @returns A block blob public inputs instance. + */ +export function makeBlockBlobPublicInputs(seed = 1): BlockBlobPublicInputs { + return new BlockBlobPublicInputs(makeTuple(BLOBS_PER_BLOCK, () => makeBlobPublicInputs(seed))); +} + +// TODO: copied form circuit-types tx effect +function encodeFirstField(length: number): Fr { + const lengthBuf = Buffer.alloc(2); + lengthBuf.writeUInt16BE(length, 0); + return new Fr( + Buffer.concat([ + toBufferBE(TX_START_PREFIX, TX_START_PREFIX_BYTES_LENGTH), + Buffer.alloc(1), + lengthBuf, + Buffer.alloc(1), + Buffer.from([1]), + Buffer.alloc(1), + Buffer.alloc(1), + ]), + ); +} + +/** + * Make an encoded blob with the given length + * + * This will deserialise correctly in the archiver + * @param length + * @returns + */ +export function makeEncodedBlob(length: number): Promise { + return Blob.fromFields([encodeFirstField(length + 1), ...Array.from({ length: length }, () => Fr.random())]); +} + +/** + * Make an unencoded blob with the given length + * + * This will fail deserialisation in the archiver + * @param length + * @returns + */ +export function makeUnencodedBlob(length: number): Promise { + return Blob.fromFields([...Array.from({ length: length }, () => Fr.random())]); +} + +export function makeEncodedBlobFields(fields: Fr[]): Promise { + return Blob.fromFields([encodeFirstField(fields.length + 1), ...fields]); +} diff --git a/yarn-project/blob-lib/tsconfig.json b/yarn-project/blob-lib/tsconfig.json index e92b3fa25626..5f6f42e6f105 100644 --- a/yarn-project/blob-lib/tsconfig.json +++ b/yarn-project/blob-lib/tsconfig.json @@ -7,6 +7,9 @@ }, "include": ["src"], "references": [ + { + "path": "../constants" + }, { "path": "../foundation" } diff --git a/yarn-project/blob-sink/src/client/blob-sink-client-tests.ts b/yarn-project/blob-sink/src/client/blob-sink-client-tests.ts index c3c0b7625cff..2c3b18696429 100644 --- a/yarn-project/blob-sink/src/client/blob-sink-client-tests.ts +++ b/yarn-project/blob-sink/src/client/blob-sink-client-tests.ts @@ -1,4 +1,4 @@ -import { makeEncodedBlob } from '@aztec/blob-lib'; +import { makeEncodedBlob } from '@aztec/blob-lib/testing'; import { type BlobSinkClientInterface } from './interface.js'; diff --git a/yarn-project/blob-sink/src/client/http.test.ts b/yarn-project/blob-sink/src/client/http.test.ts index 8ab70f801b0f..535135036d3c 100644 --- a/yarn-project/blob-sink/src/client/http.test.ts +++ b/yarn-project/blob-sink/src/client/http.test.ts @@ -1,4 +1,5 @@ -import { Blob, makeEncodedBlob, makeUnencodedBlob } from '@aztec/blob-lib'; +import { Blob } from '@aztec/blob-lib'; +import { makeEncodedBlob, makeUnencodedBlob } from '@aztec/blob-lib/testing'; import { Fr } from '@aztec/foundation/fields'; import { jest } from '@jest/globals'; diff --git a/yarn-project/blob-sink/src/server/server.test.ts b/yarn-project/blob-sink/src/server/server.test.ts index e8b350c075e2..83b25289e840 100644 --- a/yarn-project/blob-sink/src/server/server.test.ts +++ b/yarn-project/blob-sink/src/server/server.test.ts @@ -1,4 +1,5 @@ -import { Blob, makeEncodedBlob } from '@aztec/blob-lib'; +import { Blob } from '@aztec/blob-lib'; +import { makeEncodedBlob } from '@aztec/blob-lib/testing'; import request from 'supertest'; diff --git a/yarn-project/bootstrap.sh b/yarn-project/bootstrap.sh index 633c788a5a68..126216c2f64f 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 ::: foundation circuits.js types builder ethereum l1-artifacts + compile_project ::: constants foundation circuits.js types builder ethereum l1-artifacts # Call all projects that have a generation stage. parallel --joblog joblog.txt --line-buffered --tag 'cd {} && yarn generate' ::: \ diff --git a/yarn-project/bot/src/bot.ts b/yarn-project/bot/src/bot.ts index 464b8c31d55d..fbf0143c57ae 100644 --- a/yarn-project/bot/src/bot.ts +++ b/yarn-project/bot/src/bot.ts @@ -6,7 +6,8 @@ import { type Wallet, createLogger, } from '@aztec/aztec.js'; -import { type AztecNode, type FunctionCall, type PXE } from '@aztec/circuit-types'; +import { type FunctionCall } from '@aztec/circuit-types'; +import { type AztecNode, type PXE } from '@aztec/circuit-types/interfaces/client'; import { Gas } from '@aztec/circuits.js'; import { timesParallel } from '@aztec/foundation/collection'; import { type EasyPrivateTokenContract } from '@aztec/noir-contracts.js/EasyPrivateToken'; diff --git a/yarn-project/bot/src/factory.ts b/yarn-project/bot/src/factory.ts index c71191ba1e88..3e4a7da65a40 100644 --- a/yarn-project/bot/src/factory.ts +++ b/yarn-project/bot/src/factory.ts @@ -11,7 +11,8 @@ import { createPXEClient, retryUntil, } from '@aztec/aztec.js'; -import { type AztecNode, type FunctionCall, type PXE } from '@aztec/circuit-types'; +import { type FunctionCall } from '@aztec/circuit-types'; +import { type AztecNode, type PXE } from '@aztec/circuit-types/interfaces/client'; import { type AztecAddress, Fr, deriveSigningKey } from '@aztec/circuits.js'; import { createEthereumChain, createL1Clients } from '@aztec/ethereum'; import { EasyPrivateTokenContract } from '@aztec/noir-contracts.js/EasyPrivateToken'; diff --git a/yarn-project/builder/package.json b/yarn-project/builder/package.json index 3365b48c419d..aaa9dccac73f 100644 --- a/yarn-project/builder/package.json +++ b/yarn-project/builder/package.json @@ -67,8 +67,8 @@ ] }, "dependencies": { + "@aztec/circuits.js": "workspace:^", "@aztec/foundation": "workspace:^", - "@aztec/types": "workspace:^", "commander": "^12.1.0" }, "devDependencies": { diff --git a/yarn-project/builder/src/contract-interface-gen/codegen.ts b/yarn-project/builder/src/contract-interface-gen/codegen.ts index dee4a1e5add4..bb8d08f56e0e 100644 --- a/yarn-project/builder/src/contract-interface-gen/codegen.ts +++ b/yarn-project/builder/src/contract-interface-gen/codegen.ts @@ -1,5 +1,5 @@ /* eslint-disable no-console */ -import { loadContractArtifact } from '@aztec/types/abi'; +import { loadContractArtifact } from '@aztec/circuits.js/abi'; import crypto from 'crypto'; import { access, mkdir, readFile, readdir, stat, writeFile } from 'fs/promises'; diff --git a/yarn-project/builder/src/contract-interface-gen/typescript.ts b/yarn-project/builder/src/contract-interface-gen/typescript.ts index c27d4550010e..dee21758bf64 100644 --- a/yarn-project/builder/src/contract-interface-gen/typescript.ts +++ b/yarn-project/builder/src/contract-interface-gen/typescript.ts @@ -11,7 +11,7 @@ import { isFunctionSelectorStruct, isU128Struct, isWrappedFieldStruct, -} from '@aztec/foundation/abi'; +} from '@aztec/circuits.js/abi'; /** * Returns the corresponding typescript type for a given Noir type. diff --git a/yarn-project/builder/tsconfig.json b/yarn-project/builder/tsconfig.json index 3435c3b70e5f..a6b3ad94790f 100644 --- a/yarn-project/builder/tsconfig.json +++ b/yarn-project/builder/tsconfig.json @@ -7,10 +7,10 @@ }, "references": [ { - "path": "../foundation" + "path": "../circuits.js" }, { - "path": "../types" + "path": "../foundation" } ], "include": ["src", "src/*.json"] diff --git a/yarn-project/circuit-types/package.json b/yarn-project/circuit-types/package.json index 504e78b639d9..b38870d41864 100644 --- a/yarn-project/circuit-types/package.json +++ b/yarn-project/circuit-types/package.json @@ -4,12 +4,12 @@ "type": "module", "exports": { ".": "./dest/index.js", - "./blob": "./dest/blob/index.js", "./stats": "./dest/stats/index.js", "./jest": "./dest/jest/index.js", - "./interfaces": "./dest/interfaces/index.js", + "./interfaces/client": "./dest/interfaces/client.js", + "./interfaces/server": "./dest/interfaces/server.js", "./log_id": "./dest/logs/log_id.js", - "./test": "./dest/test/index.js", + "./testing": "./dest/test/index.js", "./tx_hash": "./dest/tx/tx_hash.js", "./config": "./dest/config.js" }, @@ -68,6 +68,7 @@ }, "dependencies": { "@aztec/circuits.js": "workspace:^", + "@aztec/constants": "workspace:^", "@aztec/ethereum": "workspace:^", "@aztec/foundation": "workspace:^", "@aztec/types": "workspace:^", diff --git a/yarn-project/circuit-types/src/auth_witness.ts b/yarn-project/circuit-types/src/auth_witness.ts index ea135a2d5ddb..540b7d767d78 100644 --- a/yarn-project/circuit-types/src/auth_witness.ts +++ b/yarn-project/circuit-types/src/auth_witness.ts @@ -1,4 +1,4 @@ -import { Vector } from '@aztec/circuits.js'; +import { Vector } from '@aztec/circuits.js/types'; import { Fr } from '@aztec/foundation/fields'; import { hexSchemaFor } from '@aztec/foundation/schemas'; import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize'; diff --git a/yarn-project/circuit-types/src/function_call.ts b/yarn-project/circuit-types/src/function_call.ts index cded239241e6..fc7e852c19f1 100644 --- a/yarn-project/circuit-types/src/function_call.ts +++ b/yarn-project/circuit-types/src/function_call.ts @@ -1,5 +1,5 @@ import { AztecAddress, type Fr } from '@aztec/circuits.js'; -import { type AbiType, FunctionSelector, FunctionType } from '@aztec/foundation/abi'; +import { type AbiType, FunctionSelector, FunctionType } from '@aztec/circuits.js/abi'; import { type FieldsOf } from '@aztec/foundation/types'; /** A request to call a function on a contract from a given address. */ diff --git a/yarn-project/circuit-types/src/index.ts b/yarn-project/circuit-types/src/index.ts index 49b434f69eff..26f838a5acad 100644 --- a/yarn-project/circuit-types/src/index.ts +++ b/yarn-project/circuit-types/src/index.ts @@ -7,14 +7,12 @@ export * from './function_call.js'; export * from './global_variable_builder.js'; export * from './hashed_values.js'; export * from './in_block.js'; -export * from './interfaces/index.js'; export * from './l2_block.js'; export * from './l2_block_downloader/index.js'; export * from './l2_block_source.js'; export * from './logs/index.js'; export * from './merkle_tree_id.js'; export * from './messaging/index.js'; -export * from './mocks.js'; export * from './notes/index.js'; export * from './nullifier_with_block_source.js'; export * from './p2p/index.js'; diff --git a/yarn-project/circuit-types/src/interfaces/archiver.test.ts b/yarn-project/circuit-types/src/interfaces/archiver.test.ts index d5e2bd76d417..1c51e61f7cb3 100644 --- a/yarn-project/circuit-types/src/interfaces/archiver.test.ts +++ b/yarn-project/circuit-types/src/interfaces/archiver.test.ts @@ -12,10 +12,9 @@ import { computePublicBytecodeCommitment, getContractClassFromArtifact, } from '@aztec/circuits.js'; -import { type ContractArtifact } from '@aztec/foundation/abi'; +import { type ContractArtifact, loadContractArtifact } from '@aztec/circuits.js/abi'; import { type JsonRpcTestContext, createJsonRpcTestSetup } from '@aztec/foundation/json-rpc/test'; import { fileURLToPath } from '@aztec/foundation/url'; -import { loadContractArtifact } from '@aztec/types/abi'; import { readFileSync } from 'fs'; import omit from 'lodash.omit'; diff --git a/yarn-project/circuit-types/src/interfaces/archiver.ts b/yarn-project/circuit-types/src/interfaces/archiver.ts index 9dee18253a72..d485d044a09e 100644 --- a/yarn-project/circuit-types/src/interfaces/archiver.ts +++ b/yarn-project/circuit-types/src/interfaces/archiver.ts @@ -6,7 +6,7 @@ import { PrivateLog, PublicFunctionSchema, } from '@aztec/circuits.js'; -import { type ApiSchemaFor, optional, schemas } from '@aztec/foundation/schemas'; +import { type ApiSchemaFor, optional, schemas } from '@aztec/circuits.js/schemas'; import { z } from 'zod'; diff --git a/yarn-project/circuit-types/src/interfaces/aztec-node.test.ts b/yarn-project/circuit-types/src/interfaces/aztec-node.test.ts index 605909330f7e..625a0cc24699 100644 --- a/yarn-project/circuit-types/src/interfaces/aztec-node.test.ts +++ b/yarn-project/circuit-types/src/interfaces/aztec-node.test.ts @@ -1,5 +1,4 @@ import { - ARCHIVE_HEIGHT, AztecAddress, BlockHeader, type ContractClassPublic, @@ -7,23 +6,26 @@ import { EthAddress, Fr, GasFees, - L1_TO_L2_MSG_TREE_HEIGHT, - NOTE_HASH_TREE_HEIGHT, - NULLIFIER_TREE_HEIGHT, type NodeInfo, - PUBLIC_DATA_TREE_HEIGHT, PrivateLog, type ProtocolContractAddresses, ProtocolContractsNames, PublicKeys, getContractClassFromArtifact, } from '@aztec/circuits.js'; +import { type ContractArtifact } from '@aztec/circuits.js/abi'; +import { loadContractArtifact } from '@aztec/circuits.js/abi'; +import { + ARCHIVE_HEIGHT, + L1_TO_L2_MSG_TREE_HEIGHT, + NOTE_HASH_TREE_HEIGHT, + NULLIFIER_TREE_HEIGHT, + PUBLIC_DATA_TREE_HEIGHT, +} from '@aztec/constants'; import { type L1ContractAddresses, L1ContractsNames } from '@aztec/ethereum/l1-contract-addresses'; -import { type ContractArtifact } from '@aztec/foundation/abi'; import { memoize } from '@aztec/foundation/decorators'; import { type JsonRpcTestContext, createJsonRpcTestSetup } from '@aztec/foundation/json-rpc/test'; import { fileURLToPath } from '@aztec/foundation/url'; -import { loadContractArtifact } from '@aztec/types/abi'; import { readFileSync } from 'fs'; import omit from 'lodash.omit'; diff --git a/yarn-project/circuit-types/src/interfaces/aztec-node.ts b/yarn-project/circuit-types/src/interfaces/aztec-node.ts index 357bb9027468..5a55ee0730f8 100644 --- a/yarn-project/circuit-types/src/interfaces/aztec-node.ts +++ b/yarn-project/circuit-types/src/interfaces/aztec-node.ts @@ -1,21 +1,23 @@ import { - ARCHIVE_HEIGHT, BlockHeader, type ContractClassPublic, ContractClassPublicSchema, type ContractInstanceWithAddress, ContractInstanceWithAddressSchema, GasFees, - L1_TO_L2_MSG_TREE_HEIGHT, - NOTE_HASH_TREE_HEIGHT, - NULLIFIER_TREE_HEIGHT, type NodeInfo, NodeInfoSchema, - PUBLIC_DATA_TREE_HEIGHT, PrivateLog, type ProtocolContractAddresses, ProtocolContractAddressesSchema, } from '@aztec/circuits.js'; +import { + ARCHIVE_HEIGHT, + L1_TO_L2_MSG_TREE_HEIGHT, + NOTE_HASH_TREE_HEIGHT, + NULLIFIER_TREE_HEIGHT, + 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'; diff --git a/yarn-project/circuit-types/src/interfaces/client.ts b/yarn-project/circuit-types/src/interfaces/client.ts new file mode 100644 index 000000000000..9b023e27b348 --- /dev/null +++ b/yarn-project/circuit-types/src/interfaces/client.ts @@ -0,0 +1,6 @@ +export * from '../private_execution_result.js'; +export * from './pxe.js'; +export * from './aztec-node.js'; +export * from './private_kernel_prover.js'; +export * from './nullifier_membership_witness.js'; +export * from './l2_block_number.js'; diff --git a/yarn-project/circuit-types/src/interfaces/configs.ts b/yarn-project/circuit-types/src/interfaces/configs.ts index a9653552d29c..4ae2771e009c 100644 --- a/yarn-project/circuit-types/src/interfaces/configs.ts +++ b/yarn-project/circuit-types/src/interfaces/configs.ts @@ -1,5 +1,5 @@ import { type AztecAddress, type EthAddress, type Fr, type FunctionSelector } 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/circuit-types/src/interfaces/merkle_tree_operations.ts b/yarn-project/circuit-types/src/interfaces/merkle_tree_operations.ts index 334951fb1c33..d54c9ca80572 100644 --- a/yarn-project/circuit-types/src/interfaces/merkle_tree_operations.ts +++ b/yarn-project/circuit-types/src/interfaces/merkle_tree_operations.ts @@ -1,10 +1,5 @@ -import { - type BlockHeader, - type Fr, - type NullifierLeaf, - type PublicDataTreeLeaf, - type StateReference, -} from '@aztec/circuits.js'; +import { type BlockHeader, type Fr, type StateReference } from '@aztec/circuits.js'; +import { type NullifierLeaf, type PublicDataTreeLeaf } from '@aztec/circuits.js/trees'; import { createLogger } from '@aztec/foundation/log'; import { type IndexedTreeLeafPreimage } from '@aztec/foundation/trees'; diff --git a/yarn-project/circuit-types/src/interfaces/nullifier_membership_witness.ts b/yarn-project/circuit-types/src/interfaces/nullifier_membership_witness.ts index ec46c4d99e92..ac881b3cb9d7 100644 --- a/yarn-project/circuit-types/src/interfaces/nullifier_membership_witness.ts +++ b/yarn-project/circuit-types/src/interfaces/nullifier_membership_witness.ts @@ -1,4 +1,6 @@ -import { Fr, NULLIFIER_TREE_HEIGHT, NullifierLeafPreimage } from '@aztec/circuits.js'; +import { Fr } from '@aztec/circuits.js'; +import { NullifierLeafPreimage } from '@aztec/circuits.js/trees'; +import { NULLIFIER_TREE_HEIGHT } from '@aztec/constants'; import { schemas } from '@aztec/foundation/schemas'; import { z } from 'zod'; diff --git a/yarn-project/circuit-types/src/interfaces/private_kernel_prover.ts b/yarn-project/circuit-types/src/interfaces/private_kernel_prover.ts index d92e373d09d5..6cde07665357 100644 --- a/yarn-project/circuit-types/src/interfaces/private_kernel_prover.ts +++ b/yarn-project/circuit-types/src/interfaces/private_kernel_prover.ts @@ -1,13 +1,12 @@ +import { type ClientIvcProof, type VerificationKeyAsFields } from '@aztec/circuits.js'; import { - type ClientIvcProof, type PrivateKernelCircuitPublicInputs, type PrivateKernelInitCircuitPrivateInputs, type PrivateKernelInnerCircuitPrivateInputs, type PrivateKernelResetCircuitPrivateInputs, type PrivateKernelTailCircuitPrivateInputs, type PrivateKernelTailCircuitPublicInputs, - type VerificationKeyAsFields, -} from '@aztec/circuits.js'; +} from '@aztec/circuits.js/kernel'; import { type WitnessMap } from '@noir-lang/acvm_js'; import { z } from 'zod'; diff --git a/yarn-project/circuit-types/src/interfaces/prover-broker.ts b/yarn-project/circuit-types/src/interfaces/prover-broker.ts index 5a03de484191..2026dba91da7 100644 --- a/yarn-project/circuit-types/src/interfaces/prover-broker.ts +++ b/yarn-project/circuit-types/src/interfaces/prover-broker.ts @@ -1,10 +1,4 @@ -import { - type ProofUri, - type ProvingJob, - type ProvingJobId, - type ProvingJobStatus, - type ProvingRequestType, -} from '@aztec/circuit-types'; +import type { ProofUri, ProvingJob, ProvingJobId, ProvingJobStatus, ProvingRequestType } from './proving-job.js'; /** * An interface for the proving orchestrator. The producer uses this to enqueue jobs for agents diff --git a/yarn-project/circuit-types/src/interfaces/proving-job-source.test.ts b/yarn-project/circuit-types/src/interfaces/proving-job-source.test.ts index af6da9b1b110..2092398d194d 100644 --- a/yarn-project/circuit-types/src/interfaces/proving-job-source.test.ts +++ b/yarn-project/circuit-types/src/interfaces/proving-job-source.test.ts @@ -1,5 +1,6 @@ -import { NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, VerificationKeyData, makeRecursiveProof } from '@aztec/circuits.js'; +import { VerificationKeyData, makeRecursiveProof } from '@aztec/circuits.js'; import { BaseOrMergeRollupPublicInputs } from '@aztec/circuits.js/rollup'; +import { NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH } from '@aztec/constants'; import { type JsonRpcTestContext, createJsonRpcTestSetup } from '@aztec/foundation/json-rpc/test'; import { type ProvingJobSource, ProvingJobSourceSchema } from './proving-job-source.js'; diff --git a/yarn-project/circuit-types/src/interfaces/proving-job.ts b/yarn-project/circuit-types/src/interfaces/proving-job.ts index 495c0e0aa87e..4fcfba5f9c4f 100644 --- a/yarn-project/circuit-types/src/interfaces/proving-job.ts +++ b/yarn-project/circuit-types/src/interfaces/proving-job.ts @@ -1,16 +1,11 @@ import { - AVM_PROOF_LENGTH_IN_FIELDS, - AvmCircuitInputs, BaseParityInputs, - NESTED_RECURSIVE_PROOF_LENGTH, - NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, ParityPublicInputs, - RECURSIVE_PROOF_LENGTH, RecursiveProof, RootParityInputs, - TUBE_PROOF_LENGTH, VerificationKeyData, } from '@aztec/circuits.js'; +import { AvmCircuitInputs } from '@aztec/circuits.js/avm'; import { BaseOrMergeRollupPublicInputs, BlockMergeRollupInputs, @@ -25,6 +20,13 @@ import { SingleTxBlockRootRollupInputs, TubeInputs, } from '@aztec/circuits.js/rollup'; +import { + AVM_PROOF_LENGTH_IN_FIELDS, + NESTED_RECURSIVE_PROOF_LENGTH, + NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, + RECURSIVE_PROOF_LENGTH, + TUBE_PROOF_LENGTH, +} from '@aztec/constants'; import { type ZodFor } from '@aztec/foundation/schemas'; import { z } from 'zod'; diff --git a/yarn-project/circuit-types/src/interfaces/pxe.test.ts b/yarn-project/circuit-types/src/interfaces/pxe.test.ts index fe7a41018b6e..c873154c6e01 100644 --- a/yarn-project/circuit-types/src/interfaces/pxe.test.ts +++ b/yarn-project/circuit-types/src/interfaces/pxe.test.ts @@ -6,21 +6,21 @@ import { EthAddress, Fr, GasFees, - L1_TO_L2_MSG_TREE_HEIGHT, type NodeInfo, Point, - PrivateKernelTailCircuitPublicInputs, type ProtocolContractAddresses, ProtocolContractsNames, PublicKeys, getContractClassFromArtifact, } from '@aztec/circuits.js'; +import { type AbiDecoded, type ContractArtifact, EventSelector } from '@aztec/circuits.js/abi'; +import { loadContractArtifact } from '@aztec/circuits.js/abi'; +import { PrivateKernelTailCircuitPublicInputs } from '@aztec/circuits.js/kernel'; +import { L1_TO_L2_MSG_TREE_HEIGHT } from '@aztec/constants'; import { type L1ContractAddresses, L1ContractsNames } from '@aztec/ethereum/l1-contract-addresses'; -import { type AbiDecoded, type ContractArtifact, EventSelector } from '@aztec/foundation/abi'; import { memoize } from '@aztec/foundation/decorators'; import { type JsonRpcTestContext, createJsonRpcTestSetup } from '@aztec/foundation/json-rpc/test'; import { fileURLToPath } from '@aztec/foundation/url'; -import { loadContractArtifact } from '@aztec/types/abi'; import { jest } from '@jest/globals'; import { deepStrictEqual } from 'assert'; diff --git a/yarn-project/circuit-types/src/interfaces/pxe.ts b/yarn-project/circuit-types/src/interfaces/pxe.ts index 917ce52c1c82..50c9864fbb6b 100644 --- a/yarn-project/circuit-types/src/interfaces/pxe.ts +++ b/yarn-project/circuit-types/src/interfaces/pxe.ts @@ -7,7 +7,6 @@ import { ContractInstanceWithAddressSchema, type Fr, GasFees, - L1_TO_L2_MSG_TREE_HEIGHT, type NodeInfo, NodeInfoSchema, type PartialAddress, @@ -22,8 +21,10 @@ import { type ContractArtifact, ContractArtifactSchema, type EventSelector, -} from '@aztec/foundation/abi'; -import { AbiDecodedSchema, type ApiSchemaFor, type ZodFor, optional, schemas } from '@aztec/foundation/schemas'; +} from '@aztec/circuits.js/abi'; +import { AbiDecodedSchema, schemas } from '@aztec/circuits.js/schemas'; +import { L1_TO_L2_MSG_TREE_HEIGHT } from '@aztec/constants'; +import { type ApiSchemaFor, type ZodFor, optional } from '@aztec/foundation/schemas'; import { z } from 'zod'; diff --git a/yarn-project/circuit-types/src/interfaces/index.ts b/yarn-project/circuit-types/src/interfaces/server.ts similarity index 82% rename from yarn-project/circuit-types/src/interfaces/index.ts rename to yarn-project/circuit-types/src/interfaces/server.ts index 86380b3b9bb2..413676798739 100644 --- a/yarn-project/circuit-types/src/interfaces/index.ts +++ b/yarn-project/circuit-types/src/interfaces/server.ts @@ -1,13 +1,10 @@ -export * from '../private_execution_result.js'; export * from './archiver.js'; -export * from './aztec-node.js'; export * from './block-builder.js'; export * from './configs.js'; export * from './epoch-prover.js'; export * from './l2_block_number.js'; export * from './merkle_tree_operations.js'; export * from './nullifier_membership_witness.js'; -export * from './private_kernel_prover.js'; export * from './processed-tx-handler.js'; export * from './prover-agent.js'; export * from './prover-client.js'; @@ -15,7 +12,6 @@ export * from './prover-coordination.js'; export * from './prover-node.js'; export * from './proving-job-source.js'; export * from './proving-job.js'; -export * from './pxe.js'; export * from './server_circuit_prover.js'; export * from './service.js'; export * from './world_state.js'; diff --git a/yarn-project/circuit-types/src/interfaces/server_circuit_prover.ts b/yarn-project/circuit-types/src/interfaces/server_circuit_prover.ts index be2d864ff284..44a015088e66 100644 --- a/yarn-project/circuit-types/src/interfaces/server_circuit_prover.ts +++ b/yarn-project/circuit-types/src/interfaces/server_circuit_prover.ts @@ -1,14 +1,5 @@ -import { - type AVM_PROOF_LENGTH_IN_FIELDS, - type AvmCircuitInputs, - type BaseParityInputs, - type NESTED_RECURSIVE_PROOF_LENGTH, - type NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, - type ParityPublicInputs, - type RECURSIVE_PROOF_LENGTH, - type RootParityInputs, - type TUBE_PROOF_LENGTH, -} from '@aztec/circuits.js'; +import { type BaseParityInputs, type ParityPublicInputs, type RootParityInputs } from '@aztec/circuits.js'; +import { type AvmCircuitInputs } from '@aztec/circuits.js/avm'; import { type BaseOrMergeRollupPublicInputs, type BlockMergeRollupInputs, @@ -23,6 +14,13 @@ import { type SingleTxBlockRootRollupInputs, type TubeInputs, } from '@aztec/circuits.js/rollup'; +import { + type AVM_PROOF_LENGTH_IN_FIELDS, + type NESTED_RECURSIVE_PROOF_LENGTH, + type NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, + type RECURSIVE_PROOF_LENGTH, + type TUBE_PROOF_LENGTH, +} from '@aztec/constants'; import type { Tx } from '../tx/tx.js'; import { type ProofAndVerificationKey, type PublicInputsAndRecursiveProof } from './proving-job.js'; diff --git a/yarn-project/circuit-types/src/l2_block.ts b/yarn-project/circuit-types/src/l2_block.ts index 805a204042ff..6365a054d755 100644 --- a/yarn-project/circuit-types/src/l2_block.ts +++ b/yarn-project/circuit-types/src/l2_block.ts @@ -1,4 +1,5 @@ -import { AppendOnlyTreeSnapshot, BlockHeader } from '@aztec/circuits.js'; +import { BlockHeader } from '@aztec/circuits.js'; +import { AppendOnlyTreeSnapshot } from '@aztec/circuits.js/trees'; import { sha256, 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/l2_block_code_to_purge.ts b/yarn-project/circuit-types/src/l2_block_code_to_purge.ts index e30722d45cdc..b296630a2aae 100644 --- a/yarn-project/circuit-types/src/l2_block_code_to_purge.ts +++ b/yarn-project/circuit-types/src/l2_block_code_to_purge.ts @@ -1,5 +1,4 @@ import { - AppendOnlyTreeSnapshot, AztecAddress, BlockHeader, ContentCommitment, @@ -11,7 +10,7 @@ import { PartialStateReference, StateReference, } from '@aztec/circuits.js'; -import { fr } from '@aztec/circuits.js/testing'; +import { AppendOnlyTreeSnapshot } from '@aztec/circuits.js/trees'; import { toBufferBE } from '@aztec/foundation/bigint-buffer'; /** @@ -29,8 +28,8 @@ export function makeHeader( makeContentCommitment(seed + 0x200, numTxs, inHash), makeStateReference(seed + 0x600), makeGlobalVariables((seed += 0x700), blockNumber, slotNumber ?? blockNumber), - fr(seed + 0x800), - fr(seed + 0x900), + new Fr(seed + 0x800), + new Fr(seed + 0x900), ); } diff --git a/yarn-project/circuit-types/src/l2_block_downloader/l2_block_downloader.ts b/yarn-project/circuit-types/src/l2_block_downloader/l2_block_downloader.ts index 6aae7fe32f06..89f6cf5b23ad 100644 --- a/yarn-project/circuit-types/src/l2_block_downloader/l2_block_downloader.ts +++ b/yarn-project/circuit-types/src/l2_block_downloader/l2_block_downloader.ts @@ -1,4 +1,4 @@ -import { INITIAL_L2_BLOCK_NUM } from '@aztec/circuits.js/constants'; +import { INITIAL_L2_BLOCK_NUM } from '@aztec/constants'; import { createLogger } from '@aztec/foundation/log'; import { FifoMemoryQueue, Semaphore, SerialQueue } from '@aztec/foundation/queue'; import { InterruptibleSleep } from '@aztec/foundation/sleep'; diff --git a/yarn-project/circuit-types/src/logs/event_metadata.ts b/yarn-project/circuit-types/src/logs/event_metadata.ts index 523cbe623dd9..5105ffc93aed 100644 --- a/yarn-project/circuit-types/src/logs/event_metadata.ts +++ b/yarn-project/circuit-types/src/logs/event_metadata.ts @@ -1,6 +1,6 @@ import { type PublicLog } from '@aztec/circuits.js'; -import { type AbiType, AbiTypeSchema, type EventSelector, decodeFromAbi } from '@aztec/foundation/abi'; -import { schemas } from '@aztec/foundation/schemas'; +import { type AbiType, AbiTypeSchema, type EventSelector, decodeFromAbi } from '@aztec/circuits.js/abi'; +import { schemas } from '@aztec/circuits.js/schemas'; import { z } from 'zod'; diff --git a/yarn-project/circuit-types/src/logs/function_l2_logs.ts b/yarn-project/circuit-types/src/logs/function_l2_logs.ts index ad406b7b9a33..77de3f309038 100644 --- a/yarn-project/circuit-types/src/logs/function_l2_logs.ts +++ b/yarn-project/circuit-types/src/logs/function_l2_logs.ts @@ -1,4 +1,4 @@ -import { MAX_CONTRACT_CLASS_LOGS_PER_CALL } from '@aztec/circuits.js'; +import { MAX_CONTRACT_CLASS_LOGS_PER_CALL } from '@aztec/constants'; import { sha256Trunc } from '@aztec/foundation/crypto'; import { BufferReader, prefixBufferWithLength } from '@aztec/foundation/serialize'; diff --git a/yarn-project/circuit-types/src/logs/l1_payload/encrypted_log_payload.ts b/yarn-project/circuit-types/src/logs/l1_payload/encrypted_log_payload.ts index 8b685d337c18..e41ac65dfc7f 100644 --- a/yarn-project/circuit-types/src/logs/l1_payload/encrypted_log_payload.ts +++ b/yarn-project/circuit-types/src/logs/l1_payload/encrypted_log_payload.ts @@ -3,11 +3,11 @@ import { Fr, type GrumpkinScalar, NotOnCurveError, - PRIVATE_LOG_SIZE_IN_FIELDS, Point, PrivateLog, derivePublicKeyFromSecretKey, } from '@aztec/circuits.js'; +import { PRIVATE_LOG_SIZE_IN_FIELDS } from '@aztec/constants'; import { randomBytes } from '@aztec/foundation/crypto'; import { BufferReader, type Tuple, numToUInt16BE, serializeToBuffer } from '@aztec/foundation/serialize'; diff --git a/yarn-project/circuit-types/src/logs/l1_payload/encryption_util.ts b/yarn-project/circuit-types/src/logs/l1_payload/encryption_util.ts index ec4dd568908c..57c09f594b1a 100644 --- a/yarn-project/circuit-types/src/logs/l1_payload/encryption_util.ts +++ b/yarn-project/circuit-types/src/logs/l1_payload/encryption_util.ts @@ -1,6 +1,6 @@ -import { GeneratorIndex, type Point } from '@aztec/circuits.js'; -import { Aes128 } from '@aztec/circuits.js/barretenberg'; -import { sha256 } from '@aztec/foundation/crypto'; +import { type Point } from '@aztec/circuits.js'; +import { GeneratorIndex } from '@aztec/constants'; +import { Aes128, sha256 } from '@aztec/foundation/crypto'; import { numToUInt8 } from '@aztec/foundation/serialize'; function extractCloseToUniformlyRandom256BitsFromEcdhSharedSecretUsingSha256(sharedSecret: Point): Buffer { diff --git a/yarn-project/circuit-types/src/logs/l1_payload/l1_event_payload.ts b/yarn-project/circuit-types/src/logs/l1_payload/l1_event_payload.ts index 7ae013efa66d..0d03475f117f 100644 --- a/yarn-project/circuit-types/src/logs/l1_payload/l1_event_payload.ts +++ b/yarn-project/circuit-types/src/logs/l1_payload/l1_event_payload.ts @@ -1,5 +1,5 @@ import { AztecAddress, type PrivateLog } from '@aztec/circuits.js'; -import { EventSelector } from '@aztec/foundation/abi'; +import { EventSelector } from '@aztec/circuits.js/abi'; import { type Fq, Fr } from '@aztec/foundation/fields'; import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize'; diff --git a/yarn-project/circuit-types/src/logs/l1_payload/l1_note_payload.ts b/yarn-project/circuit-types/src/logs/l1_payload/l1_note_payload.ts index c6b410bf9f3c..ac5501e99889 100644 --- a/yarn-project/circuit-types/src/logs/l1_payload/l1_note_payload.ts +++ b/yarn-project/circuit-types/src/logs/l1_payload/l1_note_payload.ts @@ -1,5 +1,5 @@ import { AztecAddress, type PrivateLog, type PublicLog, Vector } from '@aztec/circuits.js'; -import { NoteSelector } from '@aztec/foundation/abi'; +import { NoteSelector } from '@aztec/circuits.js/abi'; import { randomInt } from '@aztec/foundation/crypto'; import { type Fq, Fr } from '@aztec/foundation/fields'; import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize'; diff --git a/yarn-project/circuit-types/src/logs/l1_payload/shared_secret_derivation.ts b/yarn-project/circuit-types/src/logs/l1_payload/shared_secret_derivation.ts index d6c1074ca220..44debb2a04c1 100644 --- a/yarn-project/circuit-types/src/logs/l1_payload/shared_secret_derivation.ts +++ b/yarn-project/circuit-types/src/logs/l1_payload/shared_secret_derivation.ts @@ -1,5 +1,5 @@ import { type AztecAddress, type GrumpkinScalar, type Point, type PublicKey } from '@aztec/circuits.js'; -import { Grumpkin } from '@aztec/circuits.js/barretenberg'; +import { Grumpkin } from '@aztec/foundation/crypto'; /** * Derive an Elliptic Curve Diffie-Hellman (ECDH) Shared Secret. diff --git a/yarn-project/circuit-types/src/logs/log_id.ts b/yarn-project/circuit-types/src/logs/log_id.ts index ec1080799cec..e2a6d752385d 100644 --- a/yarn-project/circuit-types/src/logs/log_id.ts +++ b/yarn-project/circuit-types/src/logs/log_id.ts @@ -1,4 +1,4 @@ -import { INITIAL_L2_BLOCK_NUM } from '@aztec/circuits.js/constants'; +import { INITIAL_L2_BLOCK_NUM } from '@aztec/constants'; import { toBufferBE } from '@aztec/foundation/bigint-buffer'; import { schemas } from '@aztec/foundation/schemas'; import { BufferReader } from '@aztec/foundation/serialize'; diff --git a/yarn-project/circuit-types/src/logs/tx_l2_logs.ts b/yarn-project/circuit-types/src/logs/tx_l2_logs.ts index e1becac450ec..b2f24f3d84ba 100644 --- a/yarn-project/circuit-types/src/logs/tx_l2_logs.ts +++ b/yarn-project/circuit-types/src/logs/tx_l2_logs.ts @@ -1,4 +1,5 @@ -import { Fr, type LogHash, MAX_CONTRACT_CLASS_LOGS_PER_TX, type ScopedLogHash } from '@aztec/circuits.js'; +import { Fr, type LogHash, type ScopedLogHash } from '@aztec/circuits.js'; +import { MAX_CONTRACT_CLASS_LOGS_PER_TX } from '@aztec/constants'; import { sha256Trunc } from '@aztec/foundation/crypto'; import { BufferReader, prefixBufferWithLength } from '@aztec/foundation/serialize'; diff --git a/yarn-project/circuit-types/src/merkle_tree_id.ts b/yarn-project/circuit-types/src/merkle_tree_id.ts index 056ce79111da..feccff190366 100644 --- a/yarn-project/circuit-types/src/merkle_tree_id.ts +++ b/yarn-project/circuit-types/src/merkle_tree_id.ts @@ -9,7 +9,7 @@ import { NULLIFIER_TREE_ID, PUBLIC_DATA_TREE_HEIGHT, PUBLIC_DATA_TREE_ID, -} from '@aztec/circuits.js'; +} from '@aztec/constants'; /** * Defines the possible Merkle tree IDs. diff --git a/yarn-project/circuit-types/src/messaging/inbox_leaf.ts b/yarn-project/circuit-types/src/messaging/inbox_leaf.ts index 7c8bfead6392..134d50511cfc 100644 --- a/yarn-project/circuit-types/src/messaging/inbox_leaf.ts +++ b/yarn-project/circuit-types/src/messaging/inbox_leaf.ts @@ -1,4 +1,5 @@ -import { Fr, INITIAL_L2_BLOCK_NUM, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/circuits.js'; +import { Fr } from '@aztec/circuits.js'; +import { INITIAL_L2_BLOCK_NUM, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants'; import { toBigIntBE } from '@aztec/foundation/bigint-buffer'; import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize'; 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 36a3ee7c0402..713a854903d0 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,5 +1,5 @@ -import { type L1_TO_L2_MSG_TREE_HEIGHT } from '@aztec/circuits.js'; 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'; diff --git a/yarn-project/circuit-types/src/notes/extended_note.test.ts b/yarn-project/circuit-types/src/notes/extended_note.test.ts index 968b2a544bef..4b27678e86e9 100644 --- a/yarn-project/circuit-types/src/notes/extended_note.test.ts +++ b/yarn-project/circuit-types/src/notes/extended_note.test.ts @@ -1,6 +1,6 @@ import { jsonStringify } from '@aztec/foundation/json-rpc'; -import { randomExtendedNote, randomUniqueNote } from '../mocks.js'; +import { randomExtendedNote, randomUniqueNote } from '../test/mocks.js'; import { ExtendedNote, UniqueNote } from './extended_note.js'; describe('ExtendedNote', () => { diff --git a/yarn-project/circuit-types/src/notes/extended_note.ts b/yarn-project/circuit-types/src/notes/extended_note.ts index 4b1d8b65d3ee..5c1a9316159a 100644 --- a/yarn-project/circuit-types/src/notes/extended_note.ts +++ b/yarn-project/circuit-types/src/notes/extended_note.ts @@ -1,6 +1,6 @@ import { AztecAddress, Fr } from '@aztec/circuits.js'; -import { NoteSelector } from '@aztec/foundation/abi'; -import { schemas } from '@aztec/foundation/schemas'; +import { NoteSelector } from '@aztec/circuits.js/abi'; +import { schemas } from '@aztec/circuits.js/schemas'; import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize'; import { bufferToHex, hexToBuffer } from '@aztec/foundation/string'; diff --git a/yarn-project/circuit-types/src/p2p/block_attestation.test.ts b/yarn-project/circuit-types/src/p2p/block_attestation.test.ts index 7050d6b3743c..4fed502f7091 100644 --- a/yarn-project/circuit-types/src/p2p/block_attestation.test.ts +++ b/yarn-project/circuit-types/src/p2p/block_attestation.test.ts @@ -1,8 +1,8 @@ // Serde test for the block attestation type import { Secp256k1Signer } from '@aztec/foundation/crypto'; +import { makeBlockAttestation } from '../test/mocks.js'; import { BlockAttestation } from './block_attestation.js'; -import { makeBlockAttestation } from './mocks.js'; describe('Block Attestation serialization / deserialization', () => { const checkEquivalence = (serialized: BlockAttestation, deserialized: BlockAttestation) => { diff --git a/yarn-project/circuit-types/src/p2p/block_proposal.test.ts b/yarn-project/circuit-types/src/p2p/block_proposal.test.ts index 3db49eabadeb..a4ad0226fb6d 100644 --- a/yarn-project/circuit-types/src/p2p/block_proposal.test.ts +++ b/yarn-project/circuit-types/src/p2p/block_proposal.test.ts @@ -1,8 +1,8 @@ // Serde test for the block proposal type import { Secp256k1Signer } from '@aztec/foundation/crypto'; +import { makeBlockProposal } from '../test/mocks.js'; import { BlockProposal } from './block_proposal.js'; -import { makeBlockProposal } from './mocks.js'; describe('Block Proposal serialization / deserialization', () => { const checkEquivalence = (serialized: BlockProposal, deserialized: BlockProposal) => { diff --git a/yarn-project/circuit-types/src/p2p/index.ts b/yarn-project/circuit-types/src/p2p/index.ts index 24ee7781f65e..36218852b07c 100644 --- a/yarn-project/circuit-types/src/p2p/index.ts +++ b/yarn-project/circuit-types/src/p2p/index.ts @@ -8,4 +8,3 @@ export * from './topic_type.js'; export * from './client_type.js'; export * from './message_validator.js'; export * from './peer_error.js'; -export * from './mocks.js'; diff --git a/yarn-project/circuit-types/src/p2p/mocks.ts b/yarn-project/circuit-types/src/p2p/mocks.ts deleted file mode 100644 index ff9fd3f6a0fd..000000000000 --- a/yarn-project/circuit-types/src/p2p/mocks.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { type BlockHeader } from '@aztec/circuits.js'; -import { makeHeader } from '@aztec/circuits.js/testing'; -import { Secp256k1Signer } from '@aztec/foundation/crypto'; -import { Fr } from '@aztec/foundation/fields'; - -import { TxHash } from '../tx/tx_hash.js'; -import { BlockAttestation } from './block_attestation.js'; -import { BlockProposal } from './block_proposal.js'; -import { ConsensusPayload } from './consensus_payload.js'; -import { SignatureDomainSeparator, getHashedSignaturePayloadEthSignedMessage } from './signature_utils.js'; - -export interface MakeConsensusPayloadOptions { - signer?: Secp256k1Signer; - header?: BlockHeader; - archive?: Fr; - txHashes?: TxHash[]; -} - -const makeAndSignConsensusPayload = async ( - domainSeparator: SignatureDomainSeparator, - options?: MakeConsensusPayloadOptions, -) => { - const { - signer = Secp256k1Signer.random(), - header = makeHeader(1), - archive = Fr.random(), - txHashes = [0, 1, 2, 3, 4, 5].map(() => TxHash.random()), - } = options ?? {}; - - const payload = ConsensusPayload.fromFields({ - header, - archive, - txHashes, - }); - - const hash = await getHashedSignaturePayloadEthSignedMessage(payload, domainSeparator); - const signature = signer.sign(hash); - - return { payload, signature }; -}; - -export const makeBlockProposal = async (options?: MakeConsensusPayloadOptions): Promise => { - const { payload, signature } = await makeAndSignConsensusPayload(SignatureDomainSeparator.blockProposal, options); - return new BlockProposal(payload, signature); -}; - -// TODO(https://github.com/AztecProtocol/aztec-packages/issues/8028) -export const makeBlockAttestation = async (options?: MakeConsensusPayloadOptions): Promise => { - const { payload, signature } = await makeAndSignConsensusPayload(SignatureDomainSeparator.blockAttestation, options); - return new BlockAttestation(payload, signature); -}; diff --git a/yarn-project/circuit-types/src/private_execution_result.ts b/yarn-project/circuit-types/src/private_execution_result.ts index 1f1a9b7e3216..039a396d3131 100644 --- a/yarn-project/circuit-types/src/private_execution_result.ts +++ b/yarn-project/circuit-types/src/private_execution_result.ts @@ -1,9 +1,10 @@ import { type IsEmpty, PrivateCircuitPublicInputs, sortByCounter } from '@aztec/circuits.js'; -import { NoteSelector } from '@aztec/foundation/abi'; +import { NoteSelector } from '@aztec/circuits.js/abi'; +import { schemas } from '@aztec/circuits.js/schemas'; import { timesParallel } from '@aztec/foundation/collection'; import { randomBytes, randomInt } from '@aztec/foundation/crypto'; import { Fr } from '@aztec/foundation/fields'; -import { type ZodFor, mapSchema, schemas } from '@aztec/foundation/schemas'; +import { type ZodFor, mapSchema } from '@aztec/foundation/schemas'; import { type FieldsOf } from '@aztec/foundation/types'; import { z } from 'zod'; diff --git a/yarn-project/circuit-types/src/public_data_witness.test.ts b/yarn-project/circuit-types/src/public_data_witness.test.ts index c2b031217d99..90de171d0d1e 100644 --- a/yarn-project/circuit-types/src/public_data_witness.test.ts +++ b/yarn-project/circuit-types/src/public_data_witness.test.ts @@ -1,5 +1,6 @@ -import { PUBLIC_DATA_TREE_HEIGHT, PublicDataTreeLeafPreimage } from '@aztec/circuits.js'; import { fr } from '@aztec/circuits.js/testing'; +import { PublicDataTreeLeafPreimage } from '@aztec/circuits.js/trees'; +import { PUBLIC_DATA_TREE_HEIGHT } from '@aztec/constants'; import { toBufferBE } from '@aztec/foundation/bigint-buffer'; import { randomInt } from '@aztec/foundation/crypto'; diff --git a/yarn-project/circuit-types/src/public_data_witness.ts b/yarn-project/circuit-types/src/public_data_witness.ts index 41e43418b9a4..2847ace7391f 100644 --- a/yarn-project/circuit-types/src/public_data_witness.ts +++ b/yarn-project/circuit-types/src/public_data_witness.ts @@ -1,4 +1,6 @@ -import { Fr, PUBLIC_DATA_TREE_HEIGHT, PublicDataTreeLeafPreimage } from '@aztec/circuits.js'; +import { Fr } from '@aztec/circuits.js'; +import { PublicDataTreeLeafPreimage } from '@aztec/circuits.js/trees'; +import { PUBLIC_DATA_TREE_HEIGHT } from '@aztec/constants'; import { toBigIntBE } from '@aztec/foundation/bigint-buffer'; import { schemas } from '@aztec/foundation/schemas'; import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize'; diff --git a/yarn-project/circuit-types/src/simulation_error.ts b/yarn-project/circuit-types/src/simulation_error.ts index dc67b11d4d15..da123f6f14bb 100644 --- a/yarn-project/circuit-types/src/simulation_error.ts +++ b/yarn-project/circuit-types/src/simulation_error.ts @@ -1,6 +1,6 @@ -import { AztecAddress, type Fr, FunctionSelector } from '@aztec/circuits.js'; -import { type OpcodeLocation } from '@aztec/foundation/abi'; -import { schemas } from '@aztec/foundation/schemas'; +import { AztecAddress, type Fr } from '@aztec/circuits.js'; +import { FunctionSelector, type OpcodeLocation } from '@aztec/circuits.js/abi'; +import { schemas } from '@aztec/circuits.js/schemas'; import { z } from 'zod'; diff --git a/yarn-project/circuit-types/src/test/factories.ts b/yarn-project/circuit-types/src/test/factories.ts index a8647ff85c9d..baa08814485e 100644 --- a/yarn-project/circuit-types/src/test/factories.ts +++ b/yarn-project/circuit-types/src/test/factories.ts @@ -1,34 +1,34 @@ import { - AvmCircuitInputs, - AvmCircuitPublicInputs, - AvmExecutionHints, AztecAddress, type BlockHeader, - FIXED_DA_GAS, - FIXED_L2_GAS, Fr, Gas, GasFees, GasSettings, GlobalVariables, - MAX_NULLIFIERS_PER_TX, - MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, PublicDataWrite, PublicLog, RevertCode, ScopedLogHash, - TxConstantData, mergeAccumulatedData, } from '@aztec/circuits.js'; +import { AvmCircuitInputs, AvmCircuitPublicInputs, AvmExecutionHints } from '@aztec/circuits.js/avm'; +import { TxConstantData } from '@aztec/circuits.js/kernel'; import { makePrivateToPublicAccumulatedData, makePrivateToRollupAccumulatedData } from '@aztec/circuits.js/testing'; +import { + FIXED_DA_GAS, + FIXED_L2_GAS, + MAX_NULLIFIERS_PER_TX, + MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, +} from '@aztec/constants'; import { makeTuple } from '@aztec/foundation/array'; import { type MerkleTreeReadOperations } from '../interfaces/merkle_tree_operations.js'; import { ProvingRequestType } from '../interfaces/proving-job.js'; import { makeHeader } from '../l2_block_code_to_purge.js'; -import { mockTx } from '../mocks.js'; import { type GasUsed } from '../tx/gas_used.js'; import { makeProcessedTxFromPrivateOnlyTx, makeProcessedTxFromTxWithPublicCalls } from '../tx/processed_tx.js'; +import { mockTx } from './mocks.js'; /** Makes a bloated processed tx for testing purposes. */ export async function makeBloatedProcessedTx({ diff --git a/yarn-project/circuit-types/src/test/index.ts b/yarn-project/circuit-types/src/test/index.ts index e24620a0a234..2a6f887858ba 100644 --- a/yarn-project/circuit-types/src/test/index.ts +++ b/yarn-project/circuit-types/src/test/index.ts @@ -1 +1,2 @@ export * from './factories.js'; +export * from './mocks.js'; diff --git a/yarn-project/circuit-types/src/mocks.ts b/yarn-project/circuit-types/src/test/mocks.ts similarity index 78% rename from yarn-project/circuit-types/src/mocks.ts rename to yarn-project/circuit-types/src/test/mocks.ts index 232de1087914..7154d99397f1 100644 --- a/yarn-project/circuit-types/src/mocks.ts +++ b/yarn-project/circuit-types/src/test/mocks.ts @@ -1,37 +1,44 @@ import { AztecAddress, + type BlockHeader, CallContext, ClientIvcProof, type ContractInstanceWithAddress, GasFees, GasSettings, - MAX_ENQUEUED_CALLS_PER_TX, Nullifier, - PartialPrivateTailPublicInputsForPublic, PrivateCircuitPublicInputs, - PrivateKernelTailCircuitPublicInputs, - PrivateToPublicAccumulatedDataBuilder, SerializableContractInstance, computeContractAddressFromInstance, getContractClassFromArtifact, } from '@aztec/circuits.js'; +import { type ContractArtifact, NoteSelector } from '@aztec/circuits.js/abi'; import { computeVarArgsHash } from '@aztec/circuits.js/hash'; -import { makeCombinedConstantData, makeGas, makePublicCallRequest } from '@aztec/circuits.js/testing'; -import { type ContractArtifact, NoteSelector } from '@aztec/foundation/abi'; +import { + PartialPrivateTailPublicInputsForPublic, + PrivateKernelTailCircuitPublicInputs, + PrivateToPublicAccumulatedDataBuilder, +} from '@aztec/circuits.js/kernel'; +import { makeCombinedConstantData, makeGas, makeHeader, makePublicCallRequest } from '@aztec/circuits.js/testing'; +import { MAX_ENQUEUED_CALLS_PER_TX } from '@aztec/constants'; import { times } from '@aztec/foundation/collection'; -import { randomBytes } from '@aztec/foundation/crypto'; +import { Secp256k1Signer, randomBytes } from '@aztec/foundation/crypto'; import { Fr } from '@aztec/foundation/fields'; -import { ContractClassTxL2Logs, Note } from './logs/index.js'; -import { ExtendedNote, UniqueNote } from './notes/index.js'; +import { ContractClassTxL2Logs, Note } from '../logs/index.js'; +import { ExtendedNote, UniqueNote } from '../notes/index.js'; +import { BlockAttestation } from '../p2p/block_attestation.js'; +import { BlockProposal } from '../p2p/block_proposal.js'; +import { ConsensusPayload } from '../p2p/consensus_payload.js'; +import { SignatureDomainSeparator, getHashedSignaturePayloadEthSignedMessage } from '../p2p/signature_utils.js'; import { CountedPublicExecutionRequest, PrivateCallExecutionResult, PrivateExecutionResult, -} from './private_execution_result.js'; -import { PublicExecutionRequest } from './public_execution_request.js'; -import { PublicSimulationOutput, Tx, TxHash, TxSimulationResult, accumulatePrivateReturnValues } from './tx/index.js'; -import { TxEffect } from './tx_effect.js'; +} from '../private_execution_result.js'; +import { PublicExecutionRequest } from '../public_execution_request.js'; +import { PublicSimulationOutput, Tx, TxHash, TxSimulationResult, accumulatePrivateReturnValues } from '../tx/index.js'; +import { TxEffect } from '../tx_effect.js'; export const randomTxHash = (): TxHash => TxHash.random(); @@ -252,3 +259,44 @@ export const randomUniqueNote = async ({ nonce, ); }; + +export interface MakeConsensusPayloadOptions { + signer?: Secp256k1Signer; + header?: BlockHeader; + archive?: Fr; + txHashes?: TxHash[]; +} + +const makeAndSignConsensusPayload = async ( + domainSeparator: SignatureDomainSeparator, + options?: MakeConsensusPayloadOptions, +) => { + const { + signer = Secp256k1Signer.random(), + header = makeHeader(1), + archive = Fr.random(), + txHashes = [0, 1, 2, 3, 4, 5].map(() => TxHash.random()), + } = options ?? {}; + + const payload = ConsensusPayload.fromFields({ + header, + archive, + txHashes, + }); + + const hash = await getHashedSignaturePayloadEthSignedMessage(payload, domainSeparator); + const signature = signer.sign(hash); + + return { payload, signature }; +}; + +export const makeBlockProposal = async (options?: MakeConsensusPayloadOptions): Promise => { + const { payload, signature } = await makeAndSignConsensusPayload(SignatureDomainSeparator.blockProposal, options); + return new BlockProposal(payload, signature); +}; + +// TODO(https://github.com/AztecProtocol/aztec-packages/issues/8028) +export const makeBlockAttestation = async (options?: MakeConsensusPayloadOptions): Promise => { + const { payload, signature } = await makeAndSignConsensusPayload(SignatureDomainSeparator.blockAttestation, options); + return new BlockAttestation(payload, signature); +}; diff --git a/yarn-project/circuit-types/src/tx/processed_tx.ts b/yarn-project/circuit-types/src/tx/processed_tx.ts index 3cbd89b4bfe0..c1a19a770e6f 100644 --- a/yarn-project/circuit-types/src/tx/processed_tx.ts +++ b/yarn-project/circuit-types/src/tx/processed_tx.ts @@ -1,14 +1,13 @@ import { type ClientIvcProof, - CombinedConstantData, Fr, Gas, type GlobalVariables, - type PrivateKernelTailCircuitPublicInputs, type PublicDataWrite, RevertCode, } from '@aztec/circuits.js'; import { siloL2ToL1Message } from '@aztec/circuits.js/hash'; +import { CombinedConstantData, type PrivateKernelTailCircuitPublicInputs } from '@aztec/circuits.js/kernel'; import { type AvmProvingRequest } from '../interfaces/proving-job.js'; import { type SimulationError } from '../simulation_error.js'; diff --git a/yarn-project/circuit-types/src/tx/public_simulation_output.ts b/yarn-project/circuit-types/src/tx/public_simulation_output.ts index 18b4a5c79faa..133a5e6419ff 100644 --- a/yarn-project/circuit-types/src/tx/public_simulation_output.ts +++ b/yarn-project/circuit-types/src/tx/public_simulation_output.ts @@ -1,4 +1,5 @@ -import { CombinedConstantData, Fr, Gas } from '@aztec/circuits.js'; +import { Fr, Gas } from '@aztec/circuits.js'; +import { CombinedConstantData } from '@aztec/circuits.js/kernel'; import { type ZodFor, schemas } from '@aztec/foundation/schemas'; import times from 'lodash.times'; diff --git a/yarn-project/circuit-types/src/tx/simulated_tx.test.ts b/yarn-project/circuit-types/src/tx/simulated_tx.test.ts index a2d622b8b470..ecb9b099a24f 100644 --- a/yarn-project/circuit-types/src/tx/simulated_tx.test.ts +++ b/yarn-project/circuit-types/src/tx/simulated_tx.test.ts @@ -1,6 +1,6 @@ import { jsonStringify } from '@aztec/foundation/json-rpc'; -import { mockSimulatedTx } from '../mocks.js'; +import { mockSimulatedTx } from '../test/mocks.js'; import { TxProvingResult, TxSimulationResult } from './simulated_tx.js'; describe('simulated_tx', () => { diff --git a/yarn-project/circuit-types/src/tx/simulated_tx.ts b/yarn-project/circuit-types/src/tx/simulated_tx.ts index de3921ca381c..fbab5476c87c 100644 --- a/yarn-project/circuit-types/src/tx/simulated_tx.ts +++ b/yarn-project/circuit-types/src/tx/simulated_tx.ts @@ -1,4 +1,5 @@ -import { ClientIvcProof, Gas, PrivateKernelTailCircuitPublicInputs } from '@aztec/circuits.js'; +import { ClientIvcProof, Gas } from '@aztec/circuits.js'; +import { PrivateKernelTailCircuitPublicInputs } from '@aztec/circuits.js/kernel'; import { type FieldsOf } from '@aztec/foundation/types'; import { z } from 'zod'; diff --git a/yarn-project/circuit-types/src/tx/tx.test.ts b/yarn-project/circuit-types/src/tx/tx.test.ts index 8a272a1c4bd1..dfee1be36f1e 100644 --- a/yarn-project/circuit-types/src/tx/tx.test.ts +++ b/yarn-project/circuit-types/src/tx/tx.test.ts @@ -1,6 +1,6 @@ import { jsonStringify } from '@aztec/foundation/json-rpc'; -import { mockTx } from '../mocks.js'; +import { mockTx } from '../test/mocks.js'; import { Tx } from './tx.js'; describe('Tx', () => { diff --git a/yarn-project/circuit-types/src/tx/tx.ts b/yarn-project/circuit-types/src/tx/tx.ts index 50deb357c465..2b5124002716 100644 --- a/yarn-project/circuit-types/src/tx/tx.ts +++ b/yarn-project/circuit-types/src/tx/tx.ts @@ -1,11 +1,5 @@ -import { - ClientIvcProof, - Fr, - type GasSettings, - PrivateKernelTailCircuitPublicInputs, - PrivateLog, - type PrivateToPublicAccumulatedData, -} from '@aztec/circuits.js'; +import { ClientIvcProof, Fr, type GasSettings, PrivateLog } from '@aztec/circuits.js'; +import { PrivateKernelTailCircuitPublicInputs, type PrivateToPublicAccumulatedData } from '@aztec/circuits.js/kernel'; import { Buffer32 } from '@aztec/foundation/buffer'; import { arraySerializedSizeOfNonEmpty } from '@aztec/foundation/collection'; import { BufferReader, serializeArrayOfBufferableToVector, serializeToBuffer } from '@aztec/foundation/serialize'; diff --git a/yarn-project/circuit-types/src/tx_effect.ts b/yarn-project/circuit-types/src/tx_effect.ts index 5ad060395853..34503aa14e50 100644 --- a/yarn-project/circuit-types/src/tx_effect.ts +++ b/yarn-project/circuit-types/src/tx_effect.ts @@ -1,6 +1,6 @@ +import { Fr, PrivateLog, PublicDataWrite, PublicLog, RevertCode } from '@aztec/circuits.js'; import { CONTRACT_CLASS_LOGS_PREFIX, - Fr, L2_L1_MSGS_PREFIX, MAX_L2_TO_L1_MSGS_PER_TX, MAX_NOTE_HASHES_PER_TX, @@ -14,13 +14,9 @@ import { PUBLIC_DATA_UPDATE_REQUESTS_PREFIX, PUBLIC_LOGS_PREFIX, PUBLIC_LOG_SIZE_IN_FIELDS, - PrivateLog, - PublicDataWrite, - PublicLog, REVERT_CODE_PREFIX, - RevertCode, TX_FEE_PREFIX, -} from '@aztec/circuits.js'; +} from '@aztec/constants'; import { type FieldsOf, makeTuple, makeTupleAsync } from '@aztec/foundation/array'; import { toBufferBE } from '@aztec/foundation/bigint-buffer'; import { padArrayEnd } from '@aztec/foundation/collection'; diff --git a/yarn-project/circuit-types/src/tx_execution_request.ts b/yarn-project/circuit-types/src/tx_execution_request.ts index 18e19a74edfa..76cc924e58e5 100644 --- a/yarn-project/circuit-types/src/tx_execution_request.ts +++ b/yarn-project/circuit-types/src/tx_execution_request.ts @@ -1,5 +1,5 @@ import { AztecAddress, Fr, FunctionData, FunctionSelector, TxContext, TxRequest, Vector } from '@aztec/circuits.js'; -import { schemas } from '@aztec/foundation/schemas'; +import { schemas } from '@aztec/circuits.js/schemas'; import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize'; import { bufferToHex, hexToBuffer } from '@aztec/foundation/string'; import { type FieldsOf } from '@aztec/foundation/types'; diff --git a/yarn-project/circuit-types/tsconfig.json b/yarn-project/circuit-types/tsconfig.json index 15a8206d1cb4..e19ead0239dd 100644 --- a/yarn-project/circuit-types/tsconfig.json +++ b/yarn-project/circuit-types/tsconfig.json @@ -9,6 +9,9 @@ { "path": "../circuits.js" }, + { + "path": "../constants" + }, { "path": "../ethereum" }, diff --git a/yarn-project/circuits.js/package.json b/yarn-project/circuits.js/package.json index e5844f9d5fb0..407615a90fbb 100644 --- a/yarn-project/circuits.js/package.json +++ b/yarn-project/circuits.js/package.json @@ -8,6 +8,7 @@ ], "exports": { ".": "./dest/index.js", + "./abi": "./dest/abi/index.js", "./hash": "./dest/hash/index.js", "./keys": "./dest/keys/index.js", "./barretenberg": "./dest/barretenberg/index.js", @@ -16,12 +17,15 @@ "./interfaces": "./dest/interfaces/index.js", "./utils": "./dest/utils/index.js", "./types": "./dest/types/index.js", - "./constants": "./dest/constants.js", "./contract": "./dest/contract/index.js", - "./merkle": "./dest/merkle/index.js", "./simulation": "./dest/simulator/index.js", - "./blobs": "./dest/structs/blobs/index.js", - "./rollup": "./dest/structs/rollup/index.js" + "./rollup": "./dest/structs/rollup/index.js", + "./kernel": "./dest/structs/kernel/index.js", + "./trees": "./dest/structs/trees/index.js", + "./avm": "./dest/structs/avm/index.js", + "./schemas": "./dest/schemas/index.js", + "./noir": "./dest/noir/index.js", + "./shared-mutable": "./dest/structs/shared_mutable/index.js" }, "typedocOptions": { "entryPoints": [ @@ -43,17 +47,21 @@ "dependencies": { "@aztec/bb.js": "portal:../../barretenberg/ts", "@aztec/blob-lib": "workspace:^", + "@aztec/constants": "workspace:^", "@aztec/ethereum": "workspace:^", "@aztec/foundation": "workspace:^", - "@aztec/types": "workspace:^", + "lodash.chunk": "^4.2.0", "msgpackr": "^1.11.2", + "pako": "^2.1.0", "tslib": "^2.4.0", "zod": "^3.23.8" }, "devDependencies": { "@jest/globals": "^29.5.0", "@types/jest": "^29.5.0", + "@types/lodash.chunk": "^4.2.9", "@types/node": "^18.7.23", + "@types/pako": "^2.0.3", "eslint": "^8.35.0", "jest": "^29.5.0", "prettier": "^2.8.4", diff --git a/yarn-project/foundation/src/abi/__snapshots__/function_selector.test.ts.snap b/yarn-project/circuits.js/src/abi/__snapshots__/function_selector.test.ts.snap similarity index 100% rename from yarn-project/foundation/src/abi/__snapshots__/function_selector.test.ts.snap rename to yarn-project/circuits.js/src/abi/__snapshots__/function_selector.test.ts.snap diff --git a/yarn-project/foundation/src/abi/abi.test.ts b/yarn-project/circuits.js/src/abi/abi.test.ts similarity index 100% rename from yarn-project/foundation/src/abi/abi.test.ts rename to yarn-project/circuits.js/src/abi/abi.test.ts diff --git a/yarn-project/foundation/src/abi/abi.ts b/yarn-project/circuits.js/src/abi/abi.ts similarity index 98% rename from yarn-project/foundation/src/abi/abi.ts rename to yarn-project/circuits.js/src/abi/abi.ts index c4b555ba73b1..cbf1d9e95910 100644 --- a/yarn-project/foundation/src/abi/abi.ts +++ b/yarn-project/circuits.js/src/abi/abi.ts @@ -1,13 +1,13 @@ /* eslint-disable camelcase */ +import { type Fr } from '@aztec/foundation/fields'; +import { createLogger } from '@aztec/foundation/log'; +import { type ZodFor, schemas } from '@aztec/foundation/schemas'; + import { inflate } from 'pako'; import { z } from 'zod'; -import { type Fr } from '../fields/fields.js'; -import { createLogger } from '../log/index.js'; -import { schemas } from '../schemas/schemas.js'; -import { type ZodFor } from '../schemas/types.js'; import { FunctionSelector } from './function_selector.js'; -import { type NoteSelector } from './note_selector.js'; +import { NoteSelector } from './note_selector.js'; /** A basic value. */ export interface BasicValue { @@ -318,7 +318,7 @@ export type ContractNote = { }; export const ContractNoteSchema = z.object({ - id: schemas.NoteSelector, + id: NoteSelector.schema, typ: z.string(), fields: z.array(NoteFieldSchema), }) satisfies ZodFor; diff --git a/yarn-project/foundation/src/abi/buffer.test.ts b/yarn-project/circuits.js/src/abi/buffer.test.ts similarity index 100% rename from yarn-project/foundation/src/abi/buffer.test.ts rename to yarn-project/circuits.js/src/abi/buffer.test.ts diff --git a/yarn-project/foundation/src/abi/buffer.ts b/yarn-project/circuits.js/src/abi/buffer.ts similarity index 97% rename from yarn-project/foundation/src/abi/buffer.ts rename to yarn-project/circuits.js/src/abi/buffer.ts index 501f8070ea72..a7f3004de867 100644 --- a/yarn-project/foundation/src/abi/buffer.ts +++ b/yarn-project/circuits.js/src/abi/buffer.ts @@ -1,6 +1,6 @@ -import chunk from 'lodash.chunk'; +import { Fr } from '@aztec/foundation/fields'; -import { Fr } from '../fields/fields.js'; +import chunk from 'lodash.chunk'; /** * Formats a buffer as an array of fields. Splits the input into 31-byte chunks, and stores each diff --git a/yarn-project/types/src/abi/contract_artifact.test.ts b/yarn-project/circuits.js/src/abi/contract_artifact.test.ts similarity index 75% rename from yarn-project/types/src/abi/contract_artifact.test.ts rename to yarn-project/circuits.js/src/abi/contract_artifact.test.ts index 83ac5273287d..380c37daabf2 100644 --- a/yarn-project/types/src/abi/contract_artifact.test.ts +++ b/yarn-project/circuits.js/src/abi/contract_artifact.test.ts @@ -1,9 +1,9 @@ -import { getSampleContractArtifact } from '../test/fixtures.js'; +import { getBenchmarkContractArtifact } from '../tests/fixtures.js'; import { contractArtifactFromBuffer, contractArtifactToBuffer } from './contract_artifact.js'; describe('contract_artifact', () => { it('serializes and deserializes an instance', async () => { - const artifact = getSampleContractArtifact(); + const artifact = getBenchmarkContractArtifact(); const serialized = contractArtifactToBuffer(artifact); const deserialized = await contractArtifactFromBuffer(serialized); expect(deserialized).toEqual(artifact); diff --git a/yarn-project/types/src/abi/contract_artifact.ts b/yarn-project/circuits.js/src/abi/contract_artifact.ts similarity index 99% rename from yarn-project/types/src/abi/contract_artifact.ts rename to yarn-project/circuits.js/src/abi/contract_artifact.ts index 7505a9ed4aa1..4e95f669c234 100644 --- a/yarn-project/types/src/abi/contract_artifact.ts +++ b/yarn-project/circuits.js/src/abi/contract_artifact.ts @@ -12,7 +12,7 @@ import { type IntegerValue, type StructValue, type TypedStructFieldValue, -} from '@aztec/foundation/abi'; +} from '@aztec/circuits.js/abi'; import { jsonParseWithSchema, jsonStringify } from '@aztec/foundation/json-rpc'; import { diff --git a/yarn-project/foundation/src/abi/decoder.test.ts b/yarn-project/circuits.js/src/abi/decoder.test.ts similarity index 99% rename from yarn-project/foundation/src/abi/decoder.test.ts rename to yarn-project/circuits.js/src/abi/decoder.test.ts index 19ccce4da717..2a59fb890a17 100644 --- a/yarn-project/foundation/src/abi/decoder.test.ts +++ b/yarn-project/circuits.js/src/abi/decoder.test.ts @@ -1,4 +1,5 @@ -import { Fr } from '../fields/fields.js'; +import { Fr } from '@aztec/foundation/fields'; + import { type ABIParameterVisibility, type FunctionArtifact } from './abi.js'; import { decodeFromAbi, decodeFunctionSignature, decodeFunctionSignatureWithParameterNames } from './decoder.js'; diff --git a/yarn-project/foundation/src/abi/decoder.ts b/yarn-project/circuits.js/src/abi/decoder.ts similarity index 98% rename from yarn-project/foundation/src/abi/decoder.ts rename to yarn-project/circuits.js/src/abi/decoder.ts index cd07e4866707..4aff1fde8059 100644 --- a/yarn-project/foundation/src/abi/decoder.ts +++ b/yarn-project/circuits.js/src/abi/decoder.ts @@ -1,5 +1,6 @@ -import { AztecAddress } from '../aztec-address/index.js'; -import { Fr } from '../fields/index.js'; +import { AztecAddress } from '@aztec/foundation/aztec-address'; +import { Fr } from '@aztec/foundation/fields'; + 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/foundation/src/abi/encoder.test.ts b/yarn-project/circuits.js/src/abi/encoder.test.ts similarity index 95% rename from yarn-project/foundation/src/abi/encoder.test.ts rename to yarn-project/circuits.js/src/abi/encoder.test.ts index fe60cc7f7f0b..4475b36e45ac 100644 --- a/yarn-project/foundation/src/abi/encoder.test.ts +++ b/yarn-project/circuits.js/src/abi/encoder.test.ts @@ -1,8 +1,8 @@ -import { AztecAddress } from '../aztec-address/index.js'; -import { Fr } from '../fields/fields.js'; -import { Point } from '../fields/point.js'; -import { jsonParseWithSchema, jsonStringify } from '../json-rpc/convert.js'; -import { schemas } from '../schemas/schemas.js'; +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 { type FunctionAbi, FunctionType } from './abi.js'; import { encodeArguments } from './encoder.js'; diff --git a/yarn-project/foundation/src/abi/encoder.ts b/yarn-project/circuits.js/src/abi/encoder.ts similarity index 99% rename from yarn-project/foundation/src/abi/encoder.ts rename to yarn-project/circuits.js/src/abi/encoder.ts index 6bbf1e3515be..831b951df80a 100644 --- a/yarn-project/foundation/src/abi/encoder.ts +++ b/yarn-project/circuits.js/src/abi/encoder.ts @@ -1,4 +1,5 @@ -import { Fr } from '../fields/index.js'; +import { Fr } from '@aztec/foundation/fields'; + import { type AbiType, type FunctionAbi } from './abi.js'; import { U128 } from './u128.js'; import { isAddressStruct, isFunctionSelectorStruct, isU128Struct, isWrappedFieldStruct } from './utils.js'; diff --git a/yarn-project/foundation/src/abi/event_selector.ts b/yarn-project/circuits.js/src/abi/event_selector.ts similarity index 88% rename from yarn-project/foundation/src/abi/event_selector.ts rename to yarn-project/circuits.js/src/abi/event_selector.ts index 80036e772827..41239e05f8cf 100644 --- a/yarn-project/foundation/src/abi/event_selector.ts +++ b/yarn-project/circuits.js/src/abi/event_selector.ts @@ -1,8 +1,9 @@ -import { fromHex, toBigIntBE } from '../bigint-buffer/index.js'; -import { poseidon2HashBytes, randomBytes } from '../crypto/index.js'; -import { type Fr } from '../fields/fields.js'; -import { hexSchemaFor } from '../schemas/utils.js'; -import { BufferReader } from '../serialize/buffer_reader.js'; +import { fromHex, toBigIntBE } from '@aztec/foundation/bigint-buffer'; +import { poseidon2HashBytes, randomBytes } from '@aztec/foundation/crypto'; +import { type Fr } from '@aztec/foundation/fields'; +import { hexSchemaFor } from '@aztec/foundation/schemas'; +import { BufferReader } from '@aztec/foundation/serialize'; + import { Selector } from './selector.js'; /* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */ diff --git a/yarn-project/foundation/src/abi/function_selector.test.ts b/yarn-project/circuits.js/src/abi/function_selector.test.ts similarity index 93% rename from yarn-project/foundation/src/abi/function_selector.test.ts rename to yarn-project/circuits.js/src/abi/function_selector.test.ts index 6ebdf1ff6f73..23205916217b 100644 --- a/yarn-project/foundation/src/abi/function_selector.test.ts +++ b/yarn-project/circuits.js/src/abi/function_selector.test.ts @@ -1,4 +1,5 @@ -import { setupCustomSnapshotSerializers } from '../testing/index.js'; +import { setupCustomSnapshotSerializers } from '@aztec/foundation/testing'; + import { FunctionSelector } from './function_selector.js'; describe('FunctionSelector', () => { diff --git a/yarn-project/foundation/src/abi/function_selector.ts b/yarn-project/circuits.js/src/abi/function_selector.ts similarity index 90% rename from yarn-project/foundation/src/abi/function_selector.ts rename to yarn-project/circuits.js/src/abi/function_selector.ts index 909e1d95d603..0afc0bf3f973 100644 --- a/yarn-project/foundation/src/abi/function_selector.ts +++ b/yarn-project/circuits.js/src/abi/function_selector.ts @@ -1,10 +1,9 @@ -import { fromHex, toBigIntBE } from '../bigint-buffer/index.js'; -import { poseidon2HashBytes, randomBytes } from '../crypto/index.js'; -import { type Fr } from '../fields/fields.js'; -import { hexSchemaFor } from '../schemas/utils.js'; -import { BufferReader } from '../serialize/buffer_reader.js'; -import { FieldReader } from '../serialize/field_reader.js'; -import { TypeRegistry } from '../serialize/type_registry.js'; +import { fromHex, toBigIntBE } from '@aztec/foundation/bigint-buffer'; +import { poseidon2HashBytes, randomBytes } from '@aztec/foundation/crypto'; +import { type Fr } from '@aztec/foundation/fields'; +import { hexSchemaFor } from '@aztec/foundation/schemas'; +import { BufferReader, FieldReader, TypeRegistry } from '@aztec/foundation/serialize'; + import { type ABIParameter } from './abi.js'; import { decodeFunctionSignature } from './decoder.js'; import { Selector } from './selector.js'; diff --git a/yarn-project/foundation/src/abi/index.ts b/yarn-project/circuits.js/src/abi/index.ts similarity index 87% rename from yarn-project/foundation/src/abi/index.ts rename to yarn-project/circuits.js/src/abi/index.ts index 3cededc1a9b6..806b84c91364 100644 --- a/yarn-project/foundation/src/abi/index.ts +++ b/yarn-project/circuits.js/src/abi/index.ts @@ -7,3 +7,4 @@ export * from './function_selector.js'; export * from './note_selector.js'; export * from './utils.js'; export * from './u128.js'; +export * from './contract_artifact.js'; diff --git a/yarn-project/types/src/abi/mocked_keys.ts b/yarn-project/circuits.js/src/abi/mocked_keys.ts similarity index 100% rename from yarn-project/types/src/abi/mocked_keys.ts rename to yarn-project/circuits.js/src/abi/mocked_keys.ts diff --git a/yarn-project/foundation/src/abi/note_selector.ts b/yarn-project/circuits.js/src/abi/note_selector.ts similarity index 85% rename from yarn-project/foundation/src/abi/note_selector.ts rename to yarn-project/circuits.js/src/abi/note_selector.ts index 862ee55d7005..47b9af0546b8 100644 --- a/yarn-project/foundation/src/abi/note_selector.ts +++ b/yarn-project/circuits.js/src/abi/note_selector.ts @@ -1,9 +1,9 @@ -import { toBigIntBE } from '../bigint-buffer/index.js'; -import { randomInt } from '../crypto/index.js'; -import { Fr } from '../fields/fields.js'; -import { hexSchemaFor } from '../schemas/utils.js'; -import { BufferReader } from '../serialize/buffer_reader.js'; -import { TypeRegistry } from '../serialize/type_registry.js'; +import { toBigIntBE } from '@aztec/foundation/bigint-buffer'; +import { randomInt } from '@aztec/foundation/crypto'; +import { Fr } from '@aztec/foundation/fields'; +import { hexSchemaFor } from '@aztec/foundation/schemas'; +import { BufferReader, TypeRegistry } from '@aztec/foundation/serialize'; + import { Selector } from './selector.js'; /* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */ diff --git a/yarn-project/foundation/src/abi/selector.ts b/yarn-project/circuits.js/src/abi/selector.ts similarity index 89% rename from yarn-project/foundation/src/abi/selector.ts rename to yarn-project/circuits.js/src/abi/selector.ts index 9ee416654b3f..01ffe6fc531b 100644 --- a/yarn-project/foundation/src/abi/selector.ts +++ b/yarn-project/circuits.js/src/abi/selector.ts @@ -1,8 +1,8 @@ -import { inspect } from 'util'; +import { toBufferBE } from '@aztec/foundation/bigint-buffer'; +import { Fr } from '@aztec/foundation/fields'; +import { bufferToHex } from '@aztec/foundation/string'; -import { toBufferBE } from '../bigint-buffer/index.js'; -import { Fr } from '../fields/index.js'; -import { bufferToHex } from '../string/index.js'; +import { inspect } from 'util'; /** A selector is the first 4 bytes of the hash of a signature. */ export abstract class Selector { diff --git a/yarn-project/foundation/src/abi/u128.test.ts b/yarn-project/circuits.js/src/abi/u128.test.ts similarity index 100% rename from yarn-project/foundation/src/abi/u128.test.ts rename to yarn-project/circuits.js/src/abi/u128.test.ts diff --git a/yarn-project/foundation/src/abi/u128.ts b/yarn-project/circuits.js/src/abi/u128.ts similarity index 97% rename from yarn-project/foundation/src/abi/u128.ts rename to yarn-project/circuits.js/src/abi/u128.ts index 14fda5848955..f8a63b9e1ad3 100644 --- a/yarn-project/foundation/src/abi/u128.ts +++ b/yarn-project/circuits.js/src/abi/u128.ts @@ -1,4 +1,4 @@ -import { Fr } from '../fields/fields.js'; +import { Fr } from '@aztec/foundation/fields'; // A typescript version of noir::std::U128 export class U128 { diff --git a/yarn-project/foundation/src/abi/utils.test.ts b/yarn-project/circuits.js/src/abi/utils.test.ts similarity index 100% rename from yarn-project/foundation/src/abi/utils.test.ts rename to yarn-project/circuits.js/src/abi/utils.test.ts diff --git a/yarn-project/foundation/src/abi/utils.ts b/yarn-project/circuits.js/src/abi/utils.ts similarity index 100% rename from yarn-project/foundation/src/abi/utils.ts rename to yarn-project/circuits.js/src/abi/utils.ts diff --git a/yarn-project/circuits.js/src/barretenberg/README.txt b/yarn-project/circuits.js/src/barretenberg/README.txt deleted file mode 100644 index e85c0ca52c03..000000000000 --- a/yarn-project/circuits.js/src/barretenberg/README.txt +++ /dev/null @@ -1 +0,0 @@ -Temporary folder - see https://github.com/AztecProtocol/aztec-packages/issues/782 diff --git a/yarn-project/circuits.js/src/barretenberg/crypto/index.ts b/yarn-project/circuits.js/src/barretenberg/crypto/index.ts deleted file mode 100644 index e9c594c032d0..000000000000 --- a/yarn-project/circuits.js/src/barretenberg/crypto/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from './aes128/index.js'; -export * from './grumpkin/index.js'; -export * from './ecdsa/index.js'; -export * from './secp256k1/index.js'; -export * from './schnorr/index.js'; -export * from './signature/index.js'; diff --git a/yarn-project/circuits.js/src/barretenberg/index.ts b/yarn-project/circuits.js/src/barretenberg/index.ts deleted file mode 100644 index d86f006724fd..000000000000 --- a/yarn-project/circuits.js/src/barretenberg/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './crypto/index.js'; diff --git a/yarn-project/circuits.js/src/contract/artifact_hash.test.ts b/yarn-project/circuits.js/src/contract/artifact_hash.test.ts index 453f058785df..efb98b970b18 100644 --- a/yarn-project/circuits.js/src/contract/artifact_hash.test.ts +++ b/yarn-project/circuits.js/src/contract/artifact_hash.test.ts @@ -1,5 +1,4 @@ -import { type ContractArtifact } from '@aztec/foundation/abi'; - +import { type ContractArtifact } from '../abi/index.js'; import { getTestContractArtifact } from '../tests/fixtures.js'; import { computeArtifactHash } from './artifact_hash.js'; diff --git a/yarn-project/circuits.js/src/contract/artifact_hash.ts b/yarn-project/circuits.js/src/contract/artifact_hash.ts index a69151ee9882..aec73e6c9005 100644 --- a/yarn-project/circuits.js/src/contract/artifact_hash.ts +++ b/yarn-project/circuits.js/src/contract/artifact_hash.ts @@ -1,11 +1,10 @@ -import { type ContractArtifact, type FunctionArtifact, FunctionSelector, FunctionType } from '@aztec/foundation/abi'; import { sha256 } from '@aztec/foundation/crypto'; import { Fr, reduceFn } from '@aztec/foundation/fields'; import { createLogger } from '@aztec/foundation/log'; import { numToUInt8 } from '@aztec/foundation/serialize'; +import { MerkleTree, MerkleTreeCalculator } from '@aztec/foundation/trees'; -import { type MerkleTree } from '../merkle/merkle_tree.js'; -import { MerkleTreeCalculator } from '../merkle/merkle_tree_calculator.js'; +import { type ContractArtifact, type FunctionArtifact, FunctionSelector, FunctionType } from '../abi/index.js'; const VERSION = 1; diff --git a/yarn-project/circuits.js/src/contract/contract_address.test.ts b/yarn-project/circuits.js/src/contract/contract_address.test.ts index 7179cd706abc..dd2a3d886ce9 100644 --- a/yarn-project/circuits.js/src/contract/contract_address.test.ts +++ b/yarn-project/circuits.js/src/contract/contract_address.test.ts @@ -1,7 +1,7 @@ -import { type FunctionAbi, FunctionType } from '@aztec/foundation/abi'; import { Fr } from '@aztec/foundation/fields'; import { setupCustomSnapshotSerializers } from '@aztec/foundation/testing'; +import { type FunctionAbi, FunctionType } from '../abi/index.js'; import { AztecAddress, deriveKeys } from '../index.js'; import { computeContractAddressFromInstance, diff --git a/yarn-project/circuits.js/src/contract/contract_address.ts b/yarn-project/circuits.js/src/contract/contract_address.ts index 98a577774d69..1601dafdb004 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 { type FunctionAbi, FunctionSelector, encodeArguments } from '@aztec/foundation/abi'; +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 { GeneratorIndex } from '../constants.gen.js'; +import { type FunctionAbi, FunctionSelector, encodeArguments } from '../abi/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_class.test.ts b/yarn-project/circuits.js/src/contract/contract_class.test.ts index c64b940f9a18..153e47ae0d46 100644 --- a/yarn-project/circuits.js/src/contract/contract_class.test.ts +++ b/yarn-project/circuits.js/src/contract/contract_class.test.ts @@ -1,7 +1,7 @@ -import { FunctionSelector, FunctionType } from '@aztec/foundation/abi'; +import { PUBLIC_DISPATCH_SELECTOR } from '@aztec/constants'; import { Fr } from '@aztec/foundation/fields'; -import { PUBLIC_DISPATCH_SELECTOR } from '../constants.gen.js'; +import { FunctionSelector, FunctionType } from '../abi/index.js'; import { getBenchmarkContractArtifact } from '../tests/fixtures.js'; import { getContractClassFromArtifact } from './contract_class.js'; diff --git a/yarn-project/circuits.js/src/contract/contract_class.ts b/yarn-project/circuits.js/src/contract/contract_class.ts index 7e973dde13dc..d593e569644c 100644 --- a/yarn-project/circuits.js/src/contract/contract_class.ts +++ b/yarn-project/circuits.js/src/contract/contract_class.ts @@ -1,8 +1,8 @@ -import { type ContractArtifact, type FunctionArtifact, FunctionSelector, FunctionType } from '@aztec/foundation/abi'; +import { PUBLIC_DISPATCH_SELECTOR } from '@aztec/constants'; import { vkAsFieldsMegaHonk } from '@aztec/foundation/crypto'; import { Fr } from '@aztec/foundation/fields'; -import { PUBLIC_DISPATCH_SELECTOR } from '../constants.gen.js'; +import { type ContractArtifact, type FunctionArtifact, FunctionSelector, FunctionType } from '../abi/index.js'; import { hashVK } from '../hash/hash.js'; import { computeArtifactHash } from './artifact_hash.js'; import { type ContractClassIdPreimage, computeContractClassIdWithPreimage } from './contract_class_id.js'; diff --git a/yarn-project/circuits.js/src/contract/contract_class_id.ts b/yarn-project/circuits.js/src/contract/contract_class_id.ts index 011347564142..825c0d09eaa2 100644 --- a/yarn-project/circuits.js/src/contract/contract_class_id.ts +++ b/yarn-project/circuits.js/src/contract/contract_class_id.ts @@ -1,10 +1,10 @@ -import { bufferAsFields } from '@aztec/foundation/abi'; +import { GeneratorIndex, MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS } from '@aztec/constants'; import { poseidon2HashAccumulate, poseidon2HashWithSeparator } from '@aztec/foundation/crypto'; import { Fr } from '@aztec/foundation/fields'; import { strict as assert } from 'assert'; -import { GeneratorIndex, MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS } from '../constants.gen.js'; +import { bufferAsFields } from '../abi/index.js'; import { type ContractClass } from './interfaces/contract_class.js'; import { computePrivateFunctionsRoot } from './private_function.js'; diff --git a/yarn-project/circuits.js/src/contract/contract_instance.ts b/yarn-project/circuits.js/src/contract/contract_instance.ts index 77ad130e30fc..67850b360338 100644 --- a/yarn-project/circuits.js/src/contract/contract_instance.ts +++ b/yarn-project/circuits.js/src/contract/contract_instance.ts @@ -1,14 +1,9 @@ -import { - type ContractArtifact, - type FunctionArtifact, - FunctionSelector, - getDefaultInitializer, -} from '@aztec/foundation/abi'; 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 { 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_class.ts b/yarn-project/circuits.js/src/contract/interfaces/contract_class.ts index 002c3ac4f758..152e780663dd 100644 --- a/yarn-project/circuits.js/src/contract/interfaces/contract_class.ts +++ b/yarn-project/circuits.js/src/contract/interfaces/contract_class.ts @@ -1,9 +1,10 @@ -import { type FunctionSelector } from '@aztec/foundation/abi'; import { type Fr } from '@aztec/foundation/fields'; import { type ZodFor, schemas } from '@aztec/foundation/schemas'; import { z } from 'zod'; +import { FunctionSelector } from '../../abi/index.js'; + const VERSION = 1 as const; /** @@ -34,7 +35,7 @@ export interface PrivateFunction { } const PrivateFunctionSchema = z.object({ - selector: schemas.FunctionSelector, + selector: FunctionSelector.schema, vkHash: schemas.Fr, }) satisfies ZodFor; @@ -57,7 +58,7 @@ export interface PublicFunction { } export const PublicFunctionSchema = z.object({ - selector: schemas.FunctionSelector, + selector: FunctionSelector.schema, bytecode: schemas.Buffer, }) satisfies ZodFor; @@ -71,7 +72,7 @@ export interface UnconstrainedFunction { const UnconstrainedFunctionSchema = z.object({ /** lala */ - selector: schemas.FunctionSelector, + selector: FunctionSelector.schema, bytecode: schemas.Buffer, }) satisfies ZodFor; 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 433e7ddd9589..537bcd84921c 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 FunctionSelector } from '@aztec/foundation/abi'; import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { type Fr } from '@aztec/foundation/fields'; +import { FunctionSelector } from '../../abi/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/private_function.ts b/yarn-project/circuits.js/src/contract/private_function.ts index 046ce0a3f196..defe15f8ef3e 100644 --- a/yarn-project/circuits.js/src/contract/private_function.ts +++ b/yarn-project/circuits.js/src/contract/private_function.ts @@ -1,8 +1,8 @@ +import { FUNCTION_TREE_HEIGHT, GeneratorIndex } from '@aztec/constants'; import { pedersenHash, poseidon2Hash, poseidon2HashWithSeparator } from '@aztec/foundation/crypto'; import { Fr } from '@aztec/foundation/fields'; +import { type MerkleTree, MerkleTreeCalculator } from '@aztec/foundation/trees'; -import { FUNCTION_TREE_HEIGHT, GeneratorIndex } from '../constants.gen.js'; -import { type MerkleTree, MerkleTreeCalculator } from '../merkle/index.js'; import { type PrivateFunction } from './interfaces/contract_class.js'; // Memoize the merkle tree calculators to avoid re-computing the zero-hash for each level in each call diff --git a/yarn-project/circuits.js/src/contract/private_function_membership_proof.test.ts b/yarn-project/circuits.js/src/contract/private_function_membership_proof.test.ts index 07336a9f3097..478c5097901f 100644 --- a/yarn-project/circuits.js/src/contract/private_function_membership_proof.test.ts +++ b/yarn-project/circuits.js/src/contract/private_function_membership_proof.test.ts @@ -1,6 +1,6 @@ -import { type ContractArtifact, type FunctionArtifact, FunctionSelector, FunctionType } from '@aztec/foundation/abi'; import { Fr } from '@aztec/foundation/fields'; +import { type ContractArtifact, type FunctionArtifact, FunctionSelector, FunctionType } from '../abi/index.js'; import { getBenchmarkContractArtifact } from '../tests/fixtures.js'; import { computeVerificationKeyHash, getContractClassFromArtifact } from './contract_class.js'; import { type ContractClassIdPreimage } from './contract_class_id.js'; diff --git a/yarn-project/circuits.js/src/contract/private_function_membership_proof.ts b/yarn-project/circuits.js/src/contract/private_function_membership_proof.ts index 0c05011f4f74..6a8f00be7b2d 100644 --- a/yarn-project/circuits.js/src/contract/private_function_membership_proof.ts +++ b/yarn-project/circuits.js/src/contract/private_function_membership_proof.ts @@ -1,9 +1,9 @@ -import { type ContractArtifact, FunctionSelector, FunctionType } from '@aztec/foundation/abi'; import { poseidon2Hash } from '@aztec/foundation/crypto'; import { Fr } from '@aztec/foundation/fields'; import { createLogger } from '@aztec/foundation/log'; +import { computeRootFromSiblingPath } from '@aztec/foundation/trees'; -import { computeRootFromSiblingPath } from '../merkle/index.js'; +import { type ContractArtifact, FunctionSelector, FunctionType } from '../abi/index.js'; import { computeArtifactFunctionTree, computeArtifactHash, diff --git a/yarn-project/circuits.js/src/contract/unconstrained_function_membership_proof.test.ts b/yarn-project/circuits.js/src/contract/unconstrained_function_membership_proof.test.ts index ccf19ec5e8f2..004704e6f21a 100644 --- a/yarn-project/circuits.js/src/contract/unconstrained_function_membership_proof.test.ts +++ b/yarn-project/circuits.js/src/contract/unconstrained_function_membership_proof.test.ts @@ -1,6 +1,6 @@ -import { type ContractArtifact, type FunctionArtifact, FunctionSelector, FunctionType } from '@aztec/foundation/abi'; import { Fr } from '@aztec/foundation/fields'; +import { type ContractArtifact, type FunctionArtifact, FunctionSelector, FunctionType } from '../abi/index.js'; import { getTestContractArtifact } from '../tests/fixtures.js'; import { getContractClassFromArtifact } from './contract_class.js'; import { type ContractClassIdPreimage } from './contract_class_id.js'; @@ -14,7 +14,7 @@ describe('unconstrained_function_membership_proof', () => { let artifact: ContractArtifact; let contractClass: ContractClass & ContractClassIdPreimage; let unconstrainedFunction: FunctionArtifact; - let vkHash: Fr; + const vkHash: Fr = Fr.random(); let selector: FunctionSelector; beforeEach(async () => { diff --git a/yarn-project/circuits.js/src/contract/unconstrained_function_membership_proof.ts b/yarn-project/circuits.js/src/contract/unconstrained_function_membership_proof.ts index 5957bce625d2..d96cc20003ff 100644 --- a/yarn-project/circuits.js/src/contract/unconstrained_function_membership_proof.ts +++ b/yarn-project/circuits.js/src/contract/unconstrained_function_membership_proof.ts @@ -1,8 +1,8 @@ -import { type ContractArtifact, FunctionSelector, FunctionType } from '@aztec/foundation/abi'; import { Fr } from '@aztec/foundation/fields'; import { createLogger } from '@aztec/foundation/log'; +import { computeRootFromSiblingPath } from '@aztec/foundation/trees'; -import { computeRootFromSiblingPath } from '../merkle/index.js'; +import { type ContractArtifact, FunctionSelector, FunctionType } from '../abi/index.js'; import { computeArtifactFunctionTree, computeArtifactHash, diff --git a/yarn-project/circuits.js/src/hash/hash.ts b/yarn-project/circuits.js/src/hash/hash.ts index 4489e00f87a3..8a1601f6fdb4 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 { GeneratorIndex } from '../constants.gen.js'; import { type ScopedL2ToL1Message } from '../structs/l2_to_l1_message.js'; /** 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 e04c5b725b99..caafb38f45e7 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 { MAX_NOTE_HASHES_PER_TX, MAX_NOTE_HASH_READ_REQUESTS_PER_TX } from '../constants.gen.js'; import { NoteHash, type NoteHashReadRequestHints, diff --git a/yarn-project/circuits.js/src/hints/build_note_hash_read_request_hints.ts b/yarn-project/circuits.js/src/hints/build_note_hash_read_request_hints.ts index 21feaa4c05ba..e151cbd8353b 100644 --- a/yarn-project/circuits.js/src/hints/build_note_hash_read_request_hints.ts +++ b/yarn-project/circuits.js/src/hints/build_note_hash_read_request_hints.ts @@ -1,12 +1,12 @@ -import { type Tuple } from '@aztec/foundation/serialize'; - import { type MAX_NOTE_HASHES_PER_TX, MAX_NOTE_HASH_READ_REQUESTS_PER_TX, type NOTE_HASH_TREE_HEIGHT, -} from '../constants.gen.js'; +} from '@aztec/constants'; +import { type Tuple } from '@aztec/foundation/serialize'; +import type { MembershipWitness } from '@aztec/foundation/trees'; + import { - type MembershipWitness, NoteHashReadRequestHintsBuilder, PendingReadHint, ReadRequestResetStates, 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 5b1df7c425fe..84fbf68be7d7 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 { MAX_NULLIFIERS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX } from '../constants.gen.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 8110d72df7c4..dd46f9889c19 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 @@ -1,17 +1,16 @@ +import { + type MAX_NULLIFIERS_PER_TX, + 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 } from '@aztec/foundation/trees'; +import { type IndexedTreeLeafPreimage, MembershipWitness } from '@aztec/foundation/trees'; -import { - type MAX_NULLIFIERS_PER_TX, - MAX_NULLIFIER_READ_REQUESTS_PER_TX, - type NULLIFIER_TREE_HEIGHT, -} from '../constants.gen.js'; import { siloNullifier } from '../hash/hash.js'; import { - type MembershipWitness, Nullifier, NullifierReadRequestHintsBuilder, PendingReadHint, 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 6f85aae552e1..f0c6679775d1 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 @@ -8,8 +8,8 @@ import { type ScopedNoteHash, type ScopedNullifier, ScopedReadRequest, - TransientDataIndexHint, } from '../structs/index.js'; +import { TransientDataIndexHint } from '../structs/transient_data_index_hint.js'; import { buildTransientDataHints } from './build_transient_data_hints.js'; describe('buildTransientDataHints', () => { diff --git a/yarn-project/circuits.js/src/hints/build_transient_data_hints.ts b/yarn-project/circuits.js/src/hints/build_transient_data_hints.ts index 6044d02f17a5..13ae857810b6 100644 --- a/yarn-project/circuits.js/src/hints/build_transient_data_hints.ts +++ b/yarn-project/circuits.js/src/hints/build_transient_data_hints.ts @@ -1,15 +1,11 @@ -import { - type ScopedNoteHash, - type ScopedNullifier, - type ScopedReadRequest, - TransientDataIndexHint, - countAccumulatedItems, - isValidNoteHashReadRequest, - isValidNullifierReadRequest, -} from '@aztec/circuits.js'; import { padArrayEnd } from '@aztec/foundation/collection'; import { type Tuple } from '@aztec/foundation/serialize'; +import { type ScopedNoteHash, type ScopedNullifier, type ScopedReadRequest } from '../structs/index.js'; +import { TransientDataIndexHint } from '../structs/transient_data_index_hint.js'; +import { countAccumulatedItems } from '../utils/index.js'; +import { isValidNoteHashReadRequest } from './build_note_hash_read_request_hints.js'; +import { isValidNullifierReadRequest } from './build_nullifier_read_request_hints.js'; import { ScopedValueCache } from './scoped_value_cache.js'; export function buildTransientDataHints( diff --git a/yarn-project/circuits.js/src/hints/find_private_kernel_reset_dimensions.test.ts b/yarn-project/circuits.js/src/hints/find_private_kernel_reset_dimensions.test.ts index 1a845001a9b4..a45500cf97ef 100644 --- a/yarn-project/circuits.js/src/hints/find_private_kernel_reset_dimensions.test.ts +++ b/yarn-project/circuits.js/src/hints/find_private_kernel_reset_dimensions.test.ts @@ -5,7 +5,7 @@ import { PrivateKernelResetDimensions, type PrivateKernelResetDimensionsConfig, privateKernelResetDimensionNames, -} from '../structs/index.js'; +} from '../structs/kernel/index.js'; import { findPrivateKernelResetDimensions } from './find_private_kernel_reset_dimensions.js'; describe('findPrivateKernelResetDimensions', () => { diff --git a/yarn-project/circuits.js/src/hints/find_private_kernel_reset_dimensions.ts b/yarn-project/circuits.js/src/hints/find_private_kernel_reset_dimensions.ts index 6a40471cae17..9003129b7338 100644 --- a/yarn-project/circuits.js/src/hints/find_private_kernel_reset_dimensions.ts +++ b/yarn-project/circuits.js/src/hints/find_private_kernel_reset_dimensions.ts @@ -2,7 +2,7 @@ import { PrivateKernelResetDimensions, type PrivateKernelResetDimensionsConfig, privateKernelResetDimensionNames, -} from '../structs/index.js'; +} from '../structs/kernel/index.js'; interface DimensionOption { dimensions: PrivateKernelResetDimensions; diff --git a/yarn-project/circuits.js/src/index.ts b/yarn-project/circuits.js/src/index.ts index e4c04ed31fac..fa51ad6ece92 100644 --- a/yarn-project/circuits.js/src/index.ts +++ b/yarn-project/circuits.js/src/index.ts @@ -1,4 +1,3 @@ -export * from './constants.js'; export * from './contract/index.js'; export * from './fees/index.js'; export * from './hints/index.js'; @@ -7,4 +6,3 @@ export * from './keys/index.js'; export * from './structs/index.js'; export * from './types/index.js'; export * from './utils/index.js'; -export * from './merkle/index.js'; diff --git a/yarn-project/circuits.js/src/keys/derivation.ts b/yarn-project/circuits.js/src/keys/derivation.ts index 1fd89f3b68f0..910a07e1c75a 100644 --- a/yarn-project/circuits.js/src/keys/derivation.ts +++ b/yarn-project/circuits.js/src/keys/derivation.ts @@ -1,9 +1,8 @@ +import { GeneratorIndex } from '@aztec/constants'; import { AztecAddress } from '@aztec/foundation/aztec-address'; -import { poseidon2HashWithSeparator, sha512ToGrumpkinScalar } from '@aztec/foundation/crypto'; +import { Grumpkin, poseidon2HashWithSeparator, sha512ToGrumpkinScalar } from '@aztec/foundation/crypto'; import { Fq, Fr, GrumpkinScalar } from '@aztec/foundation/fields'; -import { Grumpkin } from '../barretenberg/crypto/grumpkin/index.js'; -import { GeneratorIndex } from '../constants.gen.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/keys/key_types.ts b/yarn-project/circuits.js/src/keys/key_types.ts index 3ccc908c14d7..a34e8db92f76 100644 --- a/yarn-project/circuits.js/src/keys/key_types.ts +++ b/yarn-project/circuits.js/src/keys/key_types.ts @@ -1,4 +1,4 @@ -import { type GeneratorIndex } from '../constants.gen.js'; +import { type GeneratorIndex } from '@aztec/constants'; export type KeyGenerator = GeneratorIndex.NSK_M | GeneratorIndex.IVSK_M | GeneratorIndex.OVSK_M | GeneratorIndex.TSK_M; export type KeyPrefix = 'n' | 'iv' | 'ov' | 't'; diff --git a/yarn-project/circuits.js/src/keys/utils.ts b/yarn-project/circuits.js/src/keys/utils.ts index c7c9657917d1..482737e32269 100644 --- a/yarn-project/circuits.js/src/keys/utils.ts +++ b/yarn-project/circuits.js/src/keys/utils.ts @@ -1,4 +1,5 @@ -import { GeneratorIndex } from '../constants.gen.js'; +import { GeneratorIndex } from '@aztec/constants'; + import { type KeyGenerator, type KeyPrefix } from './key_types.js'; export function getKeyGenerator(prefix: KeyPrefix): KeyGenerator { diff --git a/yarn-project/circuits.js/src/merkle/index.ts b/yarn-project/circuits.js/src/merkle/index.ts deleted file mode 100644 index a5b3e0863896..000000000000 --- a/yarn-project/circuits.js/src/merkle/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './merkle_tree_calculator.js'; -export * from './merkle_tree.js'; -export * from './indexed_merkle_tree_calculator.js'; -export * from './indexed_merkle_tree.js'; -export * from './sibling_path.js'; diff --git a/yarn-project/types/src/noir/index.ts b/yarn-project/circuits.js/src/noir/index.ts similarity index 99% rename from yarn-project/types/src/noir/index.ts rename to yarn-project/circuits.js/src/noir/index.ts index bfe1d3959071..0369d3005939 100644 --- a/yarn-project/types/src/noir/index.ts +++ b/yarn-project/circuits.js/src/noir/index.ts @@ -6,7 +6,7 @@ import { type AbiValue, type DebugFileMap, type DebugInfo, -} from '@aztec/foundation/abi'; +} from '@aztec/circuits.js/abi'; export const AZTEC_PRIVATE_ATTRIBUTE = 'private'; export const AZTEC_PUBLIC_ATTRIBUTE = 'public'; diff --git a/yarn-project/circuits.js/src/schemas/index.ts b/yarn-project/circuits.js/src/schemas/index.ts new file mode 100644 index 000000000000..51d2d73dab73 --- /dev/null +++ b/yarn-project/circuits.js/src/schemas/index.ts @@ -0,0 +1,35 @@ +// eslint-disable-next-line @typescript-eslint/no-unused-vars +import { Buffer32 } from '@aztec/foundation/buffer'; +import { type ZodFor, schemas as foundationSchemas } from '@aztec/foundation/schemas'; + +import { z } from 'zod'; + +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'; + +export const schemas = { + NoteSelector: NoteSelector.schema, + FunctionSelector: FunctionSelector.schema, + EventSelector: EventSelector.schema, + ...foundationSchemas, +}; + +export const AbiDecodedSchema: ZodFor = z.union([ + schemas.BigInt, + z.boolean(), + schemas.AztecAddress, + z.array(z.lazy(() => AbiDecodedSchema)), + z.record(z.lazy(() => AbiDecodedSchema)), +]); + +export { + type ZodFor, + bufferSchema, + hexSchema, + hexSchemaFor, + bufferSchemaFor, + type ApiSchemaFor, + optional, +} from '@aztec/foundation/schemas'; diff --git a/yarn-project/circuits.js/src/structs/avm/avm.ts b/yarn-project/circuits.js/src/structs/avm/avm.ts index 238b1109b8ba..57dd61f5aa0a 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 { PublicDataTreeLeafPreimage } from '@aztec/circuits.js'; import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fq, Fr, Point } from '@aztec/foundation/fields'; import { bufferSchemaFor } from '@aztec/foundation/schemas'; @@ -11,8 +10,9 @@ import { Encoder, addExtension } from 'msgpackr'; import { type ContractClassIdPreimage } from '../../contract/contract_class_id.js'; import { PublicKeys } from '../../types/public_keys.js'; -import { Vector } from '../shared.js'; +import { Vector } from '../../types/shared.js'; import { NullifierLeafPreimage } from '../trees/nullifier_leaf.js'; +import { PublicDataTreeLeafPreimage } from '../trees/public_data_leaf.js'; import { AvmCircuitPublicInputs } from './avm_circuit_public_inputs.js'; export class AvmEnqueuedCallHint { diff --git a/yarn-project/circuits.js/src/structs/avm/avm_accumulated_data.ts b/yarn-project/circuits.js/src/structs/avm/avm_accumulated_data.ts index ba3b8f0c9083..ccbadb806935 100644 --- a/yarn-project/circuits.js/src/structs/avm/avm_accumulated_data.ts +++ b/yarn-project/circuits.js/src/structs/avm/avm_accumulated_data.ts @@ -1,3 +1,10 @@ +import { + MAX_L2_TO_L1_MSGS_PER_TX, + MAX_NOTE_HASHES_PER_TX, + MAX_NULLIFIERS_PER_TX, + MAX_PUBLIC_LOGS_PER_TX, + MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, +} from '@aztec/constants'; import { makeTuple } from '@aztec/foundation/array'; import { arraySerializedSizeOfNonEmpty } from '@aztec/foundation/collection'; import { Fr } from '@aztec/foundation/fields'; @@ -6,13 +13,6 @@ import { bufferToHex, hexToBuffer } from '@aztec/foundation/string'; import { inspect } from 'util'; -import { - MAX_L2_TO_L1_MSGS_PER_TX, - MAX_NOTE_HASHES_PER_TX, - MAX_NULLIFIERS_PER_TX, - MAX_PUBLIC_LOGS_PER_TX, - MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, -} from '../../constants.gen.js'; import { ScopedL2ToL1Message } from '../l2_to_l1_message.js'; import { PublicDataWrite } from '../public_data_write.js'; import { PublicLog } from '../public_log.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 1a9c1abeb1a9..bade4d429dfc 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,3 +1,4 @@ +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'; @@ -6,7 +7,6 @@ import { bufferToHex, hexToBuffer } from '@aztec/foundation/string'; import { inspect } from 'util'; -import { MAX_ENQUEUED_CALLS_PER_TX } from '../../constants.gen.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/avm/index.ts b/yarn-project/circuits.js/src/structs/avm/index.ts new file mode 100644 index 000000000000..35906c39cafa --- /dev/null +++ b/yarn-project/circuits.js/src/structs/avm/index.ts @@ -0,0 +1,3 @@ +export * from './avm.js'; +export * from './avm_accumulated_data.js'; +export * from './avm_circuit_public_inputs.js'; diff --git a/yarn-project/circuits.js/src/structs/blobs/index.ts b/yarn-project/circuits.js/src/structs/blobs/index.ts deleted file mode 100644 index f382b2046804..000000000000 --- a/yarn-project/circuits.js/src/structs/blobs/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './blob_public_inputs.js'; -export * from './sponge_blob.js'; diff --git a/yarn-project/circuits.js/src/structs/block_header.test.ts b/yarn-project/circuits.js/src/structs/block_header.test.ts index ccffd90b1e4a..96c42b4912af 100644 --- a/yarn-project/circuits.js/src/structs/block_header.test.ts +++ b/yarn-project/circuits.js/src/structs/block_header.test.ts @@ -1,8 +1,8 @@ +import { BLOCK_HEADER_LENGTH } from '@aztec/constants'; import { randomInt } from '@aztec/foundation/crypto'; import { setupCustomSnapshotSerializers } from '@aztec/foundation/testing'; import { updateInlineTestData } from '@aztec/foundation/testing/files'; -import { BLOCK_HEADER_LENGTH } from '../constants.gen.js'; import { makeHeader } from '../tests/factories.js'; import { BlockHeader } from './block_header.js'; diff --git a/yarn-project/circuits.js/src/structs/block_header.ts b/yarn-project/circuits.js/src/structs/block_header.ts index fa4f170ea84d..cdb5b2328c55 100644 --- a/yarn-project/circuits.js/src/structs/block_header.ts +++ b/yarn-project/circuits.js/src/structs/block_header.ts @@ -1,3 +1,4 @@ +import { BLOCK_HEADER_LENGTH, GeneratorIndex } from '@aztec/constants'; import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto'; import { Fr } from '@aztec/foundation/fields'; import { schemas } from '@aztec/foundation/schemas'; @@ -8,7 +9,6 @@ import { type FieldsOf } from '@aztec/foundation/types'; import { inspect } from 'util'; import { z } from 'zod'; -import { BLOCK_HEADER_LENGTH, GeneratorIndex } from '../constants.gen.js'; import { ContentCommitment } from './content_commitment.js'; import { GlobalVariables } from './global_variables.js'; import { StateReference } from './state_reference.js'; diff --git a/yarn-project/circuits.js/src/structs/call_context.test.ts b/yarn-project/circuits.js/src/structs/call_context.test.ts index 5dc6af77e5ce..eac1f6b1ee60 100644 --- a/yarn-project/circuits.js/src/structs/call_context.test.ts +++ b/yarn-project/circuits.js/src/structs/call_context.test.ts @@ -1,6 +1,6 @@ +import { CALL_CONTEXT_LENGTH } from '@aztec/constants'; import { randomInt } from '@aztec/foundation/crypto'; -import { CALL_CONTEXT_LENGTH } from '../constants.gen.js'; import { makeCallContext } from '../tests/factories.js'; import { CallContext } from './call_context.js'; diff --git a/yarn-project/circuits.js/src/structs/call_context.ts b/yarn-project/circuits.js/src/structs/call_context.ts index 923b53d49347..c9a9280a7249 100644 --- a/yarn-project/circuits.js/src/structs/call_context.ts +++ b/yarn-project/circuits.js/src/structs/call_context.ts @@ -1,4 +1,4 @@ -import { FunctionSelector } from '@aztec/foundation/abi'; +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'; @@ -8,7 +8,7 @@ import { type FieldsOf } from '@aztec/foundation/types'; import { inspect } from 'util'; import { z } from 'zod'; -import { CALL_CONTEXT_LENGTH } from '../constants.gen.js'; +import { FunctionSelector } from '../abi/index.js'; /** * Call context. @@ -55,7 +55,7 @@ export class CallContext { .object({ msgSender: schemas.AztecAddress, contractAddress: schemas.AztecAddress, - functionSelector: schemas.FunctionSelector, + functionSelector: FunctionSelector.schema, isStaticCall: z.boolean(), }) .transform(CallContext.from); diff --git a/yarn-project/circuits.js/src/structs/content_commitment.test.ts b/yarn-project/circuits.js/src/structs/content_commitment.test.ts index 64dfa9e79ab0..5cf222234257 100644 --- a/yarn-project/circuits.js/src/structs/content_commitment.test.ts +++ b/yarn-project/circuits.js/src/structs/content_commitment.test.ts @@ -1,6 +1,6 @@ +import { CONTENT_COMMITMENT_LENGTH } from '@aztec/constants'; import { randomInt } from '@aztec/foundation/crypto'; -import { CONTENT_COMMITMENT_LENGTH } from '../constants.gen.js'; import { makeContentCommitment } from '../tests/factories.js'; import { ContentCommitment } from './content_commitment.js'; diff --git a/yarn-project/circuits.js/src/structs/content_commitment.ts b/yarn-project/circuits.js/src/structs/content_commitment.ts index 5fe9a58a8c84..69b9979f50fb 100644 --- a/yarn-project/circuits.js/src/structs/content_commitment.ts +++ b/yarn-project/circuits.js/src/structs/content_commitment.ts @@ -1,3 +1,4 @@ +import { CONTENT_COMMITMENT_LENGTH } from '@aztec/constants'; import { Fr } from '@aztec/foundation/fields'; import { schemas } from '@aztec/foundation/schemas'; import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/serialize'; @@ -5,8 +6,6 @@ import { bufferToHex } from '@aztec/foundation/string'; import { z } from 'zod'; -import { CONTENT_COMMITMENT_LENGTH } from '../constants.gen.js'; - export const NUM_BYTES_PER_SHA256 = 32; export class ContentCommitment { diff --git a/yarn-project/circuits.js/src/structs/contract_storage_read.test.ts b/yarn-project/circuits.js/src/structs/contract_storage_read.test.ts index e4d243fcdd7f..84424ddaf736 100644 --- a/yarn-project/circuits.js/src/structs/contract_storage_read.test.ts +++ b/yarn-project/circuits.js/src/structs/contract_storage_read.test.ts @@ -1,6 +1,6 @@ +import { CONTRACT_STORAGE_READ_LENGTH } from '@aztec/constants'; import { randomInt } from '@aztec/foundation/crypto'; -import { CONTRACT_STORAGE_READ_LENGTH } from '../constants.gen.js'; import { makeContractStorageRead } from '../tests/factories.js'; import { ContractStorageRead } from './contract_storage_read.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 56f0f95aa1dd..90cb54b1e69f 100644 --- a/yarn-project/circuits.js/src/structs/contract_storage_read.ts +++ b/yarn-project/circuits.js/src/structs/contract_storage_read.ts @@ -1,9 +1,8 @@ +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 { CONTRACT_STORAGE_READ_LENGTH } from '../constants.gen.js'; - /** * Contract storage read operation on a specific contract. * diff --git a/yarn-project/circuits.js/src/structs/contract_storage_update_request.test.ts b/yarn-project/circuits.js/src/structs/contract_storage_update_request.test.ts index f162130558a4..9cdd2ebf0180 100644 --- a/yarn-project/circuits.js/src/structs/contract_storage_update_request.test.ts +++ b/yarn-project/circuits.js/src/structs/contract_storage_update_request.test.ts @@ -1,6 +1,6 @@ +import { CONTRACT_STORAGE_UPDATE_REQUEST_LENGTH } from '@aztec/constants'; import { randomInt } from '@aztec/foundation/crypto'; -import { CONTRACT_STORAGE_UPDATE_REQUEST_LENGTH } from '../constants.gen.js'; import { makeContractStorageUpdateRequest } from '../tests/factories.js'; import { ContractStorageUpdateRequest } from './contract_storage_update_request.js'; 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 91875b29a247..86398475be60 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,10 +1,9 @@ +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 { CONTRACT_STORAGE_UPDATE_REQUEST_LENGTH } from '../constants.gen.js'; - /** * Contract storage update request for a slot on a specific contract. * diff --git a/yarn-project/circuits.js/src/structs/function_data.test.ts b/yarn-project/circuits.js/src/structs/function_data.test.ts index 2c6b2e64a630..eddd16062d37 100644 --- a/yarn-project/circuits.js/src/structs/function_data.test.ts +++ b/yarn-project/circuits.js/src/structs/function_data.test.ts @@ -1,7 +1,7 @@ -import { FunctionSelector } from '@aztec/foundation/abi'; +import { FUNCTION_DATA_LENGTH } from '@aztec/constants'; import { setupCustomSnapshotSerializers } from '@aztec/foundation/testing'; -import { FUNCTION_DATA_LENGTH } from '../constants.gen.js'; +import { FunctionSelector } from '../abi/index.js'; import { FunctionData } from './function_data.js'; describe('FunctionData', () => { diff --git a/yarn-project/circuits.js/src/structs/function_data.ts b/yarn-project/circuits.js/src/structs/function_data.ts index eb813bbf44c0..10f51660c1ce 100644 --- a/yarn-project/circuits.js/src/structs/function_data.ts +++ b/yarn-project/circuits.js/src/structs/function_data.ts @@ -1,11 +1,10 @@ -import { type FunctionAbi, FunctionSelector, FunctionType } from '@aztec/foundation/abi'; +import { FUNCTION_DATA_LENGTH } from '@aztec/constants'; import { Fr } from '@aztec/foundation/fields'; -import { schemas } from '@aztec/foundation/schemas'; import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/serialize'; import { z } from 'zod'; -import { FUNCTION_DATA_LENGTH } from '../constants.gen.js'; +import { type FunctionAbi, FunctionSelector, FunctionType } from '../abi/index.js'; import { type ContractFunctionDao } from '../types/contract_function_dao.js'; /** Function description for circuit. */ @@ -27,7 +26,7 @@ export class FunctionData { static get schema() { return z .object({ - selector: schemas.FunctionSelector, + selector: FunctionSelector.schema, isPrivate: z.boolean(), }) .transform(({ selector, isPrivate }) => new FunctionData(selector, isPrivate)); diff --git a/yarn-project/circuits.js/src/structs/gas.ts b/yarn-project/circuits.js/src/structs/gas.ts index 956c2b5052d4..4df9aabb2939 100644 --- a/yarn-project/circuits.js/src/structs/gas.ts +++ b/yarn-project/circuits.js/src/structs/gas.ts @@ -6,8 +6,8 @@ import { type FieldsOf } from '@aztec/foundation/types'; import { inspect } from 'util'; import { z } from 'zod'; +import { type UInt32 } from '../types/shared.js'; import { type GasFees } from './gas_fees.js'; -import { type UInt32 } from './shared.js'; export const GasDimensions = ['da', 'l2'] as const; export type GasDimensions = (typeof GasDimensions)[number]; diff --git a/yarn-project/circuits.js/src/structs/gas_settings.ts b/yarn-project/circuits.js/src/structs/gas_settings.ts index e432c8a8f8ad..e27b1b06a1db 100644 --- a/yarn-project/circuits.js/src/structs/gas_settings.ts +++ b/yarn-project/circuits.js/src/structs/gas_settings.ts @@ -1,10 +1,10 @@ +import { DEFAULT_GAS_LIMIT, DEFAULT_TEARDOWN_GAS_LIMIT, GAS_SETTINGS_LENGTH } from '@aztec/constants'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader, FieldReader, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize'; import { type FieldsOf } from '@aztec/foundation/types'; import { z } from 'zod'; -import { DEFAULT_GAS_LIMIT, DEFAULT_TEARDOWN_GAS_LIMIT, GAS_SETTINGS_LENGTH } from '../constants.gen.js'; import { Gas, GasDimensions } from './gas.js'; import { GasFees } from './gas_fees.js'; diff --git a/yarn-project/circuits.js/src/structs/global_variables.test.ts b/yarn-project/circuits.js/src/structs/global_variables.test.ts index 82665ceea7e9..ada458b5190a 100644 --- a/yarn-project/circuits.js/src/structs/global_variables.test.ts +++ b/yarn-project/circuits.js/src/structs/global_variables.test.ts @@ -1,6 +1,6 @@ +import { GLOBAL_VARIABLES_LENGTH } from '@aztec/constants'; import { randomInt } from '@aztec/foundation/crypto'; -import { GLOBAL_VARIABLES_LENGTH } from '../constants.gen.js'; import { makeGlobalVariables } from '../tests/factories.js'; import { GlobalVariables } from './global_variables.js'; diff --git a/yarn-project/circuits.js/src/structs/global_variables.ts b/yarn-project/circuits.js/src/structs/global_variables.ts index 240b4d9abedf..e630947106f0 100644 --- a/yarn-project/circuits.js/src/structs/global_variables.ts +++ b/yarn-project/circuits.js/src/structs/global_variables.ts @@ -1,3 +1,4 @@ +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'; @@ -9,7 +10,6 @@ import { type FieldsOf } from '@aztec/foundation/types'; import { inspect } from 'util'; import { z } from 'zod'; -import { GLOBAL_VARIABLES_LENGTH } from '../constants.gen.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 f27cd4a22d12..4ad6cea547da 100644 --- a/yarn-project/circuits.js/src/structs/index.ts +++ b/yarn-project/circuits.js/src/structs/index.ts @@ -1,7 +1,4 @@ export * from '@aztec/foundation/eth-address'; -export * from './avm/avm.js'; -export * from './avm/avm_accumulated_data.js'; -export * from './avm/avm_circuit_public_inputs.js'; export * from './call_context.js'; export * from './client_ivc_proof.js'; export * from './complete_address.js'; @@ -16,31 +13,11 @@ export * from './gas_settings.js'; export * from './global_variables.js'; export * from './block_header.js'; export * from './indexed_tagging_secret.js'; -export * from './kernel/private_to_rollup_accumulated_data.js'; -export * from './kernel/combined_constant_data.js'; -export * from './kernel/private_to_rollup_kernel_circuit_public_inputs.js'; -export * from './kernel/private_accumulated_data.js'; -export * from './kernel/private_call_data.js'; -export * from './kernel/private_kernel_circuit_public_inputs.js'; -export * from './kernel/private_kernel_data.js'; -export * from './kernel/private_kernel_init_circuit_private_inputs.js'; -export * from './kernel/private_kernel_inner_circuit_private_inputs.js'; -export * from './kernel/private_kernel_reset_circuit_private_inputs.js'; -export * from './kernel/private_kernel_reset_dimensions.js'; -export * from './kernel/private_kernel_reset_hints.js'; -export * from './kernel/private_kernel_tail_circuit_private_inputs.js'; -export * from './kernel/private_kernel_tail_circuit_public_inputs.js'; -export * from './kernel/private_to_avm_accumulated_data.js'; -export * from './kernel/private_to_public_accumulated_data.js'; -export * from './kernel/private_to_public_accumulated_data_builder.js'; -export * from './kernel/private_to_public_kernel_circuit_public_inputs.js'; -export * from './kernel/tx_constant_data.js'; export * from './key_validation_request.js'; export * from './key_validation_request_and_generator.js'; export * from './l2_to_l1_message.js'; export * from './log_hash.js'; export * from './max_block_number.js'; -export * from './membership_witness.js'; export * from './note_hash.js'; export * from './nullifier.js'; export * from './optional_number.js'; @@ -69,17 +46,14 @@ export * from './recursive_proof.js'; export * from './revert_code.js'; export * from './rollup_validation_requests.js'; export * from './scoped_key_validation_request_and_generator.js'; -export * from './shared.js'; -export * from './shared_mutable/index.js'; export * from './state_reference.js'; export * from './tree_leaf_read_request.js'; export * from './tree_snapshots.js'; -export * from './trees/index.js'; export * from './tx_context.js'; export * from './tx_request.js'; export * from './verification_key.js'; export * from './vk_witness_data.js'; -export { EventSelector, FunctionSelector } from '@aztec/foundation/abi'; +export { EventSelector, FunctionSelector } from '../abi/index.js'; export * from '@aztec/foundation/aztec-address'; export * from '@aztec/foundation/fields'; diff --git a/yarn-project/circuits.js/src/structs/kernel/index.ts b/yarn-project/circuits.js/src/structs/kernel/index.ts new file mode 100644 index 000000000000..1de15e7ad840 --- /dev/null +++ b/yarn-project/circuits.js/src/structs/kernel/index.ts @@ -0,0 +1,19 @@ +export * from './private_to_rollup_accumulated_data.js'; +export * from './combined_constant_data.js'; +export * from './private_to_rollup_kernel_circuit_public_inputs.js'; +export * from './private_accumulated_data.js'; +export * from './private_call_data.js'; +export * from './private_kernel_circuit_public_inputs.js'; +export * from './private_kernel_data.js'; +export * from './private_kernel_init_circuit_private_inputs.js'; +export * from './private_kernel_inner_circuit_private_inputs.js'; +export * from './private_kernel_reset_circuit_private_inputs.js'; +export * from './private_kernel_reset_dimensions.js'; +export * from './private_kernel_reset_hints.js'; +export * from './private_kernel_tail_circuit_private_inputs.js'; +export * from './private_kernel_tail_circuit_public_inputs.js'; +export * from './private_to_avm_accumulated_data.js'; +export * from './private_to_public_accumulated_data.js'; +export * from './private_to_public_accumulated_data_builder.js'; +export * from './private_to_public_kernel_circuit_public_inputs.js'; +export * from './tx_constant_data.js'; diff --git a/yarn-project/circuits.js/src/structs/kernel/private_accumulated_data.ts b/yarn-project/circuits.js/src/structs/kernel/private_accumulated_data.ts index 12cbb6a723be..6ad8abdc21ed 100644 --- a/yarn-project/circuits.js/src/structs/kernel/private_accumulated_data.ts +++ b/yarn-project/circuits.js/src/structs/kernel/private_accumulated_data.ts @@ -1,7 +1,3 @@ -import { makeTuple } from '@aztec/foundation/array'; -import { BufferReader, type Tuple, serializeToBuffer } from '@aztec/foundation/serialize'; -import { bufferToHex, hexToBuffer } from '@aztec/foundation/string'; - import { MAX_CONTRACT_CLASS_LOGS_PER_TX, MAX_ENQUEUED_CALLS_PER_TX, @@ -10,7 +6,11 @@ import { MAX_NULLIFIERS_PER_TX, MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX, MAX_PRIVATE_LOGS_PER_TX, -} from '../../constants.gen.js'; +} from '@aztec/constants'; +import { makeTuple } from '@aztec/foundation/array'; +import { BufferReader, type Tuple, serializeToBuffer } from '@aztec/foundation/serialize'; +import { bufferToHex, hexToBuffer } from '@aztec/foundation/string'; + import { ScopedL2ToL1Message } from '../l2_to_l1_message.js'; import { ScopedLogHash } from '../log_hash.js'; import { ScopedNoteHash } from '../note_hash.js'; diff --git a/yarn-project/circuits.js/src/structs/kernel/private_call_data.ts b/yarn-project/circuits.js/src/structs/kernel/private_call_data.ts index d21d5f264309..6d758b7b4d3b 100644 --- a/yarn-project/circuits.js/src/structs/kernel/private_call_data.ts +++ b/yarn-project/circuits.js/src/structs/kernel/private_call_data.ts @@ -1,15 +1,15 @@ -import { Fr } from '@aztec/foundation/fields'; -import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize'; -import { type FieldsOf } from '@aztec/foundation/types'; - import { FUNCTION_TREE_HEIGHT, PROTOCOL_CONTRACT_TREE_HEIGHT, PUBLIC_DATA_TREE_HEIGHT, UPDATES_VALUE_SIZE, -} from '../../constants.gen.js'; +} from '@aztec/constants'; +import { Fr } from '@aztec/foundation/fields'; +import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize'; +import { MembershipWitness } from '@aztec/foundation/trees'; +import { type FieldsOf } from '@aztec/foundation/types'; + import { PublicKeys } from '../../types/public_keys.js'; -import { MembershipWitness } from '../membership_witness.js'; import { PrivateCircuitPublicInputs } from '../private_circuit_public_inputs.js'; import { ScheduledDelayChange } from '../shared_mutable/scheduled_delay_change.js'; import { ScheduledValueChange } from '../shared_mutable/scheduled_value_change.js'; diff --git a/yarn-project/circuits.js/src/structs/kernel/private_kernel_data.ts b/yarn-project/circuits.js/src/structs/kernel/private_kernel_data.ts index 049d51c84332..77ed9c649098 100644 --- a/yarn-project/circuits.js/src/structs/kernel/private_kernel_data.ts +++ b/yarn-project/circuits.js/src/structs/kernel/private_kernel_data.ts @@ -1,9 +1,9 @@ +import { CLIENT_IVC_VERIFICATION_KEY_LENGTH_IN_FIELDS, VK_TREE_HEIGHT } from '@aztec/constants'; import { makeTuple } from '@aztec/foundation/array'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader, type Tuple, serializeToBuffer } from '@aztec/foundation/serialize'; -import { CLIENT_IVC_VERIFICATION_KEY_LENGTH_IN_FIELDS, VK_TREE_HEIGHT } from '../../constants.gen.js'; -import { type UInt32 } from '../shared.js'; +import { type UInt32 } from '../../types/shared.js'; import { VerificationKeyAsFields } from '../verification_key.js'; import { PrivateKernelCircuitPublicInputs } from './private_kernel_circuit_public_inputs.js'; diff --git a/yarn-project/circuits.js/src/structs/kernel/private_kernel_reset_circuit_private_inputs.ts b/yarn-project/circuits.js/src/structs/kernel/private_kernel_reset_circuit_private_inputs.ts index 0085ff416b40..58144ba0f8e1 100644 --- a/yarn-project/circuits.js/src/structs/kernel/private_kernel_reset_circuit_private_inputs.ts +++ b/yarn-project/circuits.js/src/structs/kernel/private_kernel_reset_circuit_private_inputs.ts @@ -1,11 +1,11 @@ -import { serializeToBuffer } from '@aztec/foundation/serialize'; - import { type MAX_KEY_VALIDATION_REQUESTS_PER_TX, type MAX_NOTE_HASH_READ_REQUESTS_PER_TX, type MAX_NULLIFIERS_PER_TX, type MAX_NULLIFIER_READ_REQUESTS_PER_TX, -} from '../../constants.gen.js'; +} from '@aztec/constants'; +import { serializeToBuffer } from '@aztec/foundation/serialize'; + import { type PrivateKernelData } from './private_kernel_data.js'; import { type PrivateKernelResetDimensions } from './private_kernel_reset_dimensions.js'; import { type PrivateKernelResetHints } from './private_kernel_reset_hints.js'; diff --git a/yarn-project/circuits.js/src/structs/kernel/private_to_avm_accumulated_data.ts b/yarn-project/circuits.js/src/structs/kernel/private_to_avm_accumulated_data.ts index 66eaee844eaa..a35ee3ec5c56 100644 --- a/yarn-project/circuits.js/src/structs/kernel/private_to_avm_accumulated_data.ts +++ b/yarn-project/circuits.js/src/structs/kernel/private_to_avm_accumulated_data.ts @@ -1,3 +1,9 @@ +import { + MAX_L2_TO_L1_MSGS_PER_TX, + MAX_NOTE_HASHES_PER_TX, + MAX_NULLIFIERS_PER_TX, + PRIVATE_TO_AVM_ACCUMULATED_DATA_LENGTH, +} from '@aztec/constants'; import { type FieldsOf, makeTuple } from '@aztec/foundation/array'; import { arraySerializedSizeOfNonEmpty } from '@aztec/foundation/collection'; import { Fr } from '@aztec/foundation/fields'; @@ -11,14 +17,8 @@ import { import { inspect } from 'util'; -import { - MAX_L2_TO_L1_MSGS_PER_TX, - MAX_NOTE_HASHES_PER_TX, - MAX_NULLIFIERS_PER_TX, - PRIVATE_TO_AVM_ACCUMULATED_DATA_LENGTH, -} from '../../constants.gen.js'; +import { type UInt32 } from '../../types/shared.js'; import { ScopedL2ToL1Message } from '../l2_to_l1_message.js'; -import { type UInt32 } from '../shared.js'; export class PrivateToAvmAccumulatedData { constructor( diff --git a/yarn-project/circuits.js/src/structs/kernel/private_to_public_accumulated_data.ts b/yarn-project/circuits.js/src/structs/kernel/private_to_public_accumulated_data.ts index b9df967a756e..a28d2d60a935 100644 --- a/yarn-project/circuits.js/src/structs/kernel/private_to_public_accumulated_data.ts +++ b/yarn-project/circuits.js/src/structs/kernel/private_to_public_accumulated_data.ts @@ -1,3 +1,12 @@ +import { + MAX_CONTRACT_CLASS_LOGS_PER_TX, + MAX_ENQUEUED_CALLS_PER_TX, + MAX_L2_TO_L1_MSGS_PER_TX, + MAX_NOTE_HASHES_PER_TX, + MAX_NULLIFIERS_PER_TX, + MAX_PRIVATE_LOGS_PER_TX, + PRIVATE_TO_PUBLIC_ACCUMULATED_DATA_LENGTH, +} from '@aztec/constants'; import { type FieldsOf, makeTuple } from '@aztec/foundation/array'; import { arraySerializedSizeOfNonEmpty } from '@aztec/foundation/collection'; import { Fr } from '@aztec/foundation/fields'; @@ -11,15 +20,6 @@ import { import { inspect } from 'util'; -import { - MAX_CONTRACT_CLASS_LOGS_PER_TX, - MAX_ENQUEUED_CALLS_PER_TX, - MAX_L2_TO_L1_MSGS_PER_TX, - MAX_NOTE_HASHES_PER_TX, - MAX_NULLIFIERS_PER_TX, - MAX_PRIVATE_LOGS_PER_TX, - PRIVATE_TO_PUBLIC_ACCUMULATED_DATA_LENGTH, -} from '../../constants.gen.js'; import { ScopedL2ToL1Message } from '../l2_to_l1_message.js'; import { ScopedLogHash } from '../log_hash.js'; import { PrivateLog } from '../private_log.js'; diff --git a/yarn-project/circuits.js/src/structs/kernel/private_to_public_accumulated_data_builder.ts b/yarn-project/circuits.js/src/structs/kernel/private_to_public_accumulated_data_builder.ts index 3b12e0501904..3363751f2b68 100644 --- a/yarn-project/circuits.js/src/structs/kernel/private_to_public_accumulated_data_builder.ts +++ b/yarn-project/circuits.js/src/structs/kernel/private_to_public_accumulated_data_builder.ts @@ -1,6 +1,3 @@ -import { padArrayEnd } from '@aztec/foundation/collection'; -import { Fr } from '@aztec/foundation/fields'; - import { MAX_CONTRACT_CLASS_LOGS_PER_TX, MAX_ENQUEUED_CALLS_PER_TX, @@ -8,7 +5,10 @@ import { MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, MAX_PRIVATE_LOGS_PER_TX, -} from '../../constants.gen.js'; +} from '@aztec/constants'; +import { padArrayEnd } from '@aztec/foundation/collection'; +import { Fr } from '@aztec/foundation/fields'; + import { ScopedL2ToL1Message } from '../l2_to_l1_message.js'; import { ScopedLogHash } from '../log_hash.js'; import { PrivateLog } from '../private_log.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 0c5a5247e5d7..6c98d727f375 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,3 +1,4 @@ +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'; @@ -5,7 +6,6 @@ import { BufferReader, serializeToBuffer, serializeToFields } from '@aztec/found import { bufferToHex, hexToBuffer } from '@aztec/foundation/string'; import { type FieldsOf } from '@aztec/foundation/types'; -import { GeneratorIndex, PRIVATE_TO_PUBLIC_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH } from '../../constants.gen.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_accumulated_data.ts b/yarn-project/circuits.js/src/structs/kernel/private_to_rollup_accumulated_data.ts index 7d511c61ca91..4481a6ae75a1 100644 --- a/yarn-project/circuits.js/src/structs/kernel/private_to_rollup_accumulated_data.ts +++ b/yarn-project/circuits.js/src/structs/kernel/private_to_rollup_accumulated_data.ts @@ -1,3 +1,11 @@ +import { + MAX_CONTRACT_CLASS_LOGS_PER_TX, + MAX_L2_TO_L1_MSGS_PER_TX, + MAX_NOTE_HASHES_PER_TX, + MAX_NULLIFIERS_PER_TX, + MAX_PRIVATE_LOGS_PER_TX, + PRIVATE_TO_ROLLUP_ACCUMULATED_DATA_LENGTH, +} from '@aztec/constants'; import { type FieldsOf, makeTuple } from '@aztec/foundation/array'; import { arraySerializedSizeOfNonEmpty } from '@aztec/foundation/collection'; import { Fr } from '@aztec/foundation/fields'; @@ -7,14 +15,6 @@ import { bufferToHex, hexToBuffer } from '@aztec/foundation/string'; import { inspect } from 'util'; -import { - MAX_CONTRACT_CLASS_LOGS_PER_TX, - MAX_L2_TO_L1_MSGS_PER_TX, - MAX_NOTE_HASHES_PER_TX, - MAX_NULLIFIERS_PER_TX, - MAX_PRIVATE_LOGS_PER_TX, - PRIVATE_TO_ROLLUP_ACCUMULATED_DATA_LENGTH, -} from '../../constants.gen.js'; import { ScopedL2ToL1Message } from '../l2_to_l1_message.js'; import { ScopedLogHash } from '../log_hash.js'; import { PrivateLog } from '../private_log.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 f822a51ac7ed..c8144e377c81 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,3 +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'; @@ -6,7 +7,6 @@ import { BufferReader, serializeToBuffer, serializeToFields } from '@aztec/found import { bufferToHex, hexToBuffer } from '@aztec/foundation/string'; import { type FieldsOf } from '@aztec/foundation/types'; -import { GeneratorIndex, PRIVATE_TO_ROLLUP_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH } from '../../constants.gen.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/kernel/tx_constant_data.ts b/yarn-project/circuits.js/src/structs/kernel/tx_constant_data.ts index 361852982adf..26ab31088733 100644 --- a/yarn-project/circuits.js/src/structs/kernel/tx_constant_data.ts +++ b/yarn-project/circuits.js/src/structs/kernel/tx_constant_data.ts @@ -1,8 +1,8 @@ +import { TX_CONSTANT_DATA_LENGTH } from '@aztec/constants'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader, FieldReader, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize'; import { type FieldsOf } from '@aztec/foundation/types'; -import { TX_CONSTANT_DATA_LENGTH } from '../../constants.gen.js'; import { BlockHeader } from '../block_header.js'; import { TxContext } from '../tx_context.js'; diff --git a/yarn-project/circuits.js/src/structs/key_validation_request.ts b/yarn-project/circuits.js/src/structs/key_validation_request.ts index eb2e6ccf4d37..c97ebae65d74 100644 --- a/yarn-project/circuits.js/src/structs/key_validation_request.ts +++ b/yarn-project/circuits.js/src/structs/key_validation_request.ts @@ -1,8 +1,7 @@ +import { KEY_VALIDATION_REQUEST_LENGTH } from '@aztec/constants'; import { Fr, GrumpkinScalar, Point } from '@aztec/foundation/fields'; import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/serialize'; -import { KEY_VALIDATION_REQUEST_LENGTH } from '../constants.gen.js'; - /** * Request for validating keys used in the app. */ diff --git a/yarn-project/circuits.js/src/structs/key_validation_request_and_generator.ts b/yarn-project/circuits.js/src/structs/key_validation_request_and_generator.ts index 21b9f66fb832..82caaeb81c3e 100644 --- a/yarn-project/circuits.js/src/structs/key_validation_request_and_generator.ts +++ b/yarn-project/circuits.js/src/structs/key_validation_request_and_generator.ts @@ -1,7 +1,7 @@ +import { KEY_VALIDATION_REQUEST_AND_GENERATOR_LENGTH } from '@aztec/constants'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/serialize'; -import { KEY_VALIDATION_REQUEST_AND_GENERATOR_LENGTH } from '../constants.gen.js'; import { KeyValidationRequest } from './key_validation_request.js'; /** diff --git a/yarn-project/circuits.js/src/structs/l2_to_l1_message.test.ts b/yarn-project/circuits.js/src/structs/l2_to_l1_message.test.ts index 0bf8b4c576e3..a4b3190ed65d 100644 --- a/yarn-project/circuits.js/src/structs/l2_to_l1_message.test.ts +++ b/yarn-project/circuits.js/src/structs/l2_to_l1_message.test.ts @@ -1,6 +1,6 @@ +import { L2_TO_L1_MESSAGE_LENGTH } from '@aztec/constants'; import { randomInt } from '@aztec/foundation/crypto'; -import { L2_TO_L1_MESSAGE_LENGTH } from '../constants.gen.js'; import { makeL2ToL1Message } from '../tests/factories.js'; import { L2ToL1Message } from './l2_to_l1_message.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 d69541886003..8fa11f3fa646 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,11 +1,10 @@ +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 { L2_TO_L1_MESSAGE_LENGTH, SCOPED_L2_TO_L1_MESSAGE_LENGTH } from '../constants.gen.js'; - export class L2ToL1Message { constructor(public recipient: EthAddress, public content: Fr, public counter: number) {} diff --git a/yarn-project/circuits.js/src/structs/max_block_number.ts b/yarn-project/circuits.js/src/structs/max_block_number.ts index 998fdd4a1a41..95e1b25ac11b 100644 --- a/yarn-project/circuits.js/src/structs/max_block_number.ts +++ b/yarn-project/circuits.js/src/structs/max_block_number.ts @@ -1,9 +1,8 @@ +import { MAX_BLOCK_NUMBER_LENGTH } from '@aztec/constants'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader, FieldReader, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize'; import { type FieldsOf } from '@aztec/foundation/types'; -import { MAX_BLOCK_NUMBER_LENGTH } from '../constants.gen.js'; - /** * Maximum block number. */ diff --git a/yarn-project/circuits.js/src/structs/parity/base_parity_inputs.ts b/yarn-project/circuits.js/src/structs/parity/base_parity_inputs.ts index a02b44025a37..cae60fa137ec 100644 --- a/yarn-project/circuits.js/src/structs/parity/base_parity_inputs.ts +++ b/yarn-project/circuits.js/src/structs/parity/base_parity_inputs.ts @@ -1,10 +1,9 @@ +import { type NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, NUM_MSGS_PER_BASE_PARITY } from '@aztec/constants'; import { Fr } from '@aztec/foundation/fields'; import { bufferSchemaFor } from '@aztec/foundation/schemas'; import { BufferReader, type Tuple, serializeToBuffer } from '@aztec/foundation/serialize'; import { bufferToHex, hexToBuffer } from '@aztec/foundation/string'; -import { type NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, NUM_MSGS_PER_BASE_PARITY } from '../../constants.gen.js'; - export class BaseParityInputs { constructor( /** Aggregated proof of all the parity circuit iterations. */ diff --git a/yarn-project/circuits.js/src/structs/parity/root_parity_input.test.ts b/yarn-project/circuits.js/src/structs/parity/root_parity_input.test.ts index 976cbf4d198a..4dbc08e168c9 100644 --- a/yarn-project/circuits.js/src/structs/parity/root_parity_input.test.ts +++ b/yarn-project/circuits.js/src/structs/parity/root_parity_input.test.ts @@ -1,4 +1,5 @@ -import { NESTED_RECURSIVE_PROOF_LENGTH, RECURSIVE_PROOF_LENGTH } from '../../constants.gen.js'; +import { NESTED_RECURSIVE_PROOF_LENGTH, RECURSIVE_PROOF_LENGTH } from '@aztec/constants'; + import { makeRootParityInput } from '../../tests/factories.js'; import { RootParityInput } from './root_parity_input.js'; diff --git a/yarn-project/circuits.js/src/structs/parity/root_parity_input.ts b/yarn-project/circuits.js/src/structs/parity/root_parity_input.ts index e9b159b43871..976d5227c9ee 100644 --- a/yarn-project/circuits.js/src/structs/parity/root_parity_input.ts +++ b/yarn-project/circuits.js/src/structs/parity/root_parity_input.ts @@ -1,10 +1,10 @@ +import { VK_TREE_HEIGHT } from '@aztec/constants'; import { Fr } from '@aztec/foundation/fields'; import { schemas } from '@aztec/foundation/schemas'; import { BufferReader, type Tuple, serializeToBuffer } from '@aztec/foundation/serialize'; import { bufferToHex, hexToBuffer } from '@aztec/foundation/string'; import { type FieldsOf } from '@aztec/foundation/types'; -import { VK_TREE_HEIGHT } from '../../constants.gen.js'; import { RecursiveProof } from '../recursive_proof.js'; import { VerificationKeyAsFields } from '../verification_key.js'; import { ParityPublicInputs } from './parity_public_inputs.js'; diff --git a/yarn-project/circuits.js/src/structs/parity/root_parity_inputs.ts b/yarn-project/circuits.js/src/structs/parity/root_parity_inputs.ts index 2b09078c7551..7fc249116a86 100644 --- a/yarn-project/circuits.js/src/structs/parity/root_parity_inputs.ts +++ b/yarn-project/circuits.js/src/structs/parity/root_parity_inputs.ts @@ -1,8 +1,8 @@ +import { NUM_BASE_PARITY_PER_ROOT_PARITY, RECURSIVE_PROOF_LENGTH } from '@aztec/constants'; import { bufferSchemaFor } from '@aztec/foundation/schemas'; import { BufferReader, type Tuple, serializeToBuffer } from '@aztec/foundation/serialize'; import { bufferToHex, hexToBuffer } from '@aztec/foundation/string'; -import { NUM_BASE_PARITY_PER_ROOT_PARITY, RECURSIVE_PROOF_LENGTH } from '../../constants.gen.js'; import { RootParityInput } from './root_parity_input.js'; export class RootParityInputs { diff --git a/yarn-project/circuits.js/src/structs/partial_state_reference.test.ts b/yarn-project/circuits.js/src/structs/partial_state_reference.test.ts index 0ee79d0431a6..d4d9bc34df7e 100644 --- a/yarn-project/circuits.js/src/structs/partial_state_reference.test.ts +++ b/yarn-project/circuits.js/src/structs/partial_state_reference.test.ts @@ -1,6 +1,6 @@ +import { PARTIAL_STATE_REFERENCE_LENGTH } from '@aztec/constants'; import { randomInt } from '@aztec/foundation/crypto'; -import { PARTIAL_STATE_REFERENCE_LENGTH } from '../constants.gen.js'; import { makePartialStateReference } from '../tests/factories.js'; import { PartialStateReference } from './partial_state_reference.js'; diff --git a/yarn-project/circuits.js/src/structs/partial_state_reference.ts b/yarn-project/circuits.js/src/structs/partial_state_reference.ts index 1db9147bedb4..62b3cb1fdcb8 100644 --- a/yarn-project/circuits.js/src/structs/partial_state_reference.ts +++ b/yarn-project/circuits.js/src/structs/partial_state_reference.ts @@ -1,9 +1,9 @@ +import { PARTIAL_STATE_REFERENCE_LENGTH } from '@aztec/constants'; import { type Fr } from '@aztec/foundation/fields'; import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/serialize'; import { z } from 'zod'; -import { PARTIAL_STATE_REFERENCE_LENGTH } from '../constants.gen.js'; import { AppendOnlyTreeSnapshot } from './trees/append_only_tree_snapshot.js'; /** diff --git a/yarn-project/circuits.js/src/structs/private_circuit_public_inputs.test.ts b/yarn-project/circuits.js/src/structs/private_circuit_public_inputs.test.ts index fac696a23995..939db67a6c2d 100644 --- a/yarn-project/circuits.js/src/structs/private_circuit_public_inputs.test.ts +++ b/yarn-project/circuits.js/src/structs/private_circuit_public_inputs.test.ts @@ -1,7 +1,7 @@ +import { PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH } from '@aztec/constants'; import { randomInt } from '@aztec/foundation/crypto'; import { setupCustomSnapshotSerializers } from '@aztec/foundation/testing'; -import { PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH } from '../constants.gen.js'; import { makePrivateCircuitPublicInputs } from '../tests/factories.js'; import { PrivateCircuitPublicInputs } from './private_circuit_public_inputs.js'; diff --git a/yarn-project/circuits.js/src/structs/private_circuit_public_inputs.ts b/yarn-project/circuits.js/src/structs/private_circuit_public_inputs.ts index 94c0041a9252..b837c9ac002d 100644 --- a/yarn-project/circuits.js/src/structs/private_circuit_public_inputs.ts +++ b/yarn-project/circuits.js/src/structs/private_circuit_public_inputs.ts @@ -1,15 +1,3 @@ -import { makeTuple } from '@aztec/foundation/array'; -import { Fr } from '@aztec/foundation/fields'; -import { bufferSchemaFor } from '@aztec/foundation/schemas'; -import { - BufferReader, - FieldReader, - type Tuple, - serializeToBuffer, - serializeToFields, -} from '@aztec/foundation/serialize'; -import { type FieldsOf } from '@aztec/foundation/types'; - import { MAX_CONTRACT_CLASS_LOGS_PER_CALL, MAX_ENQUEUED_CALLS_PER_CALL, @@ -22,7 +10,19 @@ import { MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, MAX_PRIVATE_LOGS_PER_CALL, PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH, -} from '../constants.gen.js'; +} from '@aztec/constants'; +import { makeTuple } from '@aztec/foundation/array'; +import { Fr } from '@aztec/foundation/fields'; +import { bufferSchemaFor } from '@aztec/foundation/schemas'; +import { + BufferReader, + FieldReader, + type Tuple, + serializeToBuffer, + serializeToFields, +} from '@aztec/foundation/serialize'; +import { type FieldsOf } from '@aztec/foundation/types'; + import { BlockHeader } from '../structs/block_header.js'; import { isEmptyArray } from '../utils/index.js'; import { CallContext } from './call_context.js'; diff --git a/yarn-project/circuits.js/src/structs/private_log.ts b/yarn-project/circuits.js/src/structs/private_log.ts index 8e019eee09c3..651866d54fca 100644 --- a/yarn-project/circuits.js/src/structs/private_log.ts +++ b/yarn-project/circuits.js/src/structs/private_log.ts @@ -1,3 +1,4 @@ +import { PRIVATE_LOG_SIZE_IN_FIELDS } from '@aztec/constants'; import { makeTuple } from '@aztec/foundation/array'; import { Fr } from '@aztec/foundation/fields'; import { schemas } from '@aztec/foundation/schemas'; @@ -6,8 +7,6 @@ import { BufferReader, FieldReader, type Tuple, serializeToBuffer } from '@aztec import { inspect } from 'util'; import { z } from 'zod'; -import { PRIVATE_LOG_SIZE_IN_FIELDS } from '../constants.gen.js'; - export class PrivateLog { static SIZE_IN_BYTES = Fr.SIZE_IN_BYTES * PRIVATE_LOG_SIZE_IN_FIELDS; 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 7924e2a6df14..13d8f60cc10d 100644 --- a/yarn-project/circuits.js/src/structs/private_log_data.ts +++ b/yarn-project/circuits.js/src/structs/private_log_data.ts @@ -1,3 +1,4 @@ +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'; @@ -5,9 +6,8 @@ import { type FieldsOf } from '@aztec/foundation/types'; import { inspect } from 'util'; -import { PRIVATE_LOG_DATA_LENGTH } from '../constants.gen.js'; +import { type UInt32 } from '../types/shared.js'; import { PrivateLog } from './private_log.js'; -import { type UInt32 } from './shared.js'; export class PrivateLogData { constructor(public log: PrivateLog, public noteHashCounter: UInt32, public counter: UInt32) {} diff --git a/yarn-project/circuits.js/src/structs/private_validation_requests.ts b/yarn-project/circuits.js/src/structs/private_validation_requests.ts index 3b8da4dc0306..53da320aeb1f 100644 --- a/yarn-project/circuits.js/src/structs/private_validation_requests.ts +++ b/yarn-project/circuits.js/src/structs/private_validation_requests.ts @@ -1,3 +1,8 @@ +import { + MAX_KEY_VALIDATION_REQUESTS_PER_TX, + MAX_NOTE_HASH_READ_REQUESTS_PER_TX, + MAX_NULLIFIER_READ_REQUESTS_PER_TX, +} from '@aztec/constants'; import { makeTuple } from '@aztec/foundation/array'; import { arraySerializedSizeOfNonEmpty } from '@aztec/foundation/collection'; import { type Fr } from '@aztec/foundation/fields'; @@ -6,11 +11,6 @@ import { bufferToHex, hexToBuffer } from '@aztec/foundation/string'; import { inspect } from 'util'; -import { - MAX_KEY_VALIDATION_REQUESTS_PER_TX, - MAX_NOTE_HASH_READ_REQUESTS_PER_TX, - MAX_NULLIFIER_READ_REQUESTS_PER_TX, -} from '../constants.gen.js'; import { OptionalNumber } from './optional_number.js'; import { ScopedReadRequest } from './read_request.js'; import { RollupValidationRequests } from './rollup_validation_requests.js'; diff --git a/yarn-project/circuits.js/src/structs/proof.ts b/yarn-project/circuits.js/src/structs/proof.ts index de3942dab7c2..a94fc37ffcc2 100644 --- a/yarn-project/circuits.js/src/structs/proof.ts +++ b/yarn-project/circuits.js/src/structs/proof.ts @@ -1,9 +1,8 @@ +import { AGGREGATION_OBJECT_LENGTH } from '@aztec/constants'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize'; import { bufferToHex, hexToBuffer } from '@aztec/foundation/string'; -import { AGGREGATION_OBJECT_LENGTH } from '../constants.gen.js'; - const EMPTY_PROOF_SIZE = 42; /** 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 67987838ccee..f0e0e001572f 100644 --- a/yarn-project/circuits.js/src/structs/public_call_request.ts +++ b/yarn-project/circuits.js/src/structs/public_call_request.ts @@ -1,4 +1,4 @@ -import { FunctionSelector } from '@aztec/foundation/abi'; +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'; @@ -6,8 +6,8 @@ import { type FieldsOf } from '@aztec/foundation/types'; import { inspect } from 'util'; -import { COUNTED_PUBLIC_CALL_REQUEST_LENGTH, PUBLIC_CALL_REQUEST_LENGTH } from '../constants.gen.js'; -import { type UInt32 } from './shared.js'; +import { FunctionSelector } from '../abi/index.js'; +import { type UInt32 } from '../types/shared.js'; /** * Represents a request to call a public function. 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 64965ffd59e3..75c326bbec78 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 { PUBLIC_CALL_STACK_ITEM_COMPRESSED_LENGTH } from '../constants.gen.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_hint.ts b/yarn-project/circuits.js/src/structs/public_data_hint.ts index a3e6b766725c..1096e1a52028 100644 --- a/yarn-project/circuits.js/src/structs/public_data_hint.ts +++ b/yarn-project/circuits.js/src/structs/public_data_hint.ts @@ -1,8 +1,8 @@ +import { PUBLIC_DATA_TREE_HEIGHT } from '@aztec/constants'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize'; +import { MembershipWitness } from '@aztec/foundation/trees'; -import { PUBLIC_DATA_TREE_HEIGHT } from '../constants.gen.js'; -import { MembershipWitness } from './membership_witness.js'; import { PublicDataTreeLeafPreimage } from './trees/index.js'; export class PublicDataHint { diff --git a/yarn-project/circuits.js/src/structs/public_log.test.ts b/yarn-project/circuits.js/src/structs/public_log.test.ts index c15dd126d893..cbaf67f7c5a3 100644 --- a/yarn-project/circuits.js/src/structs/public_log.test.ts +++ b/yarn-project/circuits.js/src/structs/public_log.test.ts @@ -1,4 +1,5 @@ -import { PUBLIC_LOG_SIZE_IN_FIELDS } from '../constants.gen.js'; +import { PUBLIC_LOG_SIZE_IN_FIELDS } from '@aztec/constants'; + import { PublicLog } from './public_log.js'; describe('PublicLog', () => { diff --git a/yarn-project/circuits.js/src/structs/public_log.ts b/yarn-project/circuits.js/src/structs/public_log.ts index 70fa4a34effa..1049b59bd254 100644 --- a/yarn-project/circuits.js/src/structs/public_log.ts +++ b/yarn-project/circuits.js/src/structs/public_log.ts @@ -1,3 +1,4 @@ +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'; @@ -13,8 +14,6 @@ import { import { inspect } from 'util'; import { z } from 'zod'; -import { PUBLIC_LOG_DATA_SIZE_IN_FIELDS, PUBLIC_LOG_SIZE_IN_FIELDS } from '../constants.gen.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_hints/note_hash_read_request_hints.ts b/yarn-project/circuits.js/src/structs/read_request_hints/note_hash_read_request_hints.ts index 2f5e842241d0..6c0e00030c8b 100644 --- a/yarn-project/circuits.js/src/structs/read_request_hints/note_hash_read_request_hints.ts +++ b/yarn-project/circuits.js/src/structs/read_request_hints/note_hash_read_request_hints.ts @@ -1,9 +1,9 @@ +import { MAX_NOTE_HASH_READ_REQUESTS_PER_TX, NOTE_HASH_TREE_HEIGHT } from '@aztec/constants'; import { makeTuple } from '@aztec/foundation/array'; import { Fr } from '@aztec/foundation/fields'; import { type BufferReader } from '@aztec/foundation/serialize'; +import { type MembershipWitness } from '@aztec/foundation/trees'; -import { MAX_NOTE_HASH_READ_REQUESTS_PER_TX, NOTE_HASH_TREE_HEIGHT } from '../../constants.gen.js'; -import { type MembershipWitness } from '../membership_witness.js'; import { PendingReadHint, ReadRequestResetHints, diff --git a/yarn-project/circuits.js/src/structs/read_request_hints/nullifier_read_request_hints.ts b/yarn-project/circuits.js/src/structs/read_request_hints/nullifier_read_request_hints.ts index ac8c472a1c21..324e004b0fff 100644 --- a/yarn-project/circuits.js/src/structs/read_request_hints/nullifier_read_request_hints.ts +++ b/yarn-project/circuits.js/src/structs/read_request_hints/nullifier_read_request_hints.ts @@ -1,9 +1,8 @@ +import { MAX_NULLIFIER_READ_REQUESTS_PER_TX, NULLIFIER_TREE_HEIGHT } from '@aztec/constants'; import { makeTuple } from '@aztec/foundation/array'; import { type BufferReader } from '@aztec/foundation/serialize'; -import { type TreeLeafPreimage } from '@aztec/foundation/trees'; +import { type MembershipWitness, type TreeLeafPreimage } from '@aztec/foundation/trees'; -import { MAX_NULLIFIER_READ_REQUESTS_PER_TX, NULLIFIER_TREE_HEIGHT } from '../../constants.gen.js'; -import { type MembershipWitness } from '../membership_witness.js'; import { NullifierLeafPreimage } from '../trees/index.js'; import { PendingReadHint, diff --git a/yarn-project/circuits.js/src/structs/read_request_hints/read_request_hints.ts b/yarn-project/circuits.js/src/structs/read_request_hints/read_request_hints.ts index 8b4c1304c559..e29c557a7084 100644 --- a/yarn-project/circuits.js/src/structs/read_request_hints/read_request_hints.ts +++ b/yarn-project/circuits.js/src/structs/read_request_hints/read_request_hints.ts @@ -1,7 +1,6 @@ import { makeTuple } from '@aztec/foundation/array'; import { BufferReader, type Bufferable, type Tuple, serializeToBuffer } from '@aztec/foundation/serialize'; - -import { MembershipWitness } from '../membership_witness.js'; +import { MembershipWitness } from '@aztec/foundation/trees'; export enum ReadRequestState { NADA = 0, diff --git a/yarn-project/circuits.js/src/structs/rollup/avm_proof_data.ts b/yarn-project/circuits.js/src/structs/rollup/avm_proof_data.ts index 72c843c89e73..79d7c431ffe2 100644 --- a/yarn-project/circuits.js/src/structs/rollup/avm_proof_data.ts +++ b/yarn-project/circuits.js/src/structs/rollup/avm_proof_data.ts @@ -1,6 +1,6 @@ +import { AVM_PROOF_LENGTH_IN_FIELDS } from '@aztec/constants'; import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize'; -import { AVM_PROOF_LENGTH_IN_FIELDS } from '../../constants.gen.js'; import { AvmCircuitPublicInputs } from '../avm/avm_circuit_public_inputs.js'; import { RecursiveProof, makeEmptyRecursiveProof } from '../recursive_proof.js'; import { VkWitnessData } from '../vk_witness_data.js'; diff --git a/yarn-project/circuits.js/src/structs/rollup/base_or_merge_rollup_public_inputs.ts b/yarn-project/circuits.js/src/structs/rollup/base_or_merge_rollup_public_inputs.ts index cc2947d98349..622e5ae9f51e 100644 --- a/yarn-project/circuits.js/src/structs/rollup/base_or_merge_rollup_public_inputs.ts +++ b/yarn-project/circuits.js/src/structs/rollup/base_or_merge_rollup_public_inputs.ts @@ -1,11 +1,11 @@ +import { SpongeBlob } from '@aztec/blob-lib'; import { Fr } from '@aztec/foundation/fields'; import { bufferSchemaFor } from '@aztec/foundation/schemas'; import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize'; import { bufferToHex, hexToBuffer } from '@aztec/foundation/string'; -import { SpongeBlob } from '../blobs/sponge_blob.js'; +import { RollupTypes } from '../../types/shared.js'; import { PartialStateReference } from '../partial_state_reference.js'; -import { RollupTypes } from '../shared.js'; import { ConstantRollupData } from './constant_rollup_data.js'; /** diff --git a/yarn-project/circuits.js/src/structs/rollup/base_rollup_hints.ts b/yarn-project/circuits.js/src/structs/rollup/base_rollup_hints.ts index 6b86eec3a2c6..d315fd736e3e 100644 --- a/yarn-project/circuits.js/src/structs/rollup/base_rollup_hints.ts +++ b/yarn-project/circuits.js/src/structs/rollup/base_rollup_hints.ts @@ -1,10 +1,10 @@ +import { SpongeBlob } from '@aztec/blob-lib'; +import { ARCHIVE_HEIGHT } from '@aztec/constants'; import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize'; import { bufferToHex, hexToBuffer } from '@aztec/foundation/string'; +import { MembershipWitness } from '@aztec/foundation/trees'; import { type FieldsOf } from '@aztec/foundation/types'; -import { ARCHIVE_HEIGHT } from '../../constants.gen.js'; -import { SpongeBlob } from '../blobs/sponge_blob.js'; -import { MembershipWitness } from '../membership_witness.js'; import { PartialStateReference } from '../partial_state_reference.js'; import { PublicDataHint } from '../public_data_hint.js'; import { ConstantRollupData } from './constant_rollup_data.js'; diff --git a/yarn-project/circuits.js/src/structs/rollup/block_root_or_block_merge_public_inputs.ts b/yarn-project/circuits.js/src/structs/rollup/block_root_or_block_merge_public_inputs.ts index 56bd636c6ef8..b98d900c8235 100644 --- a/yarn-project/circuits.js/src/structs/rollup/block_root_or_block_merge_public_inputs.ts +++ b/yarn-project/circuits.js/src/structs/rollup/block_root_or_block_merge_public_inputs.ts @@ -1,3 +1,5 @@ +import { BlockBlobPublicInputs } from '@aztec/blob-lib'; +import { AZTEC_MAX_EPOCH_DURATION } from '@aztec/constants'; import { EthAddress } from '@aztec/foundation/eth-address'; import { Fr } from '@aztec/foundation/fields'; import { bufferSchemaFor } from '@aztec/foundation/schemas'; @@ -5,8 +7,6 @@ import { BufferReader, type Tuple, serializeToBuffer, serializeToFields } from ' import { bufferToHex, hexToBuffer } from '@aztec/foundation/string'; import { type FieldsOf } from '@aztec/foundation/types'; -import { AZTEC_MAX_EPOCH_DURATION } from '../../constants.gen.js'; -import { BlockBlobPublicInputs } from '../blobs/blob_public_inputs.js'; import { GlobalVariables } from '../global_variables.js'; import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js'; diff --git a/yarn-project/circuits.js/src/structs/rollup/block_root_rollup.ts b/yarn-project/circuits.js/src/structs/rollup/block_root_rollup.ts index 3e513055331c..421cbc6df693 100644 --- a/yarn-project/circuits.js/src/structs/rollup/block_root_rollup.ts +++ b/yarn-project/circuits.js/src/structs/rollup/block_root_rollup.ts @@ -1,16 +1,16 @@ -import { Fr } from '@aztec/foundation/fields'; -import { bufferSchemaFor } from '@aztec/foundation/schemas'; -import { BufferReader, type Tuple, serializeToBuffer } from '@aztec/foundation/serialize'; -import { bufferToHex, hexToBuffer } from '@aztec/foundation/string'; -import { type FieldsOf } from '@aztec/foundation/types'; - import { ARCHIVE_HEIGHT, BLOBS_PER_BLOCK, FIELDS_PER_BLOB, L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH, NESTED_RECURSIVE_PROOF_LENGTH, -} from '../../constants.gen.js'; +} from '@aztec/constants'; +import { Fr } from '@aztec/foundation/fields'; +import { bufferSchemaFor } from '@aztec/foundation/schemas'; +import { BufferReader, type Tuple, serializeToBuffer } from '@aztec/foundation/serialize'; +import { bufferToHex, hexToBuffer } from '@aztec/foundation/string'; +import { type FieldsOf } from '@aztec/foundation/types'; + import { BlockHeader } from '../block_header.js'; import { RootParityInput } from '../parity/root_parity_input.js'; import { PreviousRollupData } from './previous_rollup_data.js'; diff --git a/yarn-project/circuits.js/src/structs/rollup/previous_rollup_block_data.ts b/yarn-project/circuits.js/src/structs/rollup/previous_rollup_block_data.ts index a679a1cea19e..605a3ebe6281 100644 --- a/yarn-project/circuits.js/src/structs/rollup/previous_rollup_block_data.ts +++ b/yarn-project/circuits.js/src/structs/rollup/previous_rollup_block_data.ts @@ -1,7 +1,7 @@ +import { NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, VK_TREE_HEIGHT } from '@aztec/constants'; import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize'; +import { MembershipWitness } from '@aztec/foundation/trees'; -import { NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, VK_TREE_HEIGHT } from '../../constants.gen.js'; -import { MembershipWitness } from '../membership_witness.js'; import { RecursiveProof } from '../recursive_proof.js'; import { VerificationKeyAsFields } from '../verification_key.js'; import { BlockRootOrBlockMergePublicInputs } from './block_root_or_block_merge_public_inputs.js'; diff --git a/yarn-project/circuits.js/src/structs/rollup/previous_rollup_data.ts b/yarn-project/circuits.js/src/structs/rollup/previous_rollup_data.ts index 5f4f0f7e8749..e027ee7dd1ef 100644 --- a/yarn-project/circuits.js/src/structs/rollup/previous_rollup_data.ts +++ b/yarn-project/circuits.js/src/structs/rollup/previous_rollup_data.ts @@ -1,7 +1,7 @@ +import { NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, VK_TREE_HEIGHT } from '@aztec/constants'; import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize'; +import { MembershipWitness } from '@aztec/foundation/trees'; -import { NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, VK_TREE_HEIGHT } from '../../constants.gen.js'; -import { MembershipWitness } from '../membership_witness.js'; import { RecursiveProof } from '../recursive_proof.js'; import { VerificationKeyAsFields } from '../verification_key.js'; import { BaseOrMergeRollupPublicInputs } from './base_or_merge_rollup_public_inputs.js'; diff --git a/yarn-project/circuits.js/src/structs/rollup/private_tube_data.ts b/yarn-project/circuits.js/src/structs/rollup/private_tube_data.ts index a6eac678493e..13bc4ee936da 100644 --- a/yarn-project/circuits.js/src/structs/rollup/private_tube_data.ts +++ b/yarn-project/circuits.js/src/structs/rollup/private_tube_data.ts @@ -1,6 +1,6 @@ +import { NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH } from '@aztec/constants'; import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize'; -import { NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH } from '../../constants.gen.js'; import { PrivateToRollupKernelCircuitPublicInputs } from '../kernel/private_to_rollup_kernel_circuit_public_inputs.js'; import { RecursiveProof, makeEmptyRecursiveProof } from '../recursive_proof.js'; import { VkWitnessData } from '../vk_witness_data.js'; diff --git a/yarn-project/circuits.js/src/structs/rollup/public_tube_data.ts b/yarn-project/circuits.js/src/structs/rollup/public_tube_data.ts index 18075b5a92c6..6fdb085857d8 100644 --- a/yarn-project/circuits.js/src/structs/rollup/public_tube_data.ts +++ b/yarn-project/circuits.js/src/structs/rollup/public_tube_data.ts @@ -1,6 +1,6 @@ +import { NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH } from '@aztec/constants'; import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize'; -import { NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH } from '../../constants.gen.js'; import { PrivateToPublicKernelCircuitPublicInputs } from '../kernel/private_to_public_kernel_circuit_public_inputs.js'; import { RecursiveProof, makeEmptyRecursiveProof } from '../recursive_proof.js'; import { VkWitnessData } from '../vk_witness_data.js'; diff --git a/yarn-project/circuits.js/src/structs/rollup/root_rollup.test.ts b/yarn-project/circuits.js/src/structs/rollup/root_rollup.test.ts index 7a10ef1d431b..a33e4883ad19 100644 --- a/yarn-project/circuits.js/src/structs/rollup/root_rollup.test.ts +++ b/yarn-project/circuits.js/src/structs/rollup/root_rollup.test.ts @@ -1,4 +1,5 @@ -import { ROOT_ROLLUP_PUBLIC_INPUTS_LENGTH } from '../../constants.gen.js'; +import { ROOT_ROLLUP_PUBLIC_INPUTS_LENGTH } from '@aztec/constants'; + import { makeRootRollupPublicInputs } from '../../tests/factories.js'; import { RootRollupPublicInputs } from './root_rollup.js'; diff --git a/yarn-project/circuits.js/src/structs/rollup/root_rollup.ts b/yarn-project/circuits.js/src/structs/rollup/root_rollup.ts index f494e7e1f2c4..3b554c8eef55 100644 --- a/yarn-project/circuits.js/src/structs/rollup/root_rollup.ts +++ b/yarn-project/circuits.js/src/structs/rollup/root_rollup.ts @@ -1,3 +1,5 @@ +import { BlockBlobPublicInputs } from '@aztec/blob-lib'; +import { AZTEC_MAX_EPOCH_DURATION } from '@aztec/constants'; import { makeTuple } from '@aztec/foundation/array'; import { Fr } from '@aztec/foundation/fields'; import { bufferSchemaFor } from '@aztec/foundation/schemas'; @@ -5,8 +7,6 @@ import { BufferReader, type Tuple, serializeToBuffer, serializeToFields } from ' import { bufferToHex, hexToBuffer } from '@aztec/foundation/string'; import { type FieldsOf } from '@aztec/foundation/types'; -import { AZTEC_MAX_EPOCH_DURATION } from '../../constants.gen.js'; -import { BlockBlobPublicInputs } from '../blobs/blob_public_inputs.js'; import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js'; import { FeeRecipient } from './block_root_or_block_merge_public_inputs.js'; import { PreviousRollupBlockData } from './previous_rollup_block_data.js'; diff --git a/yarn-project/circuits.js/src/structs/rollup/state_diff_hints.ts b/yarn-project/circuits.js/src/structs/rollup/state_diff_hints.ts index b7e1683a58d2..5e2ee90d8ce6 100644 --- a/yarn-project/circuits.js/src/structs/rollup/state_diff_hints.ts +++ b/yarn-project/circuits.js/src/structs/rollup/state_diff_hints.ts @@ -1,16 +1,16 @@ -import { makeTuple } from '@aztec/foundation/array'; -import { Fr } from '@aztec/foundation/fields'; -import { BufferReader, type Tuple, serializeToBuffer } from '@aztec/foundation/serialize'; -import { type FieldsOf } from '@aztec/foundation/types'; - import { MAX_NULLIFIERS_PER_TX, NOTE_HASH_SUBTREE_SIBLING_PATH_LENGTH, NULLIFIER_SUBTREE_SIBLING_PATH_LENGTH, NULLIFIER_TREE_HEIGHT, PUBLIC_DATA_TREE_HEIGHT, -} from '../../constants.gen.js'; -import { MembershipWitness } from '../membership_witness.js'; +} from '@aztec/constants'; +import { makeTuple } from '@aztec/foundation/array'; +import { Fr } from '@aztec/foundation/fields'; +import { BufferReader, type Tuple, serializeToBuffer } from '@aztec/foundation/serialize'; +import { MembershipWitness } from '@aztec/foundation/trees'; +import { type FieldsOf } from '@aztec/foundation/types'; + import { NullifierLeafPreimage, PublicDataTreeLeafPreimage } from '../trees/index.js'; /** diff --git a/yarn-project/circuits.js/src/structs/rollup_validation_requests.ts b/yarn-project/circuits.js/src/structs/rollup_validation_requests.ts index c415c9817824..8720a0f0f2b0 100644 --- a/yarn-project/circuits.js/src/structs/rollup_validation_requests.ts +++ b/yarn-project/circuits.js/src/structs/rollup_validation_requests.ts @@ -1,9 +1,9 @@ +import { ROLLUP_VALIDATION_REQUESTS_LENGTH } from '@aztec/constants'; import { type Fr } from '@aztec/foundation/fields'; import { BufferReader, FieldReader, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize'; import { bufferToHex, hexToBuffer } from '@aztec/foundation/string'; import { type FieldsOf } from '@aztec/foundation/types'; -import { ROLLUP_VALIDATION_REQUESTS_LENGTH } from '../constants.gen.js'; import { MaxBlockNumber } from './max_block_number.js'; /** 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 959c0808687a..70e9cffa5756 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 { SCOPED_KEY_VALIDATION_REQUEST_AND_GENERATOR_LENGTH } from '../constants.gen.js'; import { KeyValidationRequestAndGenerator } from './key_validation_request_and_generator.js'; /** diff --git a/yarn-project/circuits.js/src/structs/shared_mutable/index.ts b/yarn-project/circuits.js/src/structs/shared_mutable/index.ts index d503d08263bb..fd2bc702fe70 100644 --- a/yarn-project/circuits.js/src/structs/shared_mutable/index.ts +++ b/yarn-project/circuits.js/src/structs/shared_mutable/index.ts @@ -1,7 +1,6 @@ +import { SCHEDULED_DELAY_CHANGE_PCKD_LEN } from '@aztec/constants'; import { Fr } from '@aztec/foundation/fields'; -import { SCHEDULED_DELAY_CHANGE_PCKD_LEN } from '../../constants.gen.js'; - export * from './scheduled_delay_change.js'; export * from './scheduled_value_change.js'; diff --git a/yarn-project/circuits.js/src/structs/shared_mutable/scheduled_delay_change.ts b/yarn-project/circuits.js/src/structs/shared_mutable/scheduled_delay_change.ts index a99d77d60d30..9a23eb1b9ef3 100644 --- a/yarn-project/circuits.js/src/structs/shared_mutable/scheduled_delay_change.ts +++ b/yarn-project/circuits.js/src/structs/shared_mutable/scheduled_delay_change.ts @@ -1,7 +1,7 @@ import { Fr } from '@aztec/foundation/fields'; import { BufferReader } from '@aztec/foundation/serialize'; -import { type UInt32 } from '../shared.js'; +import { type UInt32 } from '../../types/shared.js'; export class ScheduledDelayChange { constructor(public previous: UInt32 | undefined, public blockOfChange: UInt32, public post: UInt32 | undefined) {} diff --git a/yarn-project/circuits.js/src/structs/shared_mutable/scheduled_value_change.ts b/yarn-project/circuits.js/src/structs/shared_mutable/scheduled_value_change.ts index 7ebf8e0b114d..860383e6d467 100644 --- a/yarn-project/circuits.js/src/structs/shared_mutable/scheduled_value_change.ts +++ b/yarn-project/circuits.js/src/structs/shared_mutable/scheduled_value_change.ts @@ -1,8 +1,7 @@ +import { SCHEDULED_DELAY_CHANGE_PCKD_LEN } from '@aztec/constants'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/serialize'; -import { SCHEDULED_DELAY_CHANGE_PCKD_LEN } from '../../constants.gen.js'; - export class ScheduledValueChange { constructor(public previous: Fr[], public post: Fr[], public blockOfChange: number) { if (this.previous.length !== this.post.length) { diff --git a/yarn-project/circuits.js/src/structs/state_reference.test.ts b/yarn-project/circuits.js/src/structs/state_reference.test.ts index 12528abd0fc6..6b124f50becb 100644 --- a/yarn-project/circuits.js/src/structs/state_reference.test.ts +++ b/yarn-project/circuits.js/src/structs/state_reference.test.ts @@ -1,6 +1,6 @@ +import { STATE_REFERENCE_LENGTH } from '@aztec/constants'; import { randomInt } from '@aztec/foundation/crypto'; -import { STATE_REFERENCE_LENGTH } from '../constants.gen.js'; import { makeStateReference } from '../tests/factories.js'; import { StateReference } from './state_reference.js'; diff --git a/yarn-project/circuits.js/src/structs/state_reference.ts b/yarn-project/circuits.js/src/structs/state_reference.ts index 4f550dd63b46..ce0995e33ac8 100644 --- a/yarn-project/circuits.js/src/structs/state_reference.ts +++ b/yarn-project/circuits.js/src/structs/state_reference.ts @@ -1,10 +1,10 @@ +import { STATE_REFERENCE_LENGTH } from '@aztec/constants'; import { type Fr } from '@aztec/foundation/fields'; import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/serialize'; import { inspect } from 'util'; import { z } from 'zod'; -import { STATE_REFERENCE_LENGTH } from '../constants.gen.js'; import { PartialStateReference } from './partial_state_reference.js'; import { AppendOnlyTreeSnapshot } from './trees/append_only_tree_snapshot.js'; diff --git a/yarn-project/circuits.js/src/structs/tree_snapshots.ts b/yarn-project/circuits.js/src/structs/tree_snapshots.ts index 0a85f9f5383a..28b3a92bb90b 100644 --- a/yarn-project/circuits.js/src/structs/tree_snapshots.ts +++ b/yarn-project/circuits.js/src/structs/tree_snapshots.ts @@ -1,9 +1,9 @@ +import { TREE_SNAPSHOTS_LENGTH } from '@aztec/constants'; import { type Fr } from '@aztec/foundation/fields'; import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/serialize'; import { inspect } from 'util'; -import { TREE_SNAPSHOTS_LENGTH } from '../constants.gen.js'; import { AppendOnlyTreeSnapshot } from './trees/append_only_tree_snapshot.js'; /** diff --git a/yarn-project/circuits.js/src/structs/trees/append_only_tree_snapshot.ts b/yarn-project/circuits.js/src/structs/trees/append_only_tree_snapshot.ts index 90d070338a16..dccf6342e614 100644 --- a/yarn-project/circuits.js/src/structs/trees/append_only_tree_snapshot.ts +++ b/yarn-project/circuits.js/src/structs/trees/append_only_tree_snapshot.ts @@ -6,7 +6,7 @@ import { bufferToHex, hexToBuffer } from '@aztec/foundation/string'; import { inspect } from 'util'; import { z } from 'zod'; -import { type UInt32 } from '../shared.js'; +import { type UInt32 } from '../../types/shared.js'; /** * Snapshot of an append only tree. diff --git a/yarn-project/circuits.js/src/structs/trees/protocol_contract_leaf.ts b/yarn-project/circuits.js/src/structs/trees/protocol_contract_leaf.ts index ed14ab63e6dd..836054252e1f 100644 --- a/yarn-project/circuits.js/src/structs/trees/protocol_contract_leaf.ts +++ b/yarn-project/circuits.js/src/structs/trees/protocol_contract_leaf.ts @@ -1,3 +1,4 @@ +import { MAX_PROTOCOL_CONTRACTS } from '@aztec/constants'; import { toBigIntBE } from '@aztec/foundation/bigint-buffer'; import { Fr } from '@aztec/foundation/fields'; import { schemas } from '@aztec/foundation/schemas'; @@ -6,8 +7,6 @@ import { type IndexedTreeLeaf, type IndexedTreeLeafPreimage } from '@aztec/found import { z } from 'zod'; -import { MAX_PROTOCOL_CONTRACTS } from '../../constants.gen.js'; - /** * Class containing the data of a preimage of a single leaf in the protocol contract tree. * Note: It's called preimage because this data gets hashed before being inserted as a node into the `IndexedTree`. diff --git a/yarn-project/circuits.js/src/structs/tx_context.test.ts b/yarn-project/circuits.js/src/structs/tx_context.test.ts index f2b1f4b75334..a447d7dd9f6f 100644 --- a/yarn-project/circuits.js/src/structs/tx_context.test.ts +++ b/yarn-project/circuits.js/src/structs/tx_context.test.ts @@ -1,8 +1,8 @@ +import { TX_CONTEXT_LENGTH } from '@aztec/constants'; import { randomInt } from '@aztec/foundation/crypto'; import { jsonStringify } from '@aztec/foundation/json-rpc'; import { setupCustomSnapshotSerializers } from '@aztec/foundation/testing'; -import { TX_CONTEXT_LENGTH } from '../constants.gen.js'; import { makeTxContext } from '../tests/factories.js'; import { TxContext } from './tx_context.js'; diff --git a/yarn-project/circuits.js/src/structs/tx_context.ts b/yarn-project/circuits.js/src/structs/tx_context.ts index 33234b4417a8..6bebe20674d3 100644 --- a/yarn-project/circuits.js/src/structs/tx_context.ts +++ b/yarn-project/circuits.js/src/structs/tx_context.ts @@ -1,3 +1,4 @@ +import { TX_CONTEXT_LENGTH } from '@aztec/constants'; import { Fr } from '@aztec/foundation/fields'; import { schemas } from '@aztec/foundation/schemas'; import { BufferReader, FieldReader, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize'; @@ -5,7 +6,6 @@ import { type FieldsOf } from '@aztec/foundation/types'; import { z } from 'zod'; -import { TX_CONTEXT_LENGTH } from '../constants.gen.js'; import { GasSettings } from './gas_settings.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 a3040407b138..9b148059aacc 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 { FunctionSelector } from '@aztec/foundation/abi'; +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 { TX_REQUEST_LENGTH } from '../constants.gen.js'; +import { FunctionSelector } from '../abi/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 596a5ce86961..3879c1cf53c1 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 { GeneratorIndex, TX_REQUEST_LENGTH } from '../constants.gen.js'; import { FunctionData } from './function_data.js'; import { TxContext } from './tx_context.js'; diff --git a/yarn-project/circuits.js/src/structs/verification_key.ts b/yarn-project/circuits.js/src/structs/verification_key.ts index 1532ad7c3666..c4bfdd3f5b3d 100644 --- a/yarn-project/circuits.js/src/structs/verification_key.ts +++ b/yarn-project/circuits.js/src/structs/verification_key.ts @@ -1,3 +1,7 @@ +import { + HONK_VERIFICATION_KEY_LENGTH_IN_FIELDS, + ROLLUP_HONK_VERIFICATION_KEY_LENGTH_IN_FIELDS, +} from '@aztec/constants'; import { makeTuple } from '@aztec/foundation/array'; import { times } from '@aztec/foundation/collection'; import { Fq, Fr } from '@aztec/foundation/fields'; @@ -5,11 +9,7 @@ import { bufferSchemaFor } from '@aztec/foundation/schemas'; import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize'; import { bufferToHex, hexToBuffer } from '@aztec/foundation/string'; -import { - HONK_VERIFICATION_KEY_LENGTH_IN_FIELDS, - ROLLUP_HONK_VERIFICATION_KEY_LENGTH_IN_FIELDS, -} from '../constants.gen.js'; -import { CircuitType } from './shared.js'; +import { CircuitType } from '../types/shared.js'; /** * Curve data. diff --git a/yarn-project/circuits.js/src/structs/vk_witness_data.ts b/yarn-project/circuits.js/src/structs/vk_witness_data.ts index 90e2239cd65a..6ef5c53be811 100644 --- a/yarn-project/circuits.js/src/structs/vk_witness_data.ts +++ b/yarn-project/circuits.js/src/structs/vk_witness_data.ts @@ -1,10 +1,10 @@ +import { VK_TREE_HEIGHT } from '@aztec/constants'; import { makeTuple } from '@aztec/foundation/array'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader, type Tuple, serializeToBuffer } from '@aztec/foundation/serialize'; import { bufferToHex } from '@aztec/foundation/string'; -import { VK_TREE_HEIGHT } from '../constants.gen.js'; -import { type UInt32 } from './shared.js'; +import { type UInt32 } from '../types/shared.js'; import { VerificationKeyData } from './verification_key.js'; export class VkWitnessData { diff --git a/yarn-project/circuits.js/src/tests/factories.ts b/yarn-project/circuits.js/src/tests/factories.ts index bceafef8ddab..b1df3fe4ac3f 100644 --- a/yarn-project/circuits.js/src/tests/factories.ts +++ b/yarn-project/circuits.js/src/tests/factories.ts @@ -1,45 +1,12 @@ -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 { poseidon2HashWithSeparator } from '@aztec/foundation/crypto'; -import { EthAddress } from '@aztec/foundation/eth-address'; -import { type Bufferable } from '@aztec/foundation/serialize'; - -import { SchnorrSignature } from '../barretenberg/index.js'; -import { - type ContractClassPublic, - type ContractInstanceWithAddress, - type ExecutablePrivateFunctionWithMembershipProof, - type PrivateFunction, - type PublicFunction, - SerializableContractInstance, - type UnconstrainedFunctionWithMembershipProof, -} from '../contract/index.js'; +import { makeBlockBlobPublicInputs, makeSpongeBlob } from '@aztec/blob-lib/testing'; import { ARCHIVE_HEIGHT, AVM_PROOF_LENGTH_IN_FIELDS, AZTEC_MAX_EPOCH_DURATION, - AvmCircuitInputs, - AvmContractInstanceHint, - AvmExecutionHints, BLOBS_PER_BLOCK, - BaseParityInputs, - CallContext, - CombinedConstantData, - ContractStorageRead, - ContractStorageUpdateRequest, FIELDS_PER_BLOB, - Fr, - FunctionData, - FunctionSelector, GeneratorIndex, - GrumpkinScalar, - KeyValidationRequest, - KeyValidationRequestAndGenerator, L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH, - L2ToL1Message, - LogHash, MAX_CONTRACT_CLASS_LOGS_PER_TX, MAX_ENQUEUED_CALLS_PER_CALL, MAX_ENQUEUED_CALLS_PER_TX, @@ -57,8 +24,6 @@ import { MAX_PRIVATE_LOGS_PER_TX, MAX_PUBLIC_LOGS_PER_TX, MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, - MaxBlockNumber, - MembershipWitness, NESTED_RECURSIVE_PROOF_LENGTH, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, NOTE_HASH_SUBTREE_SIBLING_PATH_LENGTH, @@ -66,39 +31,65 @@ import { NULLIFIER_TREE_HEIGHT, NUM_BASE_PARITY_PER_ROOT_PARITY, NUM_MSGS_PER_BASE_PARITY, - NoteHash, - Nullifier, - NullifierLeafPreimage, PRIVATE_LOG_SIZE_IN_FIELDS, PUBLIC_DATA_TREE_HEIGHT, PUBLIC_LOG_DATA_SIZE_IN_FIELDS, + RECURSIVE_PROOF_LENGTH, + TUBE_PROOF_LENGTH, + 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'; +import { EthAddress } from '@aztec/foundation/eth-address'; +import { type Bufferable } from '@aztec/foundation/serialize'; +import { MembershipWitness } from '@aztec/foundation/trees'; + +import { + type ContractClassPublic, + type ContractInstanceWithAddress, + type ExecutablePrivateFunctionWithMembershipProof, + type PrivateFunction, + type PublicFunction, + SerializableContractInstance, + type UnconstrainedFunctionWithMembershipProof, +} from '../contract/index.js'; +import { + BaseParityInputs, + CallContext, + ContractStorageRead, + ContractStorageUpdateRequest, + Fr, + FunctionData, + FunctionSelector, + GrumpkinScalar, + KeyValidationRequest, + KeyValidationRequestAndGenerator, + L2ToL1Message, + LogHash, + MaxBlockNumber, + NoteHash, + Nullifier, ParityPublicInputs, - PartialPrivateTailPublicInputsForPublic, - PartialPrivateTailPublicInputsForRollup, PartialStateReference, Point, PrivateCallRequest, PrivateCircuitPublicInputs, - PrivateKernelTailCircuitPublicInputs, - PrivateToRollupAccumulatedData, Proof, PublicCallRequest, PublicDataHint, PublicDataRead, - PublicDataTreeLeaf, - PublicDataTreeLeafPreimage, PublicKeys, - RECURSIVE_PROOF_LENGTH, ReadRequest, RollupTypes, RootParityInput, RootParityInputs, ScopedLogHash, StateReference, - TUBE_PROOF_LENGTH, TxContext, TxRequest, - VK_TREE_HEIGHT, Vector, VerificationKey, VerificationKeyAsFields, @@ -108,38 +99,48 @@ import { computePublicBytecodeCommitment, makeRecursiveProof, } from '../index.js'; -import { BlobPublicInputs, BlockBlobPublicInputs } from '../structs/blobs/blob_public_inputs.js'; -import { Poseidon2Sponge, SpongeBlob } from '../structs/blobs/sponge_blob.js'; -import { BlockHeader } from '../structs/block_header.js'; -import { ContentCommitment, NUM_BYTES_PER_SHA256 } from '../structs/content_commitment.js'; -import { Gas } from '../structs/gas.js'; -import { GasFees } from '../structs/gas_fees.js'; -import { GasSettings } from '../structs/gas_settings.js'; -import { GlobalVariables } from '../structs/global_variables.js'; import { AvmAccumulatedData, AvmAppendTreeHint, + AvmCircuitInputs, AvmCircuitPublicInputs, AvmContractBytecodeHints, + AvmContractInstanceHint, AvmEnqueuedCallHint, + AvmExecutionHints, AvmNullifierReadTreeHint, AvmNullifierWriteTreeHint, AvmPublicDataReadTreeHint, AvmPublicDataWriteTreeHint, +} from '../structs/avm/index.js'; +import { BlockHeader } from '../structs/block_header.js'; +import { ContentCommitment, NUM_BYTES_PER_SHA256 } from '../structs/content_commitment.js'; +import { Gas } from '../structs/gas.js'; +import { GasFees } from '../structs/gas_fees.js'; +import { GasSettings } from '../structs/gas_settings.js'; +import { GlobalVariables } from '../structs/global_variables.js'; +import { CountedPublicCallRequest, PrivateLog, PrivateLogData, - PrivateToAvmAccumulatedData, - PrivateToAvmAccumulatedDataArrayLengths, - PrivateToPublicAccumulatedData, - PrivateToPublicKernelCircuitPublicInputs, PublicDataWrite, PublicLog, ScopedL2ToL1Message, TreeSnapshots, - TxConstantData, VkWitnessData, } from '../structs/index.js'; +import { + CombinedConstantData, + PartialPrivateTailPublicInputsForPublic, + PartialPrivateTailPublicInputsForRollup, + PrivateKernelTailCircuitPublicInputs, + PrivateToAvmAccumulatedData, + PrivateToAvmAccumulatedDataArrayLengths, + PrivateToPublicAccumulatedData, + PrivateToPublicKernelCircuitPublicInputs, + PrivateToRollupAccumulatedData, + TxConstantData, +} from '../structs/kernel/index.js'; import { PrivateToRollupKernelCircuitPublicInputs } from '../structs/kernel/private_to_rollup_kernel_circuit_public_inputs.js'; import { AvmProofData } from '../structs/rollup/avm_proof_data.js'; import { BaseOrMergeRollupPublicInputs } from '../structs/rollup/base_or_merge_rollup_public_inputs.js'; @@ -168,6 +169,8 @@ import { RootRollupInputs, RootRollupPublicInputs } from '../structs/rollup/root import { PrivateBaseStateDiffHints } from '../structs/rollup/state_diff_hints.js'; import { RollupValidationRequests } from '../structs/rollup_validation_requests.js'; import { AppendOnlyTreeSnapshot } from '../structs/trees/append_only_tree_snapshot.js'; +import { NullifierLeafPreimage } from '../structs/trees/nullifier_leaf.js'; +import { PublicDataTreeLeaf, PublicDataTreeLeafPreimage } from '../structs/trees/public_data_leaf.js'; /** * Creates an arbitrary side effect object with the given seed. @@ -635,36 +638,6 @@ export function makeAppendOnlyTreeSnapshot(seed = 1): AppendOnlyTreeSnapshot { return new AppendOnlyTreeSnapshot(fr(seed), seed); } -/** - * Makes arbitrary poseidon sponge for blob inputs. - * Note: will not verify inside the circuit. - * @param seed - The seed to use for generating the sponge. - * @returns A sponge blob instance. - */ -export function makeSpongeBlob(seed = 1): SpongeBlob { - return new SpongeBlob(new Poseidon2Sponge(makeTuple(3, fr), makeTuple(4, fr), 1, false), seed, seed + 1); -} - -/** - * Makes arbitrary blob public inputs. - * Note: will not verify inside the circuit. - * @param seed - The seed to use for generating the blob inputs. - * @returns A blob public inputs instance. - */ -export function makeBlobPublicInputs(seed = 1): BlobPublicInputs { - return new BlobPublicInputs(fr(seed), BigInt(seed + 1), makeTuple(2, fr)); -} - -/** - * Makes arbitrary block blob public inputs. - * Note: will not verify inside the circuit. - * @param seed - The seed to use for generating the blob inputs. - * @returns A block blob public inputs instance. - */ -export function makeBlockBlobPublicInputs(seed = 1): BlockBlobPublicInputs { - return new BlockBlobPublicInputs(makeTuple(BLOBS_PER_BLOCK, () => makeBlobPublicInputs(seed))); -} - /** * Makes arbitrary eth address. * @param seed - The seed to use for generating the eth address. diff --git a/yarn-project/circuits.js/src/tests/fixtures.ts b/yarn-project/circuits.js/src/tests/fixtures.ts index a771830b5b5b..cb913e54ec46 100644 --- a/yarn-project/circuits.js/src/tests/fixtures.ts +++ b/yarn-project/circuits.js/src/tests/fixtures.ts @@ -1,11 +1,10 @@ -import { type ContractArtifact } from '@aztec/foundation/abi'; -import { loadContractArtifact } from '@aztec/types/abi'; -import { type NoirCompiledContract } from '@aztec/types/noir'; - import { readFileSync } from 'fs'; import { dirname, resolve } from 'path'; import { fileURLToPath } from 'url'; +import { type ContractArtifact, loadContractArtifact } from '../abi/index.js'; +import { type NoirCompiledContract } from '../noir/index.js'; + // Copied from the build output for the contract `Benchmarking` in noir-contracts export function getBenchmarkContractArtifact(): ContractArtifact { const path = getPathToFixture('Benchmarking.test.json'); diff --git a/yarn-project/circuits.js/src/types/contract_function_dao.ts b/yarn-project/circuits.js/src/types/contract_function_dao.ts index db0688ab873f..c59d9032b562 100644 --- a/yarn-project/circuits.js/src/types/contract_function_dao.ts +++ b/yarn-project/circuits.js/src/types/contract_function_dao.ts @@ -1,4 +1,4 @@ -import { type FunctionArtifact, type FunctionSelector } from '@aztec/foundation/abi'; +import { type FunctionArtifact, type FunctionSelector } from '../abi/index.js'; /** * A contract function Data Access Object (DAO). diff --git a/yarn-project/circuits.js/src/types/index.ts b/yarn-project/circuits.js/src/types/index.ts index e928d0676526..6913f9f03d1a 100644 --- a/yarn-project/circuits.js/src/types/index.ts +++ b/yarn-project/circuits.js/src/types/index.ts @@ -3,3 +3,4 @@ export * from './deployment_info.js'; export * from './partial_address.js'; export * from './public_key.js'; export * from './public_keys.js'; +export * from './shared.js'; diff --git a/yarn-project/circuits.js/src/types/public_keys.ts b/yarn-project/circuits.js/src/types/public_keys.ts index 70f4b26dcb27..704aa2ed1e0c 100644 --- a/yarn-project/circuits.js/src/types/public_keys.ts +++ b/yarn-project/circuits.js/src/types/public_keys.ts @@ -1,12 +1,3 @@ -import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto'; -import { Fr, Point } from '@aztec/foundation/fields'; -import { schemas } from '@aztec/foundation/schemas'; -import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/serialize'; -import { bufferToHex, withoutHexPrefix } from '@aztec/foundation/string'; -import { type FieldsOf } from '@aztec/foundation/types'; - -import { z } from 'zod'; - import { DEFAULT_IVPK_M_X, DEFAULT_IVPK_M_Y, @@ -17,7 +8,16 @@ import { DEFAULT_TPK_M_X, DEFAULT_TPK_M_Y, GeneratorIndex, -} from '../constants.gen.js'; +} from '@aztec/constants'; +import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto'; +import { Fr, Point } from '@aztec/foundation/fields'; +import { schemas } from '@aztec/foundation/schemas'; +import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/serialize'; +import { bufferToHex, withoutHexPrefix } from '@aztec/foundation/string'; +import { type FieldsOf } from '@aztec/foundation/types'; + +import { z } from 'zod'; + import { type PublicKey } from './public_key.js'; export class PublicKeys { diff --git a/yarn-project/circuits.js/src/structs/shared.ts b/yarn-project/circuits.js/src/types/shared.ts similarity index 100% rename from yarn-project/circuits.js/src/structs/shared.ts rename to yarn-project/circuits.js/src/types/shared.ts diff --git a/yarn-project/circuits.js/src/utils/utils.test.ts b/yarn-project/circuits.js/src/utils/utils.test.ts index bb313e99ce49..52dcade777bb 100644 --- a/yarn-project/circuits.js/src/utils/utils.test.ts +++ b/yarn-project/circuits.js/src/utils/utils.test.ts @@ -1,8 +1,8 @@ +import { MAX_FIELD_VALUE } from '@aztec/constants'; import { makeTuple } from '@aztec/foundation/array'; import { Fr } from '@aztec/foundation/fields'; import { type Tuple } from '@aztec/foundation/serialize'; -import { MAX_FIELD_VALUE } from '../constants.gen.js'; import { type IsEmpty } from '../interfaces/index.js'; import { countAccumulatedItems, getNonEmptyItems, isEmptyArray, mergeAccumulatedData, sortByCounter } from './index.js'; diff --git a/yarn-project/circuits.js/tsconfig.json b/yarn-project/circuits.js/tsconfig.json index b5050d9ffeaa..a96d8a3531fb 100644 --- a/yarn-project/circuits.js/tsconfig.json +++ b/yarn-project/circuits.js/tsconfig.json @@ -10,15 +10,14 @@ "path": "../blob-lib" }, { - "path": "../ethereum" + "path": "../constants" }, { - "path": "../foundation" + "path": "../ethereum" }, { - "path": "../types" + "path": "../foundation" } ], - "include": ["src"], - "exclude": ["src/scripts"] + "include": ["src"] } diff --git a/yarn-project/cli-wallet/src/cmds/deploy.ts b/yarn-project/cli-wallet/src/cmds/deploy.ts index 295451e9a2eb..d28d0b9acbf6 100644 --- a/yarn-project/cli-wallet/src/cmds/deploy.ts +++ b/yarn-project/cli-wallet/src/cmds/deploy.ts @@ -1,7 +1,7 @@ import { type AccountWalletWithSecretKey, ContractDeployer, type DeployMethod, Fr, type PXE } from '@aztec/aztec.js'; import { PublicKeys } from '@aztec/circuits.js'; +import { getInitializer } from '@aztec/circuits.js/abi'; import { GITHUB_TAG_PREFIX, encodeArgs, getContractArtifact } from '@aztec/cli/utils'; -import { getInitializer } from '@aztec/foundation/abi'; import { type LogFn, type Logger } from '@aztec/foundation/log'; import { type IFeeOpts, printGasEstimates } from '../utils/options/fees.js'; diff --git a/yarn-project/cli-wallet/src/cmds/index.ts b/yarn-project/cli-wallet/src/cmds/index.ts index 0ae8d25975aa..c475a5ed6a1f 100644 --- a/yarn-project/cli-wallet/src/cmds/index.ts +++ b/yarn-project/cli-wallet/src/cmds/index.ts @@ -1,7 +1,7 @@ import { getIdentities } from '@aztec/accounts/utils'; import { createCompatibleClient } from '@aztec/aztec.js/rpc'; import { TxHash } from '@aztec/aztec.js/tx_hash'; -import { createAztecNodeClient } from '@aztec/circuit-types'; +import { createAztecNodeClient } from '@aztec/circuit-types/interfaces/client'; import { GasFees } from '@aztec/circuits.js'; import { ETHEREUM_HOST, diff --git a/yarn-project/cli-wallet/src/utils/accounts.ts b/yarn-project/cli-wallet/src/utils/accounts.ts index 6acc8890fa97..827943e78359 100644 --- a/yarn-project/cli-wallet/src/utils/accounts.ts +++ b/yarn-project/cli-wallet/src/utils/accounts.ts @@ -1,6 +1,6 @@ import { getIdentities } from '@aztec/accounts/utils'; import { type AccountManager, type AccountWalletWithSecretKey } from '@aztec/aztec.js'; -import { type PXE } from '@aztec/circuit-types/interfaces'; +import { type PXE } from '@aztec/circuit-types/interfaces/client'; import { deriveSigningKey } from '@aztec/circuits.js/keys'; import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; diff --git a/yarn-project/cli-wallet/src/utils/pxe_wrapper.ts b/yarn-project/cli-wallet/src/utils/pxe_wrapper.ts index a2ebe7fb26ff..9a7d58396cb9 100644 --- a/yarn-project/cli-wallet/src/utils/pxe_wrapper.ts +++ b/yarn-project/cli-wallet/src/utils/pxe_wrapper.ts @@ -1,4 +1,4 @@ -import { type AztecNode, type PXE, createAztecNodeClient } from '@aztec/circuit-types'; +import { type AztecNode, type PXE, createAztecNodeClient } from '@aztec/circuit-types/interfaces/client'; import { type PXEServiceConfig, createPXEService, getPXEServiceConfig } from '@aztec/pxe'; /* diff --git a/yarn-project/cli/package.json b/yarn-project/cli/package.json index 13357249c323..63d1dec6c870 100644 --- a/yarn-project/cli/package.json +++ b/yarn-project/cli/package.json @@ -70,6 +70,7 @@ "@aztec/archiver": "workspace:^", "@aztec/aztec.js": "workspace:^", "@aztec/circuit-types": "workspace:^", + "@aztec/constants": "workspace:^", "@aztec/foundation": "workspace:^", "@aztec/l1-artifacts": "workspace:^", "@aztec/types": "workspace:^", diff --git a/yarn-project/cli/src/cmds/contracts/inspect_contract.ts b/yarn-project/cli/src/cmds/contracts/inspect_contract.ts index 6bd002b464b7..d2434962d8c0 100644 --- a/yarn-project/cli/src/cmds/contracts/inspect_contract.ts +++ b/yarn-project/cli/src/cmds/contracts/inspect_contract.ts @@ -4,7 +4,7 @@ import { FunctionSelector, decodeFunctionSignature, decodeFunctionSignatureWithParameterNames, -} from '@aztec/foundation/abi'; +} from '@aztec/circuits.js/abi'; import { sha256 } from '@aztec/foundation/crypto'; import { type LogFn, type Logger } from '@aztec/foundation/log'; diff --git a/yarn-project/cli/src/cmds/contracts/parse_parameter_struct.ts b/yarn-project/cli/src/cmds/contracts/parse_parameter_struct.ts index af03828558ef..cf09d8f1080c 100644 --- a/yarn-project/cli/src/cmds/contracts/parse_parameter_struct.ts +++ b/yarn-project/cli/src/cmds/contracts/parse_parameter_struct.ts @@ -1,4 +1,4 @@ -import { type StructType } from '@aztec/foundation/abi'; +import { type StructType } from '@aztec/circuits.js/abi'; import { jsonStringify } from '@aztec/foundation/json-rpc'; import { type LogFn } from '@aztec/foundation/log'; diff --git a/yarn-project/cli/src/cmds/devnet/bootstrap_network.ts b/yarn-project/cli/src/cmds/devnet/bootstrap_network.ts index 6d72a4e7d118..30417bd3b071 100644 --- a/yarn-project/cli/src/cmds/devnet/bootstrap_network.ts +++ b/yarn-project/cli/src/cmds/devnet/bootstrap_network.ts @@ -8,7 +8,8 @@ import { createCompatibleClient, retryUntil, } from '@aztec/aztec.js'; -import { type AztecAddress, type EthAddress, FEE_FUNDING_FOR_TESTER_ACCOUNT, Fr } from '@aztec/circuits.js'; +import { type AztecAddress, type EthAddress, Fr } from '@aztec/circuits.js'; +import { FEE_FUNDING_FOR_TESTER_ACCOUNT } from '@aztec/constants'; import { type ContractArtifacts, type L1Clients, diff --git a/yarn-project/cli/src/cmds/l1/prover_stats.ts b/yarn-project/cli/src/cmds/l1/prover_stats.ts index f30a3be27100..41f0f189a0da 100644 --- a/yarn-project/cli/src/cmds/l1/prover_stats.ts +++ b/yarn-project/cli/src/cmds/l1/prover_stats.ts @@ -1,5 +1,5 @@ import { retrieveL2ProofVerifiedEvents } from '@aztec/archiver'; -import { createAztecNodeClient } from '@aztec/circuit-types'; +import { createAztecNodeClient } from '@aztec/circuit-types/interfaces/client'; import { EthAddress } from '@aztec/circuits.js'; import { createEthereumChain } from '@aztec/ethereum'; import { compactArray, mapValues, unique } from '@aztec/foundation/collection'; diff --git a/yarn-project/cli/src/cmds/misc/compute_selector.ts b/yarn-project/cli/src/cmds/misc/compute_selector.ts index e14f9285bf77..7f64194ff8cc 100644 --- a/yarn-project/cli/src/cmds/misc/compute_selector.ts +++ b/yarn-project/cli/src/cmds/misc/compute_selector.ts @@ -1,4 +1,4 @@ -import { FunctionSelector } from '@aztec/foundation/abi'; +import { FunctionSelector } from '@aztec/circuits.js/abi'; import { type LogFn } from '@aztec/foundation/log'; export async function computeSelector(functionSignature: string, log: LogFn) { diff --git a/yarn-project/cli/src/cmds/misc/setup_contracts.ts b/yarn-project/cli/src/cmds/misc/setup_contracts.ts index d6df9c6a49d2..f63bfd95decd 100644 --- a/yarn-project/cli/src/cmds/misc/setup_contracts.ts +++ b/yarn-project/cli/src/cmds/misc/setup_contracts.ts @@ -1,5 +1,6 @@ import { DefaultWaitOpts, type EthAddress, FeeJuicePaymentMethod, type Wallet } from '@aztec/aztec.js'; -import { FEE_JUICE_INITIAL_MINT, Gas } from '@aztec/circuits.js'; +import { Gas } from '@aztec/circuits.js'; +import { FEE_JUICE_INITIAL_MINT } from '@aztec/constants'; import { type LogFn } from '@aztec/foundation/log'; import { ProtocolContractAddress } from '@aztec/protocol-contracts'; diff --git a/yarn-project/cli/src/utils/aztec.test.ts b/yarn-project/cli/src/utils/aztec.test.ts index 9d4be0b4c150..689f221cbcfd 100644 --- a/yarn-project/cli/src/utils/aztec.test.ts +++ b/yarn-project/cli/src/utils/aztec.test.ts @@ -1,5 +1,5 @@ import { type NodeInfo } from '@aztec/aztec.js'; -import { type PXE } from '@aztec/circuit-types'; +import { type PXE } from '@aztec/circuit-types/interfaces/client'; import { type MockProxy, mock } from 'jest-mock-extended'; diff --git a/yarn-project/cli/src/utils/aztec.ts b/yarn-project/cli/src/utils/aztec.ts index 6172e36a87ec..04804667dcf7 100644 --- a/yarn-project/cli/src/utils/aztec.ts +++ b/yarn-project/cli/src/utils/aztec.ts @@ -1,7 +1,7 @@ import { type ContractArtifact, type FunctionArtifact, loadContractArtifact } from '@aztec/aztec.js/abi'; -import { type PXE } from '@aztec/circuit-types'; +import { type PXE } from '@aztec/circuit-types/interfaces/client'; +import { FunctionType } from '@aztec/circuits.js/abi'; import { type DeployL1Contracts, type L1ContractsConfig } from '@aztec/ethereum'; -import { FunctionType } from '@aztec/foundation/abi'; import { type EthAddress } from '@aztec/foundation/eth-address'; import { type Fr } from '@aztec/foundation/fields'; import { type LogFn, type Logger } from '@aztec/foundation/log'; diff --git a/yarn-project/cli/src/utils/commands.ts b/yarn-project/cli/src/utils/commands.ts index af6729164381..59c951629d2e 100644 --- a/yarn-project/cli/src/utils/commands.ts +++ b/yarn-project/cli/src/utils/commands.ts @@ -4,7 +4,7 @@ import { EthAddress } from '@aztec/aztec.js/eth_address'; import { Fr } from '@aztec/aztec.js/fields'; import { LogId } from '@aztec/aztec.js/log_id'; import { TxHash } from '@aztec/aztec.js/tx_hash'; -import { type PXE } from '@aztec/circuit-types'; +import { type PXE } from '@aztec/circuit-types/interfaces/client'; import { PublicKeys } from '@aztec/circuits.js/types'; import { type LogFn } from '@aztec/foundation/log'; diff --git a/yarn-project/cli/src/utils/encoding.ts b/yarn-project/cli/src/utils/encoding.ts index af5cdd9012ee..8ab82c2b4bd2 100644 --- a/yarn-project/cli/src/utils/encoding.ts +++ b/yarn-project/cli/src/utils/encoding.ts @@ -1,4 +1,4 @@ -import { type ABIParameter, type AbiType, type StructType, isU128Struct } from '@aztec/foundation/abi'; +import { type ABIParameter, type AbiType, type StructType, isU128Struct } from '@aztec/circuits.js/abi'; import { Fr } from '@aztec/foundation/fields'; /** diff --git a/yarn-project/cli/src/utils/inspect.ts b/yarn-project/cli/src/utils/inspect.ts index f45de2a89ffe..10abe701d40f 100644 --- a/yarn-project/cli/src/utils/inspect.ts +++ b/yarn-project/cli/src/utils/inspect.ts @@ -1,5 +1,6 @@ import { type ContractArtifact } from '@aztec/aztec.js'; -import { type ExtendedNote, NoteStatus, type PXE, type TxHash } from '@aztec/circuit-types'; +import { type ExtendedNote, NoteStatus, type TxHash } from '@aztec/circuit-types'; +import { type PXE } from '@aztec/circuit-types/interfaces/client'; import { type AztecAddress, type Fr } from '@aztec/circuits.js'; import { siloNullifier } from '@aztec/circuits.js/hash'; import { type LogFn } from '@aztec/foundation/log'; diff --git a/yarn-project/cli/tsconfig.json b/yarn-project/cli/tsconfig.json index 3887fb697932..fae4b7f9b86d 100644 --- a/yarn-project/cli/tsconfig.json +++ b/yarn-project/cli/tsconfig.json @@ -15,6 +15,9 @@ { "path": "../circuit-types" }, + { + "path": "../constants" + }, { "path": "../foundation" }, @@ -24,6 +27,9 @@ { "path": "../types" }, + { + "path": "../world-state" + }, { "path": "../accounts" }, @@ -35,9 +41,6 @@ }, { "path": "../protocol-contracts" - }, - { - "path": "../world-state" } ], "include": ["src"], diff --git a/yarn-project/constants/.eslintrc.cjs b/yarn-project/constants/.eslintrc.cjs new file mode 100644 index 000000000000..e659927475c0 --- /dev/null +++ b/yarn-project/constants/.eslintrc.cjs @@ -0,0 +1 @@ +module.exports = require('@aztec/foundation/eslint'); diff --git a/yarn-project/constants/package.json b/yarn-project/constants/package.json new file mode 100644 index 000000000000..361d99bdbe29 --- /dev/null +++ b/yarn-project/constants/package.json @@ -0,0 +1,76 @@ +{ + "name": "@aztec/constants", + "version": "0.1.0", + "type": "module", + "inherits": [ + "../package.common.json" + ], + "exports": { + ".": "./dest/constants.js" + }, + "scripts": { + "build": "yarn clean && 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", + "remake-constants": "node --loader @swc-node/register src/scripts/constants.in.ts && cd ../../l1-contracts && forge fmt", + "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}" + }, + "dependencies": { + "tslib": "^2.4.0" + }, + "devDependencies": { + "@jest/globals": "^29.5.0", + "@types/jest": "^29.5.0", + "@types/node": "^18.7.23", + "eslint": "^8.35.0", + "jest": "^29.5.0", + "prettier": "^2.8.4", + "ts-node": "^10.9.1", + "typescript": "^5.0.4" + }, + "files": [ + "dest", + "src", + "!*.test.*", + "!src/scripts/*" + ], + "types": "./dest/index.d.ts", + "engines": { + "node": ">=18" + }, + "jest": { + "extensionsToTreatAsEsm": [ + ".ts" + ], + "transform": { + "^.+\\.tsx?$": [ + "@swc/jest", + { + "jsc": { + "parser": { + "syntax": "typescript", + "decorators": true + }, + "transform": { + "decoratorVersion": "2022-03" + } + } + } + ] + }, + "moduleNameMapper": { + "^(\\.{1,2}/.*)\\.[cm]?js$": "$1" + }, + "testRegex": "./src/.*\\.test\\.(js|mjs|ts)$", + "rootDir": "./src", + "reporters": [ + "default" + ], + "testTimeout": 120000, + "setupFiles": [ + "../../foundation/src/jest/setup.mjs" + ] + } +} diff --git a/yarn-project/circuits.js/precommit.sh b/yarn-project/constants/precommit.sh similarity index 100% rename from yarn-project/circuits.js/precommit.sh rename to yarn-project/constants/precommit.sh diff --git a/yarn-project/circuits.js/src/constants.gen.ts b/yarn-project/constants/src/constants.gen.ts similarity index 100% rename from yarn-project/circuits.js/src/constants.gen.ts rename to yarn-project/constants/src/constants.gen.ts diff --git a/yarn-project/circuits.js/src/constants.ts b/yarn-project/constants/src/constants.ts similarity index 100% rename from yarn-project/circuits.js/src/constants.ts rename to yarn-project/constants/src/constants.ts diff --git a/yarn-project/circuits.js/src/scripts/constants.in.ts b/yarn-project/constants/src/scripts/constants.in.ts similarity index 100% rename from yarn-project/circuits.js/src/scripts/constants.in.ts rename to yarn-project/constants/src/scripts/constants.in.ts diff --git a/yarn-project/constants/tsconfig.json b/yarn-project/constants/tsconfig.json new file mode 100644 index 000000000000..10c967d40005 --- /dev/null +++ b/yarn-project/constants/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "..", + "compilerOptions": { + "outDir": "dest", + "rootDir": "src", + "tsBuildInfoFile": ".tsbuildinfo" + }, + "include": ["src"], + "references": [] +} diff --git a/yarn-project/end-to-end/package.json b/yarn-project/end-to-end/package.json index 16611b0a4409..e723e9cdee3d 100644 --- a/yarn-project/end-to-end/package.json +++ b/yarn-project/end-to-end/package.json @@ -8,8 +8,7 @@ "./package.local.json" ], "scripts": { - "build": "yarn clean && tsc -b && webpack", - "build:e2e": "yarn clean && tsc -b", + "build": "yarn clean && tsc -b", "build:dev": "tsc -b --watch", "clean": "rm -rf ./dest .tsbuildinfo", "formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src", @@ -38,6 +37,7 @@ "@aztec/bot": "workspace:^", "@aztec/circuit-types": "workspace:^", "@aztec/circuits.js": "workspace:^", + "@aztec/constants": "workspace:^", "@aztec/entrypoints": "workspace:^", "@aztec/epoch-cache": "workspace:^", "@aztec/ethereum": "workspace:^", diff --git a/yarn-project/end-to-end/package.local.json b/yarn-project/end-to-end/package.local.json index 2193ade2cf91..a560d54a1df6 100644 --- a/yarn-project/end-to-end/package.local.json +++ b/yarn-project/end-to-end/package.local.json @@ -1,6 +1,5 @@ { "scripts": { - "build": "yarn clean && tsc -b && webpack", "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests src/fixtures" }, "jest": { diff --git a/yarn-project/end-to-end/src/composed/integration_l1_publisher.test.ts b/yarn-project/end-to-end/src/composed/integration_l1_publisher.test.ts index 60df5bd7770b..9e3daa8be34c 100644 --- a/yarn-project/end-to-end/src/composed/integration_l1_publisher.test.ts +++ b/yarn-project/end-to-end/src/composed/integration_l1_publisher.test.ts @@ -1,21 +1,13 @@ import { type ArchiveSource } from '@aztec/archiver'; import { getConfigEnvVars } from '@aztec/aztec-node'; import { AztecAddress, Fr, GlobalVariables, type L2Block, createLogger } from '@aztec/aztec.js'; -import { Blob } from '@aztec/blob-lib'; +import { Blob, BlockBlobPublicInputs } from '@aztec/blob-lib'; // eslint-disable-next-line no-restricted-imports import { type L2Tips, type ProcessedTx } from '@aztec/circuit-types'; -import { makeBloatedProcessedTx } from '@aztec/circuit-types/test'; -import { - type BlockHeader, - EthAddress, - GENESIS_ARCHIVE_ROOT, - GasFees, - GasSettings, - MAX_NULLIFIERS_PER_TX, - NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, -} from '@aztec/circuits.js'; -import { BlockBlobPublicInputs } from '@aztec/circuits.js/blobs'; +import { makeBloatedProcessedTx } from '@aztec/circuit-types/testing'; +import { type BlockHeader, EthAddress, GasFees, GasSettings } from '@aztec/circuits.js'; import { fr } from '@aztec/circuits.js/testing'; +import { GENESIS_ARCHIVE_ROOT, MAX_NULLIFIERS_PER_TX, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants'; import { EpochCache } from '@aztec/epoch-cache'; import { GovernanceProposerContract, diff --git a/yarn-project/end-to-end/src/devnet/e2e_smoke.test.ts b/yarn-project/end-to-end/src/devnet/e2e_smoke.test.ts index 38e1e35eb19f..5d1571e14cae 100644 --- a/yarn-project/end-to-end/src/devnet/e2e_smoke.test.ts +++ b/yarn-project/end-to-end/src/devnet/e2e_smoke.test.ts @@ -13,7 +13,7 @@ import { retryUntil, } from '@aztec/aztec.js'; // eslint-disable-next-line no-restricted-imports -import { PXESchema } from '@aztec/circuit-types'; +import { PXESchema } from '@aztec/circuit-types/interfaces/client'; import { deriveSigningKey } from '@aztec/circuits.js'; import { createNamespacedSafeJsonRpcServer, startHttpRpcServer } from '@aztec/foundation/json-rpc/server'; import { type Logger } from '@aztec/foundation/log'; diff --git a/yarn-project/end-to-end/src/e2e_block_building.test.ts b/yarn-project/end-to-end/src/e2e_block_building.test.ts index e651ccdee2b5..fa795a8f69a3 100644 --- a/yarn-project/end-to-end/src/e2e_block_building.test.ts +++ b/yarn-project/end-to-end/src/e2e_block_building.test.ts @@ -20,7 +20,8 @@ import { sleep, } from '@aztec/aztec.js'; // eslint-disable-next-line no-restricted-imports -import { type MerkleTreeWriteOperations, type Tx } from '@aztec/circuit-types'; +import { type Tx } from '@aztec/circuit-types'; +import { type MerkleTreeWriteOperations } from '@aztec/circuit-types/interfaces/server'; import { getL1ContractsConfigEnvVars } from '@aztec/ethereum'; import { asyncMap } from '@aztec/foundation/async-map'; import { times, unique } from '@aztec/foundation/collection'; diff --git a/yarn-project/end-to-end/src/e2e_contract_updates.test.ts b/yarn-project/end-to-end/src/e2e_contract_updates.test.ts index 9cc7028ea1b3..988da11d1139 100644 --- a/yarn-project/end-to-end/src/e2e_contract_updates.test.ts +++ b/yarn-project/end-to-end/src/e2e_contract_updates.test.ts @@ -1,19 +1,15 @@ import { getSchnorrAccountContractAddress } from '@aztec/accounts/schnorr'; import { Fr, type Wallet, getContractClassFromArtifact } from '@aztec/aztec.js'; import { registerContractClass } from '@aztec/aztec.js/deployment'; +import { type AztecAddress, deriveSigningKey, getContractInstanceFromDeployParams } from '@aztec/circuits.js'; +import { computePublicDataTreeLeafSlot, deriveStorageSlotInMap } from '@aztec/circuits.js/hash'; import { - type AztecAddress, - MINIMUM_UPDATE_DELAY, - PublicDataTreeLeaf, ScheduledDelayChange, ScheduledValueChange, - UPDATED_CLASS_IDS_SLOT, - UPDATES_SCHEDULED_VALUE_CHANGE_LEN, computeSharedMutableHashSlot, - deriveSigningKey, - getContractInstanceFromDeployParams, -} from '@aztec/circuits.js'; -import { computePublicDataTreeLeafSlot, deriveStorageSlotInMap } from '@aztec/circuits.js/hash'; +} from '@aztec/circuits.js/shared-mutable'; +import { PublicDataTreeLeaf } from '@aztec/circuits.js/trees'; +import { MINIMUM_UPDATE_DELAY, UPDATED_CLASS_IDS_SLOT, UPDATES_SCHEDULED_VALUE_CHANGE_LEN } from '@aztec/constants'; import { poseidon2Hash } from '@aztec/foundation/crypto'; import { UpdatableContract } from '@aztec/noir-contracts.js/Updatable'; import { UpdatedContract, UpdatedContractArtifact } from '@aztec/noir-contracts.js/Updated'; diff --git a/yarn-project/end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts b/yarn-project/end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts index 3e208137b638..50d849800728 100644 --- a/yarn-project/end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts +++ b/yarn-project/end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts @@ -22,7 +22,7 @@ import { registerContractClass, } from '@aztec/aztec.js/deployment'; import { type ContractClassIdPreimage, PublicKeys } from '@aztec/circuits.js'; -import { FunctionSelector, FunctionType } from '@aztec/foundation/abi'; +import { FunctionSelector, FunctionType } from '@aztec/circuits.js/abi'; import { writeTestData } from '@aztec/foundation/testing/files'; import { StatefulTestContract } from '@aztec/noir-contracts.js/StatefulTest'; import { TestContract } from '@aztec/noir-contracts.js/Test'; diff --git a/yarn-project/end-to-end/src/e2e_event_logs.test.ts b/yarn-project/end-to-end/src/e2e_event_logs.test.ts index c0db5b7d1e67..9956d45e3dab 100644 --- a/yarn-project/end-to-end/src/e2e_event_logs.test.ts +++ b/yarn-project/end-to-end/src/e2e_event_logs.test.ts @@ -6,7 +6,7 @@ import { Fr, L1EventPayload, } from '@aztec/aztec.js'; -import { EventSelector } from '@aztec/foundation/abi'; +import { EventSelector } from '@aztec/circuits.js/abi'; import { makeTuple } from '@aztec/foundation/array'; import { timesParallel } from '@aztec/foundation/collection'; import { type Tuple } from '@aztec/foundation/serialize'; diff --git a/yarn-project/end-to-end/src/e2e_fees/account_init.test.ts b/yarn-project/end-to-end/src/e2e_fees/account_init.test.ts index 34c2d195e1a2..bb93ae1f0a85 100644 --- a/yarn-project/end-to-end/src/e2e_fees/account_init.test.ts +++ b/yarn-project/end-to-end/src/e2e_fees/account_init.test.ts @@ -13,7 +13,8 @@ import { type Wallet, deriveKeys, } from '@aztec/aztec.js'; -import { type AztecAddress, type CompleteAddress, FEE_FUNDING_FOR_TESTER_ACCOUNT, Fq } from '@aztec/circuits.js'; +import { type AztecAddress, type CompleteAddress, Fq } from '@aztec/circuits.js'; +import { FEE_FUNDING_FOR_TESTER_ACCOUNT } from '@aztec/constants'; import { type FPCContract } from '@aztec/noir-contracts.js/FPC'; import { SchnorrAccountContract } from '@aztec/noir-contracts.js/SchnorrAccount'; import { type TokenContract as BananaCoin } from '@aztec/noir-contracts.js/Token'; diff --git a/yarn-project/end-to-end/src/e2e_fees/failures.test.ts b/yarn-project/end-to-end/src/e2e_fees/failures.test.ts index 60a48a0c9fa0..41fb09dd627f 100644 --- a/yarn-project/end-to-end/src/e2e_fees/failures.test.ts +++ b/yarn-project/end-to-end/src/e2e_fees/failures.test.ts @@ -9,7 +9,7 @@ import { TxStatus, } from '@aztec/aztec.js'; import { Gas, GasSettings } from '@aztec/circuits.js'; -import { FunctionType, U128 } from '@aztec/foundation/abi'; +import { FunctionType, U128 } from '@aztec/circuits.js/abi'; import { type FPCContract } from '@aztec/noir-contracts.js/FPC'; import { type TokenContract as BananaCoin } from '@aztec/noir-contracts.js/Token'; diff --git a/yarn-project/end-to-end/src/e2e_fees/fee_juice_payments.test.ts b/yarn-project/end-to-end/src/e2e_fees/fee_juice_payments.test.ts index a4c2b30cd8d2..c614be0fe78d 100644 --- a/yarn-project/end-to-end/src/e2e_fees/fee_juice_payments.test.ts +++ b/yarn-project/end-to-end/src/e2e_fees/fee_juice_payments.test.ts @@ -8,7 +8,8 @@ import { FeeJuicePaymentMethodWithClaim, type PXE, } from '@aztec/aztec.js'; -import { FEE_FUNDING_FOR_TESTER_ACCOUNT, type GasSettings } from '@aztec/circuits.js'; +import { type GasSettings } from '@aztec/circuits.js'; +import { FEE_FUNDING_FOR_TESTER_ACCOUNT } from '@aztec/constants'; import { type FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice'; import { type TokenContract as BananaCoin } from '@aztec/noir-contracts.js/Token'; diff --git a/yarn-project/end-to-end/src/e2e_fees/fees_test.ts b/yarn-project/end-to-end/src/e2e_fees/fees_test.ts index 77d077209e07..e8120401bfc4 100644 --- a/yarn-project/end-to-end/src/e2e_fees/fees_test.ts +++ b/yarn-project/end-to-end/src/e2e_fees/fees_test.ts @@ -9,7 +9,8 @@ import { createLogger, sleep, } from '@aztec/aztec.js'; -import { EthAddress, FEE_FUNDING_FOR_TESTER_ACCOUNT, GasSettings, computePartialAddress } from '@aztec/circuits.js'; +import { EthAddress, GasSettings, computePartialAddress } from '@aztec/circuits.js'; +import { FEE_FUNDING_FOR_TESTER_ACCOUNT } from '@aztec/constants'; import { createL1Clients } from '@aztec/ethereum'; import { TestERC20Abi } from '@aztec/l1-artifacts'; import { AppSubscriptionContract } from '@aztec/noir-contracts.js/AppSubscription'; diff --git a/yarn-project/end-to-end/src/e2e_keys.test.ts b/yarn-project/end-to-end/src/e2e_keys.test.ts index 698069fd7760..ee523f564034 100644 --- a/yarn-project/end-to-end/src/e2e_keys.test.ts +++ b/yarn-project/end-to-end/src/e2e_keys.test.ts @@ -1,8 +1,6 @@ import { type InitialAccountData } from '@aztec/accounts/testing'; import { type AztecAddress, type AztecNode, Fr, type L2Block, type Wallet } from '@aztec/aztec.js'; import { - GeneratorIndex, - INITIAL_L2_BLOCK_NUM, computeAppNullifierSecretKey, computeAppSecretKey, deriveMasterNullifierSecretKey, @@ -10,6 +8,7 @@ import { derivePublicKeyFromSecretKey, } from '@aztec/circuits.js'; import { siloNullifier } from '@aztec/circuits.js/hash'; +import { GeneratorIndex, INITIAL_L2_BLOCK_NUM } from '@aztec/constants'; import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto'; import { TestContract } from '@aztec/noir-contracts.js/Test'; diff --git a/yarn-project/end-to-end/src/e2e_p2p/p2p_network.ts b/yarn-project/end-to-end/src/e2e_p2p/p2p_network.ts index 8d901f16d7c8..d6e86946070d 100644 --- a/yarn-project/end-to-end/src/e2e_p2p/p2p_network.ts +++ b/yarn-project/end-to-end/src/e2e_p2p/p2p_network.ts @@ -3,7 +3,7 @@ import { type InitialAccountData } from '@aztec/accounts/testing'; import { type AztecNodeConfig, type AztecNodeService } from '@aztec/aztec-node'; import { type AccountWalletWithSecretKey } from '@aztec/aztec.js'; import { ChainMonitor } from '@aztec/aztec.js/ethereum'; -import { type PublicDataTreeLeaf } from '@aztec/circuits.js'; +import { type PublicDataTreeLeaf } from '@aztec/circuits.js/trees'; import { RollupContract, getExpectedAddress, getL1ContractsConfigEnvVars } from '@aztec/ethereum'; import { L1TxUtilsWithBlobs } from '@aztec/ethereum/l1-tx-utils-with-blobs'; import { EthCheatCodesWithState } from '@aztec/ethereum/test'; diff --git a/yarn-project/end-to-end/src/e2e_pending_note_hashes_contract.test.ts b/yarn-project/end-to-end/src/e2e_pending_note_hashes_contract.test.ts index 639bc7a2475d..ff202bf2477e 100644 --- a/yarn-project/end-to-end/src/e2e_pending_note_hashes_contract.test.ts +++ b/yarn-project/end-to-end/src/e2e_pending_note_hashes_contract.test.ts @@ -4,7 +4,7 @@ import { MAX_NOTE_HASHES_PER_TX, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, MAX_NOTE_HASH_READ_REQUESTS_PER_TX, -} from '@aztec/circuits.js'; +} from '@aztec/constants'; import { PendingNoteHashesContract } from '@aztec/noir-contracts.js/PendingNoteHashes'; import { setup } from './fixtures/utils.js'; diff --git a/yarn-project/end-to-end/src/e2e_synching.test.ts b/yarn-project/end-to-end/src/e2e_synching.test.ts index 7b2441788111..5f4adff44da1 100644 --- a/yarn-project/end-to-end/src/e2e_synching.test.ts +++ b/yarn-project/end-to-end/src/e2e_synching.test.ts @@ -48,7 +48,8 @@ import { } from '@aztec/aztec.js'; import { createBlobSinkClient } from '@aztec/blob-sink/client'; // eslint-disable-next-line no-restricted-imports -import { L2Block, tryStop } from '@aztec/circuit-types'; +import { L2Block } from '@aztec/circuit-types'; +import { tryStop } from '@aztec/circuit-types/interfaces/server'; import { type AztecAddress, EthAddress } from '@aztec/circuits.js'; import { EpochCache } from '@aztec/epoch-cache'; import { diff --git a/yarn-project/end-to-end/src/fixtures/setup_p2p_test.ts b/yarn-project/end-to-end/src/fixtures/setup_p2p_test.ts index 4e7dd4c859ce..05c2d36b2e0e 100644 --- a/yarn-project/end-to-end/src/fixtures/setup_p2p_test.ts +++ b/yarn-project/end-to-end/src/fixtures/setup_p2p_test.ts @@ -3,7 +3,7 @@ */ import { type AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node'; import { type SentTx } from '@aztec/aztec.js'; -import { type PublicDataTreeLeaf } from '@aztec/circuits.js'; +import { type PublicDataTreeLeaf } from '@aztec/circuits.js/trees'; import { addLogNameHandler, removeLogNameHandler } from '@aztec/foundation/log'; import { type DateProvider } from '@aztec/foundation/timer'; import { type PXEService } from '@aztec/pxe'; diff --git a/yarn-project/end-to-end/src/fixtures/utils.ts b/yarn-project/end-to-end/src/fixtures/utils.ts index c40c15fedf1d..54e62f1b0781 100644 --- a/yarn-project/end-to-end/src/fixtures/utils.ts +++ b/yarn-project/end-to-end/src/fixtures/utils.ts @@ -33,15 +33,9 @@ import { deployInstance, registerContractClass } from '@aztec/aztec.js/deploymen import { type BBNativePrivateKernelProver } from '@aztec/bb-prover'; import { createBlobSinkClient } from '@aztec/blob-sink/client'; import { type BlobSinkServer, createBlobSinkServer } from '@aztec/blob-sink/server'; -import { - FEE_JUICE_INITIAL_MINT, - Fr, - GENESIS_ARCHIVE_ROOT, - GENESIS_BLOCK_HASH, - Gas, - type PublicDataTreeLeaf, - getContractClassFromArtifact, -} from '@aztec/circuits.js'; +import { Fr, Gas, getContractClassFromArtifact } from '@aztec/circuits.js'; +import { type PublicDataTreeLeaf } from '@aztec/circuits.js/trees'; +import { FEE_JUICE_INITIAL_MINT, GENESIS_ARCHIVE_ROOT, GENESIS_BLOCK_HASH } from '@aztec/constants'; import { type DeployL1ContractsArgs, ForwarderContract, diff --git a/yarn-project/end-to-end/tsconfig.json b/yarn-project/end-to-end/tsconfig.json index 7f1aede46269..0c4495cc43b3 100644 --- a/yarn-project/end-to-end/tsconfig.json +++ b/yarn-project/end-to-end/tsconfig.json @@ -39,6 +39,9 @@ { "path": "../circuits.js" }, + { + "path": "../constants" + }, { "path": "../entrypoints" }, diff --git a/yarn-project/entrypoints/src/account_entrypoint.ts b/yarn-project/entrypoints/src/account_entrypoint.ts index 19a754e104bc..546bd13ee0c1 100644 --- a/yarn-project/entrypoints/src/account_entrypoint.ts +++ b/yarn-project/entrypoints/src/account_entrypoint.ts @@ -7,7 +7,7 @@ import { } from '@aztec/aztec.js/entrypoint'; import { HashedValues, TxExecutionRequest } from '@aztec/circuit-types'; import { type AztecAddress, TxContext } from '@aztec/circuits.js'; -import { type FunctionAbi, FunctionSelector, encodeArguments } from '@aztec/foundation/abi'; +import { type FunctionAbi, FunctionSelector, encodeArguments } from '@aztec/circuits.js/abi'; import { DEFAULT_CHAIN_ID, DEFAULT_VERSION } from './constants.js'; diff --git a/yarn-project/entrypoints/src/dapp_entrypoint.ts b/yarn-project/entrypoints/src/dapp_entrypoint.ts index 85bc568254b5..3bf0231cd877 100644 --- a/yarn-project/entrypoints/src/dapp_entrypoint.ts +++ b/yarn-project/entrypoints/src/dapp_entrypoint.ts @@ -3,7 +3,7 @@ import { type AuthWitnessProvider } from '@aztec/aztec.js/account'; import { type EntrypointInterface, EntrypointPayload, type ExecutionRequestInit } from '@aztec/aztec.js/entrypoint'; import { HashedValues, TxExecutionRequest } from '@aztec/circuit-types'; import { type AztecAddress, Fr, TxContext } from '@aztec/circuits.js'; -import { type FunctionAbi, FunctionSelector, encodeArguments } from '@aztec/foundation/abi'; +import { type FunctionAbi, FunctionSelector, encodeArguments } from '@aztec/circuits.js/abi'; import { DEFAULT_CHAIN_ID, DEFAULT_VERSION } from './constants.js'; diff --git a/yarn-project/circuits.js/src/barretenberg/crypto/aes128/index.test.ts b/yarn-project/foundation/src/crypto/aes128/index.test.ts similarity index 100% rename from yarn-project/circuits.js/src/barretenberg/crypto/aes128/index.test.ts rename to yarn-project/foundation/src/crypto/aes128/index.test.ts diff --git a/yarn-project/circuits.js/src/barretenberg/crypto/aes128/index.ts b/yarn-project/foundation/src/crypto/aes128/index.ts similarity index 100% rename from yarn-project/circuits.js/src/barretenberg/crypto/aes128/index.ts rename to yarn-project/foundation/src/crypto/aes128/index.ts diff --git a/yarn-project/circuits.js/src/barretenberg/crypto/ecdsa/index.test.ts b/yarn-project/foundation/src/crypto/ecdsa/index.test.ts similarity index 100% rename from yarn-project/circuits.js/src/barretenberg/crypto/ecdsa/index.test.ts rename to yarn-project/foundation/src/crypto/ecdsa/index.test.ts diff --git a/yarn-project/circuits.js/src/barretenberg/crypto/ecdsa/index.ts b/yarn-project/foundation/src/crypto/ecdsa/index.ts similarity index 97% rename from yarn-project/circuits.js/src/barretenberg/crypto/ecdsa/index.ts rename to yarn-project/foundation/src/crypto/ecdsa/index.ts index b545f0e0d0d3..2c171880672a 100644 --- a/yarn-project/circuits.js/src/barretenberg/crypto/ecdsa/index.ts +++ b/yarn-project/foundation/src/crypto/ecdsa/index.ts @@ -1,7 +1,7 @@ import { BarretenbergSync } from '@aztec/bb.js'; import { numToInt32BE } from '@aztec/foundation/serialize'; -import { concatenateUint8Arrays } from '../../serialize.js'; +import { concatenateUint8Arrays } from '../serialize.js'; import { EcdsaSignature } from './signature.js'; export * from './signature.js'; diff --git a/yarn-project/circuits.js/src/barretenberg/crypto/ecdsa/signature.test.ts b/yarn-project/foundation/src/crypto/ecdsa/signature.test.ts similarity index 100% rename from yarn-project/circuits.js/src/barretenberg/crypto/ecdsa/signature.test.ts rename to yarn-project/foundation/src/crypto/ecdsa/signature.test.ts diff --git a/yarn-project/circuits.js/src/barretenberg/crypto/ecdsa/signature.ts b/yarn-project/foundation/src/crypto/ecdsa/signature.ts similarity index 100% rename from yarn-project/circuits.js/src/barretenberg/crypto/ecdsa/signature.ts rename to yarn-project/foundation/src/crypto/ecdsa/signature.ts diff --git a/yarn-project/circuits.js/src/barretenberg/crypto/grumpkin/index.test.ts b/yarn-project/foundation/src/crypto/grumpkin/index.test.ts similarity index 91% rename from yarn-project/circuits.js/src/barretenberg/crypto/grumpkin/index.test.ts rename to yarn-project/foundation/src/crypto/grumpkin/index.test.ts index efd59168da2f..7acc1be1d4a9 100644 --- a/yarn-project/circuits.js/src/barretenberg/crypto/grumpkin/index.test.ts +++ b/yarn-project/foundation/src/crypto/grumpkin/index.test.ts @@ -1,6 +1,7 @@ import { createLogger } from '@aztec/foundation/log'; -import { GrumpkinScalar, type Point } from '../../../index.js'; +import { GrumpkinScalar } from '../../fields/fields.js'; +import type { Point } from '../../fields/point.js'; import { Grumpkin } from './index.js'; const log = createLogger('circuits:grumpkin_test'); diff --git a/yarn-project/circuits.js/src/barretenberg/crypto/grumpkin/index.ts b/yarn-project/foundation/src/crypto/grumpkin/index.ts similarity index 100% rename from yarn-project/circuits.js/src/barretenberg/crypto/grumpkin/index.ts rename to yarn-project/foundation/src/crypto/grumpkin/index.ts diff --git a/yarn-project/foundation/src/crypto/index.ts b/yarn-project/foundation/src/crypto/index.ts index 8df25e761beb..e411164d4e05 100644 --- a/yarn-project/foundation/src/crypto/index.ts +++ b/yarn-project/foundation/src/crypto/index.ts @@ -6,3 +6,9 @@ export * from './pedersen/index.js'; export * from './poseidon/index.js'; export * from './secp256k1-signer/index.js'; export * from './keys/index.js'; +export * from './aes128/index.js'; +export * from './grumpkin/index.js'; +export * from './ecdsa/index.js'; +export * from './secp256k1/index.js'; +export * from './schnorr/index.js'; +export * from './signature/index.js'; diff --git a/yarn-project/circuits.js/src/barretenberg/crypto/schnorr/index.test.ts b/yarn-project/foundation/src/crypto/schnorr/index.test.ts similarity index 100% rename from yarn-project/circuits.js/src/barretenberg/crypto/schnorr/index.test.ts rename to yarn-project/foundation/src/crypto/schnorr/index.test.ts diff --git a/yarn-project/circuits.js/src/barretenberg/crypto/schnorr/index.ts b/yarn-project/foundation/src/crypto/schnorr/index.ts similarity index 89% rename from yarn-project/circuits.js/src/barretenberg/crypto/schnorr/index.ts rename to yarn-project/foundation/src/crypto/schnorr/index.ts index 43f095595640..892490b1b010 100644 --- a/yarn-project/circuits.js/src/barretenberg/crypto/schnorr/index.ts +++ b/yarn-project/foundation/src/crypto/schnorr/index.ts @@ -2,8 +2,7 @@ import { BarretenbergSync } from '@aztec/bb.js'; import { type GrumpkinScalar, Point } from '@aztec/foundation/fields'; import { numToInt32BE } from '@aztec/foundation/serialize'; -import { type PublicKey } from '../../../types/public_key.js'; -import { concatenateUint8Arrays } from '../../serialize.js'; +import { concatenateUint8Arrays } from '../serialize.js'; import { SchnorrSignature } from './signature.js'; export * from './signature.js'; @@ -17,7 +16,7 @@ export class Schnorr { * @param privateKey - The private key. * @returns A grumpkin public key. */ - public async computePublicKey(privateKey: GrumpkinScalar): Promise { + public async computePublicKey(privateKey: GrumpkinScalar): Promise { const api = await BarretenbergSync.initSingleton(); const [result] = api.getWasm().callWasmExport('schnorr_compute_public_key', [privateKey.toBuffer()], [64]); return Point.fromBuffer(Buffer.from(result)); @@ -45,7 +44,7 @@ export class Schnorr { * @param sig - The Schnorr signature. * @returns True or false. */ - public async verifySignature(msg: Uint8Array, pubKey: PublicKey, sig: SchnorrSignature) { + public async verifySignature(msg: Uint8Array, pubKey: Point, sig: SchnorrSignature) { const api = await BarretenbergSync.initSingleton(); const messageArray = concatenateUint8Arrays([numToInt32BE(msg.length), msg]); const [result] = api diff --git a/yarn-project/circuits.js/src/barretenberg/crypto/schnorr/signature.ts b/yarn-project/foundation/src/crypto/schnorr/signature.ts similarity index 100% rename from yarn-project/circuits.js/src/barretenberg/crypto/schnorr/signature.ts rename to yarn-project/foundation/src/crypto/schnorr/signature.ts diff --git a/yarn-project/circuits.js/src/barretenberg/crypto/secp256k1/index.test.ts b/yarn-project/foundation/src/crypto/secp256k1/index.test.ts similarity index 100% rename from yarn-project/circuits.js/src/barretenberg/crypto/secp256k1/index.test.ts rename to yarn-project/foundation/src/crypto/secp256k1/index.test.ts diff --git a/yarn-project/circuits.js/src/barretenberg/crypto/secp256k1/index.ts b/yarn-project/foundation/src/crypto/secp256k1/index.ts similarity index 100% rename from yarn-project/circuits.js/src/barretenberg/crypto/secp256k1/index.ts rename to yarn-project/foundation/src/crypto/secp256k1/index.ts diff --git a/yarn-project/circuits.js/src/barretenberg/serialize.ts b/yarn-project/foundation/src/crypto/serialize.ts similarity index 100% rename from yarn-project/circuits.js/src/barretenberg/serialize.ts rename to yarn-project/foundation/src/crypto/serialize.ts diff --git a/yarn-project/circuits.js/src/barretenberg/crypto/signature/index.ts b/yarn-project/foundation/src/crypto/signature/index.ts similarity index 100% rename from yarn-project/circuits.js/src/barretenberg/crypto/signature/index.ts rename to yarn-project/foundation/src/crypto/signature/index.ts diff --git a/yarn-project/foundation/src/index.ts b/yarn-project/foundation/src/index.ts index 78694f262f8f..fe42539cbe60 100644 --- a/yarn-project/foundation/src/index.ts +++ b/yarn-project/foundation/src/index.ts @@ -1,5 +1,4 @@ // Reexport all folders at the root for packages targeting CommonJS -export * as abi from './abi/index.js'; export * as asyncMap from './async-map/index.js'; export * as aztecAddress from './aztec-address/index.js'; export * as bigintBuffer from './bigint-buffer/index.js'; diff --git a/yarn-project/foundation/src/schemas/schemas.ts b/yarn-project/foundation/src/schemas/schemas.ts index 5677274d59c5..a290e0bf67bc 100644 --- a/yarn-project/foundation/src/schemas/schemas.ts +++ b/yarn-project/foundation/src/schemas/schemas.ts @@ -1,16 +1,11 @@ import { z } from 'zod'; -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'; import { Buffer32 } from '../buffer/buffer32.js'; import { EthAddress } from '../eth-address/index.js'; import { Fq, Fr } from '../fields/fields.js'; import { Point } from '../fields/point.js'; import { isHex, withoutHexPrefix } from '../string/index.js'; -import { type ZodFor } from './types.js'; import { bufferSchema, hexSchema } from './utils.js'; /** Validation schemas for common types. Every schema must match its toJSON. */ @@ -21,15 +16,6 @@ export const schemas = { /** Accepts a hex string. */ AztecAddress: AztecAddress.schema, - /** Accepts a hex string. */ - FunctionSelector: FunctionSelector.schema, - - /** Accepts a hex string. */ - NoteSelector: NoteSelector.schema, - - /** Accepts a hex string. */ - EventSelector: EventSelector.schema, - /** Accepts a hex string. */ Fr: Fr.schema, @@ -78,11 +64,3 @@ export const schemas = { /** Hex string with an optional 0x prefix which gets removed as part of the parsing. */ HexString: hexSchema, }; - -export const AbiDecodedSchema: ZodFor = z.union([ - schemas.BigInt, - z.boolean(), - schemas.AztecAddress, - z.array(z.lazy(() => AbiDecodedSchema)), - z.record(z.lazy(() => AbiDecodedSchema)), -]); diff --git a/yarn-project/foundation/src/serialize/type_registry.test.ts b/yarn-project/foundation/src/serialize/type_registry.test.ts index 440c44aa7bc6..e8af2ff2d297 100644 --- a/yarn-project/foundation/src/serialize/type_registry.test.ts +++ b/yarn-project/foundation/src/serialize/type_registry.test.ts @@ -1,6 +1,3 @@ -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'; import { EthAddress } from '../eth-address/index.js'; import { Fq, Fr } from '../fields/fields.js'; @@ -20,8 +17,6 @@ describe('TypeRegistry', () => { fq: Fq.random(), aztecAddress: await AztecAddress.random(), ethAddress: EthAddress.random(), - functionSelector: FunctionSelector.random(), - noteSelector: NoteSelector.random(), }; const json = JSON.stringify(data, resolver); @@ -32,19 +27,10 @@ describe('TypeRegistry', () => { expect(parsed.fq).toBeInstanceOf(Fq); expect(parsed.aztecAddress).toBeInstanceOf(AztecAddress); expect(parsed.ethAddress).toBeInstanceOf(EthAddress); - expect(parsed.functionSelector).toBeInstanceOf(FunctionSelector); - expect(parsed.noteSelector).toBeInstanceOf(NoteSelector); }); it('deserializes registered types in arrays', async () => { - const data = [ - Fr.random(), - Fq.random(), - await AztecAddress.random(), - EthAddress.random(), - FunctionSelector.random(), - NoteSelector.random(), - ]; + const data = [Fr.random(), Fq.random(), await AztecAddress.random(), EthAddress.random()]; const json = JSON.stringify(data, resolver); const parsed = JSON.parse(json, reviver); @@ -54,16 +40,14 @@ describe('TypeRegistry', () => { expect(parsed[1]).toBeInstanceOf(Fq); expect(parsed[2]).toBeInstanceOf(AztecAddress); expect(parsed[3]).toBeInstanceOf(EthAddress); - expect(parsed[4]).toBeInstanceOf(FunctionSelector); - expect(parsed[5]).toBeInstanceOf(NoteSelector); }); - 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 = { eventSelector: EventSelector.random() }; + // const json = JSON.stringify(data, resolver); + // const parsed = JSON.parse(json); + // expect(parsed.eventSelector).toEqual(data.eventSelector.toString()); + // }); it('handles plain objects', () => { const data = { obj: { number: 10, string: 'string', fr: Fr.random() } }; diff --git a/yarn-project/foundation/src/trees/index.ts b/yarn-project/foundation/src/trees/index.ts index 5d427c75dd2b..d6ec06f72c1c 100644 --- a/yarn-project/foundation/src/trees/index.ts +++ b/yarn-project/foundation/src/trees/index.ts @@ -1,5 +1,11 @@ export * from './unbalanced_merkle_tree.js'; export * from './unbalanced_tree_store.js'; +export * from './merkle_tree_calculator.js'; +export * from './merkle_tree.js'; +export * from './indexed_merkle_tree_calculator.js'; +export * from './indexed_merkle_tree.js'; +export * from './sibling_path.js'; +export * from './membership_witness.js'; /** * A leaf of an indexed merkle tree. diff --git a/yarn-project/circuits.js/src/merkle/indexed_merkle_tree.ts b/yarn-project/foundation/src/trees/indexed_merkle_tree.ts similarity index 95% rename from yarn-project/circuits.js/src/merkle/indexed_merkle_tree.ts rename to yarn-project/foundation/src/trees/indexed_merkle_tree.ts index 2e8d0992518c..fb5679120d1f 100644 --- a/yarn-project/circuits.js/src/merkle/indexed_merkle_tree.ts +++ b/yarn-project/foundation/src/trees/indexed_merkle_tree.ts @@ -2,7 +2,7 @@ import { Fr } from '@aztec/foundation/fields'; import { assertLength } from '@aztec/foundation/serialize'; import { type IndexedTreeLeafPreimage } from '@aztec/foundation/trees'; -import { MembershipWitness } from '../structs/membership_witness.js'; +import { MembershipWitness } from './membership_witness.js'; import { MerkleTree } from './merkle_tree.js'; /** A simple immutable indexed merkle tree container. Use a IndexedMerkleTreeCalculator to create a new instance from a set of leaves. */ diff --git a/yarn-project/circuits.js/src/merkle/indexed_merkle_tree_calculator.test.ts b/yarn-project/foundation/src/trees/indexed_merkle_tree_calculator.test.ts similarity index 66% rename from yarn-project/circuits.js/src/merkle/indexed_merkle_tree_calculator.test.ts rename to yarn-project/foundation/src/trees/indexed_merkle_tree_calculator.test.ts index 281863646a0c..7266b017f596 100644 --- a/yarn-project/circuits.js/src/merkle/indexed_merkle_tree_calculator.test.ts +++ b/yarn-project/foundation/src/trees/indexed_merkle_tree_calculator.test.ts @@ -1,15 +1,13 @@ -import { AztecAddress } from '@aztec/foundation/aztec-address'; -import { poseidon2Hash } from '@aztec/foundation/crypto'; -import { Fr } from '@aztec/foundation/fields'; - -import { MAX_PROTOCOL_CONTRACTS, PROTOCOL_CONTRACT_TREE_HEIGHT } from '../constants.js'; -import { type MembershipWitness } from '../index.js'; -import { ProtocolContractLeafPreimage } from '../structs/trees/index.js'; +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'; +import { BufferReader } from '../serialize/buffer_reader.js'; +import type { IndexedTreeLeaf, IndexedTreeLeafPreimage } from './index.js'; import { type IndexedMerkleTree } from './indexed_merkle_tree.js'; import { IndexedMerkleTreeCalculator } from './indexed_merkle_tree_calculator.js'; +import type { MembershipWitness } from './membership_witness.js'; -// Note: this is currently only used for the static protocol contract tree, so I'm using ProtocolContractLeafPreimage -// rather than a test preimage. class TestHasher { public async hash(lhs: Buffer, rhs: Buffer): Promise { return (await poseidon2Hash([lhs, rhs])).toBuffer(); @@ -20,9 +18,91 @@ class TestHasher { } } +/** + * An address to be inserted or checked in the protocol contract tree. + */ +export class TestLeaf implements IndexedTreeLeaf { + constructor( + /** + * Address value. + */ + public address: Fr, + ) {} + + getKey(): bigint { + return this.address.toBigInt(); + } + + toBuffer(): Buffer { + return this.address.toBuffer(); + } + + isEmpty(): boolean { + return this.address.isZero(); + } + + updateTo(_another: TestLeaf): TestLeaf { + throw new Error('Test leaf tree is insert only'); + } + + static buildDummy(key: bigint): TestLeaf { + return new TestLeaf(new Fr(key)); + } + + static fromBuffer(buf: Buffer): TestLeaf { + return new TestLeaf(Fr.fromBuffer(buf)); + } +} + +class TestLeafPreimage implements IndexedTreeLeafPreimage { + constructor( + /** + * Leaf value inside the indexed tree's linked list. + */ + public address: Fr, + /** + * Next value inside the indexed tree's linked list. + */ + public nextAddress: Fr, + /** + * Index of the next leaf in the indexed tree's linked list. + */ + public nextIndex: bigint, + ) {} + + getKey(): bigint { + return this.address.toBigInt(); + } + + getNextKey(): bigint { + return this.nextAddress.toBigInt(); + } + + getNextIndex(): bigint { + return this.nextIndex; + } + + asLeaf(): TestLeaf { + return new TestLeaf(this.address); + } + + toBuffer(): Buffer { + return Buffer.concat(this.toHashInputs()); + } + + static fromBuffer(buffer: Buffer | BufferReader): TestLeafPreimage { + const reader = BufferReader.asReader(buffer); + return new TestLeafPreimage(reader.readObject(Fr), reader.readObject(Fr), toBigIntBE(reader.readBytes(32))); + } + + toHashInputs(): Buffer[] { + return [Buffer.from(this.address.toBuffer()), Buffer.from(this.nextAddress.toBuffer())]; + } +} + async function checkSiblingPath( witness: MembershipWitness, - tree: IndexedMerkleTree, + tree: IndexedMerkleTree, ) { let index = Number(witness.leafIndex); let currentValue = tree.leaves[index]; @@ -40,24 +120,20 @@ async function checkSiblingPath( describe('indexed merkle tree root calculator', () => { it('should correctly handle no leaves', async () => { // Height of 3 is 8 leaves. - const calculator = await IndexedMerkleTreeCalculator.create(4, new TestHasher(), ProtocolContractLeafPreimage); + const calculator = await IndexedMerkleTreeCalculator.create(4, new TestHasher(), TestLeafPreimage); const expected = await calculator.computeTreeRoot(new Array(8).fill(new Fr(0)).map(fr => fr.toBuffer())); await expect(calculator.computeTreeRoot()).resolves.toEqual(expected); }); it('should compute entire tree', async () => { const hasher = new TestHasher(); - const calculator = await IndexedMerkleTreeCalculator.create(4, hasher, ProtocolContractLeafPreimage); + const calculator = await IndexedMerkleTreeCalculator.create(4, hasher, TestLeafPreimage); const values = Array.from({ length: 5 }).map((_, i) => new Fr(i).toBuffer()); const result = await calculator.computeTree(values); const expectedLeafPreimages = values.map( (l, i) => - new ProtocolContractLeafPreimage( - new Fr(l), - i == 4 ? Fr.ZERO : new Fr(l).add(Fr.ONE), - i == 4 ? BigInt(0) : BigInt(i), - ), + new TestLeafPreimage(new Fr(l), i == 4 ? Fr.ZERO : new Fr(l).add(Fr.ONE), i == 4 ? BigInt(0) : BigInt(i)), ); const leaves = await Promise.all(expectedLeafPreimages.map(l => hasher.hashInputs(l.toHashInputs()))); const expectedRoot = await calculator.computeTreeRoot(leaves); @@ -67,35 +143,35 @@ describe('indexed merkle tree root calculator', () => { it('should correctly get a membership witness', async () => { const hasher = new TestHasher(); - const calculator = await IndexedMerkleTreeCalculator.create(3, hasher, ProtocolContractLeafPreimage); + const calculator = await IndexedMerkleTreeCalculator.create(3, hasher, TestLeafPreimage); const values = Array.from({ length: 5 }).map((_, i) => new Fr(i + 1).toBuffer()); const tree = await calculator.computeTree(values); // We will have the below leaf at index 2. - const testLeaf = new ProtocolContractLeafPreimage(new Fr(2), new Fr(3), 3n); + const testLeaf = new TestLeafPreimage(new Fr(2), new Fr(3), 3n); const testLeafHash = await hasher.hashInputs(testLeaf.toHashInputs()); const index = tree.getIndex(testLeafHash); expect(index).toEqual(2); // We will have the below leaf at index 3 => is the right sibling of testLeaf. - const rightSibling = new ProtocolContractLeafPreimage(new Fr(3), new Fr(4), 4n); + const rightSibling = new TestLeafPreimage(new Fr(3), new Fr(4), 4n); const rightSiblingHash = await hasher.hashInputs(rightSibling.toHashInputs()); const witness = tree.getMembershipWitness(index); await checkSiblingPath(witness, tree); expect(witness.leafIndex).toEqual(BigInt(index)); - expect(witness.siblingPath[0]).toEqual(Fr.fromBuffer(rightSiblingHash)); + expect(witness.siblingPath[0].toString()).toEqual(Fr.fromBuffer(rightSiblingHash).toString()); }); it('should correctly get a non membership witness', async () => { const hasher = new TestHasher(); - const calculator = await IndexedMerkleTreeCalculator.create(3, hasher, ProtocolContractLeafPreimage); + const calculator = await IndexedMerkleTreeCalculator.create(3, hasher, TestLeafPreimage); const values = Array.from({ length: 5 }).map((_, i) => new Fr(i * 2).toBuffer()); const tree = await calculator.computeTree(values); // Choose an odd value which will not be in the tree. const testValue = 5n; // Its low leaf will exist at index 2 in the tree.f - const expectedLowLeaf = new ProtocolContractLeafPreimage(new Fr(4), new Fr(6), 3n); + const expectedLowLeaf = new TestLeafPreimage(new Fr(4), new Fr(6), 3n); const lowLeaf = tree.getLowLeaf(testValue); expect(lowLeaf).toEqual(expectedLowLeaf); @@ -109,19 +185,13 @@ describe('indexed merkle tree root calculator', () => { expect(witness).toEqual(tree.getMembershipWitness(lowLeafHash)); // The low leaf is at index 2 => it has a right sibling. const expectedSibling = tree.leaves[lowLeafIndex + 1]; - expect(witness.siblingPath[0]).toEqual(Fr.fromBuffer(expectedSibling)); + expect(witness.siblingPath[0].toString()).toStrictEqual(Fr.fromBuffer(expectedSibling).toString()); }); it('should correctly get a membership witness for addresses', async () => { const hasher = new TestHasher(); - const calculator = await IndexedMerkleTreeCalculator.create( - PROTOCOL_CONTRACT_TREE_HEIGHT, - hasher, - ProtocolContractLeafPreimage, - ); - let values: AztecAddress[] = await Promise.all( - Array.from({ length: MAX_PROTOCOL_CONTRACTS }).map(() => AztecAddress.random()), - ); + const calculator = await IndexedMerkleTreeCalculator.create(3, hasher, TestLeafPreimage); + let values: AztecAddress[] = await Promise.all(Array.from({ length: 7 }).map(() => AztecAddress.random())); // Manually add the zero leaf here, so the below recalcs are easier. values = [AztecAddress.ZERO, ...values]; const tree = await calculator.computeTree(values.map(a => a.toBuffer())); @@ -134,7 +204,7 @@ describe('indexed merkle tree root calculator', () => { const nextValue = sortedValues[sortedValues.indexOf(testValue) + 1] || AztecAddress.ZERO; // Reconstruct its leaf preimage. - const testLeafPreimage = new ProtocolContractLeafPreimage( + const testLeafPreimage = new TestLeafPreimage( testValue.toField(), nextValue.toField(), BigInt(values.indexOf(nextValue) || 0), @@ -146,19 +216,15 @@ describe('indexed merkle tree root calculator', () => { await checkSiblingPath(witness, tree); const expectedSibling = testIndex % 2 ? tree.leafPreimages[testIndex - 1] : tree.leafPreimages[testIndex + 1]; expect(witness.leafIndex).toEqual(BigInt(testIndex)); - expect(witness.siblingPath[0]).toEqual(Fr.fromBuffer(await hasher.hashInputs(expectedSibling.toHashInputs()))); + expect(witness.siblingPath[0].toString()).toStrictEqual( + Fr.fromBuffer(await hasher.hashInputs(expectedSibling.toHashInputs())).toString(), + ); }); it('should correctly get a non membership witness for addresses', async () => { const hasher = new TestHasher(); - const calculator = await IndexedMerkleTreeCalculator.create( - PROTOCOL_CONTRACT_TREE_HEIGHT, - hasher, - ProtocolContractLeafPreimage, - ); - let values: AztecAddress[] = await Promise.all( - Array.from({ length: MAX_PROTOCOL_CONTRACTS }).map(() => AztecAddress.random()), - ); + const calculator = await IndexedMerkleTreeCalculator.create(3, hasher, TestLeafPreimage); + let values: AztecAddress[] = await Promise.all(Array.from({ length: 7 }).map(() => AztecAddress.random())); // Manually add the zero leaf here, so the below recalcs are easier. values = [AztecAddress.ZERO, ...values]; const tree = await calculator.computeTree(values.map(a => a.toBuffer())); @@ -178,7 +244,7 @@ describe('indexed merkle tree root calculator', () => { ]; // Reconstruct the low leaf preimage. - const expectedLowLeaf = new ProtocolContractLeafPreimage( + const expectedLowLeaf = new TestLeafPreimage( previousValue.toField(), nextValue.toField(), BigInt(values.indexOf(nextValue)), @@ -196,6 +262,8 @@ describe('indexed merkle tree root calculator', () => { const expectedSibling = lowLeafIndex % 2 ? tree.leafPreimages[lowLeafIndex - 1] : tree.leafPreimages[lowLeafIndex + 1]; expect(witness.leafIndex).toEqual(BigInt(lowLeafIndex)); - expect(witness.siblingPath[0]).toEqual(Fr.fromBuffer(await hasher.hashInputs(expectedSibling.toHashInputs()))); + expect(witness.siblingPath[0].toString()).toStrictEqual( + Fr.fromBuffer(await hasher.hashInputs(expectedSibling.toHashInputs())).toString(), + ); }); }); diff --git a/yarn-project/circuits.js/src/merkle/indexed_merkle_tree_calculator.ts b/yarn-project/foundation/src/trees/indexed_merkle_tree_calculator.ts similarity index 100% rename from yarn-project/circuits.js/src/merkle/indexed_merkle_tree_calculator.ts rename to yarn-project/foundation/src/trees/indexed_merkle_tree_calculator.ts diff --git a/yarn-project/circuits.js/src/structs/membership_witness.ts b/yarn-project/foundation/src/trees/membership_witness.ts similarity index 92% rename from yarn-project/circuits.js/src/structs/membership_witness.ts rename to yarn-project/foundation/src/trees/membership_witness.ts index fd623300be17..e6489c201d8b 100644 --- a/yarn-project/circuits.js/src/structs/membership_witness.ts +++ b/yarn-project/foundation/src/trees/membership_witness.ts @@ -1,7 +1,7 @@ -import { assertMemberLength } from '@aztec/foundation/array'; -import { toBigIntBE, toBufferBE } from '@aztec/foundation/bigint-buffer'; -import { Fr } from '@aztec/foundation/fields'; -import { BufferReader, type Tuple, serializeToBuffer } from '@aztec/foundation/serialize'; +import { assertMemberLength } from '../array/array.js'; +import { toBigIntBE, toBufferBE } from '../bigint-buffer/index.js'; +import { Fr } from '../fields/fields.js'; +import { BufferReader, type Tuple, serializeToBuffer } from '../serialize/index.js'; /** * Contains information which can be used to prove that a leaf is a member of a Merkle tree. diff --git a/yarn-project/circuits.js/src/merkle/merkle_tree.ts b/yarn-project/foundation/src/trees/merkle_tree.ts similarity index 100% rename from yarn-project/circuits.js/src/merkle/merkle_tree.ts rename to yarn-project/foundation/src/trees/merkle_tree.ts diff --git a/yarn-project/circuits.js/src/merkle/merkle_tree_calculator.test.ts b/yarn-project/foundation/src/trees/merkle_tree_calculator.test.ts similarity index 100% rename from yarn-project/circuits.js/src/merkle/merkle_tree_calculator.test.ts rename to yarn-project/foundation/src/trees/merkle_tree_calculator.test.ts diff --git a/yarn-project/circuits.js/src/merkle/merkle_tree_calculator.ts b/yarn-project/foundation/src/trees/merkle_tree_calculator.ts similarity index 100% rename from yarn-project/circuits.js/src/merkle/merkle_tree_calculator.ts rename to yarn-project/foundation/src/trees/merkle_tree_calculator.ts diff --git a/yarn-project/circuits.js/src/merkle/sibling_path.test.ts b/yarn-project/foundation/src/trees/sibling_path.test.ts similarity index 100% rename from yarn-project/circuits.js/src/merkle/sibling_path.test.ts rename to yarn-project/foundation/src/trees/sibling_path.test.ts diff --git a/yarn-project/circuits.js/src/merkle/sibling_path.ts b/yarn-project/foundation/src/trees/sibling_path.ts similarity index 100% rename from yarn-project/circuits.js/src/merkle/sibling_path.ts rename to yarn-project/foundation/src/trees/sibling_path.ts diff --git a/yarn-project/foundation/src/trees/unbalanced_merkle_tree.ts b/yarn-project/foundation/src/trees/unbalanced_merkle_tree.ts index ceedcfc2f734..391ca90f434a 100644 --- a/yarn-project/foundation/src/trees/unbalanced_merkle_tree.ts +++ b/yarn-project/foundation/src/trees/unbalanced_merkle_tree.ts @@ -1,5 +1,5 @@ -import { padArrayEnd } from '@aztec/foundation/collection'; -import { sha256Trunc } from '@aztec/foundation/crypto'; +import { padArrayEnd } from '../collection/array.js'; +import { sha256Trunc } from '../crypto/sha256/index.js'; /** * Computes the merkle root for an unbalanced tree. diff --git a/yarn-project/ivc-integration/package.json b/yarn-project/ivc-integration/package.json index 197673bf760b..434ac4a0488f 100644 --- a/yarn-project/ivc-integration/package.json +++ b/yarn-project/ivc-integration/package.json @@ -62,6 +62,7 @@ "dependencies": { "@aztec/bb.js": "../../ts", "@aztec/circuits.js": "workspace:^", + "@aztec/constants": "workspace:^", "@aztec/foundation": "workspace:^", "@aztec/types": "workspace:^", "@noir-lang/noir_codegen": "portal:../../noir/packages/noir_codegen", diff --git a/yarn-project/ivc-integration/src/avm_integration.test.ts b/yarn-project/ivc-integration/src/avm_integration.test.ts index 95ecaf7ab4a1..a4b7fb8abe99 100644 --- a/yarn-project/ivc-integration/src/avm_integration.test.ts +++ b/yarn-project/ivc-integration/src/avm_integration.test.ts @@ -1,11 +1,12 @@ import { type BBSuccess, BB_RESULT, generateAvmProof, generateProof, verifyProof } from '@aztec/bb-prover'; import { - type AvmCircuitInputs, AztecAddress, type ContractClassPublic, type ContractInstanceWithAddress, FunctionSelector, } from '@aztec/circuits.js'; +import { type AvmCircuitInputs } from '@aztec/circuits.js/avm'; +import { makeContractClassPublic, makeContractInstanceFromClassId } from '@aztec/circuits.js/testing'; import { AVM_PROOF_LENGTH_IN_FIELDS, AVM_PUBLIC_COLUMN_MAX_SIZE, @@ -13,8 +14,7 @@ import { AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS, PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH, PUBLIC_DISPATCH_SELECTOR, -} from '@aztec/circuits.js/constants'; -import { makeContractClassPublic, makeContractInstanceFromClassId } from '@aztec/circuits.js/testing'; +} from '@aztec/constants'; import { Fr } from '@aztec/foundation/fields'; import { createLogger } from '@aztec/foundation/log'; import { BufferReader } from '@aztec/foundation/serialize'; diff --git a/yarn-project/ivc-integration/src/index.ts b/yarn-project/ivc-integration/src/index.ts index 670000668751..21629bc80c27 100644 --- a/yarn-project/ivc-integration/src/index.ts +++ b/yarn-project/ivc-integration/src/index.ts @@ -1,4 +1,4 @@ -import { type CLIENT_IVC_VERIFICATION_KEY_LENGTH_IN_FIELDS } from '@aztec/circuits.js'; +import { type CLIENT_IVC_VERIFICATION_KEY_LENGTH_IN_FIELDS } from '@aztec/constants'; import { type ForeignCallOutput, Noir } from '@noir-lang/noir_js'; import createDebug from 'debug'; diff --git a/yarn-project/ivc-integration/src/scripts/generate_declaration_files.ts b/yarn-project/ivc-integration/src/scripts/generate_declaration_files.ts index 5a3cd7557fd9..50310dc3c913 100644 --- a/yarn-project/ivc-integration/src/scripts/generate_declaration_files.ts +++ b/yarn-project/ivc-integration/src/scripts/generate_declaration_files.ts @@ -4,7 +4,7 @@ import { readdir, writeFile } from 'fs/promises'; import { join } from 'path'; const contract = `\ -import { type NoirCompiledCircuit } from '@aztec/types/noir'; +import { type NoirCompiledCircuit } from '@aztec/circuits.js/noir'; const circuit: NoirCompiledCircuit; export = circuit; `; diff --git a/yarn-project/ivc-integration/tsconfig.json b/yarn-project/ivc-integration/tsconfig.json index 9824741f2bbe..f51690eeff84 100644 --- a/yarn-project/ivc-integration/tsconfig.json +++ b/yarn-project/ivc-integration/tsconfig.json @@ -10,6 +10,9 @@ { "path": "../circuits.js" }, + { + "path": "../constants" + }, { "path": "../foundation" }, diff --git a/yarn-project/key-store/package.json b/yarn-project/key-store/package.json index 278f5fc2864a..a0e6838f9496 100644 --- a/yarn-project/key-store/package.json +++ b/yarn-project/key-store/package.json @@ -57,6 +57,7 @@ "dependencies": { "@aztec/circuit-types": "workspace:^", "@aztec/circuits.js": "workspace:^", + "@aztec/constants": "workspace:^", "@aztec/foundation": "workspace:^", "@aztec/kv-store": "workspace:^", "tslib": "^2.4.0" diff --git a/yarn-project/key-store/src/key_store.ts b/yarn-project/key-store/src/key_store.ts index 4e32f8376374..42f78d09401f 100644 --- a/yarn-project/key-store/src/key_store.ts +++ b/yarn-project/key-store/src/key_store.ts @@ -3,7 +3,6 @@ import { AztecAddress, CompleteAddress, Fr, - GeneratorIndex, GrumpkinScalar, KEY_PREFIXES, type KeyPrefix, @@ -14,6 +13,7 @@ import { deriveKeys, derivePublicKeyFromSecretKey, } from '@aztec/circuits.js'; +import { GeneratorIndex } from '@aztec/constants'; import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto'; import { toArray } from '@aztec/foundation/iterable'; import { type Bufferable, serializeToBuffer } from '@aztec/foundation/serialize'; diff --git a/yarn-project/key-store/tsconfig.json b/yarn-project/key-store/tsconfig.json index 4e0866fd5215..8d37123496be 100644 --- a/yarn-project/key-store/tsconfig.json +++ b/yarn-project/key-store/tsconfig.json @@ -12,6 +12,9 @@ { "path": "../circuits.js" }, + { + "path": "../constants" + }, { "path": "../foundation" }, diff --git a/yarn-project/merkle-tree/src/interfaces/indexed_tree.ts b/yarn-project/merkle-tree/src/interfaces/indexed_tree.ts index 54f30c2a61fd..8bb0bb68afed 100644 --- a/yarn-project/merkle-tree/src/interfaces/indexed_tree.ts +++ b/yarn-project/merkle-tree/src/interfaces/indexed_tree.ts @@ -1,4 +1,4 @@ -import { type BatchInsertionResult } from '@aztec/circuit-types'; +import { type BatchInsertionResult } from '@aztec/circuit-types/interfaces/server'; import { type IndexedTreeLeaf, type IndexedTreeLeafPreimage } from '@aztec/foundation/trees'; import { 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 ed25a419e5e6..7c454f3efd5e 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,4 +1,5 @@ -import { Fr, NullifierLeaf, NullifierLeafPreimage } from '@aztec/circuits.js'; +import { Fr } from '@aztec/circuits.js'; +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'; 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 63823f35620c..bd52886ad5cb 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,4 +1,5 @@ -import { type BatchInsertionResult, type LeafUpdateWitnessData, SiblingPath } from '@aztec/circuit-types'; +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 { toBufferBE } from '@aztec/foundation/bigint-buffer'; import { type FromBuffer } from '@aztec/foundation/serialize'; 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 0cd8dcc4ead6..85392274e659 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,11 +1,11 @@ import { SiblingPath } from '@aztec/circuit-types'; +import { Fr } from '@aztec/circuits.js'; import { - Fr, NullifierLeaf, NullifierLeafPreimage, PublicDataTreeLeaf, PublicDataTreeLeafPreimage, -} from '@aztec/circuits.js'; +} from '@aztec/circuits.js/trees'; import { toBufferBE } from '@aztec/foundation/bigint-buffer'; import { type FromBuffer } from '@aztec/foundation/serialize'; import { type AztecKVStore } from '@aztec/kv-store'; diff --git a/yarn-project/noir-bb-bench/src/scripts/generate_declaration_files.ts b/yarn-project/noir-bb-bench/src/scripts/generate_declaration_files.ts index 5a3cd7557fd9..50310dc3c913 100644 --- a/yarn-project/noir-bb-bench/src/scripts/generate_declaration_files.ts +++ b/yarn-project/noir-bb-bench/src/scripts/generate_declaration_files.ts @@ -4,7 +4,7 @@ import { readdir, writeFile } from 'fs/promises'; import { join } from 'path'; const contract = `\ -import { type NoirCompiledCircuit } from '@aztec/types/noir'; +import { type NoirCompiledCircuit } from '@aztec/circuits.js/noir'; const circuit: NoirCompiledCircuit; export = circuit; `; diff --git a/yarn-project/noir-contracts.js/scripts/generate-types.sh b/yarn-project/noir-contracts.js/scripts/generate-types.sh index 525eac230abe..b2027b7eb324 100755 --- a/yarn-project/noir-contracts.js/scripts/generate-types.sh +++ b/yarn-project/noir-contracts.js/scripts/generate-types.sh @@ -25,7 +25,7 @@ echo "// Auto generated module - do not edit!" >"$INDEX" mkdir -p artifacts decl=$(cat < = { function generateImports() { return ` - import { type NoirCompiledCircuit } from '@aztec/types/noir'; + import { type NoirCompiledCircuit } from '@aztec/circuits.js/noir'; import { type ClientProtocolArtifact } from './artifacts/types.js'; `; } diff --git a/yarn-project/noir-protocol-circuits-types/src/scripts/generate_declaration_files.ts b/yarn-project/noir-protocol-circuits-types/src/scripts/generate_declaration_files.ts index 2b6a9ed14426..33d97af3f8ff 100644 --- a/yarn-project/noir-protocol-circuits-types/src/scripts/generate_declaration_files.ts +++ b/yarn-project/noir-protocol-circuits-types/src/scripts/generate_declaration_files.ts @@ -4,7 +4,7 @@ import { readdir, writeFile } from 'fs/promises'; import { join } from 'path'; const contract = `\ -import { type NoirCompiledCircuit } from '@aztec/types/noir'; +import { type NoirCompiledCircuit } from '@aztec/circuits.js/noir'; const circuit: NoirCompiledCircuit; export = circuit; `; diff --git a/yarn-project/noir-protocol-circuits-types/src/scripts/generate_private_kernel_reset_data.ts b/yarn-project/noir-protocol-circuits-types/src/scripts/generate_private_kernel_reset_data.ts index 63bd8a0a7a7e..52bcbd3a7801 100644 --- a/yarn-project/noir-protocol-circuits-types/src/scripts/generate_private_kernel_reset_data.ts +++ b/yarn-project/noir-protocol-circuits-types/src/scripts/generate_private_kernel_reset_data.ts @@ -1,3 +1,4 @@ +import { type PrivateKernelResetDimensionsConfig, privateKernelResetDimensionNames } from '@aztec/circuits.js/kernel'; import { MAX_KEY_VALIDATION_REQUESTS_PER_TX, MAX_NOTE_HASHES_PER_TX, @@ -6,10 +7,8 @@ import { MAX_NULLIFIER_READ_REQUESTS_PER_TX, MAX_PRIVATE_LOGS_PER_TX, PRIVATE_KERNEL_RESET_INDEX, - type PrivateKernelResetDimensionsConfig, VK_TREE_HEIGHT, - privateKernelResetDimensionNames, -} from '@aztec/circuits.js'; +} from '@aztec/constants'; import { createConsoleLogger } from '@aztec/foundation/log'; import { promises as fs } from 'fs'; @@ -35,7 +34,7 @@ const maxDimensions = [ function generateTypeFileImports() { return ` - import { PrivateKernelResetDimensions, type PrivateKernelResetDimensionsConfig } from '@aztec/circuits.js'; + import { PrivateKernelResetDimensions, type PrivateKernelResetDimensionsConfig } from '@aztec/circuits.js/kernel'; `; } @@ -50,7 +49,7 @@ function generateVkFileImports() { function generateDataFileImports() { return ` - import { type NoirCompiledCircuit } from '@aztec/types/noir'; + import { type NoirCompiledCircuit } from '@aztec/circuits.js/noir'; import { type PrivateResetArtifact } from './private_kernel_reset_types.js'; `; diff --git a/yarn-project/noir-protocol-circuits-types/src/scripts/generate_vk_tree.ts b/yarn-project/noir-protocol-circuits-types/src/scripts/generate_vk_tree.ts index 813739e30f9d..bcd7b580bf2a 100644 --- a/yarn-project/noir-protocol-circuits-types/src/scripts/generate_vk_tree.ts +++ b/yarn-project/noir-protocol-circuits-types/src/scripts/generate_vk_tree.ts @@ -1,6 +1,7 @@ -import { MerkleTreeCalculator, TUBE_VK_INDEX, VK_TREE_HEIGHT } from '@aztec/circuits.js'; +import { TUBE_VK_INDEX, VK_TREE_HEIGHT } from '@aztec/constants'; import { poseidon2Hash } from '@aztec/foundation/crypto'; import { createConsoleLogger } from '@aztec/foundation/log'; +import { MerkleTreeCalculator } from '@aztec/foundation/trees'; import { fileURLToPath } from '@aztec/foundation/url'; import { promises as fs } from 'fs'; @@ -34,7 +35,7 @@ async function main() { const vkTree = await buildVKTree(); const vkTreePath = resolveRelativePath('../vk_tree.ts'); const vkTreeFileContents = ` -import { MerkleTree } from '@aztec/circuits.js'; +import { MerkleTree } from '@aztec/foundation/trees'; export const vkTree = new MerkleTree(${vkTree.height}, [${vkTree.nodes .map(node => `'${node.toString('hex')}'`) diff --git a/yarn-project/noir-protocol-circuits-types/src/utils/private_kernel_reset.ts b/yarn-project/noir-protocol-circuits-types/src/utils/private_kernel_reset.ts index 9d688a1abaa3..dd417cd8946f 100644 --- a/yarn-project/noir-protocol-circuits-types/src/utils/private_kernel_reset.ts +++ b/yarn-project/noir-protocol-circuits-types/src/utils/private_kernel_reset.ts @@ -2,7 +2,7 @@ import { type PrivateKernelResetCircuitPrivateInputs, type PrivateKernelResetDimensions, privateKernelResetDimensionNames, -} from '@aztec/circuits.js'; +} from '@aztec/circuits.js/kernel'; import { pushTestData } from '@aztec/foundation/testing'; import { diff --git a/yarn-project/noir-protocol-circuits-types/src/utils/server/foreign_call_handler.ts b/yarn-project/noir-protocol-circuits-types/src/utils/server/foreign_call_handler.ts index 323171eb4691..46807f2a3c8f 100644 --- a/yarn-project/noir-protocol-circuits-types/src/utils/server/foreign_call_handler.ts +++ b/yarn-project/noir-protocol-circuits-types/src/utils/server/foreign_call_handler.ts @@ -1,6 +1,5 @@ -import { Blob } from '@aztec/blob-lib'; +import { Blob, BlockBlobPublicInputs, SpongeBlob } from '@aztec/blob-lib'; import { Fr } from '@aztec/circuits.js'; -import { BlockBlobPublicInputs, SpongeBlob } from '@aztec/circuits.js/blobs'; import { applyStringFormatting, createLogger } from '@aztec/foundation/log'; import { type ForeignCallInput, type ForeignCallOutput } from '@noir-lang/acvm_js'; diff --git a/yarn-project/noir-protocol-circuits-types/tsconfig.json b/yarn-project/noir-protocol-circuits-types/tsconfig.json index 15aef4138e7d..f54211aa2b3d 100644 --- a/yarn-project/noir-protocol-circuits-types/tsconfig.json +++ b/yarn-project/noir-protocol-circuits-types/tsconfig.json @@ -13,6 +13,9 @@ { "path": "../circuits.js" }, + { + "path": "../constants" + }, { "path": "../foundation" }, diff --git a/yarn-project/p2p/package.json b/yarn-project/p2p/package.json index 54d2f0ef00b6..9a668fd30a6e 100644 --- a/yarn-project/p2p/package.json +++ b/yarn-project/p2p/package.json @@ -65,6 +65,7 @@ "dependencies": { "@aztec/circuit-types": "workspace:^", "@aztec/circuits.js": "workspace:^", + "@aztec/constants": "workspace:^", "@aztec/epoch-cache": "workspace:^", "@aztec/foundation": "workspace:^", "@aztec/kv-store": "workspace:^", diff --git a/yarn-project/p2p/src/bootstrap/bootstrap.ts b/yarn-project/p2p/src/bootstrap/bootstrap.ts index da322ca599a3..d3ae83d58198 100644 --- a/yarn-project/p2p/src/bootstrap/bootstrap.ts +++ b/yarn-project/p2p/src/bootstrap/bootstrap.ts @@ -1,4 +1,4 @@ -import { type P2PBootstrapApi } from '@aztec/circuit-types/interfaces'; +import { type P2PBootstrapApi } from '@aztec/circuit-types/interfaces/server'; import { createLogger } from '@aztec/foundation/log'; import { type AztecAsyncKVStore } from '@aztec/kv-store'; import { OtelMetricsAdapter, type TelemetryClient } from '@aztec/telemetry-client'; diff --git a/yarn-project/p2p/src/client/factory.ts b/yarn-project/p2p/src/client/factory.ts index f7b82ac2cf4f..7f59cd5aa80d 100644 --- a/yarn-project/p2p/src/client/factory.ts +++ b/yarn-project/p2p/src/client/factory.ts @@ -1,9 +1,8 @@ +import { type L2BlockSource, P2PClientType } from '@aztec/circuit-types'; import { type ClientProtocolCircuitVerifier, - type L2BlockSource, - P2PClientType, type WorldStateSynchronizer, -} from '@aztec/circuit-types'; +} from '@aztec/circuit-types/interfaces/server'; import { type EpochCacheInterface } from '@aztec/epoch-cache'; import { type Logger, createLogger } from '@aztec/foundation/log'; import { type AztecAsyncKVStore } from '@aztec/kv-store'; diff --git a/yarn-project/p2p/src/client/p2p_client.integration.test.ts b/yarn-project/p2p/src/client/p2p_client.integration.test.ts index dbbdba64844b..db90ec434520 100644 --- a/yarn-project/p2p/src/client/p2p_client.integration.test.ts +++ b/yarn-project/p2p/src/client/p2p_client.integration.test.ts @@ -1,6 +1,8 @@ // An integration test for the p2p client to test req resp protocols -import { PeerErrorSeverity, type Tx, type WorldStateSynchronizer, mockTx } from '@aztec/circuit-types'; +import { PeerErrorSeverity, type Tx } from '@aztec/circuit-types'; import { emptyChainConfig } from '@aztec/circuit-types/config'; +import { type WorldStateSynchronizer } from '@aztec/circuit-types/interfaces/server'; +import { mockTx } from '@aztec/circuit-types/testing'; import { type EpochCache } from '@aztec/epoch-cache'; import { sleep } from '@aztec/foundation/sleep'; diff --git a/yarn-project/p2p/src/client/p2p_client.test.ts b/yarn-project/p2p/src/client/p2p_client.test.ts index b031aa8a0825..3e79e61c9e8c 100644 --- a/yarn-project/p2p/src/client/p2p_client.test.ts +++ b/yarn-project/p2p/src/client/p2p_client.test.ts @@ -1,5 +1,6 @@ import { MockL2BlockSource } from '@aztec/archiver/test'; -import { L2Block, P2PClientType, mockTx } from '@aztec/circuit-types'; +import { L2Block, P2PClientType } from '@aztec/circuit-types'; +import { mockTx } from '@aztec/circuit-types/testing'; import { Fr } from '@aztec/circuits.js'; import { retryUntil } from '@aztec/foundation/retry'; import { sleep } from '@aztec/foundation/sleep'; diff --git a/yarn-project/p2p/src/client/p2p_client.ts b/yarn-project/p2p/src/client/p2p_client.ts index e87b09732fda..bbbdc55c1424 100644 --- a/yarn-project/p2p/src/client/p2p_client.ts +++ b/yarn-project/p2p/src/client/p2p_client.ts @@ -6,14 +6,12 @@ import { type L2BlockSource, type L2BlockStreamEvent, type L2Tips, - type P2PApi, type P2PClientType, - type PeerInfo, - type ProverCoordination, type Tx, type TxHash, } from '@aztec/circuit-types'; -import { INITIAL_L2_BLOCK_NUM } from '@aztec/circuits.js/constants'; +import { type P2PApi, type PeerInfo, type ProverCoordination } from '@aztec/circuit-types/interfaces/server'; +import { INITIAL_L2_BLOCK_NUM } from '@aztec/constants'; import { createLogger } from '@aztec/foundation/log'; import { type AztecAsyncKVStore, type AztecAsyncMap, type AztecAsyncSingleton } from '@aztec/kv-store'; import { diff --git a/yarn-project/p2p/src/mem_pools/tx_pool/aztec_kv_tx_pool.test.ts b/yarn-project/p2p/src/mem_pools/tx_pool/aztec_kv_tx_pool.test.ts index cbcc397bcd24..5c7a40511bac 100644 --- a/yarn-project/p2p/src/mem_pools/tx_pool/aztec_kv_tx_pool.test.ts +++ b/yarn-project/p2p/src/mem_pools/tx_pool/aztec_kv_tx_pool.test.ts @@ -1,4 +1,4 @@ -import { mockTx } from '@aztec/circuit-types'; +import { mockTx } from '@aztec/circuit-types/testing'; import { openTmpStore } from '@aztec/kv-store/lmdb-v2'; import { AztecKVTxPool } from './aztec_kv_tx_pool.js'; diff --git a/yarn-project/p2p/src/mem_pools/tx_pool/tx_pool_test_suite.ts b/yarn-project/p2p/src/mem_pools/tx_pool/tx_pool_test_suite.ts index 1e4129f8d499..f53595622270 100644 --- a/yarn-project/p2p/src/mem_pools/tx_pool/tx_pool_test_suite.ts +++ b/yarn-project/p2p/src/mem_pools/tx_pool/tx_pool_test_suite.ts @@ -1,4 +1,5 @@ -import { type Tx, mockTx } from '@aztec/circuit-types'; +import { type Tx } from '@aztec/circuit-types'; +import { mockTx } from '@aztec/circuit-types/testing'; import { GasFees } from '@aztec/circuits.js'; import { unfreeze } from '@aztec/foundation/types'; diff --git a/yarn-project/p2p/src/msg_validators/attestation_validator/attestation_validator.test.ts b/yarn-project/p2p/src/msg_validators/attestation_validator/attestation_validator.test.ts index 92a187fdfe00..1e5b425404be 100644 --- a/yarn-project/p2p/src/msg_validators/attestation_validator/attestation_validator.test.ts +++ b/yarn-project/p2p/src/msg_validators/attestation_validator/attestation_validator.test.ts @@ -1,4 +1,5 @@ -import { PeerErrorSeverity, makeBlockAttestation } from '@aztec/circuit-types'; +import { PeerErrorSeverity } from '@aztec/circuit-types'; +import { makeBlockAttestation } from '@aztec/circuit-types/testing'; import { makeHeader } from '@aztec/circuits.js/testing'; import { type EpochCache } from '@aztec/epoch-cache'; diff --git a/yarn-project/p2p/src/msg_validators/block_proposal_validator/block_proposal_validator.test.ts b/yarn-project/p2p/src/msg_validators/block_proposal_validator/block_proposal_validator.test.ts index ccddddceae79..30ec19e72ce5 100644 --- a/yarn-project/p2p/src/msg_validators/block_proposal_validator/block_proposal_validator.test.ts +++ b/yarn-project/p2p/src/msg_validators/block_proposal_validator/block_proposal_validator.test.ts @@ -1,4 +1,5 @@ -import { PeerErrorSeverity, makeBlockProposal } from '@aztec/circuit-types'; +import { PeerErrorSeverity } from '@aztec/circuit-types'; +import { makeBlockProposal } from '@aztec/circuit-types/testing'; import { Fr } from '@aztec/circuits.js'; import { makeHeader } from '@aztec/circuits.js/testing'; import { type EpochCache } from '@aztec/epoch-cache'; diff --git a/yarn-project/p2p/src/msg_validators/tx_validator/aggregate_tx_validator.test.ts b/yarn-project/p2p/src/msg_validators/tx_validator/aggregate_tx_validator.test.ts index 76d838491530..3dde2a014bb6 100644 --- a/yarn-project/p2p/src/msg_validators/tx_validator/aggregate_tx_validator.test.ts +++ b/yarn-project/p2p/src/msg_validators/tx_validator/aggregate_tx_validator.test.ts @@ -1,4 +1,5 @@ -import { type AnyTx, Tx, type TxHash, type TxValidationResult, type TxValidator, mockTx } from '@aztec/circuit-types'; +import { type AnyTx, Tx, type TxHash, type TxValidationResult, type TxValidator } from '@aztec/circuit-types'; +import { mockTx } from '@aztec/circuit-types/testing'; import { AggregateTxValidator } from './aggregate_tx_validator.js'; diff --git a/yarn-project/p2p/src/msg_validators/tx_validator/block_header_validator.test.ts b/yarn-project/p2p/src/msg_validators/tx_validator/block_header_validator.test.ts index d36341f1f579..95063ff5fcfd 100644 --- a/yarn-project/p2p/src/msg_validators/tx_validator/block_header_validator.test.ts +++ b/yarn-project/p2p/src/msg_validators/tx_validator/block_header_validator.test.ts @@ -1,4 +1,5 @@ -import { type AnyTx, type TxValidationResult, mockTxForRollup } from '@aztec/circuit-types'; +import { type AnyTx, type TxValidationResult } from '@aztec/circuit-types'; +import { mockTxForRollup } from '@aztec/circuit-types/testing'; import { Fr } from '@aztec/circuits.js'; import { type MockProxy, mock, mockFn } from 'jest-mock-extended'; diff --git a/yarn-project/p2p/src/msg_validators/tx_validator/data_validator.test.ts b/yarn-project/p2p/src/msg_validators/tx_validator/data_validator.test.ts index 8514685bd8cb..25f6d4fe0c47 100644 --- a/yarn-project/p2p/src/msg_validators/tx_validator/data_validator.test.ts +++ b/yarn-project/p2p/src/msg_validators/tx_validator/data_validator.test.ts @@ -1,4 +1,5 @@ -import { type Tx, mockTx } from '@aztec/circuit-types'; +import { type Tx } from '@aztec/circuit-types'; +import { mockTx } from '@aztec/circuit-types/testing'; import { AztecAddress, Fr, FunctionSelector } from '@aztec/circuits.js'; import { timesParallel } from '@aztec/foundation/collection'; diff --git a/yarn-project/p2p/src/msg_validators/tx_validator/double_spend_validator.test.ts b/yarn-project/p2p/src/msg_validators/tx_validator/double_spend_validator.test.ts index 25c39c2ad061..798525b47c8e 100644 --- a/yarn-project/p2p/src/msg_validators/tx_validator/double_spend_validator.test.ts +++ b/yarn-project/p2p/src/msg_validators/tx_validator/double_spend_validator.test.ts @@ -1,4 +1,5 @@ -import { type AnyTx, mockTx, mockTxForRollup } from '@aztec/circuit-types'; +import { type AnyTx } from '@aztec/circuit-types'; +import { mockTx, mockTxForRollup } from '@aztec/circuit-types/testing'; import { type MockProxy, mock } from 'jest-mock-extended'; diff --git a/yarn-project/p2p/src/msg_validators/tx_validator/metadata_validator.test.ts b/yarn-project/p2p/src/msg_validators/tx_validator/metadata_validator.test.ts index 940b69ce7203..a77d770b5dc7 100644 --- a/yarn-project/p2p/src/msg_validators/tx_validator/metadata_validator.test.ts +++ b/yarn-project/p2p/src/msg_validators/tx_validator/metadata_validator.test.ts @@ -1,4 +1,5 @@ -import { type AnyTx, type Tx, mockTx, mockTxForRollup } from '@aztec/circuit-types'; +import { type AnyTx, type Tx } from '@aztec/circuit-types'; +import { mockTx, mockTxForRollup } from '@aztec/circuit-types/testing'; import { Fr, MaxBlockNumber } from '@aztec/circuits.js'; import { MetadataTxValidator } from './metadata_validator.js'; diff --git a/yarn-project/p2p/src/msg_validators/tx_validator/tx_proof_validator.ts b/yarn-project/p2p/src/msg_validators/tx_validator/tx_proof_validator.ts index 2bf3b1d45081..0d7b2351a722 100644 --- a/yarn-project/p2p/src/msg_validators/tx_validator/tx_proof_validator.ts +++ b/yarn-project/p2p/src/msg_validators/tx_validator/tx_proof_validator.ts @@ -1,9 +1,5 @@ -import { - type ClientProtocolCircuitVerifier, - Tx, - type TxValidationResult, - type TxValidator, -} from '@aztec/circuit-types'; +import { Tx, type TxValidationResult, type TxValidator } from '@aztec/circuit-types'; +import { type ClientProtocolCircuitVerifier } from '@aztec/circuit-types/interfaces/server'; import { createLogger } from '@aztec/foundation/log'; export class TxProofValidator implements TxValidator { diff --git a/yarn-project/p2p/src/services/dummy_service.ts b/yarn-project/p2p/src/services/dummy_service.ts index 68d3167b766e..d18103df8309 100644 --- a/yarn-project/p2p/src/services/dummy_service.ts +++ b/yarn-project/p2p/src/services/dummy_service.ts @@ -1,4 +1,5 @@ -import type { BlockAttestation, BlockProposal, Gossipable, PeerInfo, TxHash } from '@aztec/circuit-types'; +import type { BlockAttestation, BlockProposal, Gossipable, TxHash } from '@aztec/circuit-types'; +import type { PeerInfo } from '@aztec/circuit-types/interfaces/server'; import type { PeerId } from '@libp2p/interface'; import EventEmitter from 'events'; diff --git a/yarn-project/p2p/src/services/libp2p/libp2p_service.ts b/yarn-project/p2p/src/services/libp2p/libp2p_service.ts index 45a5697d29be..95dd3292eb69 100644 --- a/yarn-project/p2p/src/services/libp2p/libp2p_service.ts +++ b/yarn-project/p2p/src/services/libp2p/libp2p_service.ts @@ -1,22 +1,24 @@ import { BlockAttestation, BlockProposal, - type ClientProtocolCircuitVerifier, type Gossipable, type L2BlockSource, MerkleTreeId, P2PClientType, PeerErrorSeverity, - type PeerInfo, type RawGossipMessage, TopicTypeMap, Tx, type TxHash, type TxValidationResult, - type WorldStateSynchronizer, getTopicTypeForClientType, metricsTopicStrToLabels, } from '@aztec/circuit-types'; +import { + type ClientProtocolCircuitVerifier, + type PeerInfo, + type WorldStateSynchronizer, +} from '@aztec/circuit-types/interfaces/server'; import { Fr } from '@aztec/circuits.js'; import { type EpochCacheInterface } from '@aztec/epoch-cache'; import { createLibp2pComponentLogger, createLogger } from '@aztec/foundation/log'; diff --git a/yarn-project/p2p/src/services/peer-manager/peer_manager.ts b/yarn-project/p2p/src/services/peer-manager/peer_manager.ts index 4c4c9eb5993d..fdca0a7cc2cd 100644 --- a/yarn-project/p2p/src/services/peer-manager/peer_manager.ts +++ b/yarn-project/p2p/src/services/peer-manager/peer_manager.ts @@ -1,4 +1,5 @@ -import { type PeerErrorSeverity, type PeerInfo } from '@aztec/circuit-types'; +import { type PeerErrorSeverity } from '@aztec/circuit-types'; +import { type PeerInfo } from '@aztec/circuit-types/interfaces/server'; import { createLogger } from '@aztec/foundation/log'; import { type TelemetryClient, trackSpan } from '@aztec/telemetry-client'; diff --git a/yarn-project/p2p/src/services/reqresp/reqresp.test.ts b/yarn-project/p2p/src/services/reqresp/reqresp.test.ts index 50693859a100..fa7eeece7f97 100644 --- a/yarn-project/p2p/src/services/reqresp/reqresp.test.ts +++ b/yarn-project/p2p/src/services/reqresp/reqresp.test.ts @@ -1,4 +1,5 @@ -import { L2Block, type L2BlockSource, PeerErrorSeverity, TxHash, mockTx } from '@aztec/circuit-types'; +import { L2Block, type L2BlockSource, PeerErrorSeverity, TxHash } from '@aztec/circuit-types'; +import { mockTx } from '@aztec/circuit-types/testing'; import { Fr } from '@aztec/foundation/fields'; import { createLogger } from '@aztec/foundation/log'; import { sleep } from '@aztec/foundation/sleep'; diff --git a/yarn-project/p2p/src/services/service.ts b/yarn-project/p2p/src/services/service.ts index d911b5699bbd..de86a98bcf42 100644 --- a/yarn-project/p2p/src/services/service.ts +++ b/yarn-project/p2p/src/services/service.ts @@ -1,4 +1,5 @@ -import type { BlockAttestation, BlockProposal, Gossipable, PeerInfo } from '@aztec/circuit-types'; +import type { BlockAttestation, BlockProposal, Gossipable } from '@aztec/circuit-types'; +import type { PeerInfo } from '@aztec/circuit-types/interfaces/server'; import type { ENR } from '@chainsafe/enr'; import type { PeerId } from '@libp2p/interface'; diff --git a/yarn-project/p2p/src/test-helpers/make-test-p2p-clients.ts b/yarn-project/p2p/src/test-helpers/make-test-p2p-clients.ts index cce4f99be305..355602096412 100644 --- a/yarn-project/p2p/src/test-helpers/make-test-p2p-clients.ts +++ b/yarn-project/p2p/src/test-helpers/make-test-p2p-clients.ts @@ -1,5 +1,6 @@ import { MockL2BlockSource } from '@aztec/archiver/test'; -import { P2PClientType, type WorldStateSynchronizer } from '@aztec/circuit-types'; +import { P2PClientType } from '@aztec/circuit-types'; +import { type WorldStateSynchronizer } from '@aztec/circuit-types/interfaces/server'; import { type EpochCache } from '@aztec/epoch-cache'; import { type Logger, createLogger } from '@aztec/foundation/log'; import { type DataStoreConfig } from '@aztec/kv-store/config'; diff --git a/yarn-project/p2p/src/test-helpers/reqresp-nodes.ts b/yarn-project/p2p/src/test-helpers/reqresp-nodes.ts index 7211ba4144ce..6a88f07df718 100644 --- a/yarn-project/p2p/src/test-helpers/reqresp-nodes.ts +++ b/yarn-project/p2p/src/test-helpers/reqresp-nodes.ts @@ -1,11 +1,9 @@ +import { type L2BlockSource, type P2PClientType, type Tx } from '@aztec/circuit-types'; +import { type ChainConfig, emptyChainConfig } from '@aztec/circuit-types/config'; import { type ClientProtocolCircuitVerifier, - type L2BlockSource, - type P2PClientType, - type Tx, type WorldStateSynchronizer, -} from '@aztec/circuit-types'; -import { type ChainConfig, emptyChainConfig } from '@aztec/circuit-types/config'; +} from '@aztec/circuit-types/interfaces/server'; import { type EpochCache } from '@aztec/epoch-cache'; import { timesParallel } from '@aztec/foundation/collection'; import { type DataStoreConfig } from '@aztec/kv-store/config'; diff --git a/yarn-project/p2p/src/testbench/p2p_client_testbench_worker.ts b/yarn-project/p2p/src/testbench/p2p_client_testbench_worker.ts index 53827c90696a..999ff7528c1a 100644 --- a/yarn-project/p2p/src/testbench/p2p_client_testbench_worker.ts +++ b/yarn-project/p2p/src/testbench/p2p_client_testbench_worker.ts @@ -4,7 +4,8 @@ * Used when running testbench commands */ import { MockL2BlockSource } from '@aztec/archiver/test'; -import { P2PClientType, Tx, TxStatus, type WorldStateSynchronizer } from '@aztec/circuit-types'; +import { P2PClientType, Tx, TxStatus } from '@aztec/circuit-types'; +import { type WorldStateSynchronizer } from '@aztec/circuit-types/interfaces/server'; import { type EpochCacheInterface } from '@aztec/epoch-cache'; import { EthAddress } from '@aztec/foundation/eth-address'; import { createLogger } from '@aztec/foundation/log'; diff --git a/yarn-project/p2p/src/testbench/testbench.test.ts b/yarn-project/p2p/src/testbench/testbench.test.ts index b1de773d22bb..9dda681e7df0 100644 --- a/yarn-project/p2p/src/testbench/testbench.test.ts +++ b/yarn-project/p2p/src/testbench/testbench.test.ts @@ -7,7 +7,7 @@ import { type ChildProcess, fork } from 'child_process'; import path from 'path'; import { fileURLToPath } from 'url'; -import { mockTx } from '../../../circuit-types/src/mocks.js'; +import { mockTx } from '../../../circuit-types/src/test/mocks.js'; import { type P2PConfig, getP2PDefaultConfig } from '../config.js'; import { generatePeerIdPrivateKeys } from '../test-helpers/generate-peer-id-private-keys.js'; import { getPorts } from '../test-helpers/get-ports.js'; diff --git a/yarn-project/p2p/tsconfig.json b/yarn-project/p2p/tsconfig.json index 7e9b08f997f8..9de93f66fc53 100644 --- a/yarn-project/p2p/tsconfig.json +++ b/yarn-project/p2p/tsconfig.json @@ -12,6 +12,9 @@ { "path": "../circuits.js" }, + { + "path": "../constants" + }, { "path": "../epoch-cache" }, diff --git a/yarn-project/package.json b/yarn-project/package.json index 7e51096b2413..5c4a108b4e52 100644 --- a/yarn-project/package.json +++ b/yarn-project/package.json @@ -36,6 +36,7 @@ "circuit-types", "cli", "cli-wallet", + "constants", "docs", "end-to-end", "entrypoints", diff --git a/yarn-project/protocol-contracts/package.json b/yarn-project/protocol-contracts/package.json index 2c48007602cd..fddec7f97455 100644 --- a/yarn-project/protocol-contracts/package.json +++ b/yarn-project/protocol-contracts/package.json @@ -70,6 +70,7 @@ }, "dependencies": { "@aztec/circuits.js": "workspace:^", + "@aztec/constants": "workspace:^", "@aztec/foundation": "workspace:^", "@aztec/types": "workspace:^", "lodash.chunk": "^4.2.0", diff --git a/yarn-project/protocol-contracts/src/auth-registry/index.ts b/yarn-project/protocol-contracts/src/auth-registry/index.ts index fd0ca2f05db5..2cb086a1206b 100644 --- a/yarn-project/protocol-contracts/src/auth-registry/index.ts +++ b/yarn-project/protocol-contracts/src/auth-registry/index.ts @@ -1,5 +1,5 @@ -import { loadContractArtifact } from '@aztec/types/abi'; -import { type NoirCompiledContract } from '@aztec/types/noir'; +import { loadContractArtifact } from '@aztec/circuits.js/abi'; +import { type NoirCompiledContract } from '@aztec/circuits.js/noir'; import AuthRegistryJson from '../../artifacts/AuthRegistry.json' assert { type: 'json' }; import { makeProtocolContract } from '../make_protocol_contract.js'; 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 7adc5c386688..834fdaf6327d 100644 --- a/yarn-project/protocol-contracts/src/build_protocol_contract_tree.ts +++ b/yarn-project/protocol-contracts/src/build_protocol_contract_tree.ts @@ -1,13 +1,9 @@ -import { - type AztecAddress, - type Fr, - type IndexedMerkleTree, - IndexedMerkleTreeCalculator, - MAX_PROTOCOL_CONTRACTS, - PROTOCOL_CONTRACT_TREE_HEIGHT, - ProtocolContractLeafPreimage, -} from '@aztec/circuits.js'; +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'; export async function buildProtocolContractTree( contracts: { address: AztecAddress; leaf: Fr }[], diff --git a/yarn-project/protocol-contracts/src/bundle/index.ts b/yarn-project/protocol-contracts/src/bundle/index.ts index cf27c11b79dc..7ab40e82347b 100644 --- a/yarn-project/protocol-contracts/src/bundle/index.ts +++ b/yarn-project/protocol-contracts/src/bundle/index.ts @@ -1,5 +1,5 @@ import { getContractClassFromArtifact, getContractInstanceFromDeployParams } from '@aztec/circuits.js'; -import { type ContractArtifact } from '@aztec/foundation/abi'; +import { type ContractArtifact } from '@aztec/circuits.js/abi'; import { AuthRegistryArtifact } from '../auth-registry/index.js'; import { ContractClassRegistererArtifact } from '../class-registerer/index.js'; diff --git a/yarn-project/protocol-contracts/src/class-registerer/contract_class_registered_event.ts b/yarn-project/protocol-contracts/src/class-registerer/contract_class_registered_event.ts index 9f9a9caeb17c..4eb53fe221f6 100644 --- a/yarn-project/protocol-contracts/src/class-registerer/contract_class_registered_event.ts +++ b/yarn-project/protocol-contracts/src/class-registerer/contract_class_registered_event.ts @@ -1,11 +1,11 @@ import { type ContractClassPublic, - PUBLIC_DISPATCH_SELECTOR, type PublicFunction, computeContractClassId, computePublicBytecodeCommitment, } from '@aztec/circuits.js'; -import { FunctionSelector, bufferFromFields } from '@aztec/foundation/abi'; +import { FunctionSelector, bufferFromFields } from '@aztec/circuits.js/abi'; +import { PUBLIC_DISPATCH_SELECTOR } from '@aztec/constants'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader } from '@aztec/foundation/serialize'; diff --git a/yarn-project/protocol-contracts/src/class-registerer/index.ts b/yarn-project/protocol-contracts/src/class-registerer/index.ts index 17dc8e3891f0..c1fb4f9517c8 100644 --- a/yarn-project/protocol-contracts/src/class-registerer/index.ts +++ b/yarn-project/protocol-contracts/src/class-registerer/index.ts @@ -1,5 +1,5 @@ -import { loadContractArtifact } from '@aztec/types/abi'; -import { type NoirCompiledContract } from '@aztec/types/noir'; +import { loadContractArtifact } from '@aztec/circuits.js/abi'; +import { type NoirCompiledContract } from '@aztec/circuits.js/noir'; import ContractClassRegistererJson from '../../artifacts/ContractClassRegisterer.json' assert { type: 'json' }; import { makeProtocolContract } from '../make_protocol_contract.js'; diff --git a/yarn-project/protocol-contracts/src/class-registerer/private_function_broadcasted_event.ts b/yarn-project/protocol-contracts/src/class-registerer/private_function_broadcasted_event.ts index 8a30be9c346b..00fd561edfd0 100644 --- a/yarn-project/protocol-contracts/src/class-registerer/private_function_broadcasted_event.ts +++ b/yarn-project/protocol-contracts/src/class-registerer/private_function_broadcasted_event.ts @@ -1,12 +1,11 @@ +import { type ExecutablePrivateFunctionWithMembershipProof, type PrivateFunction } from '@aztec/circuits.js'; +import { FunctionSelector, bufferFromFields } from '@aztec/circuits.js/abi'; import { ARTIFACT_FUNCTION_TREE_MAX_HEIGHT, - type ExecutablePrivateFunctionWithMembershipProof, FUNCTION_TREE_HEIGHT, MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS, - type PrivateFunction, REGISTERER_PRIVATE_FUNCTION_BROADCASTED_ADDITIONAL_FIELDS, -} from '@aztec/circuits.js'; -import { FunctionSelector, bufferFromFields } from '@aztec/foundation/abi'; +} from '@aztec/constants'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader, type Tuple } from '@aztec/foundation/serialize'; diff --git a/yarn-project/protocol-contracts/src/class-registerer/unconstrained_function_broadcasted_event.test.ts b/yarn-project/protocol-contracts/src/class-registerer/unconstrained_function_broadcasted_event.test.ts index db3ae210eabe..2163b296b90a 100644 --- a/yarn-project/protocol-contracts/src/class-registerer/unconstrained_function_broadcasted_event.test.ts +++ b/yarn-project/protocol-contracts/src/class-registerer/unconstrained_function_broadcasted_event.test.ts @@ -1,4 +1,4 @@ -import { FunctionSelector } from '@aztec/foundation/abi'; +import { FunctionSelector } from '@aztec/circuits.js/abi'; import { randomBytes } from '@aztec/foundation/crypto'; import { Fr } from '@aztec/foundation/fields'; import { type Tuple } from '@aztec/foundation/serialize'; diff --git a/yarn-project/protocol-contracts/src/class-registerer/unconstrained_function_broadcasted_event.ts b/yarn-project/protocol-contracts/src/class-registerer/unconstrained_function_broadcasted_event.ts index 0bc22385f077..e65cf3c35ad4 100644 --- a/yarn-project/protocol-contracts/src/class-registerer/unconstrained_function_broadcasted_event.ts +++ b/yarn-project/protocol-contracts/src/class-registerer/unconstrained_function_broadcasted_event.ts @@ -1,11 +1,10 @@ +import { type UnconstrainedFunction, type UnconstrainedFunctionWithMembershipProof } from '@aztec/circuits.js'; +import { FunctionSelector, bufferFromFields } from '@aztec/circuits.js/abi'; import { ARTIFACT_FUNCTION_TREE_MAX_HEIGHT, MAX_PACKED_BYTECODE_SIZE_PER_UNCONSTRAINED_FUNCTION_IN_FIELDS, REGISTERER_UNCONSTRAINED_FUNCTION_BROADCASTED_ADDITIONAL_FIELDS, - type UnconstrainedFunction, - type UnconstrainedFunctionWithMembershipProof, -} from '@aztec/circuits.js'; -import { FunctionSelector, bufferFromFields } from '@aztec/foundation/abi'; +} from '@aztec/constants'; import { removeArrayPaddingEnd } from '@aztec/foundation/collection'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader, type Tuple } from '@aztec/foundation/serialize'; diff --git a/yarn-project/protocol-contracts/src/fee-juice/index.ts b/yarn-project/protocol-contracts/src/fee-juice/index.ts index ed66b93ccb73..77e5c9b31212 100644 --- a/yarn-project/protocol-contracts/src/fee-juice/index.ts +++ b/yarn-project/protocol-contracts/src/fee-juice/index.ts @@ -1,8 +1,8 @@ +import { loadContractArtifact } from '@aztec/circuits.js/abi'; 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 { loadContractArtifact } from '@aztec/types/abi'; -import { type NoirCompiledContract } from '@aztec/types/noir'; import FeeJuiceJson from '../../artifacts/FeeJuice.json' assert { type: 'json' }; import { makeProtocolContract } from '../make_protocol_contract.js'; diff --git a/yarn-project/protocol-contracts/src/instance-deployer/index.ts b/yarn-project/protocol-contracts/src/instance-deployer/index.ts index 28d61b72f7cc..f0b1d138bbab 100644 --- a/yarn-project/protocol-contracts/src/instance-deployer/index.ts +++ b/yarn-project/protocol-contracts/src/instance-deployer/index.ts @@ -1,5 +1,5 @@ -import { loadContractArtifact } from '@aztec/types/abi'; -import { type NoirCompiledContract } from '@aztec/types/noir'; +import { loadContractArtifact } from '@aztec/circuits.js/abi'; +import { type NoirCompiledContract } from '@aztec/circuits.js/noir'; import ContractInstanceDeployerJson from '../../artifacts/ContractInstanceDeployer.json' assert { type: 'json' }; import { makeProtocolContract } from '../make_protocol_contract.js'; diff --git a/yarn-project/protocol-contracts/src/make_protocol_contract.ts b/yarn-project/protocol-contracts/src/make_protocol_contract.ts index 53dc83b7496b..24f613e423ad 100644 --- a/yarn-project/protocol-contracts/src/make_protocol_contract.ts +++ b/yarn-project/protocol-contracts/src/make_protocol_contract.ts @@ -1,5 +1,5 @@ -import { getContractClassFromArtifact, getContractInstanceFromDeployParams } from '@aztec/circuits.js'; -import { type ContractArtifact } from '@aztec/foundation/abi'; +import { type ContractArtifact } from '@aztec/circuits.js/abi'; +import { getContractClassFromArtifact, getContractInstanceFromDeployParams } from '@aztec/circuits.js/contract'; import { type ProtocolContract } from './protocol_contract.js'; import { ProtocolContractAddress, type ProtocolContractName, ProtocolContractSalt } from './protocol_contract_data.js'; diff --git a/yarn-project/protocol-contracts/src/multi-call-entrypoint/index.ts b/yarn-project/protocol-contracts/src/multi-call-entrypoint/index.ts index edfc9b71234b..ffc6d35e5c73 100644 --- a/yarn-project/protocol-contracts/src/multi-call-entrypoint/index.ts +++ b/yarn-project/protocol-contracts/src/multi-call-entrypoint/index.ts @@ -1,5 +1,5 @@ -import { loadContractArtifact } from '@aztec/types/abi'; -import { type NoirCompiledContract } from '@aztec/types/noir'; +import { loadContractArtifact } from '@aztec/circuits.js/abi'; +import { type NoirCompiledContract } from '@aztec/circuits.js/noir'; import MultiCallEntrypointJson from '../../artifacts/MultiCallEntrypoint.json' assert { type: 'json' }; import { makeProtocolContract } from '../make_protocol_contract.js'; diff --git a/yarn-project/protocol-contracts/src/protocol_contract.ts b/yarn-project/protocol-contracts/src/protocol_contract.ts index 96e8d69e987f..331801c6f5bc 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, type ContractClassIdPreimage, type ContractClassWithId, type ContractInstanceWithAddress, -} from '@aztec/circuits.js'; -import { type ContractArtifact } from '@aztec/foundation/abi'; +} 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 5b275a3f2470..a8e87ad24499 100644 --- a/yarn-project/protocol-contracts/src/protocol_contract_tree.ts +++ b/yarn-project/protocol-contracts/src/protocol_contract_tree.ts @@ -1,10 +1,8 @@ -import { - type AztecAddress, - type IndexedMerkleTree, - type PROTOCOL_CONTRACT_TREE_HEIGHT, - type ProtocolContractLeafPreimage, -} from '@aztec/circuits.js'; +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'; import { buildProtocolContractTree } from './build_protocol_contract_tree.js'; import { isProtocolContract } from './protocol_contract.js'; diff --git a/yarn-project/protocol-contracts/src/router/index.ts b/yarn-project/protocol-contracts/src/router/index.ts index a90209e8faf7..2f579548f876 100644 --- a/yarn-project/protocol-contracts/src/router/index.ts +++ b/yarn-project/protocol-contracts/src/router/index.ts @@ -1,5 +1,5 @@ -import { loadContractArtifact } from '@aztec/types/abi'; -import { type NoirCompiledContract } from '@aztec/types/noir'; +import { loadContractArtifact } from '@aztec/circuits.js/abi'; +import { type NoirCompiledContract } from '@aztec/circuits.js/noir'; import RouterJson from '../../artifacts/Router.json' assert { type: 'json' }; import { makeProtocolContract } from '../make_protocol_contract.js'; diff --git a/yarn-project/protocol-contracts/src/scripts/generate_data.ts b/yarn-project/protocol-contracts/src/scripts/generate_data.ts index e518047ceb28..17df472ea518 100644 --- a/yarn-project/protocol-contracts/src/scripts/generate_data.ts +++ b/yarn-project/protocol-contracts/src/scripts/generate_data.ts @@ -1,23 +1,21 @@ +import { AztecAddress, Fr, getContractInstanceFromDeployParams } from '@aztec/circuits.js'; +import { loadContractArtifact } from '@aztec/circuits.js/abi'; +import { type NoirCompiledContract } from '@aztec/circuits.js/noir'; import { - AztecAddress, CANONICAL_AUTH_REGISTRY_ADDRESS, DEPLOYER_CONTRACT_ADDRESS, DEPLOYER_CONTRACT_INSTANCE_DEPLOYED_MAGIC_VALUE, DEPLOYER_CONTRACT_INSTANCE_UPDATED_MAGIC_VALUE, FEE_JUICE_ADDRESS, - Fr, MULTI_CALL_ENTRYPOINT_ADDRESS, REGISTERER_CONTRACT_ADDRESS, REGISTERER_CONTRACT_CLASS_REGISTERED_MAGIC_VALUE, REGISTERER_PRIVATE_FUNCTION_BROADCASTED_MAGIC_VALUE, REGISTERER_UNCONSTRAINED_FUNCTION_BROADCASTED_MAGIC_VALUE, ROUTER_ADDRESS, - getContractInstanceFromDeployParams, -} from '@aztec/circuits.js'; +} from '@aztec/constants'; import { poseidon2Hash } from '@aztec/foundation/crypto'; import { createConsoleLogger } from '@aztec/foundation/log'; -import { loadContractArtifact } from '@aztec/types/abi'; -import { type NoirCompiledContract } from '@aztec/types/noir'; import { promises as fs } from 'fs'; import path from 'path'; @@ -81,7 +79,7 @@ async function computeRoot(names: string[], leaves: Fr[]) { async function generateDeclarationFile(destName: string) { const content = ` - import { type NoirCompiledContract } from '@aztec/types/noir'; + import { type NoirCompiledContract } from '@aztec/circuits.js/noir'; const circuit: NoirCompiledContract; export = circuit; `; @@ -146,7 +144,8 @@ async function generateLogTags() { async function generateOutputFile(names: string[], leaves: Fr[]) { const content = ` // GENERATED FILE - DO NOT EDIT. RUN \`yarn generate\` or \`yarn generate:data\` - import { AztecAddress, Fr } from '@aztec/circuits.js'; + import { Fr } from '@aztec/foundation/fields'; + import { AztecAddress } from '@aztec/foundation/aztec-address'; ${generateNames(names)} diff --git a/yarn-project/protocol-contracts/tsconfig.json b/yarn-project/protocol-contracts/tsconfig.json index db070c81cb12..24291d4d313b 100644 --- a/yarn-project/protocol-contracts/tsconfig.json +++ b/yarn-project/protocol-contracts/tsconfig.json @@ -9,6 +9,9 @@ { "path": "../circuits.js" }, + { + "path": "../constants" + }, { "path": "../foundation" }, diff --git a/yarn-project/prover-client/package.json b/yarn-project/prover-client/package.json index af69d02e1ee5..e51df6623cbe 100644 --- a/yarn-project/prover-client/package.json +++ b/yarn-project/prover-client/package.json @@ -70,6 +70,7 @@ "@aztec/blob-lib": "workspace:^", "@aztec/circuit-types": "workspace:^", "@aztec/circuits.js": "workspace:^", + "@aztec/constants": "workspace:^", "@aztec/foundation": "workspace:^", "@aztec/kv-store": "workspace:^", "@aztec/noir-protocol-circuits-types": "workspace:^", diff --git a/yarn-project/prover-client/src/bin/get-proof-inputs.ts b/yarn-project/prover-client/src/bin/get-proof-inputs.ts index d5c194f2ba2f..e69d8692b319 100644 --- a/yarn-project/prover-client/src/bin/get-proof-inputs.ts +++ b/yarn-project/prover-client/src/bin/get-proof-inputs.ts @@ -1,6 +1,6 @@ /* eslint-disable no-console */ import { AVM_HINTS_FILENAME, AVM_PUBLIC_INPUTS_FILENAME } from '@aztec/bb-prover'; -import { type ProofUri, ProvingJobInputs, ProvingRequestType } from '@aztec/circuit-types'; +import { type ProofUri, ProvingJobInputs, ProvingRequestType } from '@aztec/circuit-types/interfaces/server'; import { jsonParseWithSchema, jsonStringify } from '@aztec/foundation/json-rpc'; import { createLogger } from '@aztec/foundation/log'; diff --git a/yarn-project/prover-client/src/block_builder/index.ts b/yarn-project/prover-client/src/block_builder/index.ts index b91a260888b3..8bbddf197ed1 100644 --- a/yarn-project/prover-client/src/block_builder/index.ts +++ b/yarn-project/prover-client/src/block_builder/index.ts @@ -1,4 +1,4 @@ -import { type BlockBuilder, type MerkleTreeReadOperations } from '@aztec/circuit-types'; +import { type BlockBuilder, type MerkleTreeReadOperations } from '@aztec/circuit-types/interfaces/server'; export * from './light.js'; export interface BlockBuilderFactory { diff --git a/yarn-project/prover-client/src/block_builder/light.test.ts b/yarn-project/prover-client/src/block_builder/light.test.ts index 7019aae88b64..c80803958a78 100644 --- a/yarn-project/prover-client/src/block_builder/light.test.ts +++ b/yarn-project/prover-client/src/block_builder/light.test.ts @@ -1,43 +1,24 @@ import { TestCircuitProver } from '@aztec/bb-prover'; -import { Blob } from '@aztec/blob-lib'; +import { Blob, SpongeBlob } from '@aztec/blob-lib'; +import { MerkleTreeId, type ProcessedTx, toNumBlobFields } from '@aztec/circuit-types'; +import { type MerkleTreeWriteOperations, type ServerCircuitProver } from '@aztec/circuit-types/interfaces/server'; +import { makeBloatedProcessedTx } from '@aztec/circuit-types/testing'; import { - MerkleTreeId, - type MerkleTreeWriteOperations, - type ProcessedTx, - type ServerCircuitProver, - toNumBlobFields, -} from '@aztec/circuit-types'; -import { makeBloatedProcessedTx } from '@aztec/circuit-types/test'; -import { - type AppendOnlyTreeSnapshot, AztecAddress, - BLOBS_PER_BLOCK, BaseParityInputs, - FIELDS_PER_BLOB, Fr, type GlobalVariables, - L1_TO_L2_MSG_SUBTREE_HEIGHT, - L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH, - MembershipWitness, - NESTED_RECURSIVE_PROOF_LENGTH, - NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, - NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, - NUM_BASE_PARITY_PER_ROOT_PARITY, type ParityPublicInputs, PartialStateReference, - PublicDataTreeLeaf, PublicDataWrite, type RecursiveProof, RootParityInput, RootParityInputs, StateReference, - TUBE_VK_INDEX, - VK_TREE_HEIGHT, type VerificationKeyAsFields, VkWitnessData, makeEmptyRecursiveProof, } from '@aztec/circuits.js'; -import { SpongeBlob } from '@aztec/circuits.js/blobs'; import { type BaseOrMergeRollupPublicInputs, BlockRootRollupBlobData, @@ -53,10 +34,24 @@ import { SingleTxBlockRootRollupInputs, } from '@aztec/circuits.js/rollup'; import { makeGlobalVariables } from '@aztec/circuits.js/testing'; +import { type AppendOnlyTreeSnapshot, PublicDataTreeLeaf } from '@aztec/circuits.js/trees'; +import { + BLOBS_PER_BLOCK, + FIELDS_PER_BLOB, + L1_TO_L2_MSG_SUBTREE_HEIGHT, + L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH, + NESTED_RECURSIVE_PROOF_LENGTH, + NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, + NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, + NUM_BASE_PARITY_PER_ROOT_PARITY, + TUBE_VK_INDEX, + VK_TREE_HEIGHT, +} from '@aztec/constants'; import { padArrayEnd, times, timesParallel } from '@aztec/foundation/collection'; import { sha256ToField } from '@aztec/foundation/crypto'; import { type Logger, createLogger } from '@aztec/foundation/log'; import { type Tuple, assertLength } from '@aztec/foundation/serialize'; +import { MembershipWitness } from '@aztec/foundation/trees'; import { ProtocolCircuitVks, TubeVk, diff --git a/yarn-project/prover-client/src/block_builder/light.ts b/yarn-project/prover-client/src/block_builder/light.ts index 6d1556423863..498b9a518724 100644 --- a/yarn-project/prover-client/src/block_builder/light.ts +++ b/yarn-project/prover-client/src/block_builder/light.ts @@ -1,13 +1,8 @@ -import { - type BlockBuilder, - L2Block, - MerkleTreeId, - type MerkleTreeWriteOperations, - type ProcessedTx, - toNumBlobFields, -} from '@aztec/circuit-types'; -import { Fr, type GlobalVariables, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/circuits.js'; -import { SpongeBlob } from '@aztec/circuits.js/blobs'; +import { SpongeBlob } from '@aztec/blob-lib'; +import { L2Block, MerkleTreeId, type ProcessedTx, toNumBlobFields } from '@aztec/circuit-types'; +import { type BlockBuilder, type MerkleTreeWriteOperations } from '@aztec/circuit-types/interfaces/server'; +import { Fr, type GlobalVariables } from '@aztec/circuits.js'; +import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants'; import { padArrayEnd } from '@aztec/foundation/collection'; import { createLogger } from '@aztec/foundation/log'; import { type TelemetryClient, getTelemetryClient } from '@aztec/telemetry-client'; diff --git a/yarn-project/prover-client/src/config.ts b/yarn-project/prover-client/src/config.ts index a2abb77ef963..e82cae4862ef 100644 --- a/yarn-project/prover-client/src/config.ts +++ b/yarn-project/prover-client/src/config.ts @@ -1,5 +1,5 @@ import { type ACVMConfig, type BBConfig } from '@aztec/bb-prover'; -import { type ProverConfig, proverConfigMappings } from '@aztec/circuit-types'; +import { type ProverConfig, proverConfigMappings } from '@aztec/circuit-types/interfaces/server'; import { type ConfigMappingsType, booleanConfigHelper, getConfigFromMappings } from '@aztec/foundation/config'; import { diff --git a/yarn-project/prover-client/src/index.ts b/yarn-project/prover-client/src/index.ts index 02bd6a82278d..97c26111cf63 100644 --- a/yarn-project/prover-client/src/index.ts +++ b/yarn-project/prover-client/src/index.ts @@ -1,4 +1,4 @@ -export type { EpochProverManager } from '@aztec/circuit-types'; +export type { EpochProverManager } from '@aztec/circuit-types/interfaces/server'; export * from './prover-client/index.js'; export * from './config.js'; diff --git a/yarn-project/prover-client/src/mocks/fixtures.ts b/yarn-project/prover-client/src/mocks/fixtures.ts index 97a683b12343..cdcf70f32b53 100644 --- a/yarn-project/prover-client/src/mocks/fixtures.ts +++ b/yarn-project/prover-client/src/mocks/fixtures.ts @@ -1,14 +1,7 @@ -import { MerkleTreeId, type MerkleTreeWriteOperations, type ProcessedTx } from '@aztec/circuit-types'; -import { - AztecAddress, - EthAddress, - Fr, - GasFees, - GlobalVariables, - MAX_NOTE_HASHES_PER_TX, - MAX_NULLIFIERS_PER_TX, - NULLIFIER_TREE_HEIGHT, -} from '@aztec/circuits.js'; +import { MerkleTreeId, type ProcessedTx } from '@aztec/circuit-types'; +import { type MerkleTreeWriteOperations } from '@aztec/circuit-types/interfaces/server'; +import { AztecAddress, EthAddress, Fr, GasFees, GlobalVariables } from '@aztec/circuits.js'; +import { MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, NULLIFIER_TREE_HEIGHT } from '@aztec/constants'; import { padArrayEnd } from '@aztec/foundation/collection'; import { randomBytes } from '@aztec/foundation/crypto'; import { type Logger } from '@aztec/foundation/log'; diff --git a/yarn-project/prover-client/src/mocks/test_context.ts b/yarn-project/prover-client/src/mocks/test_context.ts index b249cc76bae7..6aa4860822d7 100644 --- a/yarn-project/prover-client/src/mocks/test_context.ts +++ b/yarn-project/prover-client/src/mocks/test_context.ts @@ -1,22 +1,16 @@ import { type BBProverConfig } from '@aztec/bb-prover'; +import { type L2Block, type ProcessedTx, type PublicExecutionRequest, type Tx } from '@aztec/circuit-types'; +import { type ServerCircuitProver } from '@aztec/circuit-types/interfaces/server'; +import { makeBloatedProcessedTx } from '@aztec/circuit-types/testing'; import { - type L2Block, - type ProcessedTx, - type PublicExecutionRequest, - type ServerCircuitProver, - type Tx, -} from '@aztec/circuit-types'; -import { makeBloatedProcessedTx } from '@aztec/circuit-types/test'; -import { - type AppendOnlyTreeSnapshot, AztecAddress, type BlockHeader, type Gas, type GlobalVariables, - PublicDataTreeLeaf, PublicDataWrite, TreeSnapshots, } from '@aztec/circuits.js'; +import { type AppendOnlyTreeSnapshot, PublicDataTreeLeaf } from '@aztec/circuits.js/trees'; 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/block-building-helpers.ts b/yarn-project/prover-client/src/orchestrator/block-building-helpers.ts index bb525b83f979..23f32b8f8357 100644 --- a/yarn-project/prover-client/src/orchestrator/block-building-helpers.ts +++ b/yarn-project/prover-client/src/orchestrator/block-building-helpers.ts @@ -1,39 +1,16 @@ -import { Blob } from '@aztec/blob-lib'; +import { Blob, type SpongeBlob } from '@aztec/blob-lib'; +import { Body, MerkleTreeId, type ProcessedTx, TxEffect, getTreeHeight } from '@aztec/circuit-types'; +import { type MerkleTreeWriteOperations } from '@aztec/circuit-types/interfaces/server'; import { - Body, - MerkleTreeId, - type MerkleTreeWriteOperations, - type ProcessedTx, - TxEffect, - getTreeHeight, -} from '@aztec/circuit-types'; -import { - ARCHIVE_HEIGHT, - AppendOnlyTreeSnapshot, BlockHeader, ContentCommitment, Fr, type GlobalVariables, - MAX_NOTE_HASHES_PER_TX, - MAX_NULLIFIERS_PER_TX, - MembershipWitness, - MerkleTreeCalculator, - NOTE_HASH_SUBTREE_HEIGHT, - NOTE_HASH_SUBTREE_SIBLING_PATH_LENGTH, - NULLIFIER_SUBTREE_HEIGHT, - NULLIFIER_SUBTREE_SIBLING_PATH_LENGTH, - NULLIFIER_TREE_HEIGHT, - NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, - NullifierLeafPreimage, - PUBLIC_DATA_TREE_HEIGHT, type ParityPublicInputs, PartialStateReference, PublicDataHint, - PublicDataTreeLeaf, - PublicDataTreeLeafPreimage, StateReference, } from '@aztec/circuits.js'; -import { type SpongeBlob } from '@aztec/circuits.js/blobs'; import { type BaseOrMergeRollupPublicInputs, type BlockRootOrBlockMergePublicInputs, @@ -42,12 +19,30 @@ import { PrivateBaseStateDiffHints, PublicBaseRollupHints, } from '@aztec/circuits.js/rollup'; +import { + AppendOnlyTreeSnapshot, + NullifierLeafPreimage, + PublicDataTreeLeaf, + PublicDataTreeLeafPreimage, +} from '@aztec/circuits.js/trees'; +import { + ARCHIVE_HEIGHT, + MAX_NOTE_HASHES_PER_TX, + MAX_NULLIFIERS_PER_TX, + NOTE_HASH_SUBTREE_HEIGHT, + NOTE_HASH_SUBTREE_SIBLING_PATH_LENGTH, + NULLIFIER_SUBTREE_HEIGHT, + NULLIFIER_SUBTREE_SIBLING_PATH_LENGTH, + NULLIFIER_TREE_HEIGHT, + NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, + PUBLIC_DATA_TREE_HEIGHT, +} from '@aztec/constants'; import { makeTuple } from '@aztec/foundation/array'; import { padArrayEnd } from '@aztec/foundation/collection'; import { sha256Trunc } from '@aztec/foundation/crypto'; import { type Logger } from '@aztec/foundation/log'; import { type Tuple, assertLength, serializeToBuffer, toFriendlyJSON } from '@aztec/foundation/serialize'; -import { computeUnbalancedMerkleRoot } from '@aztec/foundation/trees'; +import { MembershipWitness, MerkleTreeCalculator, computeUnbalancedMerkleRoot } from '@aztec/foundation/trees'; import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vks'; import { protocolContractTreeRoot } from '@aztec/protocol-contracts'; import { computeFeePayerBalanceLeafSlot } from '@aztec/protocol-contracts/fee-juice'; diff --git a/yarn-project/prover-client/src/orchestrator/block-proving-state.ts b/yarn-project/prover-client/src/orchestrator/block-proving-state.ts index 8b483a308bd0..5f6ebdb93499 100644 --- a/yarn-project/prover-client/src/orchestrator/block-proving-state.ts +++ b/yarn-project/prover-client/src/orchestrator/block-proving-state.ts @@ -1,25 +1,16 @@ -import { type L2Block, type MerkleTreeId, type PublicInputsAndRecursiveProof } from '@aztec/circuit-types'; +import { SpongeBlob } from '@aztec/blob-lib'; +import { type L2Block, type MerkleTreeId } from '@aztec/circuit-types'; +import { type PublicInputsAndRecursiveProof } from '@aztec/circuit-types/interfaces/server'; import { type CircuitName } from '@aztec/circuit-types/stats'; import { - type ARCHIVE_HEIGHT, - type AppendOnlyTreeSnapshot, - BLOBS_PER_BLOCK, type BlockHeader, - FIELDS_PER_BLOB, Fr, type GlobalVariables, - type L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH, - MembershipWitness, - type NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, - NUM_BASE_PARITY_PER_ROOT_PARITY, type ParityPublicInputs, - type RECURSIVE_PROOF_LENGTH, RootParityInput, RootParityInputs, StateReference, - VK_TREE_HEIGHT, } from '@aztec/circuits.js'; -import { SpongeBlob } from '@aztec/circuits.js/blobs'; import { type BaseOrMergeRollupPublicInputs, type BlockRootOrBlockMergePublicInputs, @@ -32,10 +23,21 @@ import { PreviousRollupData, SingleTxBlockRootRollupInputs, } from '@aztec/circuits.js/rollup'; +import { type AppendOnlyTreeSnapshot } from '@aztec/circuits.js/trees'; +import { + type ARCHIVE_HEIGHT, + BLOBS_PER_BLOCK, + FIELDS_PER_BLOB, + type L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH, + type NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, + NUM_BASE_PARITY_PER_ROOT_PARITY, + type RECURSIVE_PROOF_LENGTH, + VK_TREE_HEIGHT, +} from '@aztec/constants'; import { padArrayEnd } from '@aztec/foundation/collection'; import { type Logger } from '@aztec/foundation/log'; import { type Tuple } from '@aztec/foundation/serialize'; -import { type TreeNodeLocation, UnbalancedTreeStore } from '@aztec/foundation/trees'; +import { MembershipWitness, type TreeNodeLocation, UnbalancedTreeStore } from '@aztec/foundation/trees'; import { getVKIndex, getVKSiblingPath, getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vks'; import { protocolContractTreeRoot } from '@aztec/protocol-contracts'; diff --git a/yarn-project/prover-client/src/orchestrator/block_building_helpers.test.ts b/yarn-project/prover-client/src/orchestrator/block_building_helpers.test.ts index f73fa2219f97..49ec75057d6b 100644 --- a/yarn-project/prover-client/src/orchestrator/block_building_helpers.test.ts +++ b/yarn-project/prover-client/src/orchestrator/block_building_helpers.test.ts @@ -1,6 +1,6 @@ +import { BlobPublicInputs } from '@aztec/blob-lib'; import { TxEffect, TxHash } from '@aztec/circuit-types'; import { Fr } from '@aztec/circuits.js'; -import { BlobPublicInputs } from '@aztec/circuits.js/blobs'; import { updateInlineTestData } from '@aztec/foundation/testing/files'; import { buildBlobHints } from './block-building-helpers.js'; diff --git a/yarn-project/prover-client/src/orchestrator/epoch-proving-state.ts b/yarn-project/prover-client/src/orchestrator/epoch-proving-state.ts index c135e2c9f92c..bd84ab1dd921 100644 --- a/yarn-project/prover-client/src/orchestrator/epoch-proving-state.ts +++ b/yarn-project/prover-client/src/orchestrator/epoch-proving-state.ts @@ -1,20 +1,9 @@ +import { type MerkleTreeId } from '@aztec/circuit-types'; import { - type MerkleTreeId, type ProofAndVerificationKey, type PublicInputsAndRecursiveProof, -} from '@aztec/circuit-types'; -import { - type ARCHIVE_HEIGHT, - type AppendOnlyTreeSnapshot, - type BlockHeader, - type Fr, - type GlobalVariables, - type L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH, - MembershipWitness, - type NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, - type TUBE_PROOF_LENGTH, - VK_TREE_HEIGHT, -} from '@aztec/circuits.js'; +} from '@aztec/circuit-types/interfaces/server'; +import { type BlockHeader, type Fr, type GlobalVariables } from '@aztec/circuits.js'; import { BlockMergeRollupInputs, type BlockRootOrBlockMergePublicInputs, @@ -22,8 +11,16 @@ import { RootRollupInputs, type RootRollupPublicInputs, } from '@aztec/circuits.js/rollup'; +import { type AppendOnlyTreeSnapshot } from '@aztec/circuits.js/trees'; +import { + type ARCHIVE_HEIGHT, + type L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH, + type NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, + type TUBE_PROOF_LENGTH, + VK_TREE_HEIGHT, +} from '@aztec/constants'; import { type Tuple } from '@aztec/foundation/serialize'; -import { type TreeNodeLocation, UnbalancedTreeStore } from '@aztec/foundation/trees'; +import { MembershipWitness, type TreeNodeLocation, UnbalancedTreeStore } from '@aztec/foundation/trees'; import { getVKIndex, getVKSiblingPath } from '@aztec/noir-protocol-circuits-types/vks'; import { BlockProvingState } from './block-proving-state.js'; diff --git a/yarn-project/prover-client/src/orchestrator/orchestrator.ts b/yarn-project/prover-client/src/orchestrator/orchestrator.ts index e03f2aa9d37a..f55fc39d7778 100644 --- a/yarn-project/prover-client/src/orchestrator/orchestrator.ts +++ b/yarn-project/prover-client/src/orchestrator/orchestrator.ts @@ -1,31 +1,17 @@ -import { - L2Block, - MerkleTreeId, - type ProcessedTx, - type ServerCircuitProver, - type Tx, - toNumBlobFields, -} from '@aztec/circuit-types'; +import { L2Block, MerkleTreeId, type ProcessedTx, type Tx, toNumBlobFields } from '@aztec/circuit-types'; import { type EpochProver, type ForkMerkleTreeOperations, type MerkleTreeWriteOperations, type ProofAndVerificationKey, -} from '@aztec/circuit-types/interfaces'; + type ServerCircuitProver, +} from '@aztec/circuit-types/interfaces/server'; import { type CircuitName } from '@aztec/circuit-types/stats'; import { - AVM_PROOF_LENGTH_IN_FIELDS, - AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS, - type AppendOnlyTreeSnapshot, BaseParityInputs, type BlockHeader, Fr, type GlobalVariables, - L1_TO_L2_MSG_SUBTREE_HEIGHT, - L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH, - NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, - NUM_BASE_PARITY_PER_ROOT_PARITY, - type TUBE_PROOF_LENGTH, VerificationKeyData, makeEmptyRecursiveProof, } from '@aztec/circuits.js'; @@ -36,6 +22,16 @@ import { SingleTxBlockRootRollupInputs, TubeInputs, } from '@aztec/circuits.js/rollup'; +import { type AppendOnlyTreeSnapshot } from '@aztec/circuits.js/trees'; +import { + AVM_PROOF_LENGTH_IN_FIELDS, + AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS, + L1_TO_L2_MSG_SUBTREE_HEIGHT, + L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH, + NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, + NUM_BASE_PARITY_PER_ROOT_PARITY, + type TUBE_PROOF_LENGTH, +} from '@aztec/constants'; import { padArrayEnd, times } from '@aztec/foundation/collection'; import { AbortError } from '@aztec/foundation/error'; import { createLogger } from '@aztec/foundation/log'; diff --git a/yarn-project/prover-client/src/orchestrator/orchestrator_failures.test.ts b/yarn-project/prover-client/src/orchestrator/orchestrator_failures.test.ts index 04de6344e1b7..318c3faacd47 100644 --- a/yarn-project/prover-client/src/orchestrator/orchestrator_failures.test.ts +++ b/yarn-project/prover-client/src/orchestrator/orchestrator_failures.test.ts @@ -1,4 +1,4 @@ -import { type ServerCircuitProver } from '@aztec/circuit-types'; +import { type ServerCircuitProver } from '@aztec/circuit-types/interfaces/server'; import { timesAsync } from '@aztec/foundation/collection'; import { createLogger } from '@aztec/foundation/log'; diff --git a/yarn-project/prover-client/src/orchestrator/orchestrator_lifecycle.test.ts b/yarn-project/prover-client/src/orchestrator/orchestrator_lifecycle.test.ts index a290a4a6eeaa..520ba1137c75 100644 --- a/yarn-project/prover-client/src/orchestrator/orchestrator_lifecycle.test.ts +++ b/yarn-project/prover-client/src/orchestrator/orchestrator_lifecycle.test.ts @@ -1,5 +1,5 @@ -import { type ServerCircuitProver } from '@aztec/circuit-types'; -import { NUM_BASE_PARITY_PER_ROOT_PARITY } from '@aztec/circuits.js'; +import { type ServerCircuitProver } from '@aztec/circuit-types/interfaces/server'; +import { NUM_BASE_PARITY_PER_ROOT_PARITY } from '@aztec/constants'; import { createLogger } from '@aztec/foundation/log'; import { type PromiseWithResolvers, promiseWithResolvers } from '@aztec/foundation/promise'; import { sleep } from '@aztec/foundation/sleep'; diff --git a/yarn-project/prover-client/src/orchestrator/orchestrator_mixed_blocks.test.ts b/yarn-project/prover-client/src/orchestrator/orchestrator_mixed_blocks.test.ts index cc1ae11f4c5d..cd6016c43e52 100644 --- a/yarn-project/prover-client/src/orchestrator/orchestrator_mixed_blocks.test.ts +++ b/yarn-project/prover-client/src/orchestrator/orchestrator_mixed_blocks.test.ts @@ -1,5 +1,5 @@ -import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/circuits.js'; import { fr } from '@aztec/circuits.js/testing'; +import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants'; import { range } from '@aztec/foundation/array'; import { timesParallel } from '@aztec/foundation/collection'; import { createLogger } 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 9ace6e58d116..57aa39b9af9d 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,4 +1,4 @@ -import { mockTx } from '@aztec/circuit-types'; +import { mockTx } from '@aztec/circuit-types/testing'; import { timesParallel } from '@aztec/foundation/collection'; import { createLogger } from '@aztec/foundation/log'; import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vks'; diff --git a/yarn-project/prover-client/src/orchestrator/orchestrator_public_functions.test.ts b/yarn-project/prover-client/src/orchestrator/orchestrator_public_functions.test.ts index 8bdb07daecea..407b71bce40d 100644 --- a/yarn-project/prover-client/src/orchestrator/orchestrator_public_functions.test.ts +++ b/yarn-project/prover-client/src/orchestrator/orchestrator_public_functions.test.ts @@ -1,4 +1,4 @@ -import { mockTx } from '@aztec/circuit-types'; +import { mockTx } from '@aztec/circuit-types/testing'; import { createLogger } from '@aztec/foundation/log'; import { getTestData, isGenerateTestDataEnabled } from '@aztec/foundation/testing'; import { updateProtocolCircuitSampleInputs } from '@aztec/foundation/testing/files'; diff --git a/yarn-project/prover-client/src/orchestrator/orchestrator_single_blocks.test.ts b/yarn-project/prover-client/src/orchestrator/orchestrator_single_blocks.test.ts index c5fbd7986f77..42ca8299645f 100644 --- a/yarn-project/prover-client/src/orchestrator/orchestrator_single_blocks.test.ts +++ b/yarn-project/prover-client/src/orchestrator/orchestrator_single_blocks.test.ts @@ -1,5 +1,5 @@ -import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/circuits.js'; import { fr } from '@aztec/circuits.js/testing'; +import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants'; import { range } from '@aztec/foundation/array'; import { timesParallel } from '@aztec/foundation/collection'; import { createLogger } from '@aztec/foundation/log'; diff --git a/yarn-project/prover-client/src/orchestrator/orchestrator_workflow.test.ts b/yarn-project/prover-client/src/orchestrator/orchestrator_workflow.test.ts index 666189b3f230..27246d452e5a 100644 --- a/yarn-project/prover-client/src/orchestrator/orchestrator_workflow.test.ts +++ b/yarn-project/prover-client/src/orchestrator/orchestrator_workflow.test.ts @@ -1,21 +1,23 @@ +import { type Tx } from '@aztec/circuit-types'; import { type PublicInputsAndRecursiveProof, type ServerCircuitProver, - type Tx, makePublicInputsAndRecursiveProof, -} from '@aztec/circuit-types'; +} from '@aztec/circuit-types/interfaces/server'; import { type BlockHeader, ClientIvcProof, Fr, type GlobalVariables, - NESTED_RECURSIVE_PROOF_LENGTH, - NUM_BASE_PARITY_PER_ROOT_PARITY, type ParityPublicInputs, - RECURSIVE_PROOF_LENGTH, makeRecursiveProof, } from '@aztec/circuits.js'; import { makeParityPublicInputs } from '@aztec/circuits.js/testing'; +import { + NESTED_RECURSIVE_PROOF_LENGTH, + NUM_BASE_PARITY_PER_ROOT_PARITY, + RECURSIVE_PROOF_LENGTH, +} from '@aztec/constants'; import { createLogger } from '@aztec/foundation/log'; import { promiseWithResolvers } from '@aztec/foundation/promise'; import { sleep } from '@aztec/foundation/sleep'; diff --git a/yarn-project/prover-client/src/orchestrator/tx-proving-state.ts b/yarn-project/prover-client/src/orchestrator/tx-proving-state.ts index ebdca3931ca5..596fa93b36b4 100644 --- a/yarn-project/prover-client/src/orchestrator/tx-proving-state.ts +++ b/yarn-project/prover-client/src/orchestrator/tx-proving-state.ts @@ -1,13 +1,7 @@ -import { type MerkleTreeId, type ProcessedTx, type ProofAndVerificationKey } from '@aztec/circuit-types'; +import { type MerkleTreeId, type ProcessedTx } from '@aztec/circuit-types'; +import { type ProofAndVerificationKey } from '@aztec/circuit-types/interfaces/server'; import { type CircuitName } from '@aztec/circuit-types/stats'; -import { - type AVM_PROOF_LENGTH_IN_FIELDS, - AVM_VK_INDEX, - type AppendOnlyTreeSnapshot, - type TUBE_PROOF_LENGTH, - TUBE_VK_INDEX, - VkWitnessData, -} from '@aztec/circuits.js'; +import { VkWitnessData } from '@aztec/circuits.js'; import { AvmProofData, type BaseRollupHints, @@ -19,6 +13,8 @@ import { PublicTubeData, TubeInputs, } from '@aztec/circuits.js/rollup'; +import { type AppendOnlyTreeSnapshot } from '@aztec/circuits.js/trees'; +import { type AVM_PROOF_LENGTH_IN_FIELDS, AVM_VK_INDEX, type TUBE_PROOF_LENGTH, TUBE_VK_INDEX } from '@aztec/constants'; import { getVKIndex, getVKSiblingPath } from '@aztec/noir-protocol-circuits-types/vks'; /** diff --git a/yarn-project/prover-client/src/prover-client/factory.ts b/yarn-project/prover-client/src/prover-client/factory.ts index 164ff1104e50..29fcbe93b864 100644 --- a/yarn-project/prover-client/src/prover-client/factory.ts +++ b/yarn-project/prover-client/src/prover-client/factory.ts @@ -1,4 +1,4 @@ -import { type ForkMerkleTreeOperations, type ProvingJobBroker } from '@aztec/circuit-types'; +import { type ForkMerkleTreeOperations, type ProvingJobBroker } from '@aztec/circuit-types/interfaces/server'; import { type TelemetryClient, getTelemetryClient } from '@aztec/telemetry-client'; import { type ProverClientConfig } from '../config.js'; diff --git a/yarn-project/prover-client/src/prover-client/prover-client.ts b/yarn-project/prover-client/src/prover-client/prover-client.ts index 1017e93d8441..f802d59c970e 100644 --- a/yarn-project/prover-client/src/prover-client/prover-client.ts +++ b/yarn-project/prover-client/src/prover-client/prover-client.ts @@ -8,7 +8,7 @@ import { type ProvingJobConsumer, type ProvingJobProducer, type ServerCircuitProver, -} from '@aztec/circuit-types/interfaces'; +} from '@aztec/circuit-types/interfaces/server'; import { Fr } from '@aztec/circuits.js'; import { times } from '@aztec/foundation/collection'; import { createLogger } from '@aztec/foundation/log'; diff --git a/yarn-project/prover-client/src/prover-client/server-epoch-prover.ts b/yarn-project/prover-client/src/prover-client/server-epoch-prover.ts index ee36120a0a07..03b3eeb56ab8 100644 --- a/yarn-project/prover-client/src/prover-client/server-epoch-prover.ts +++ b/yarn-project/prover-client/src/prover-client/server-epoch-prover.ts @@ -1,4 +1,5 @@ -import { type EpochProver, type L2Block, type ProcessedTx, type Tx } from '@aztec/circuit-types'; +import { type L2Block, type ProcessedTx, type Tx } from '@aztec/circuit-types'; +import { type EpochProver } from '@aztec/circuit-types/interfaces/server'; import { type BlockHeader, type Fr, type GlobalVariables, type Proof } from '@aztec/circuits.js'; import { type RootRollupPublicInputs } from '@aztec/circuits.js/rollup'; diff --git a/yarn-project/prover-client/src/proving_broker/broker_prover_facade.test.ts b/yarn-project/prover-client/src/proving_broker/broker_prover_facade.test.ts index a502209d5104..7c29bc3dde26 100644 --- a/yarn-project/prover-client/src/proving_broker/broker_prover_facade.test.ts +++ b/yarn-project/prover-client/src/proving_broker/broker_prover_facade.test.ts @@ -1,6 +1,7 @@ -import { makePublicInputsAndRecursiveProof } from '@aztec/circuit-types'; -import { RECURSIVE_PROOF_LENGTH, VerificationKeyData, makeRecursiveProof } from '@aztec/circuits.js'; +import { makePublicInputsAndRecursiveProof } from '@aztec/circuit-types/interfaces/server'; +import { VerificationKeyData, makeRecursiveProof } from '@aztec/circuits.js'; import { makeBaseParityInputs, makeParityPublicInputs } from '@aztec/circuits.js/testing'; +import { RECURSIVE_PROOF_LENGTH } from '@aztec/constants'; import { promiseWithResolvers } from '@aztec/foundation/promise'; import { sleep } from '@aztec/foundation/sleep'; diff --git a/yarn-project/prover-client/src/proving_broker/broker_prover_facade.ts b/yarn-project/prover-client/src/proving_broker/broker_prover_facade.ts index 5fe4b90fdcec..165900d971d7 100644 --- a/yarn-project/prover-client/src/proving_broker/broker_prover_facade.ts +++ b/yarn-project/prover-client/src/proving_broker/broker_prover_facade.ts @@ -10,18 +10,9 @@ import { type PublicInputsAndRecursiveProof, type ServerCircuitProver, makeProvingJobId, -} from '@aztec/circuit-types'; -import { - type AVM_PROOF_LENGTH_IN_FIELDS, - type AvmCircuitInputs, - type BaseParityInputs, - type NESTED_RECURSIVE_PROOF_LENGTH, - type NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, - type ParityPublicInputs, - type RECURSIVE_PROOF_LENGTH, - type RootParityInputs, - type TUBE_PROOF_LENGTH, -} from '@aztec/circuits.js'; +} from '@aztec/circuit-types/interfaces/server'; +import { type BaseParityInputs, type ParityPublicInputs, type RootParityInputs } from '@aztec/circuits.js'; +import { type AvmCircuitInputs } from '@aztec/circuits.js/avm'; import { type BaseOrMergeRollupPublicInputs, type BlockMergeRollupInputs, @@ -36,9 +27,16 @@ import { type SingleTxBlockRootRollupInputs, type TubeInputs, } from '@aztec/circuits.js/rollup'; +import { + type AVM_PROOF_LENGTH_IN_FIELDS, + type NESTED_RECURSIVE_PROOF_LENGTH, + type NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, + type RECURSIVE_PROOF_LENGTH, + type TUBE_PROOF_LENGTH, +} from '@aztec/constants'; import { sha256 } from '@aztec/foundation/crypto'; import { createLogger } from '@aztec/foundation/log'; -import { RunningPromise, promiseWithResolvers } from '@aztec/foundation/promise'; +import { type PromiseWithResolvers, RunningPromise, promiseWithResolvers } from '@aztec/foundation/promise'; import { truncate } from '@aztec/foundation/string'; import { InlineProofStore, type ProofStore } from './proof_store/index.js'; diff --git a/yarn-project/prover-client/src/proving_broker/config.ts b/yarn-project/prover-client/src/proving_broker/config.ts index 8bf500c1043d..7424b716afa0 100644 --- a/yarn-project/prover-client/src/proving_broker/config.ts +++ b/yarn-project/prover-client/src/proving_broker/config.ts @@ -1,4 +1,4 @@ -import { ProvingRequestType } from '@aztec/circuit-types'; +import { ProvingRequestType } from '@aztec/circuit-types/interfaces/server'; import { type ConfigMappingsType, booleanConfigHelper, numberConfigHelper } from '@aztec/foundation/config'; import { type DataStoreConfig, dataConfigMappings } from '@aztec/kv-store/config'; diff --git a/yarn-project/prover-client/src/proving_broker/fixtures.ts b/yarn-project/prover-client/src/proving_broker/fixtures.ts index 1f7c1ac0a5d2..61cee95f0c6b 100644 --- a/yarn-project/prover-client/src/proving_broker/fixtures.ts +++ b/yarn-project/prover-client/src/proving_broker/fixtures.ts @@ -1,4 +1,9 @@ -import { type ProofUri, type ProvingJobId, ProvingRequestType, makeProvingJobId } from '@aztec/circuit-types'; +import { + type ProofUri, + type ProvingJobId, + ProvingRequestType, + makeProvingJobId, +} from '@aztec/circuit-types/interfaces/server'; import { randomBytes } from '@aztec/foundation/crypto'; export function makeRandomProvingJobId(epochNumber?: number): ProvingJobId { diff --git a/yarn-project/prover-client/src/proving_broker/proof_store/gcs_proof_store.ts b/yarn-project/prover-client/src/proving_broker/proof_store/gcs_proof_store.ts index cdf434d2f1d7..2ac2938a608d 100644 --- a/yarn-project/prover-client/src/proving_broker/proof_store/gcs_proof_store.ts +++ b/yarn-project/prover-client/src/proving_broker/proof_store/gcs_proof_store.ts @@ -7,7 +7,7 @@ import { type ProvingJobResultsMap, ProvingRequestType, getProvingJobInputClassFor, -} from '@aztec/circuit-types'; +} from '@aztec/circuit-types/interfaces/server'; import { Storage } from '@google-cloud/storage'; import { join } from 'path'; diff --git a/yarn-project/prover-client/src/proving_broker/proof_store/inline_proof_store.ts b/yarn-project/prover-client/src/proving_broker/proof_store/inline_proof_store.ts index 6b87c419b691..a0377e00c9e1 100644 --- a/yarn-project/prover-client/src/proving_broker/proof_store/inline_proof_store.ts +++ b/yarn-project/prover-client/src/proving_broker/proof_store/inline_proof_store.ts @@ -6,7 +6,7 @@ import { ProvingJobResult, type ProvingJobResultsMap, type ProvingRequestType, -} from '@aztec/circuit-types'; +} from '@aztec/circuit-types/interfaces/server'; import { jsonParseWithSchema, jsonStringify } from '@aztec/foundation/json-rpc'; import { type ZodFor } from '@aztec/foundation/schemas'; diff --git a/yarn-project/prover-client/src/proving_broker/proof_store/proof_store.ts b/yarn-project/prover-client/src/proving_broker/proof_store/proof_store.ts index 7b3820240f2c..b5f35163042a 100644 --- a/yarn-project/prover-client/src/proving_broker/proof_store/proof_store.ts +++ b/yarn-project/prover-client/src/proving_broker/proof_store/proof_store.ts @@ -6,7 +6,7 @@ import { type ProvingJobResult, type ProvingJobResultsMap, type ProvingRequestType, -} from '@aztec/circuit-types'; +} from '@aztec/circuit-types/interfaces/server'; /** * A database for storing proof inputs and outputs. diff --git a/yarn-project/prover-client/src/proving_broker/proving_agent.test.ts b/yarn-project/prover-client/src/proving_broker/proving_agent.test.ts index 40ac83bb3e8c..ee370634bb73 100644 --- a/yarn-project/prover-client/src/proving_broker/proving_agent.test.ts +++ b/yarn-project/prover-client/src/proving_broker/proving_agent.test.ts @@ -1,6 +1,6 @@ +import { ProvingError } from '@aztec/circuit-types'; import { type ProofUri, - ProvingError, type ProvingJob, type ProvingJobConsumer, type ProvingJobId, @@ -8,14 +8,10 @@ import { ProvingRequestType, type PublicInputsAndRecursiveProof, makePublicInputsAndRecursiveProof, -} from '@aztec/circuit-types'; -import { - type ParityPublicInputs, - RECURSIVE_PROOF_LENGTH, - VerificationKeyData, - makeRecursiveProof, -} from '@aztec/circuits.js'; +} from '@aztec/circuit-types/interfaces/server'; +import { type ParityPublicInputs, VerificationKeyData, makeRecursiveProof } from '@aztec/circuits.js'; import { makeBaseParityInputs, makeParityPublicInputs } from '@aztec/circuits.js/testing'; +import { RECURSIVE_PROOF_LENGTH } from '@aztec/constants'; import { randomBytes } from '@aztec/foundation/crypto'; import { AbortError } from '@aztec/foundation/error'; import { promiseWithResolvers } from '@aztec/foundation/promise'; diff --git a/yarn-project/prover-client/src/proving_broker/proving_agent.ts b/yarn-project/prover-client/src/proving_broker/proving_agent.ts index 729cc06df7c3..a18ac387c862 100644 --- a/yarn-project/prover-client/src/proving_broker/proving_agent.ts +++ b/yarn-project/prover-client/src/proving_broker/proving_agent.ts @@ -1,5 +1,5 @@ +import { ProvingError } from '@aztec/circuit-types'; import { - ProvingError, type ProvingJob, type ProvingJobConsumer, type ProvingJobId, @@ -7,7 +7,7 @@ import { type ProvingJobResultsMap, ProvingRequestType, type ServerCircuitProver, -} from '@aztec/circuit-types'; +} from '@aztec/circuit-types/interfaces/server'; import { createLogger } from '@aztec/foundation/log'; import { RunningPromise } from '@aztec/foundation/running-promise'; import { truncate } from '@aztec/foundation/string'; diff --git a/yarn-project/prover-client/src/proving_broker/proving_broker.test.ts b/yarn-project/prover-client/src/proving_broker/proving_broker.test.ts index 232bc297e6e8..d7d709e586de 100644 --- a/yarn-project/prover-client/src/proving_broker/proving_broker.test.ts +++ b/yarn-project/prover-client/src/proving_broker/proving_broker.test.ts @@ -4,7 +4,7 @@ import { type ProvingJobId, type ProvingJobStatus, ProvingRequestType, -} from '@aztec/circuit-types'; +} from '@aztec/circuit-types/interfaces/server'; import { sleep } from '@aztec/foundation/sleep'; import { jest } from '@jest/globals'; diff --git a/yarn-project/prover-client/src/proving_broker/proving_broker.ts b/yarn-project/prover-client/src/proving_broker/proving_broker.ts index 3f1815563090..8f8172ad41a3 100644 --- a/yarn-project/prover-client/src/proving_broker/proving_broker.ts +++ b/yarn-project/prover-client/src/proving_broker/proving_broker.ts @@ -9,7 +9,7 @@ import { type ProvingJobSettledResult, type ProvingJobStatus, ProvingRequestType, -} from '@aztec/circuit-types'; +} from '@aztec/circuit-types/interfaces/server'; import { createLogger } from '@aztec/foundation/log'; import { type PromiseWithResolvers, RunningPromise, promiseWithResolvers } from '@aztec/foundation/promise'; import { PriorityMemoryQueue } from '@aztec/foundation/queue'; diff --git a/yarn-project/prover-client/src/proving_broker/proving_broker_database.ts b/yarn-project/prover-client/src/proving_broker/proving_broker_database.ts index 09fb5028768e..acda69a94711 100644 --- a/yarn-project/prover-client/src/proving_broker/proving_broker_database.ts +++ b/yarn-project/prover-client/src/proving_broker/proving_broker_database.ts @@ -1,4 +1,9 @@ -import { type ProofUri, type ProvingJob, type ProvingJobId, type ProvingJobSettledResult } from '@aztec/circuit-types'; +import { + type ProofUri, + type ProvingJob, + type ProvingJobId, + type ProvingJobSettledResult, +} from '@aztec/circuit-types/interfaces/server'; /** * A database for storing proof requests and their results diff --git a/yarn-project/prover-client/src/proving_broker/proving_broker_database/broker_persisted_database.test.ts b/yarn-project/prover-client/src/proving_broker/proving_broker_database/broker_persisted_database.test.ts index 4b5c8946e094..f2bc2a0c9a88 100644 --- a/yarn-project/prover-client/src/proving_broker/proving_broker_database/broker_persisted_database.test.ts +++ b/yarn-project/prover-client/src/proving_broker/proving_broker_database/broker_persisted_database.test.ts @@ -1,4 +1,9 @@ -import { type ProofUri, type ProvingJob, type ProvingJobSettledResult, ProvingRequestType } from '@aztec/circuit-types'; +import { + type ProofUri, + type ProvingJob, + type ProvingJobSettledResult, + ProvingRequestType, +} from '@aztec/circuit-types/interfaces/server'; import { toArray } from '@aztec/foundation/iterable'; import { jest } from '@jest/globals'; diff --git a/yarn-project/prover-client/src/proving_broker/proving_broker_database/memory.ts b/yarn-project/prover-client/src/proving_broker/proving_broker_database/memory.ts index 50f4d3f3a0c3..ef6b836f547c 100644 --- a/yarn-project/prover-client/src/proving_broker/proving_broker_database/memory.ts +++ b/yarn-project/prover-client/src/proving_broker/proving_broker_database/memory.ts @@ -4,7 +4,7 @@ import { type ProvingJobId, type ProvingJobSettledResult, getEpochFromProvingJobId, -} from '@aztec/circuit-types'; +} from '@aztec/circuit-types/interfaces/server'; import { type ProvingBrokerDatabase } from '../proving_broker_database.js'; diff --git a/yarn-project/prover-client/src/proving_broker/proving_broker_database/persisted.ts b/yarn-project/prover-client/src/proving_broker/proving_broker_database/persisted.ts index 9de915c6165c..a70dad8be8f4 100644 --- a/yarn-project/prover-client/src/proving_broker/proving_broker_database/persisted.ts +++ b/yarn-project/prover-client/src/proving_broker/proving_broker_database/persisted.ts @@ -4,7 +4,7 @@ import { type ProvingJobId, ProvingJobSettledResult, getEpochFromProvingJobId, -} from '@aztec/circuit-types'; +} from '@aztec/circuit-types/interfaces/server'; import { jsonParseWithSchema, jsonStringify } from '@aztec/foundation/json-rpc'; import { type Logger, createLogger } from '@aztec/foundation/log'; import { BatchQueue } from '@aztec/foundation/queue'; diff --git a/yarn-project/prover-client/src/proving_broker/proving_broker_instrumentation.ts b/yarn-project/prover-client/src/proving_broker/proving_broker_instrumentation.ts index 5a17de276a68..2dc9ac270236 100644 --- a/yarn-project/prover-client/src/proving_broker/proving_broker_instrumentation.ts +++ b/yarn-project/prover-client/src/proving_broker/proving_broker_instrumentation.ts @@ -1,4 +1,4 @@ -import { ProvingRequestType } from '@aztec/circuit-types'; +import { ProvingRequestType } from '@aztec/circuit-types/interfaces/server'; import { type Timer } from '@aztec/foundation/timer'; import { Attributes, diff --git a/yarn-project/prover-client/src/proving_broker/proving_job_controller.test.ts b/yarn-project/prover-client/src/proving_broker/proving_job_controller.test.ts index 1c5fc3c02235..bc74b8eafa0d 100644 --- a/yarn-project/prover-client/src/proving_broker/proving_job_controller.test.ts +++ b/yarn-project/prover-client/src/proving_broker/proving_job_controller.test.ts @@ -1,6 +1,11 @@ -import { type ProvingJobId, ProvingRequestType, makePublicInputsAndRecursiveProof } from '@aztec/circuit-types'; -import { RECURSIVE_PROOF_LENGTH, VerificationKeyData, makeRecursiveProof } from '@aztec/circuits.js'; +import { + type ProvingJobId, + ProvingRequestType, + makePublicInputsAndRecursiveProof, +} from '@aztec/circuit-types/interfaces/server'; +import { VerificationKeyData, makeRecursiveProof } from '@aztec/circuits.js'; import { makeBaseParityInputs, makeParityPublicInputs } from '@aztec/circuits.js/testing'; +import { RECURSIVE_PROOF_LENGTH } from '@aztec/constants'; import { promiseWithResolvers } from '@aztec/foundation/promise'; import { sleep } from '@aztec/foundation/sleep'; diff --git a/yarn-project/prover-client/src/proving_broker/proving_job_controller.ts b/yarn-project/prover-client/src/proving_broker/proving_job_controller.ts index 951c5a5370e4..7d93427bba62 100644 --- a/yarn-project/prover-client/src/proving_broker/proving_job_controller.ts +++ b/yarn-project/prover-client/src/proving_broker/proving_job_controller.ts @@ -4,7 +4,7 @@ import { type ProvingJobResultsMap, ProvingRequestType, type ServerCircuitProver, -} from '@aztec/circuit-types'; +} from '@aztec/circuit-types/interfaces/server'; export enum ProvingJobControllerStatus { IDLE = 'idle', diff --git a/yarn-project/prover-client/src/proving_broker/rpc.ts b/yarn-project/prover-client/src/proving_broker/rpc.ts index 77de87d9ef2c..c795f432f0f1 100644 --- a/yarn-project/prover-client/src/proving_broker/rpc.ts +++ b/yarn-project/prover-client/src/proving_broker/rpc.ts @@ -1,5 +1,5 @@ +import { type ComponentsVersions, getVersioningResponseHandler } from '@aztec/circuit-types'; import { - type ComponentsVersions, type GetProvingJobResponse, ProofUri, ProvingJob, @@ -9,8 +9,7 @@ import { type ProvingJobProducer, ProvingJobStatus, ProvingRequestType, - getVersioningResponseHandler, -} from '@aztec/circuit-types'; +} from '@aztec/circuit-types/interfaces/server'; import { createSafeJsonRpcClient } from '@aztec/foundation/json-rpc/client'; import { type SafeJsonRpcServer } from '@aztec/foundation/json-rpc/server'; import { type ApiSchemaFor, optional } from '@aztec/foundation/schemas'; diff --git a/yarn-project/prover-client/src/test/bb_prover_full_rollup.test.ts b/yarn-project/prover-client/src/test/bb_prover_full_rollup.test.ts index 2eaafe7938c9..9da2bef2e397 100644 --- a/yarn-project/prover-client/src/test/bb_prover_full_rollup.test.ts +++ b/yarn-project/prover-client/src/test/bb_prover_full_rollup.test.ts @@ -1,6 +1,7 @@ import { BBNativeRollupProver, type BBProverConfig } from '@aztec/bb-prover'; -import { mockTx } from '@aztec/circuit-types'; -import { Fr, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/circuits.js'; +import { mockTx } from '@aztec/circuit-types/testing'; +import { Fr } from '@aztec/circuits.js'; +import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants'; import { makeTuple } from '@aztec/foundation/array'; import { timesParallel } from '@aztec/foundation/collection'; import { type Logger, createLogger } from '@aztec/foundation/log'; diff --git a/yarn-project/prover-client/src/test/bb_prover_parity.test.ts b/yarn-project/prover-client/src/test/bb_prover_parity.test.ts index 1f65db5607f1..4fdb2e3cf671 100644 --- a/yarn-project/prover-client/src/test/bb_prover_parity.test.ts +++ b/yarn-project/prover-client/src/test/bb_prover_parity.test.ts @@ -2,15 +2,17 @@ import { BBNativeRollupProver, type BBProverConfig } from '@aztec/bb-prover'; import { BaseParityInputs, Fr, - NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, - NUM_BASE_PARITY_PER_ROOT_PARITY, ParityPublicInputs, - RECURSIVE_PROOF_LENGTH, RootParityInput, RootParityInputs, VerificationKeyAsFields, makeRecursiveProof, } from '@aztec/circuits.js'; +import { + NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, + NUM_BASE_PARITY_PER_ROOT_PARITY, + RECURSIVE_PROOF_LENGTH, +} from '@aztec/constants'; import { makeTuple } from '@aztec/foundation/array'; import { randomBytes } from '@aztec/foundation/crypto'; import { createLogger } from '@aztec/foundation/log'; diff --git a/yarn-project/prover-client/src/test/mock_prover.ts b/yarn-project/prover-client/src/test/mock_prover.ts index 0a481a475bd9..b100946aefbc 100644 --- a/yarn-project/prover-client/src/test/mock_prover.ts +++ b/yarn-project/prover-client/src/test/mock_prover.ts @@ -8,21 +8,15 @@ import { type ServerCircuitProver, makeProofAndVerificationKey, makePublicInputsAndRecursiveProof, -} from '@aztec/circuit-types'; +} from '@aztec/circuit-types/interfaces/server'; import { - AVM_PROOF_LENGTH_IN_FIELDS, - AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS, - type AvmCircuitInputs, type BaseParityInputs, - NESTED_RECURSIVE_PROOF_LENGTH, - NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, - RECURSIVE_PROOF_LENGTH, type RootParityInputs, - TUBE_PROOF_LENGTH, VerificationKeyData, makeEmptyRecursiveProof, makeRecursiveProof, } from '@aztec/circuits.js'; +import { type AvmCircuitInputs } from '@aztec/circuits.js/avm'; import { type BaseOrMergeRollupPublicInputs, type BlockMergeRollupInputs, @@ -42,6 +36,14 @@ import { makeParityPublicInputs, makeRootRollupPublicInputs, } from '@aztec/circuits.js/testing'; +import { + AVM_PROOF_LENGTH_IN_FIELDS, + AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS, + NESTED_RECURSIVE_PROOF_LENGTH, + NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, + RECURSIVE_PROOF_LENGTH, + TUBE_PROOF_LENGTH, +} from '@aztec/constants'; import { times } from '@aztec/foundation/collection'; import { InlineProofStore, type ProofStore } from '../proving_broker/proof_store/index.js'; diff --git a/yarn-project/prover-client/tsconfig.json b/yarn-project/prover-client/tsconfig.json index 09e32edf21f3..8e3d3ff2b020 100644 --- a/yarn-project/prover-client/tsconfig.json +++ b/yarn-project/prover-client/tsconfig.json @@ -18,6 +18,9 @@ { "path": "../circuits.js" }, + { + "path": "../constants" + }, { "path": "../foundation" }, diff --git a/yarn-project/prover-node/package.json b/yarn-project/prover-node/package.json index ce9b269cfa02..16b90e30cf90 100644 --- a/yarn-project/prover-node/package.json +++ b/yarn-project/prover-node/package.json @@ -58,6 +58,7 @@ "@aztec/blob-sink": "workspace:^", "@aztec/circuit-types": "workspace:^", "@aztec/circuits.js": "workspace:^", + "@aztec/constants": "workspace:^", "@aztec/epoch-cache": "workspace:^", "@aztec/ethereum": "workspace:^", "@aztec/foundation": "workspace:^", diff --git a/yarn-project/prover-node/src/factory.ts b/yarn-project/prover-node/src/factory.ts index 0ae8e55f7f20..2cafc729ae4d 100644 --- a/yarn-project/prover-node/src/factory.ts +++ b/yarn-project/prover-node/src/factory.ts @@ -1,7 +1,7 @@ import { type Archiver, createArchiver } from '@aztec/archiver'; import { type BlobSinkClientInterface, createBlobSinkClient } from '@aztec/blob-sink/client'; -import { type ProverCoordination, type ProvingJobBroker } from '@aztec/circuit-types'; -import { type PublicDataTreeLeaf } from '@aztec/circuits.js'; +import { type ProverCoordination, type ProvingJobBroker } from '@aztec/circuit-types/interfaces/server'; +import { type PublicDataTreeLeaf } from '@aztec/circuits.js/trees'; import { EpochCache } from '@aztec/epoch-cache'; import { L1TxUtils, RollupContract, createEthereumChain, createL1Clients } from '@aztec/ethereum'; import { type Logger, createLogger } from '@aztec/foundation/log'; diff --git a/yarn-project/prover-node/src/http.ts b/yarn-project/prover-node/src/http.ts index dc15d4c3b317..ee5c42899987 100644 --- a/yarn-project/prover-node/src/http.ts +++ b/yarn-project/prover-node/src/http.ts @@ -1,4 +1,4 @@ -import { ProverNodeApiSchema } from '@aztec/circuit-types'; +import { ProverNodeApiSchema } from '@aztec/circuit-types/interfaces/server'; import { createTracedJsonRpcServer } from '@aztec/telemetry-client'; import { type ProverNode } from './prover-node.js'; diff --git a/yarn-project/prover-node/src/job/epoch-proving-job.test.ts b/yarn-project/prover-node/src/job/epoch-proving-job.test.ts index d7555df10b4d..7439b77e654b 100644 --- a/yarn-project/prover-node/src/job/epoch-proving-job.test.ts +++ b/yarn-project/prover-node/src/job/epoch-proving-job.test.ts @@ -1,13 +1,9 @@ +import { type L1ToL2MessageSource, L2Block, type L2BlockSource, type ProcessedTx, type Tx } from '@aztec/circuit-types'; import { type EpochProver, - type L1ToL2MessageSource, - L2Block, - type L2BlockSource, type MerkleTreeWriteOperations, - type ProcessedTx, - type Tx, type WorldStateSynchronizer, -} from '@aztec/circuit-types'; +} from '@aztec/circuit-types/interfaces/server'; import { BlockHeader, Proof } from '@aztec/circuits.js'; import { RootRollupPublicInputs } from '@aztec/circuits.js/rollup'; import { times, timesParallel } from '@aztec/foundation/collection'; diff --git a/yarn-project/prover-node/src/job/epoch-proving-job.ts b/yarn-project/prover-node/src/job/epoch-proving-job.ts index 26c5588f894a..cc0de8dd4dd9 100644 --- a/yarn-project/prover-node/src/job/epoch-proving-job.ts +++ b/yarn-project/prover-node/src/job/epoch-proving-job.ts @@ -1,14 +1,16 @@ import { - type EpochProver, - type EpochProvingJobState, - EpochProvingJobTerminalState, - type ForkMerkleTreeOperations, type L1ToL2MessageSource, type L2Block, type L2BlockSource, type ProcessedTx, type Tx, } from '@aztec/circuit-types'; +import { + type EpochProver, + type EpochProvingJobState, + EpochProvingJobTerminalState, + type ForkMerkleTreeOperations, +} from '@aztec/circuit-types/interfaces/server'; import { asyncPool } from '@aztec/foundation/async-pool'; import { createLogger } from '@aztec/foundation/log'; import { promiseWithResolvers } from '@aztec/foundation/promise'; diff --git a/yarn-project/prover-node/src/prover-coordination/factory.ts b/yarn-project/prover-node/src/prover-coordination/factory.ts index 47f9b03abac7..ff77f164e364 100644 --- a/yarn-project/prover-node/src/prover-coordination/factory.ts +++ b/yarn-project/prover-node/src/prover-coordination/factory.ts @@ -1,12 +1,8 @@ import { type ArchiveSource, type Archiver } from '@aztec/archiver'; import { BBCircuitVerifier, TestCircuitVerifier } from '@aztec/bb-prover'; -import { - P2PClientType, - type ProverCoordination, - type WorldStateSynchronizer, - createAztecNodeClient, - getComponentsVersionsFromConfig, -} from '@aztec/circuit-types'; +import { P2PClientType, getComponentsVersionsFromConfig } from '@aztec/circuit-types'; +import { createAztecNodeClient } from '@aztec/circuit-types/interfaces/client'; +import { type ProverCoordination, type WorldStateSynchronizer } from '@aztec/circuit-types/interfaces/server'; import { type EpochCache } from '@aztec/epoch-cache'; import { createLogger } from '@aztec/foundation/log'; import { type DataStoreConfig } from '@aztec/kv-store/config'; diff --git a/yarn-project/prover-node/src/prover-node-publisher.ts b/yarn-project/prover-node/src/prover-node-publisher.ts index 147d2512832b..c32072ee66b2 100644 --- a/yarn-project/prover-node/src/prover-node-publisher.ts +++ b/yarn-project/prover-node/src/prover-node-publisher.ts @@ -1,6 +1,7 @@ import { type L1PublishProofStats } from '@aztec/circuit-types/stats'; -import { AGGREGATION_OBJECT_LENGTH, AZTEC_MAX_EPOCH_DURATION, type Proof } from '@aztec/circuits.js'; +import { type Proof } from '@aztec/circuits.js'; import { type FeeRecipient, type RootRollupPublicInputs } from '@aztec/circuits.js/rollup'; +import { AGGREGATION_OBJECT_LENGTH, AZTEC_MAX_EPOCH_DURATION } from '@aztec/constants'; import { type L1TxUtils, type RollupContract } from '@aztec/ethereum'; import { makeTuple } from '@aztec/foundation/array'; import { areArraysEqual, times } from '@aztec/foundation/collection'; diff --git a/yarn-project/prover-node/src/prover-node.test.ts b/yarn-project/prover-node/src/prover-node.test.ts index a9f220ec588e..02a3c3968970 100644 --- a/yarn-project/prover-node/src/prover-node.test.ts +++ b/yarn-project/prover-node/src/prover-node.test.ts @@ -1,16 +1,18 @@ import { EmptyL1RollupConstants, - type EpochProverManager, - type EpochProvingJobState, type L1ToL2MessageSource, L2Block, type L2BlockSource, + type Tx, +} from '@aztec/circuit-types'; +import { + type EpochProverManager, + type EpochProvingJobState, type MerkleTreeWriteOperations, type ProverCoordination, - type Tx, WorldStateRunningState, type WorldStateSynchronizer, -} from '@aztec/circuit-types'; +} from '@aztec/circuit-types/interfaces/server'; import { type ContractDataSource, EthAddress } from '@aztec/circuits.js'; import { timesParallel } from '@aztec/foundation/collection'; import { sleep } from '@aztec/foundation/sleep'; diff --git a/yarn-project/prover-node/src/prover-node.ts b/yarn-project/prover-node/src/prover-node.ts index eed1c08da00d..3d11d4cf2ae2 100644 --- a/yarn-project/prover-node/src/prover-node.ts +++ b/yarn-project/prover-node/src/prover-node.ts @@ -1,19 +1,21 @@ import { - type EpochProverManager, - EpochProvingJobTerminalState, type L1ToL2MessageSource, type L2Block, type L2BlockSource, type P2PClientType, + type Tx, + type TxHash, + getTimestampRangeForEpoch, +} from '@aztec/circuit-types'; +import { + type EpochProverManager, + EpochProvingJobTerminalState, type ProverCoordination, type ProverNodeApi, type Service, - type Tx, - type TxHash, type WorldStateSynchronizer, - getTimestampRangeForEpoch, tryStop, -} from '@aztec/circuit-types'; +} from '@aztec/circuit-types/interfaces/server'; import { type ContractDataSource } from '@aztec/circuits.js'; import { compact } from '@aztec/foundation/collection'; import { memoize } from '@aztec/foundation/decorators'; diff --git a/yarn-project/prover-node/src/test/index.ts b/yarn-project/prover-node/src/test/index.ts index 4b6baca68bdc..b8326fc4b882 100644 --- a/yarn-project/prover-node/src/test/index.ts +++ b/yarn-project/prover-node/src/test/index.ts @@ -1,4 +1,4 @@ -import { type EpochProverManager } from '@aztec/circuit-types'; +import { type EpochProverManager } from '@aztec/circuit-types/interfaces/server'; import { type ProverNodePublisher } from '../prover-node-publisher.js'; import { ProverNode } from '../prover-node.js'; diff --git a/yarn-project/prover-node/tsconfig.json b/yarn-project/prover-node/tsconfig.json index bf9644614842..b129a945b73a 100644 --- a/yarn-project/prover-node/tsconfig.json +++ b/yarn-project/prover-node/tsconfig.json @@ -21,6 +21,9 @@ { "path": "../circuits.js" }, + { + "path": "../constants" + }, { "path": "../epoch-cache" }, diff --git a/yarn-project/pxe/package.json b/yarn-project/pxe/package.json index 2b9c353aab23..0268d619d76e 100644 --- a/yarn-project/pxe/package.json +++ b/yarn-project/pxe/package.json @@ -71,6 +71,7 @@ "@aztec/builder": "workspace:^", "@aztec/circuit-types": "workspace:^", "@aztec/circuits.js": "workspace:^", + "@aztec/constants": "workspace:^", "@aztec/ethereum": "workspace:^", "@aztec/foundation": "workspace:^", "@aztec/key-store": "workspace:^", diff --git a/yarn-project/pxe/src/bin/index.ts b/yarn-project/pxe/src/bin/index.ts index 15ed46c516df..7f85a932a423 100644 --- a/yarn-project/pxe/src/bin/index.ts +++ b/yarn-project/pxe/src/bin/index.ts @@ -1,5 +1,5 @@ #!/usr/bin/env -S node --no-warnings -import { createAztecNodeClient } from '@aztec/circuit-types'; +import { createAztecNodeClient } from '@aztec/circuit-types/interfaces/client'; import { createLogger } from '@aztec/foundation/log'; import { getPXEServiceConfig } from '../config/index.js'; diff --git a/yarn-project/pxe/src/config/index.ts b/yarn-project/pxe/src/config/index.ts index b2ece6595b79..5e9f85c5119e 100644 --- a/yarn-project/pxe/src/config/index.ts +++ b/yarn-project/pxe/src/config/index.ts @@ -1,5 +1,5 @@ import { type ChainConfig, chainConfigMappings } from '@aztec/circuit-types/config'; -import { INITIAL_L2_BLOCK_NUM } from '@aztec/circuits.js/constants'; +import { INITIAL_L2_BLOCK_NUM } from '@aztec/constants'; import { type ConfigMappingsType, booleanConfigHelper, diff --git a/yarn-project/pxe/src/contract_data_oracle/index.ts b/yarn-project/pxe/src/contract_data_oracle/index.ts index aef5653fa440..7ab59d71801d 100644 --- a/yarn-project/pxe/src/contract_data_oracle/index.ts +++ b/yarn-project/pxe/src/contract_data_oracle/index.ts @@ -5,8 +5,9 @@ import { type FunctionDebugMetadata, type FunctionSelector, getFunctionDebugMetadata, -} from '@aztec/foundation/abi'; +} from '@aztec/circuits.js/abi'; import { type Fr } from '@aztec/foundation/fields'; +import type { MembershipWitness } from '@aztec/foundation/trees'; import { ContractClassNotFoundError, ContractNotFoundError } from '@aztec/simulator/client'; import { type ContractArtifactDatabase } from '../database/contracts/contract_artifact_db.js'; @@ -120,7 +121,10 @@ export class ContractDataOracle { * @param selector - The function selector. * @returns A promise that resolves with the MembershipWitness instance for the specified contract's function. */ - public async getFunctionMembershipWitness(contractClassId: Fr, selector: FunctionSelector) { + public async getFunctionMembershipWitness( + contractClassId: Fr, + selector: FunctionSelector, + ): Promise> { const tree = await this.getTreeForClassId(contractClassId); return tree.getFunctionMembershipWitness(selector); } diff --git a/yarn-project/pxe/src/contract_data_oracle/private_functions_tree.ts b/yarn-project/pxe/src/contract_data_oracle/private_functions_tree.ts index e22e6def66ec..46b8eff6e33d 100644 --- a/yarn-project/pxe/src/contract_data_oracle/private_functions_tree.ts +++ b/yarn-project/pxe/src/contract_data_oracle/private_functions_tree.ts @@ -1,15 +1,14 @@ +import { type ContractArtifact, FunctionSelector } from '@aztec/circuits.js/abi'; import { type ContractClassWithId, - FUNCTION_TREE_HEIGHT, - MembershipWitness, computePrivateFunctionLeaf, computePrivateFunctionsTree, getContractClassFromArtifact, -} from '@aztec/circuits.js'; -import { type MerkleTree } from '@aztec/circuits.js/merkle'; -import { type ContractArtifact, FunctionSelector } from '@aztec/foundation/abi'; +} from '@aztec/circuits.js/contract'; +import { FUNCTION_TREE_HEIGHT } from '@aztec/constants'; import { Fr } from '@aztec/foundation/fields'; import { assertLength } from '@aztec/foundation/serialize'; +import { MembershipWitness, type MerkleTree } from '@aztec/foundation/trees'; /** * Represents a Merkle tree of functions for a particular Contract Class. diff --git a/yarn-project/pxe/src/database/contracts/contract_artifact_db.ts b/yarn-project/pxe/src/database/contracts/contract_artifact_db.ts index 3f6e6bb23110..d473d767d7fc 100644 --- a/yarn-project/pxe/src/database/contracts/contract_artifact_db.ts +++ b/yarn-project/pxe/src/database/contracts/contract_artifact_db.ts @@ -1,4 +1,4 @@ -import { type ContractArtifact } from '@aztec/foundation/abi'; +import { type ContractArtifact } from '@aztec/circuits.js/abi'; import { type Fr } from '@aztec/foundation/fields'; /** diff --git a/yarn-project/pxe/src/database/kv_pxe_database.ts b/yarn-project/pxe/src/database/kv_pxe_database.ts index bf0bcb910fba..ae660d7dbadf 100644 --- a/yarn-project/pxe/src/database/kv_pxe_database.ts +++ b/yarn-project/pxe/src/database/kv_pxe_database.ts @@ -8,7 +8,8 @@ import { type PublicKey, SerializableContractInstance, } from '@aztec/circuits.js'; -import { type ContractArtifact, FunctionSelector, FunctionType } from '@aztec/foundation/abi'; +import { type ContractArtifact, FunctionSelector, FunctionType } from '@aztec/circuits.js/abi'; +import { contractArtifactFromBuffer, contractArtifactToBuffer } from '@aztec/circuits.js/abi'; import { toBufferBE } from '@aztec/foundation/bigint-buffer'; import { Fr, type Point } from '@aztec/foundation/fields'; import { toArray } from '@aztec/foundation/iterable'; @@ -21,7 +22,6 @@ import { type AztecAsyncSet, type AztecAsyncSingleton, } from '@aztec/kv-store'; -import { contractArtifactFromBuffer, contractArtifactToBuffer } from '@aztec/types/abi'; import { NoteDao } from './note_dao.js'; import { type PxeDatabase } from './pxe_database.js'; diff --git a/yarn-project/pxe/src/database/note_dao.ts b/yarn-project/pxe/src/database/note_dao.ts index c6e219882b9d..d311a419efbe 100644 --- a/yarn-project/pxe/src/database/note_dao.ts +++ b/yarn-project/pxe/src/database/note_dao.ts @@ -1,6 +1,6 @@ -import { Note, TxHash, randomTxHash } from '@aztec/circuit-types'; +import { Note, TxHash } from '@aztec/circuit-types'; import { AztecAddress, Fr, Point, type PublicKey } from '@aztec/circuits.js'; -import { NoteSelector } from '@aztec/foundation/abi'; +import { NoteSelector } from '@aztec/circuits.js/abi'; import { toBigIntBE } from '@aztec/foundation/bigint-buffer'; import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize'; import { type NoteData } from '@aztec/simulator/client'; @@ -134,7 +134,7 @@ export class NoteDao implements NoteData { nonce = Fr.random(), noteHash = Fr.random(), siloedNullifier = Fr.random(), - txHash = randomTxHash(), + txHash = TxHash.random(), l2BlockNumber = Math.floor(Math.random() * 1000), l2BlockHash = Fr.random().toString(), index = Fr.random().toBigInt(), diff --git a/yarn-project/pxe/src/database/outgoing_note_dao.ts b/yarn-project/pxe/src/database/outgoing_note_dao.ts index 6d1d5117445f..59c4b10dea41 100644 --- a/yarn-project/pxe/src/database/outgoing_note_dao.ts +++ b/yarn-project/pxe/src/database/outgoing_note_dao.ts @@ -1,6 +1,6 @@ -import { Note, TxHash, randomTxHash } from '@aztec/circuit-types'; +import { Note, TxHash } from '@aztec/circuit-types'; import { AztecAddress, Fr, Point, type PublicKey } from '@aztec/circuits.js'; -import { NoteSelector } from '@aztec/foundation/abi'; +import { NoteSelector } from '@aztec/circuits.js/abi'; import { toBigIntBE } from '@aztec/foundation/bigint-buffer'; import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize'; @@ -102,7 +102,7 @@ export class OutgoingNoteDao { static async random({ note = Note.random(), contractAddress = undefined, - txHash = randomTxHash(), + txHash = TxHash.random(), storageSlot = Fr.random(), noteTypeId = NoteSelector.random(), nonce = Fr.random(), diff --git a/yarn-project/pxe/src/database/pxe_database.ts b/yarn-project/pxe/src/database/pxe_database.ts index f00de303703c..5b6e493a5bc7 100644 --- a/yarn-project/pxe/src/database/pxe_database.ts +++ b/yarn-project/pxe/src/database/pxe_database.ts @@ -6,7 +6,7 @@ import { type IndexedTaggingSecret, type PublicKey, } from '@aztec/circuits.js'; -import { type ContractArtifact } from '@aztec/foundation/abi'; +import { type ContractArtifact } from '@aztec/circuits.js/abi'; import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { type Fr } from '@aztec/foundation/fields'; diff --git a/yarn-project/pxe/src/database/pxe_database_test_suite.ts b/yarn-project/pxe/src/database/pxe_database_test_suite.ts index 6d19df0fe882..b2e3eca3994d 100644 --- a/yarn-project/pxe/src/database/pxe_database_test_suite.ts +++ b/yarn-project/pxe/src/database/pxe_database_test_suite.ts @@ -1,13 +1,9 @@ -import { NoteStatus, type NotesFilter, randomTxHash } from '@aztec/circuit-types'; -import { - AztecAddress, - CompleteAddress, - INITIAL_L2_BLOCK_NUM, - PublicKeys, - SerializableContractInstance, -} from '@aztec/circuits.js'; +import { NoteStatus, type NotesFilter } from '@aztec/circuit-types'; +import { randomTxHash } from '@aztec/circuit-types/testing'; +import { AztecAddress, CompleteAddress, PublicKeys, SerializableContractInstance } from '@aztec/circuits.js'; +import { FunctionType } from '@aztec/circuits.js/abi'; import { makeHeader } from '@aztec/circuits.js/testing'; -import { FunctionType } from '@aztec/foundation/abi'; +import { INITIAL_L2_BLOCK_NUM } from '@aztec/constants'; import { timesParallel } from '@aztec/foundation/collection'; import { randomInt } from '@aztec/foundation/crypto'; import { Fr, Point } from '@aztec/foundation/fields'; diff --git a/yarn-project/pxe/src/index.ts b/yarn-project/pxe/src/index.ts index e97f38565f2c..fbdaa0c4bbc5 100644 --- a/yarn-project/pxe/src/index.ts +++ b/yarn-project/pxe/src/index.ts @@ -1,4 +1,5 @@ export * from './pxe_service/index.js'; +export { pxeTestSuite } from './pxe_service/test/pxe_test_suite.js'; export * from './pxe_http/index.js'; export * from './config/index.js'; export * from './utils/create_pxe_service.js'; diff --git a/yarn-project/pxe/src/kernel_oracle/index.ts b/yarn-project/pxe/src/kernel_oracle/index.ts index 6b79cf7e7871..dc1aab77f468 100644 --- a/yarn-project/pxe/src/kernel_oracle/index.ts +++ b/yarn-project/pxe/src/kernel_oracle/index.ts @@ -1,28 +1,32 @@ -import { type AztecNode, type L2BlockNumber } from '@aztec/circuit-types'; +import { type AztecNode, type L2BlockNumber } from '@aztec/circuit-types/interfaces/client'; import { type AztecAddress, Fr, type FunctionSelector, type GrumpkinScalar, - MembershipWitness, - type NOTE_HASH_TREE_HEIGHT, - PUBLIC_DATA_TREE_HEIGHT, type Point, + type VerificationKeyAsFields, + computeContractClassIdPreimage, + computeSaltedInitializationHash, +} from '@aztec/circuits.js'; +import { computePublicDataTreeLeafSlot, deriveStorageSlotInMap } from '@aztec/circuits.js/hash'; +import { UpdatedClassIdHints } from '@aztec/circuits.js/kernel'; +import { ScheduledDelayChange, ScheduledValueChange, + computeSharedMutableHashSlot, +} from '@aztec/circuits.js/shared-mutable'; +import { + type NOTE_HASH_TREE_HEIGHT, + PUBLIC_DATA_TREE_HEIGHT, UPDATED_CLASS_IDS_SLOT, UPDATES_SCHEDULED_VALUE_CHANGE_LEN, UPDATES_VALUE_SIZE, - UpdatedClassIdHints, VK_TREE_HEIGHT, - type VerificationKeyAsFields, - computeContractClassIdPreimage, - computeSaltedInitializationHash, - computeSharedMutableHashSlot, -} from '@aztec/circuits.js'; -import { computePublicDataTreeLeafSlot, deriveStorageSlotInMap } from '@aztec/circuits.js/hash'; +} from '@aztec/constants'; import { createLogger } from '@aztec/foundation/log'; import { type Tuple } from '@aztec/foundation/serialize'; +import { MembershipWitness } from '@aztec/foundation/trees'; import { type KeyStore } from '@aztec/key-store'; import { getVKIndex, getVKSiblingPath } from '@aztec/noir-protocol-circuits-types/vks'; import { ProtocolContractAddress } from '@aztec/protocol-contracts'; diff --git a/yarn-project/pxe/src/kernel_prover/hints/build_private_kernel_reset_private_inputs.ts b/yarn-project/pxe/src/kernel_prover/hints/build_private_kernel_reset_private_inputs.ts index a30eea314994..cb46c5edb59d 100644 --- a/yarn-project/pxe/src/kernel_prover/hints/build_private_kernel_reset_private_inputs.ts +++ b/yarn-project/pxe/src/kernel_prover/hints/build_private_kernel_reset_private_inputs.ts @@ -1,20 +1,12 @@ -import { type PrivateCallExecutionResult, type PrivateKernelSimulateOutput, collectNested } from '@aztec/circuit-types'; +import { + type PrivateCallExecutionResult, + type PrivateKernelSimulateOutput, + collectNested, +} from '@aztec/circuit-types/interfaces/client'; import { type Fr, KeyValidationHint, - MAX_KEY_VALIDATION_REQUESTS_PER_TX, - MAX_NOTE_HASHES_PER_TX, - MAX_NOTE_HASH_READ_REQUESTS_PER_TX, - MAX_NULLIFIERS_PER_TX, - MAX_NULLIFIER_READ_REQUESTS_PER_TX, - MembershipWitness, - NULLIFIER_TREE_HEIGHT, type PrivateCircuitPublicInputs, - type PrivateKernelCircuitPublicInputs, - PrivateKernelData, - PrivateKernelResetCircuitPrivateInputs, - PrivateKernelResetDimensions, - PrivateKernelResetHints, type ReadRequest, ReadRequestResetStates, ReadRequestState, @@ -22,8 +14,6 @@ import { ScopedNoteHash, ScopedNullifier, ScopedReadRequest, - TransientDataIndexHint, - VK_TREE_HEIGHT, buildNoteHashReadRequestHintsFromResetStates, buildNullifierReadRequestHintsFromResetStates, buildTransientDataHints, @@ -32,11 +22,29 @@ import { getNonEmptyItems, getNoteHashReadRequestResetStates, getNullifierReadRequestResetStates, - privateKernelResetDimensionNames, } from '@aztec/circuits.js'; +import { + type PrivateKernelCircuitPublicInputs, + PrivateKernelData, + PrivateKernelResetCircuitPrivateInputs, + PrivateKernelResetDimensions, + PrivateKernelResetHints, + TransientDataIndexHint, + privateKernelResetDimensionNames, +} from '@aztec/circuits.js/kernel'; +import { + MAX_KEY_VALIDATION_REQUESTS_PER_TX, + MAX_NOTE_HASHES_PER_TX, + MAX_NOTE_HASH_READ_REQUESTS_PER_TX, + MAX_NULLIFIERS_PER_TX, + MAX_NULLIFIER_READ_REQUESTS_PER_TX, + NULLIFIER_TREE_HEIGHT, + VK_TREE_HEIGHT, +} from '@aztec/constants'; import { makeTuple } from '@aztec/foundation/array'; import { padArrayEnd } from '@aztec/foundation/collection'; import { type Tuple, assertLength } from '@aztec/foundation/serialize'; +import { MembershipWitness } from '@aztec/foundation/trees'; import { privateKernelResetDimensionsConfig } from '@aztec/noir-protocol-circuits-types/client'; import { type ProvingDataOracle } from '../proving_data_oracle.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 027440960c2a..7813e52a1de6 100644 --- a/yarn-project/pxe/src/kernel_prover/kernel_prover.test.ts +++ b/yarn-project/pxe/src/kernel_prover/kernel_prover.test.ts @@ -1,33 +1,33 @@ +import { Note, PublicExecutionRequest } from '@aztec/circuit-types'; import { - Note, NoteAndSlot, PrivateCallExecutionResult, PrivateExecutionResult, type PrivateKernelProver, - PublicExecutionRequest, -} from '@aztec/circuit-types'; +} from '@aztec/circuit-types/interfaces/client'; import { - CLIENT_IVC_VERIFICATION_KEY_LENGTH_IN_FIELDS, FunctionSelector, - MAX_NOTE_HASHES_PER_CALL, - MAX_NOTE_HASHES_PER_TX, - MembershipWitness, NoteHash, PrivateCircuitPublicInputs, - PrivateKernelCircuitPublicInputs, - PrivateKernelTailCircuitPublicInputs, PublicKeys, ScopedNoteHash, type TxRequest, - VK_TREE_HEIGHT, VerificationKey, VerificationKeyAsFields, } from '@aztec/circuits.js'; +import { NoteSelector } from '@aztec/circuits.js/abi'; +import { PrivateKernelCircuitPublicInputs, PrivateKernelTailCircuitPublicInputs } from '@aztec/circuits.js/kernel'; import { makeTxRequest } from '@aztec/circuits.js/testing'; -import { NoteSelector } from '@aztec/foundation/abi'; +import { + CLIENT_IVC_VERIFICATION_KEY_LENGTH_IN_FIELDS, + MAX_NOTE_HASHES_PER_CALL, + MAX_NOTE_HASHES_PER_TX, + 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'; import { mock } from 'jest-mock-extended'; diff --git a/yarn-project/pxe/src/kernel_prover/kernel_prover.ts b/yarn-project/pxe/src/kernel_prover/kernel_prover.ts index 814851129f41..8d7eb02fb325 100644 --- a/yarn-project/pxe/src/kernel_prover/kernel_prover.ts +++ b/yarn-project/pxe/src/kernel_prover/kernel_prover.ts @@ -8,12 +8,19 @@ import { collectNoteHashNullifierCounterMap, collectPublicTeardownFunctionCall, getFinalMinRevertibleSideEffectCounter, -} from '@aztec/circuit-types'; +} from '@aztec/circuit-types/interfaces/client'; import { AztecAddress, - CLIENT_IVC_VERIFICATION_KEY_LENGTH_IN_FIELDS, ClientIvcProof, Fr, + type PrivateLog, + type ScopedPrivateLogData, + type TxRequest, + VerificationKeyAsFields, + computeContractAddressFromInstance, +} from '@aztec/circuits.js'; +import { hashVK } from '@aztec/circuits.js/hash'; +import { PrivateCallData, PrivateKernelCircuitPublicInputs, PrivateKernelData, @@ -21,15 +28,9 @@ import { PrivateKernelInnerCircuitPrivateInputs, PrivateKernelTailCircuitPrivateInputs, type PrivateKernelTailCircuitPublicInputs, - type PrivateLog, PrivateVerificationKeyHints, - type ScopedPrivateLogData, - type TxRequest, - VK_TREE_HEIGHT, - VerificationKeyAsFields, - computeContractAddressFromInstance, -} from '@aztec/circuits.js'; -import { hashVK } from '@aztec/circuits.js/hash'; +} from '@aztec/circuits.js/kernel'; +import { CLIENT_IVC_VERIFICATION_KEY_LENGTH_IN_FIELDS, VK_TREE_HEIGHT } from '@aztec/constants'; import { vkAsFieldsMegaHonk } from '@aztec/foundation/crypto'; import { createLogger } from '@aztec/foundation/log'; import { assertLength } from '@aztec/foundation/serialize'; 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 21f5013df128..891a6db580f6 100644 --- a/yarn-project/pxe/src/kernel_prover/proving_data_oracle.ts +++ b/yarn-project/pxe/src/kernel_prover/proving_data_oracle.ts @@ -1,18 +1,16 @@ -import { type NullifierMembershipWitness } from '@aztec/circuit-types'; +import { type NullifierMembershipWitness } from '@aztec/circuit-types/interfaces/client'; import { - type FUNCTION_TREE_HEIGHT, type Fr, type FunctionSelector, type GrumpkinScalar, - type MembershipWitness, - type NOTE_HASH_TREE_HEIGHT, type Point, type PublicKeys, - type UpdatedClassIdHints, - type VK_TREE_HEIGHT, type VerificationKeyAsFields, } from '@aztec/circuits.js'; +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'; /** * Provides functionality to fetch membership witnesses for verification keys, diff --git a/yarn-project/pxe/src/pxe_http/pxe_http_server.ts b/yarn-project/pxe/src/pxe_http/pxe_http_server.ts index 7d0f38c66400..b4d6e246b22c 100644 --- a/yarn-project/pxe/src/pxe_http/pxe_http_server.ts +++ b/yarn-project/pxe/src/pxe_http/pxe_http_server.ts @@ -1,4 +1,4 @@ -import { type PXE, PXESchema } from '@aztec/circuit-types'; +import { type PXE, PXESchema } from '@aztec/circuit-types/interfaces/client'; import { createNamespacedSafeJsonRpcServer, createSafeJsonRpcServer } from '@aztec/foundation/json-rpc/server'; import http from 'http'; diff --git a/yarn-project/pxe/src/pxe_service/error_enriching.ts b/yarn-project/pxe/src/pxe_service/error_enriching.ts index bb2d4f90dc4c..38d96d3721b3 100644 --- a/yarn-project/pxe/src/pxe_service/error_enriching.ts +++ b/yarn-project/pxe/src/pxe_service/error_enriching.ts @@ -1,6 +1,6 @@ import { type SimulationError, isNoirCallStackUnresolved } from '@aztec/circuit-types'; -import { PUBLIC_DISPATCH_SELECTOR } from '@aztec/circuits.js/constants'; -import { FunctionSelector } from '@aztec/foundation/abi'; +import { FunctionSelector } from '@aztec/circuits.js/abi'; +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'; diff --git a/yarn-project/pxe/src/pxe_service/index.ts b/yarn-project/pxe/src/pxe_service/index.ts index 66f9aae2adda..a689df00e861 100644 --- a/yarn-project/pxe/src/pxe_service/index.ts +++ b/yarn-project/pxe/src/pxe_service/index.ts @@ -1,3 +1,2 @@ export * from './pxe_service.js'; export { enrichPublicSimulationError } from './error_enriching.js'; -export { pxeTestSuite } from './test/pxe_test_suite.js'; diff --git a/yarn-project/pxe/src/pxe_service/pxe_service.ts b/yarn-project/pxe/src/pxe_service/pxe_service.ts index 791de166f69c..274d58773963 100644 --- a/yarn-project/pxe/src/pxe_service/pxe_service.ts +++ b/yarn-project/pxe/src/pxe_service/pxe_service.ts @@ -1,8 +1,6 @@ import { type AuthWitness, - type AztecNode, EventMetadata, - type EventMetadataDefinition, type ExtendedNote, type FunctionCall, type GetContractClassLogsResponse, @@ -13,11 +11,6 @@ import { type LogFilter, MerkleTreeId, type NotesFilter, - type PXE, - type PXEInfo, - type PrivateExecutionResult, - type PrivateKernelProver, - type PrivateKernelSimulateOutput, PrivateSimulationResult, type PublicSimulationOutput, type SiblingPath, @@ -32,19 +25,23 @@ import { UniqueNote, getNonNullifiedL1ToL2MessageWitness, } from '@aztec/circuit-types'; +import { + type AztecNode, + type EventMetadataDefinition, + type PXE, + type PXEInfo, + type PrivateExecutionResult, + type PrivateKernelProver, + type PrivateKernelSimulateOutput, +} from '@aztec/circuit-types/interfaces/client'; import type { CompleteAddress, ContractClassWithId, ContractInstanceWithAddress, GasFees, - L1_TO_L2_MSG_TREE_HEIGHT, NodeInfo, PartialAddress, - PrivateKernelTailCircuitPublicInputs, } from '@aztec/circuits.js'; -import { computeContractAddressFromInstance, getContractClassFromArtifact } from '@aztec/circuits.js/contract'; -import { computeNoteHashNonce, siloNullifier } from '@aztec/circuits.js/hash'; -import { computeAddressSecret } from '@aztec/circuits.js/keys'; import { type AbiDecoded, type ContractArtifact, @@ -53,7 +50,12 @@ import { FunctionType, decodeFunctionSignature, encodeArguments, -} from '@aztec/foundation/abi'; +} from '@aztec/circuits.js/abi'; +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'; diff --git a/yarn-project/pxe/src/pxe_service/test/pxe_service.test.ts b/yarn-project/pxe/src/pxe_service/test/pxe_service.test.ts index 81cd434099ed..ce39c7a24d44 100644 --- a/yarn-project/pxe/src/pxe_service/test/pxe_service.test.ts +++ b/yarn-project/pxe/src/pxe_service/test/pxe_service.test.ts @@ -1,13 +1,8 @@ import { BBWASMBundlePrivateKernelProver } from '@aztec/bb-prover/wasm/bundle'; -import { - type AztecNode, - type PXE, - type PrivateKernelProver, - TxEffect, - mockTx, - randomInBlock, -} from '@aztec/circuit-types'; -import { INITIAL_L2_BLOCK_NUM } from '@aztec/circuits.js/constants'; +import { TxEffect, randomInBlock } from '@aztec/circuit-types'; +import { type AztecNode, type PXE, type PrivateKernelProver } from '@aztec/circuit-types/interfaces/client'; +import { mockTx } from '@aztec/circuit-types/testing'; +import { INITIAL_L2_BLOCK_NUM } from '@aztec/constants'; import { type L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses'; import { EthAddress } from '@aztec/foundation/eth-address'; import { KeyStore } from '@aztec/key-store'; diff --git a/yarn-project/pxe/src/pxe_service/test/pxe_test_suite.ts b/yarn-project/pxe/src/pxe_service/test/pxe_test_suite.ts index f153c0787876..26afdf41b649 100644 --- a/yarn-project/pxe/src/pxe_service/test/pxe_test_suite.ts +++ b/yarn-project/pxe/src/pxe_service/test/pxe_test_suite.ts @@ -1,10 +1,11 @@ +import { type PXE } from '@aztec/circuit-types/interfaces/client'; import { - type PXE, randomContractArtifact, randomContractInstanceWithAddress, randomDeployedContract, -} from '@aztec/circuit-types'; -import { AztecAddress, Fr, INITIAL_L2_BLOCK_NUM, getContractClassFromArtifact } from '@aztec/circuits.js'; +} from '@aztec/circuit-types/testing'; +import { AztecAddress, Fr, getContractClassFromArtifact } from '@aztec/circuits.js'; +import { INITIAL_L2_BLOCK_NUM } from '@aztec/constants'; import omit from 'lodash.omit'; diff --git a/yarn-project/pxe/src/simulator/index.ts b/yarn-project/pxe/src/simulator/index.ts index e1ee9ab457b2..51f3a56584a5 100644 --- a/yarn-project/pxe/src/simulator/index.ts +++ b/yarn-project/pxe/src/simulator/index.ts @@ -1,4 +1,4 @@ -import { type AztecNode } from '@aztec/circuit-types'; +import { type AztecNode } from '@aztec/circuit-types/interfaces/client'; import { type KeyStore } from '@aztec/key-store'; import { AcirSimulator, type SimulationProvider } from '@aztec/simulator/client'; diff --git a/yarn-project/pxe/src/simulator_oracle/index.ts b/yarn-project/pxe/src/simulator_oracle/index.ts index 087994eb6b99..35e4c8dc65b3 100644 --- a/yarn-project/pxe/src/simulator_oracle/index.ts +++ b/yarn-project/pxe/src/simulator_oracle/index.ts @@ -1,19 +1,21 @@ import { - type AztecNode, type FunctionCall, type InBlock, L1NotePayload, type L2Block, - type L2BlockNumber, MerkleTreeId, Note, type NoteStatus, - type NullifierMembershipWitness, type PublicDataWitness, TxHash, type TxScopedL2Log, getNonNullifiedL1ToL2MessageWitness, } from '@aztec/circuit-types'; +import { + type AztecNode, + type L2BlockNumber, + type NullifierMembershipWitness, +} from '@aztec/circuit-types/interfaces/client'; import { type AztecAddress, type BlockHeader, @@ -23,22 +25,20 @@ import { FunctionSelector, IndexedTaggingSecret, type KeyValidationRequest, - type L1_TO_L2_MSG_TREE_HEIGHT, - MAX_NOTE_HASHES_PER_TX, - PRIVATE_LOG_SIZE_IN_FIELDS, PrivateLog, PublicLog, computeAddressSecret, computeTaggingSecretPoint, } from '@aztec/circuits.js'; -import { computeUniqueNoteHash, siloNoteHash, siloNullifier } from '@aztec/circuits.js/hash'; import { type FunctionArtifact, FunctionType, NoteSelector, encodeArguments, getFunctionArtifact, -} from '@aztec/foundation/abi'; +} from '@aztec/circuits.js/abi'; +import { computeUniqueNoteHash, siloNoteHash, siloNullifier } from '@aztec/circuits.js/hash'; +import { type L1_TO_L2_MSG_TREE_HEIGHT, MAX_NOTE_HASHES_PER_TX, PRIVATE_LOG_SIZE_IN_FIELDS } from '@aztec/constants'; import { timesParallel } from '@aztec/foundation/collection'; import { poseidon2Hash } from '@aztec/foundation/crypto'; import { createLogger } from '@aztec/foundation/log'; diff --git a/yarn-project/pxe/src/simulator_oracle/simulator_oracle.test.ts b/yarn-project/pxe/src/simulator_oracle/simulator_oracle.test.ts index 54f087962736..f44e3bfad9f6 100644 --- a/yarn-project/pxe/src/simulator_oracle/simulator_oracle.test.ts +++ b/yarn-project/pxe/src/simulator_oracle/simulator_oracle.test.ts @@ -1,5 +1,4 @@ import { - type AztecNode, EncryptedLogPayload, L1NotePayload, L2Block, @@ -7,27 +6,25 @@ import { type TxEffect, TxHash, TxScopedL2Log, - randomContractArtifact, - randomContractInstanceWithAddress, randomInBlock, wrapInBlock, } from '@aztec/circuit-types'; +import { type AztecNode } from '@aztec/circuit-types/interfaces/client'; +import { randomContractArtifact, randomContractInstanceWithAddress } from '@aztec/circuit-types/testing'; import { AztecAddress, CompleteAddress, type Fq, Fr, GrumpkinScalar, - INITIAL_L2_BLOCK_NUM, IndexedTaggingSecret, - MAX_NOTE_HASHES_PER_TX, - PUBLIC_LOG_DATA_SIZE_IN_FIELDS, PublicLog, computeAddress, computeTaggingSecretPoint, deriveKeys, } from '@aztec/circuits.js'; -import { type FunctionArtifact, FunctionSelector, FunctionType } from '@aztec/foundation/abi'; +import { type FunctionArtifact, FunctionSelector, FunctionType } from '@aztec/circuits.js/abi'; +import { INITIAL_L2_BLOCK_NUM, MAX_NOTE_HASHES_PER_TX, PUBLIC_LOG_DATA_SIZE_IN_FIELDS } from '@aztec/constants'; import { timesParallel } from '@aztec/foundation/collection'; import { pedersenHash, poseidon2Hash } from '@aztec/foundation/crypto'; import { KeyStore } from '@aztec/key-store'; diff --git a/yarn-project/pxe/src/synchronizer/synchronizer.test.ts b/yarn-project/pxe/src/synchronizer/synchronizer.test.ts index ac24ee43eb86..392f940ca72c 100644 --- a/yarn-project/pxe/src/synchronizer/synchronizer.test.ts +++ b/yarn-project/pxe/src/synchronizer/synchronizer.test.ts @@ -1,4 +1,5 @@ -import { type AztecNode, L2Block, type L2BlockStream } from '@aztec/circuit-types'; +import { L2Block, type L2BlockStream } from '@aztec/circuit-types'; +import { type AztecNode } from '@aztec/circuit-types/interfaces/client'; import { timesParallel } from '@aztec/foundation/collection'; import { openTmpStore } from '@aztec/kv-store/lmdb'; import { L2TipsStore } from '@aztec/kv-store/stores'; diff --git a/yarn-project/pxe/src/synchronizer/synchronizer.ts b/yarn-project/pxe/src/synchronizer/synchronizer.ts index c0e93b02fb84..c0943ec76642 100644 --- a/yarn-project/pxe/src/synchronizer/synchronizer.ts +++ b/yarn-project/pxe/src/synchronizer/synchronizer.ts @@ -1,10 +1,6 @@ -import { - type AztecNode, - L2BlockStream, - type L2BlockStreamEvent, - type L2BlockStreamEventHandler, -} from '@aztec/circuit-types'; -import { INITIAL_L2_BLOCK_NUM } from '@aztec/circuits.js'; +import { L2BlockStream, type L2BlockStreamEvent, type L2BlockStreamEventHandler } from '@aztec/circuit-types'; +import { type AztecNode } from '@aztec/circuit-types/interfaces/client'; +import { INITIAL_L2_BLOCK_NUM } from '@aztec/constants'; import { type Logger, createLogger } from '@aztec/foundation/log'; import { type L2TipsStore } from '@aztec/kv-store/stores'; diff --git a/yarn-project/pxe/src/utils/create_pxe_service.ts b/yarn-project/pxe/src/utils/create_pxe_service.ts index 4a093f17d560..5aa81e86304f 100644 --- a/yarn-project/pxe/src/utils/create_pxe_service.ts +++ b/yarn-project/pxe/src/utils/create_pxe_service.ts @@ -1,6 +1,6 @@ import { BBNativePrivateKernelProver } from '@aztec/bb-prover'; import { BBWASMBundlePrivateKernelProver } from '@aztec/bb-prover/wasm/bundle'; -import { type AztecNode, type PrivateKernelProver } from '@aztec/circuit-types'; +import { type AztecNode, type PrivateKernelProver } from '@aztec/circuit-types/interfaces/client'; import { randomBytes } from '@aztec/foundation/crypto'; import { createLogger } from '@aztec/foundation/log'; import { KeyStore } from '@aztec/key-store'; diff --git a/yarn-project/pxe/tsconfig.json b/yarn-project/pxe/tsconfig.json index 1db338e8540f..029143616686 100644 --- a/yarn-project/pxe/tsconfig.json +++ b/yarn-project/pxe/tsconfig.json @@ -18,6 +18,9 @@ { "path": "../circuits.js" }, + { + "path": "../constants" + }, { "path": "../ethereum" }, diff --git a/yarn-project/sequencer-client/package.json b/yarn-project/sequencer-client/package.json index e8fb8d24601a..9d19cef0ae10 100644 --- a/yarn-project/sequencer-client/package.json +++ b/yarn-project/sequencer-client/package.json @@ -34,6 +34,7 @@ "@aztec/blob-sink": "workspace:^", "@aztec/circuit-types": "workspace:^", "@aztec/circuits.js": "workspace:^", + "@aztec/constants": "workspace:^", "@aztec/epoch-cache": "workspace:^", "@aztec/ethereum": "workspace:^", "@aztec/foundation": "workspace:^", diff --git a/yarn-project/sequencer-client/src/client/sequencer-client.ts b/yarn-project/sequencer-client/src/client/sequencer-client.ts index b76680e9ee58..8e38bbdcd572 100644 --- a/yarn-project/sequencer-client/src/client/sequencer-client.ts +++ b/yarn-project/sequencer-client/src/client/sequencer-client.ts @@ -1,5 +1,6 @@ import { type BlobSinkClientInterface } from '@aztec/blob-sink/client'; -import { type L1ToL2MessageSource, type L2BlockSource, type WorldStateSynchronizer } from '@aztec/circuit-types'; +import { type L1ToL2MessageSource, type L2BlockSource } from '@aztec/circuit-types'; +import { type WorldStateSynchronizer } from '@aztec/circuit-types/interfaces/server'; import { type AztecAddress, type ContractDataSource } from '@aztec/circuits.js'; import { EpochCache } from '@aztec/epoch-cache'; import { diff --git a/yarn-project/sequencer-client/src/sequencer/allowed.ts b/yarn-project/sequencer-client/src/sequencer/allowed.ts index a343b1d66747..aab84f85ae50 100644 --- a/yarn-project/sequencer-client/src/sequencer/allowed.ts +++ b/yarn-project/sequencer-client/src/sequencer/allowed.ts @@ -1,4 +1,4 @@ -import { type AllowedElement } from '@aztec/circuit-types'; +import { type AllowedElement } from '@aztec/circuit-types/interfaces/server'; import { getContractClassFromArtifact } from '@aztec/circuits.js'; import { FPCContract } from '@aztec/noir-contracts.js/FPC'; import { TokenContractArtifact } from '@aztec/noir-contracts.js/Token'; diff --git a/yarn-project/sequencer-client/src/sequencer/sequencer.test.ts b/yarn-project/sequencer-client/src/sequencer/sequencer.test.ts index bb7118130e5f..6317da1e7fe4 100644 --- a/yarn-project/sequencer-client/src/sequencer/sequencer.test.ts +++ b/yarn-project/sequencer-client/src/sequencer/sequencer.test.ts @@ -1,6 +1,5 @@ import { BlockAttestation, - type BlockBuilder, BlockProposal, Body, ConsensusPayload, @@ -8,15 +7,18 @@ import { L2Block, type L2BlockSource, type MerkleTreeId, - type MerkleTreeReadOperations, - type MerkleTreeWriteOperations, type Tx, TxHash, - WorldStateRunningState, - type WorldStateSynchronizer, makeProcessedTxFromPrivateOnlyTx, - mockTxForRollup, } from '@aztec/circuit-types'; +import { + type BlockBuilder, + type MerkleTreeReadOperations, + type MerkleTreeWriteOperations, + WorldStateRunningState, + type WorldStateSynchronizer, +} from '@aztec/circuit-types/interfaces/server'; +import { mockTxForRollup } from '@aztec/circuit-types/testing'; import { AztecAddress, BlockHeader, @@ -26,10 +28,10 @@ import { type Gas, GasFees, GlobalVariables, - NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, PublicDataWrite, } from '@aztec/circuits.js'; import { makeAppendOnlyTreeSnapshot } from '@aztec/circuits.js/testing'; +import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants'; import { DefaultL1ContractsConfig } from '@aztec/ethereum'; import { Buffer32 } from '@aztec/foundation/buffer'; import { times, timesParallel } from '@aztec/foundation/collection'; diff --git a/yarn-project/sequencer-client/src/sequencer/sequencer.ts b/yarn-project/sequencer-client/src/sequencer/sequencer.ts index a554323f5306..2843926f9339 100644 --- a/yarn-project/sequencer-client/src/sequencer/sequencer.ts +++ b/yarn-project/sequencer-client/src/sequencer/sequencer.ts @@ -4,23 +4,26 @@ import { type L2Block, type L2BlockSource, MerkleTreeId, - SequencerConfigSchema, Tx, type TxHash, - type WorldStateSynchronizer, } from '@aztec/circuit-types'; -import type { AllowedElement, WorldStateSynchronizerStatus } from '@aztec/circuit-types/interfaces'; +import { + type AllowedElement, + SequencerConfigSchema, + type WorldStateSynchronizer, + type WorldStateSynchronizerStatus, +} from '@aztec/circuit-types/interfaces/server'; import { type L2BlockBuiltStats } from '@aztec/circuit-types/stats'; import { - AppendOnlyTreeSnapshot, BlockHeader, ContentCommitment, type ContractDataSource, Gas, type GlobalVariables, - INITIAL_L2_BLOCK_NUM, StateReference, } from '@aztec/circuits.js'; +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'; diff --git a/yarn-project/sequencer-client/src/slasher/slasher_client.ts b/yarn-project/sequencer-client/src/slasher/slasher_client.ts index a92dae9fe3af..debe5ef6ef3c 100644 --- a/yarn-project/sequencer-client/src/slasher/slasher_client.ts +++ b/yarn-project/sequencer-client/src/slasher/slasher_client.ts @@ -6,7 +6,7 @@ import { type L2BlockStreamEvent, type L2Tips, } from '@aztec/circuit-types'; -import { INITIAL_L2_BLOCK_NUM } from '@aztec/circuits.js/constants'; +import { INITIAL_L2_BLOCK_NUM } from '@aztec/constants'; import { type L1ContractsConfig, type L1ReaderConfig, createEthereumChain } from '@aztec/ethereum'; import { EthAddress } from '@aztec/foundation/eth-address'; import { createLogger } from '@aztec/foundation/log'; diff --git a/yarn-project/sequencer-client/src/tx_validator/archive_cache.test.ts b/yarn-project/sequencer-client/src/tx_validator/archive_cache.test.ts index 01484b2052fd..bb48f1f3e38b 100644 --- a/yarn-project/sequencer-client/src/tx_validator/archive_cache.test.ts +++ b/yarn-project/sequencer-client/src/tx_validator/archive_cache.test.ts @@ -1,4 +1,5 @@ -import { MerkleTreeId, type MerkleTreeReadOperations } from '@aztec/circuit-types'; +import { MerkleTreeId } from '@aztec/circuit-types'; +import { type MerkleTreeReadOperations } from '@aztec/circuit-types/interfaces/server'; import { Fr } from '@aztec/circuits.js'; import { type MockProxy, mock } from 'jest-mock-extended'; diff --git a/yarn-project/sequencer-client/src/tx_validator/archive_cache.ts b/yarn-project/sequencer-client/src/tx_validator/archive_cache.ts index d887d87e678a..939b5f957dd9 100644 --- a/yarn-project/sequencer-client/src/tx_validator/archive_cache.ts +++ b/yarn-project/sequencer-client/src/tx_validator/archive_cache.ts @@ -1,4 +1,5 @@ -import { MerkleTreeId, type MerkleTreeReadOperations } from '@aztec/circuit-types'; +import { MerkleTreeId } from '@aztec/circuit-types'; +import { type MerkleTreeReadOperations } from '@aztec/circuit-types/interfaces/server'; import { type Fr } from '@aztec/circuits.js'; import { type ArchiveSource } from '@aztec/p2p'; diff --git a/yarn-project/sequencer-client/src/tx_validator/gas_validator.test.ts b/yarn-project/sequencer-client/src/tx_validator/gas_validator.test.ts index 07b8868c8314..e196d1714c05 100644 --- a/yarn-project/sequencer-client/src/tx_validator/gas_validator.test.ts +++ b/yarn-project/sequencer-client/src/tx_validator/gas_validator.test.ts @@ -1,6 +1,8 @@ -import { type Tx, mockTx } from '@aztec/circuit-types'; -import { AztecAddress, Fr, FunctionSelector, GasFees, GasSettings, PUBLIC_DISPATCH_SELECTOR } from '@aztec/circuits.js'; -import { U128 } from '@aztec/foundation/abi'; +import { type Tx } from '@aztec/circuit-types'; +import { mockTx } from '@aztec/circuit-types/testing'; +import { AztecAddress, Fr, FunctionSelector, GasFees, GasSettings } from '@aztec/circuits.js'; +import { U128 } from '@aztec/circuits.js/abi'; +import { PUBLIC_DISPATCH_SELECTOR } from '@aztec/constants'; import { type Writeable } from '@aztec/foundation/types'; import { ProtocolContractAddress } from '@aztec/protocol-contracts'; import { computeFeePayerBalanceStorageSlot } from '@aztec/protocol-contracts/fee-juice'; diff --git a/yarn-project/sequencer-client/src/tx_validator/gas_validator.ts b/yarn-project/sequencer-client/src/tx_validator/gas_validator.ts index f99fc2d1b402..e82cc702bae4 100644 --- a/yarn-project/sequencer-client/src/tx_validator/gas_validator.ts +++ b/yarn-project/sequencer-client/src/tx_validator/gas_validator.ts @@ -1,6 +1,6 @@ import { type Tx, TxExecutionPhase, type TxValidationResult, type TxValidator } from '@aztec/circuit-types'; import { type AztecAddress, Fr, FunctionSelector, type GasFees } from '@aztec/circuits.js'; -import { U128 } from '@aztec/foundation/abi'; +import { U128 } from '@aztec/circuits.js/abi'; import { createLogger } from '@aztec/foundation/log'; import { computeFeePayerBalanceStorageSlot } from '@aztec/protocol-contracts/fee-juice'; import { getExecutionRequestsByPhase } from '@aztec/simulator/server'; diff --git a/yarn-project/sequencer-client/src/tx_validator/nullifier_cache.test.ts b/yarn-project/sequencer-client/src/tx_validator/nullifier_cache.test.ts index 136ad73056ac..20d191ad10f3 100644 --- a/yarn-project/sequencer-client/src/tx_validator/nullifier_cache.test.ts +++ b/yarn-project/sequencer-client/src/tx_validator/nullifier_cache.test.ts @@ -1,4 +1,5 @@ -import { MerkleTreeId, type MerkleTreeReadOperations } from '@aztec/circuit-types'; +import { MerkleTreeId } from '@aztec/circuit-types'; +import { type MerkleTreeReadOperations } from '@aztec/circuit-types/interfaces/server'; import { times } from '@aztec/foundation/collection'; import { type MockProxy, mock } from 'jest-mock-extended'; diff --git a/yarn-project/sequencer-client/src/tx_validator/nullifier_cache.ts b/yarn-project/sequencer-client/src/tx_validator/nullifier_cache.ts index 3175f05e1d04..55f6e1c9430a 100644 --- a/yarn-project/sequencer-client/src/tx_validator/nullifier_cache.ts +++ b/yarn-project/sequencer-client/src/tx_validator/nullifier_cache.ts @@ -1,4 +1,5 @@ -import { MerkleTreeId, type MerkleTreeReadOperations } from '@aztec/circuit-types'; +import { MerkleTreeId } from '@aztec/circuit-types'; +import { type MerkleTreeReadOperations } from '@aztec/circuit-types/interfaces/server'; import { type NullifierSource } from '@aztec/p2p'; /** diff --git a/yarn-project/sequencer-client/src/tx_validator/phases_validator.test.ts b/yarn-project/sequencer-client/src/tx_validator/phases_validator.test.ts index 20e38a4fb4ce..230fbb89e0fc 100644 --- a/yarn-project/sequencer-client/src/tx_validator/phases_validator.test.ts +++ b/yarn-project/sequencer-client/src/tx_validator/phases_validator.test.ts @@ -1,4 +1,5 @@ -import { type Tx, mockTx } from '@aztec/circuit-types'; +import { type Tx } from '@aztec/circuit-types'; +import { mockTx } from '@aztec/circuit-types/testing'; import { type AztecAddress, type ContractDataSource, Fr, type FunctionSelector } from '@aztec/circuits.js'; import { makeAztecAddress, makeSelector } from '@aztec/circuits.js/testing'; diff --git a/yarn-project/sequencer-client/src/tx_validator/phases_validator.ts b/yarn-project/sequencer-client/src/tx_validator/phases_validator.ts index 82f021c90f1f..618995708f74 100644 --- a/yarn-project/sequencer-client/src/tx_validator/phases_validator.ts +++ b/yarn-project/sequencer-client/src/tx_validator/phases_validator.ts @@ -1,11 +1,11 @@ import { - type AllowedElement, type PublicExecutionRequest, Tx, TxExecutionPhase, type TxValidationResult, type TxValidator, } from '@aztec/circuit-types'; +import { type AllowedElement } from '@aztec/circuit-types/interfaces/server'; import { type ContractDataSource } from '@aztec/circuits.js'; import { createLogger } from '@aztec/foundation/log'; import { ContractsDataSourcePublicDB, getExecutionRequestsByPhase } from '@aztec/simulator/server'; diff --git a/yarn-project/sequencer-client/src/tx_validator/tx_validator_factory.ts b/yarn-project/sequencer-client/src/tx_validator/tx_validator_factory.ts index c716aa3db9a5..b5ce56f55869 100644 --- a/yarn-project/sequencer-client/src/tx_validator/tx_validator_factory.ts +++ b/yarn-project/sequencer-client/src/tx_validator/tx_validator_factory.ts @@ -1,11 +1,9 @@ +import { type ProcessedTx, type Tx, type TxValidator } from '@aztec/circuit-types'; import { type AllowedElement, type ClientProtocolCircuitVerifier, type MerkleTreeReadOperations, - type ProcessedTx, - type Tx, - type TxValidator, -} from '@aztec/circuit-types'; +} from '@aztec/circuit-types/interfaces/server'; import { type AztecAddress, type ContractDataSource, Fr, type GasFees, type GlobalVariables } from '@aztec/circuits.js'; import { AggregateTxValidator, diff --git a/yarn-project/sequencer-client/tsconfig.json b/yarn-project/sequencer-client/tsconfig.json index 64c3377012ea..de21e8a2dfe0 100644 --- a/yarn-project/sequencer-client/tsconfig.json +++ b/yarn-project/sequencer-client/tsconfig.json @@ -24,6 +24,9 @@ { "path": "../circuits.js" }, + { + "path": "../constants" + }, { "path": "../epoch-cache" }, diff --git a/yarn-project/simulator/package.json b/yarn-project/simulator/package.json index b295c556764d..19e5db735b36 100644 --- a/yarn-project/simulator/package.json +++ b/yarn-project/simulator/package.json @@ -62,6 +62,7 @@ "dependencies": { "@aztec/circuit-types": "workspace:^", "@aztec/circuits.js": "workspace:^", + "@aztec/constants": "workspace:^", "@aztec/foundation": "workspace:^", "@aztec/noir-protocol-circuits-types": "workspace:^", "@aztec/protocol-contracts": "workspace:^", diff --git a/yarn-project/simulator/src/acvm/acvm.ts b/yarn-project/simulator/src/acvm/acvm.ts index 66298190bed3..01f1bcf83b45 100644 --- a/yarn-project/simulator/src/acvm/acvm.ts +++ b/yarn-project/simulator/src/acvm/acvm.ts @@ -1,5 +1,5 @@ import { type NoirCallStack } from '@aztec/circuit-types'; -import type { FunctionDebugMetadata } from '@aztec/foundation/abi'; +import type { FunctionDebugMetadata } from '@aztec/circuits.js/abi'; import { createLogger } from '@aztec/foundation/log'; import { diff --git a/yarn-project/simulator/src/acvm/oracle/oracle.ts b/yarn-project/simulator/src/acvm/oracle/oracle.ts index e1cd1aed5b65..3f1f3eaf9e79 100644 --- a/yarn-project/simulator/src/acvm/oracle/oracle.ts +++ b/yarn-project/simulator/src/acvm/oracle/oracle.ts @@ -1,5 +1,5 @@ import { MerkleTreeId, UnencryptedL2Log } from '@aztec/circuit-types'; -import { FunctionSelector, NoteSelector } from '@aztec/foundation/abi'; +import { FunctionSelector, NoteSelector } from '@aztec/circuits.js/abi'; import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; diff --git a/yarn-project/simulator/src/acvm/oracle/typed_oracle.ts b/yarn-project/simulator/src/acvm/oracle/typed_oracle.ts index e8594211633b..5fda45816c98 100644 --- a/yarn-project/simulator/src/acvm/oracle/typed_oracle.ts +++ b/yarn-project/simulator/src/acvm/oracle/typed_oracle.ts @@ -3,18 +3,18 @@ import { type MerkleTreeId, type Note, type NoteStatus, - type NullifierMembershipWitness, type PublicDataWitness, type UnencryptedL2Log, } from '@aztec/circuit-types'; +import { type NullifierMembershipWitness } from '@aztec/circuit-types/interfaces/server'; import { type BlockHeader, type ContractInstance, type IndexedTaggingSecret, type KeyValidationRequest, - type L1_TO_L2_MSG_TREE_HEIGHT, } from '@aztec/circuits.js'; -import { type FunctionSelector, type NoteSelector } from '@aztec/foundation/abi'; +import { type FunctionSelector, type NoteSelector } from '@aztec/circuits.js/abi'; +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'; diff --git a/yarn-project/simulator/src/avm/apps_tests/avm_test.test.ts b/yarn-project/simulator/src/avm/apps_tests/avm_test.test.ts index 180a5497dcfa..0dc4f8588165 100644 --- a/yarn-project/simulator/src/avm/apps_tests/avm_test.test.ts +++ b/yarn-project/simulator/src/avm/apps_tests/avm_test.test.ts @@ -1,9 +1,6 @@ -import { - AztecAddress, - type ContractInstanceWithAddress, - MAX_PUBLIC_CALLS_TO_UNIQUE_CONTRACT_CLASS_IDS, -} from '@aztec/circuits.js'; +import { AztecAddress, type ContractInstanceWithAddress } from '@aztec/circuits.js'; import { makeContractInstanceFromClassId } from '@aztec/circuits.js/testing'; +import { MAX_PUBLIC_CALLS_TO_UNIQUE_CONTRACT_CLASS_IDS } from '@aztec/constants'; import { Fr } from '@aztec/foundation/fields'; import { AvmTestContractArtifact } from '@aztec/noir-contracts.js/AvmTest'; diff --git a/yarn-project/simulator/src/avm/avm_gas.ts b/yarn-project/simulator/src/avm/avm_gas.ts index 84fcfa353ff0..6ae0e35ae29a 100644 --- a/yarn-project/simulator/src/avm/avm_gas.ts +++ b/yarn-project/simulator/src/avm/avm_gas.ts @@ -1,4 +1,4 @@ -import * as c from '@aztec/circuits.js/constants'; +import * as c from '@aztec/constants'; import { TypeTag } from './avm_memory_types.js'; import { InstructionExecutionError } from './errors.js'; diff --git a/yarn-project/simulator/src/avm/avm_memory_types.ts b/yarn-project/simulator/src/avm/avm_memory_types.ts index f5c6ba979ac4..0b00215d5a17 100644 --- a/yarn-project/simulator/src/avm/avm_memory_types.ts +++ b/yarn-project/simulator/src/avm/avm_memory_types.ts @@ -6,7 +6,7 @@ import { MEM_TAG_U32, MEM_TAG_U64, MEM_TAG_U128, -} from '@aztec/circuits.js'; +} from '@aztec/constants'; import { AztecAddress } from '@aztec/foundation/aztec-address'; import { toBufferBE } from '@aztec/foundation/bigint-buffer'; import { Fr } from '@aztec/foundation/fields'; diff --git a/yarn-project/simulator/src/avm/avm_simulator.test.ts b/yarn-project/simulator/src/avm/avm_simulator.test.ts index 0991ba47149e..a9738432366d 100644 --- a/yarn-project/simulator/src/avm/avm_simulator.test.ts +++ b/yarn-project/simulator/src/avm/avm_simulator.test.ts @@ -1,12 +1,7 @@ -import { MerkleTreeId, type MerkleTreeWriteOperations } from '@aztec/circuit-types'; -import { - DEPLOYER_CONTRACT_ADDRESS, - GasFees, - PublicDataTreeLeafPreimage, - PublicKeys, - SerializableContractInstance, -} from '@aztec/circuits.js'; -import { Grumpkin } from '@aztec/circuits.js/barretenberg'; +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 { computeNoteHashNonce, computePublicDataTreeLeafSlot, @@ -16,9 +11,18 @@ import { siloNullifier, } from '@aztec/circuits.js/hash'; import { makeContractClassPublic, makeContractInstanceFromClassId } from '@aztec/circuits.js/testing'; -import { FunctionSelector } from '@aztec/foundation/abi'; +import { PublicDataTreeLeafPreimage } from '@aztec/circuits.js/trees'; +import { DEPLOYER_CONTRACT_ADDRESS } from '@aztec/constants'; import { AztecAddress } from '@aztec/foundation/aztec-address'; -import { keccak256, keccakf1600, pedersenCommit, pedersenHash, poseidon2Hash, sha256 } from '@aztec/foundation/crypto'; +import { + Grumpkin, + keccak256, + keccakf1600, + pedersenCommit, + pedersenHash, + poseidon2Hash, + sha256, +} from '@aztec/foundation/crypto'; import { Fq, Fr, Point } from '@aztec/foundation/fields'; import { type Fieldable } from '@aztec/foundation/serialize'; import { NativeWorldStateService } from '@aztec/world-state'; diff --git a/yarn-project/simulator/src/avm/avm_simulator.ts b/yarn-project/simulator/src/avm/avm_simulator.ts index 871829f750c5..48925a9f78a9 100644 --- a/yarn-project/simulator/src/avm/avm_simulator.ts +++ b/yarn-project/simulator/src/avm/avm_simulator.ts @@ -1,4 +1,5 @@ -import { type AztecAddress, Fr, type GlobalVariables, MAX_L2_GAS_PER_TX_PUBLIC_PORTION } from '@aztec/circuits.js'; +import { type AztecAddress, Fr, type GlobalVariables } from '@aztec/circuits.js'; +import { MAX_L2_GAS_PER_TX_PUBLIC_PORTION } from '@aztec/constants'; import { type Logger, createLogger } from '@aztec/foundation/log'; import { strict as assert } from 'assert'; diff --git a/yarn-project/simulator/src/avm/avm_tree.test.ts b/yarn-project/simulator/src/avm/avm_tree.test.ts index 18f839027792..1007fe6e611b 100644 --- a/yarn-project/simulator/src/avm/avm_tree.test.ts +++ b/yarn-project/simulator/src/avm/avm_tree.test.ts @@ -1,18 +1,20 @@ +import { MerkleTreeId } from '@aztec/circuit-types'; import { type IndexedTreeId, - MerkleTreeId, type MerkleTreeWriteOperations, type SequentialInsertionResult, -} from '@aztec/circuit-types'; +} from '@aztec/circuit-types/interfaces/server'; +import { + type NullifierLeafPreimage, + PublicDataTreeLeaf, + type PublicDataTreeLeafPreimage, +} from '@aztec/circuits.js/trees'; import { NOTE_HASH_TREE_HEIGHT, NULLIFIER_SUBTREE_HEIGHT, NULLIFIER_TREE_HEIGHT, - type NullifierLeafPreimage, PUBLIC_DATA_TREE_HEIGHT, - PublicDataTreeLeaf, - type PublicDataTreeLeafPreimage, -} from '@aztec/circuits.js'; +} from '@aztec/constants'; import { poseidon2Hash } from '@aztec/foundation/crypto'; import { Fr } from '@aztec/foundation/fields'; import { type IndexedTreeLeafPreimage } from '@aztec/foundation/trees'; diff --git a/yarn-project/simulator/src/avm/avm_tree.ts b/yarn-project/simulator/src/avm/avm_tree.ts index 9130783a810d..48ee78b3627d 100644 --- a/yarn-project/simulator/src/avm/avm_tree.ts +++ b/yarn-project/simulator/src/avm/avm_tree.ts @@ -1,5 +1,6 @@ -import { type IndexedTreeId, MerkleTreeId, type MerkleTreeReadOperations } from '@aztec/circuit-types'; -import { AppendOnlyTreeSnapshot, NullifierLeafPreimage, PublicDataTreeLeafPreimage } from '@aztec/circuits.js'; +import { MerkleTreeId } from '@aztec/circuit-types'; +import { type IndexedTreeId, type MerkleTreeReadOperations } from '@aztec/circuit-types/interfaces/server'; +import { AppendOnlyTreeSnapshot, NullifierLeafPreimage, PublicDataTreeLeafPreimage } from '@aztec/circuits.js/trees'; import { poseidon2Hash } from '@aztec/foundation/crypto'; import { Fr } from '@aztec/foundation/fields'; import { type IndexedTreeLeafPreimage, type TreeLeafPreimage } from '@aztec/foundation/trees'; 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 479c36fce387..d0b4dd0b558a 100644 --- a/yarn-project/simulator/src/avm/fixtures/avm_simulation_tester.ts +++ b/yarn-project/simulator/src/avm/fixtures/avm_simulation_tester.ts @@ -1,6 +1,6 @@ -import { type MerkleTreeWriteOperations } from '@aztec/circuit-types'; +import { type MerkleTreeWriteOperations } from '@aztec/circuit-types/interfaces/server'; import { GasFees, GlobalVariables } from '@aztec/circuits.js'; -import { encodeArguments } from '@aztec/foundation/abi'; +import { encodeArguments } from '@aztec/circuits.js/abi'; import { type AztecAddress } from '@aztec/foundation/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 c654a4c1d82a..e631574fc8e3 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 @@ -1,15 +1,15 @@ -import { MerkleTreeId, type MerkleTreeWriteOperations } from '@aztec/circuit-types'; +import { MerkleTreeId } from '@aztec/circuit-types'; +import { type MerkleTreeWriteOperations } from '@aztec/circuit-types/interfaces/server'; import { type ContractClassPublic, type ContractInstanceWithAddress, - DEPLOYER_CONTRACT_ADDRESS, - PUBLIC_DISPATCH_SELECTOR, PublicDataWrite, computeInitializationHash, } from '@aztec/circuits.js'; +import { type ContractArtifact, FunctionSelector } from '@aztec/circuits.js/abi'; import { computePublicDataTreeLeafSlot, siloNullifier } from '@aztec/circuits.js/hash'; import { makeContractClassPublic, makeContractInstanceFromClassId } from '@aztec/circuits.js/testing'; -import { type ContractArtifact, FunctionSelector } from '@aztec/foundation/abi'; +import { DEPLOYER_CONTRACT_ADDRESS, 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/avm/fixtures/index.ts b/yarn-project/simulator/src/avm/fixtures/index.ts index bacb8f1c017c..bea6e34c9ab1 100644 --- a/yarn-project/simulator/src/avm/fixtures/index.ts +++ b/yarn-project/simulator/src/avm/fixtures/index.ts @@ -1,6 +1,7 @@ import { isNoirCallStackUnresolved } from '@aztec/circuit-types'; -import { GasFees, GlobalVariables, MAX_L2_GAS_PER_TX_PUBLIC_PORTION } from '@aztec/circuits.js'; -import { type ContractArtifact, type FunctionArtifact, FunctionSelector } from '@aztec/foundation/abi'; +import { GasFees, GlobalVariables } from '@aztec/circuits.js'; +import { type ContractArtifact, type FunctionArtifact, FunctionSelector } from '@aztec/circuits.js/abi'; +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'; 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 93098ce464df..9c54be30bca3 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 @@ -6,7 +6,7 @@ import { type PublicFunction, computePublicBytecodeCommitment, } from '@aztec/circuits.js'; -import { type ContractArtifact } from '@aztec/foundation/abi'; +import { type ContractArtifact } from '@aztec/circuits.js/abi'; import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { type Fr } from '@aztec/foundation/fields'; import { createLogger } from '@aztec/foundation/log'; diff --git a/yarn-project/simulator/src/avm/journal/journal.ts b/yarn-project/simulator/src/avm/journal/journal.ts index 06c97b6ce32f..fb049d60f0f3 100644 --- a/yarn-project/simulator/src/avm/journal/journal.ts +++ b/yarn-project/simulator/src/avm/journal/journal.ts @@ -1,33 +1,31 @@ import { MerkleTreeId } from '@aztec/circuit-types'; +import { AztecAddress, type PublicCallRequest, SerializableContractInstance } from '@aztec/circuits.js'; +import { AvmNullifierReadTreeHint, AvmPublicDataReadTreeHint } from '@aztec/circuits.js/avm'; +import { + computeNoteHashNonce, + computePublicDataTreeLeafSlot, + computeUniqueNoteHash, + deriveStorageSlotInMap, + siloNoteHash, + siloNullifier, +} from '@aztec/circuits.js/hash'; +import { + ScheduledDelayChange, + ScheduledValueChange, + computeSharedMutableHashSlot, +} from '@aztec/circuits.js/shared-mutable'; +import { NullifierLeafPreimage, PublicDataTreeLeafPreimage } from '@aztec/circuits.js/trees'; import { - AvmNullifierReadTreeHint, - AvmPublicDataReadTreeHint, - AztecAddress, CANONICAL_AUTH_REGISTRY_ADDRESS, DEPLOYER_CONTRACT_ADDRESS, FEE_JUICE_ADDRESS, MULTI_CALL_ENTRYPOINT_ADDRESS, - NullifierLeafPreimage, - type PublicCallRequest, - PublicDataTreeLeafPreimage, REGISTERER_CONTRACT_ADDRESS, ROUTER_ADDRESS, - ScheduledDelayChange, - ScheduledValueChange, - SerializableContractInstance, UPDATED_CLASS_IDS_SLOT, UPDATES_SCHEDULED_VALUE_CHANGE_LEN, UPDATES_VALUE_SIZE, - computeSharedMutableHashSlot, -} from '@aztec/circuits.js'; -import { - computeNoteHashNonce, - computePublicDataTreeLeafSlot, - computeUniqueNoteHash, - deriveStorageSlotInMap, - siloNoteHash, - siloNullifier, -} from '@aztec/circuits.js/hash'; +} from '@aztec/constants'; 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/ec_add.test.ts b/yarn-project/simulator/src/avm/opcodes/ec_add.test.ts index 0a39a349b206..3dba78fb37ee 100644 --- a/yarn-project/simulator/src/avm/opcodes/ec_add.test.ts +++ b/yarn-project/simulator/src/avm/opcodes/ec_add.test.ts @@ -1,5 +1,5 @@ import { Fr, Point } from '@aztec/circuits.js'; -import { Grumpkin } from '@aztec/circuits.js/barretenberg'; +import { Grumpkin } from '@aztec/foundation/crypto'; import { beforeEach } from '@jest/globals'; diff --git a/yarn-project/simulator/src/avm/opcodes/ec_add.ts b/yarn-project/simulator/src/avm/opcodes/ec_add.ts index 0e261febca38..3e0232c38308 100644 --- a/yarn-project/simulator/src/avm/opcodes/ec_add.ts +++ b/yarn-project/simulator/src/avm/opcodes/ec_add.ts @@ -1,4 +1,4 @@ -import { Grumpkin } from '@aztec/circuits.js/barretenberg'; +import { Grumpkin } from '@aztec/foundation/crypto'; import { Point } from '@aztec/foundation/fields'; import { type AvmContext } from '../avm_context.js'; diff --git a/yarn-project/simulator/src/avm/opcodes/multi_scalar_mul.test.ts b/yarn-project/simulator/src/avm/opcodes/multi_scalar_mul.test.ts index d9ddc3677e06..dc27c20dca9e 100644 --- a/yarn-project/simulator/src/avm/opcodes/multi_scalar_mul.test.ts +++ b/yarn-project/simulator/src/avm/opcodes/multi_scalar_mul.test.ts @@ -1,6 +1,6 @@ import { Fq, Fr, Point } from '@aztec/circuits.js'; -import { Grumpkin } from '@aztec/circuits.js/barretenberg'; import { timesParallel } from '@aztec/foundation/collection'; +import { Grumpkin } from '@aztec/foundation/crypto'; import { type AvmContext } from '../avm_context.js'; import { Field, type MemoryValue, Uint1, Uint32 } from '../avm_memory_types.js'; diff --git a/yarn-project/simulator/src/avm/opcodes/multi_scalar_mul.ts b/yarn-project/simulator/src/avm/opcodes/multi_scalar_mul.ts index 7535fde76e05..0962b9ab7fbe 100644 --- a/yarn-project/simulator/src/avm/opcodes/multi_scalar_mul.ts +++ b/yarn-project/simulator/src/avm/opcodes/multi_scalar_mul.ts @@ -1,5 +1,5 @@ import { Fq, Point } from '@aztec/circuits.js'; -import { Grumpkin } from '@aztec/circuits.js/barretenberg'; +import { Grumpkin } from '@aztec/foundation/crypto'; import { type AvmContext } from '../avm_context.js'; import { Field, TypeTag, Uint1 } from '../avm_memory_types.js'; diff --git a/yarn-project/simulator/src/client/client_execution_context.ts b/yarn-project/simulator/src/client/client_execution_context.ts index 380c1a4e4841..c205527c0042 100644 --- a/yarn-project/simulator/src/client/client_execution_context.ts +++ b/yarn-project/simulator/src/client/client_execution_context.ts @@ -1,27 +1,28 @@ import { type AuthWitness, - type AztecNode, type Capsule, - CountedContractClassLog, - CountedPublicExecutionRequest, Note, - NoteAndSlot, type NoteStatus, - type PrivateCallExecutionResult, PublicExecutionRequest, type UnencryptedL2Log, } from '@aztec/circuit-types'; +import { + type AztecNode, + CountedContractClassLog, + CountedPublicExecutionRequest, + NoteAndSlot, + type PrivateCallExecutionResult, +} from '@aztec/circuit-types/interfaces/client'; import { type BlockHeader, CallContext, FunctionSelector, - PRIVATE_CONTEXT_INPUTS_LENGTH, - PUBLIC_DISPATCH_SELECTOR, PrivateContextInputs, type TxContext, } from '@aztec/circuits.js'; +import { type FunctionAbi, type FunctionArtifact, type NoteSelector, countArgumentsSize } from '@aztec/circuits.js/abi'; import { computeUniqueNoteHash, siloNoteHash } from '@aztec/circuits.js/hash'; -import { type FunctionAbi, type FunctionArtifact, type NoteSelector, countArgumentsSize } from '@aztec/foundation/abi'; +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 05c5a9ec1133..811f38d08a11 100644 --- a/yarn-project/simulator/src/client/db_oracle.ts +++ b/yarn-project/simulator/src/client/db_oracle.ts @@ -2,10 +2,10 @@ import { type L2Block, type MerkleTreeId, type NoteStatus, - type NullifierMembershipWitness, type PublicDataWitness, type TxScopedL2Log, } from '@aztec/circuit-types'; +import { type NullifierMembershipWitness } from '@aztec/circuit-types/interfaces/client'; import { type BlockHeader, type CompleteAddress, @@ -13,7 +13,7 @@ import { type IndexedTaggingSecret, type KeyValidationRequest, } from '@aztec/circuits.js'; -import { type FunctionArtifact, type FunctionSelector } from '@aztec/foundation/abi'; +import { type FunctionArtifact, type FunctionSelector } from '@aztec/circuits.js/abi'; import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { type Fr } from '@aztec/foundation/fields'; diff --git a/yarn-project/simulator/src/client/private_execution.test.ts b/yarn-project/simulator/src/client/private_execution.test.ts index eb200dea36d6..84ef3be96dba 100644 --- a/yarn-project/simulator/src/client/private_execution.test.ts +++ b/yarn-project/simulator/src/client/private_execution.test.ts @@ -1,29 +1,25 @@ import { - type AztecNode, - CountedPublicExecutionRequest, HashedValues, type L1ToL2Message, - type L2BlockNumber, Note, PublicExecutionRequest, TxExecutionRequest, } from '@aztec/circuit-types'; import { - AppendOnlyTreeSnapshot, + type AztecNode, + CountedPublicExecutionRequest, + type L2BlockNumber, +} from '@aztec/circuit-types/interfaces/client'; +import { BlockHeader, CallContext, CompleteAddress, type ContractInstance, GasFees, GasSettings, - GeneratorIndex, type GrumpkinScalar, IndexedTaggingSecret, KeyValidationRequest, - L1_TO_L2_MSG_TREE_HEIGHT, - NOTE_HASH_TREE_HEIGHT, - PUBLIC_DATA_TREE_HEIGHT, - PUBLIC_DISPATCH_SELECTOR, PartialStateReference, StateReference, TxContext, @@ -33,6 +29,15 @@ import { getContractInstanceFromDeployParams, getNonEmptyItems, } from '@aztec/circuits.js'; +import { + type ContractArtifact, + type FunctionArtifact, + FunctionSelector, + type NoteSelector, + encodeArguments, + getFunctionArtifact, + getFunctionArtifactByName, +} from '@aztec/circuits.js/abi'; import { computeNoteHashNonce, computeSecretHash, @@ -41,15 +46,14 @@ import { siloNullifier, } from '@aztec/circuits.js/hash'; import { makeHeader } from '@aztec/circuits.js/testing'; +import { AppendOnlyTreeSnapshot } from '@aztec/circuits.js/trees'; import { - type ContractArtifact, - type FunctionArtifact, - FunctionSelector, - type NoteSelector, - encodeArguments, - getFunctionArtifact, - getFunctionArtifactByName, -} from '@aztec/foundation/abi'; + GeneratorIndex, + L1_TO_L2_MSG_TREE_HEIGHT, + NOTE_HASH_TREE_HEIGHT, + PUBLIC_DATA_TREE_HEIGHT, + 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'; diff --git a/yarn-project/simulator/src/client/private_execution.ts b/yarn-project/simulator/src/client/private_execution.ts index 3e9a5729b321..ade73cb9a528 100644 --- a/yarn-project/simulator/src/client/private_execution.ts +++ b/yarn-project/simulator/src/client/private_execution.ts @@ -1,17 +1,15 @@ -import { type AztecNode, PrivateCallExecutionResult } from '@aztec/circuit-types'; +import { type AztecNode, PrivateCallExecutionResult } from '@aztec/circuit-types/interfaces/client'; 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 { deriveStorageSlotInMap } from '@aztec/circuits.js/hash'; +import { ScheduledValueChange } from '@aztec/circuits.js/shared-mutable'; import { - type ContractInstance, - Fr, PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH, PRIVATE_CONTEXT_INPUTS_LENGTH, - PrivateCircuitPublicInputs, - ScheduledValueChange, UPDATED_CLASS_IDS_SLOT, UPDATES_VALUE_SIZE, -} from '@aztec/circuits.js'; -import { deriveStorageSlotInMap } from '@aztec/circuits.js/hash'; -import { type FunctionArtifact, type FunctionSelector, countArgumentsSize } from '@aztec/foundation/abi'; +} from '@aztec/constants'; import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { createLogger } from '@aztec/foundation/log'; import { Timer } from '@aztec/foundation/timer'; diff --git a/yarn-project/simulator/src/client/simulator.test.ts b/yarn-project/simulator/src/client/simulator.test.ts index f36c96ecd6ed..086e622b5a52 100644 --- a/yarn-project/simulator/src/client/simulator.test.ts +++ b/yarn-project/simulator/src/client/simulator.test.ts @@ -1,6 +1,7 @@ -import { type AztecNode, CompleteAddress, Note } from '@aztec/circuit-types'; +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/foundation/abi'; +import { type FunctionArtifact, getFunctionArtifactByName } from '@aztec/circuits.js/abi'; import { AztecAddress } from '@aztec/foundation/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 19d9f5e641bd..615992c064b5 100644 --- a/yarn-project/simulator/src/client/simulator.ts +++ b/yarn-project/simulator/src/client/simulator.ts @@ -1,10 +1,5 @@ -import { - type AztecNode, - type FunctionCall, - type Note, - PrivateExecutionResult, - type TxExecutionRequest, -} from '@aztec/circuit-types'; +import { type FunctionCall, type Note, type TxExecutionRequest } from '@aztec/circuit-types'; +import { type AztecNode, PrivateExecutionResult } from '@aztec/circuit-types/interfaces/client'; import { CallContext } from '@aztec/circuits.js'; import { type ArrayType, @@ -13,7 +8,7 @@ import { FunctionType, type NoteSelector, encodeArguments, -} from '@aztec/foundation/abi'; +} from '@aztec/circuits.js/abi'; import { AztecAddress } from '@aztec/foundation/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 600da35a840b..3c1c09bc02e4 100644 --- a/yarn-project/simulator/src/client/unconstrained_execution.test.ts +++ b/yarn-project/simulator/src/client/unconstrained_execution.test.ts @@ -1,6 +1,7 @@ -import { type AztecNode, type FunctionCall, Note } from '@aztec/circuit-types'; +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/foundation/abi'; +import { FunctionSelector, FunctionType, encodeArguments } from '@aztec/circuits.js/abi'; import { AztecAddress } from '@aztec/foundation/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 d5b6036991ff..6eb98d113d6f 100644 --- a/yarn-project/simulator/src/client/unconstrained_execution.ts +++ b/yarn-project/simulator/src/client/unconstrained_execution.ts @@ -1,4 +1,4 @@ -import { type AbiDecoded, type FunctionArtifact, type FunctionSelector, decodeFromAbi } from '@aztec/foundation/abi'; +import { type AbiDecoded, type FunctionArtifact, type FunctionSelector, decodeFromAbi } from '@aztec/circuits.js/abi'; import { type AztecAddress } from '@aztec/foundation/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 190dd5132e1b..c7b36b3ca861 100644 --- a/yarn-project/simulator/src/client/view_data_oracle.ts +++ b/yarn-project/simulator/src/client/view_data_oracle.ts @@ -1,22 +1,21 @@ import { type AuthWitness, - type AztecNode, type Capsule, type CompleteAddress, type MerkleTreeId, type NoteStatus, - type NullifierMembershipWitness, type PublicDataWitness, } from '@aztec/circuit-types'; +import { type AztecNode, type NullifierMembershipWitness } from '@aztec/circuit-types/interfaces/client'; import { type BlockHeader, type ContractInstance, type IndexedTaggingSecret, type KeyValidationRequest, } from '@aztec/circuits.js'; -import { Aes128 } from '@aztec/circuits.js/barretenberg'; 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/common/errors.ts b/yarn-project/simulator/src/common/errors.ts index da35b96d784c..92bc52fcead9 100644 --- a/yarn-project/simulator/src/common/errors.ts +++ b/yarn-project/simulator/src/common/errors.ts @@ -5,7 +5,7 @@ import { type SourceCodeLocation, } from '@aztec/circuit-types'; import { type Fr } from '@aztec/circuits.js'; -import type { BrilligFunctionId, FunctionAbi, FunctionDebugMetadata, OpcodeLocation } from '@aztec/foundation/abi'; +import type { BrilligFunctionId, FunctionAbi, FunctionDebugMetadata, OpcodeLocation } from '@aztec/circuits.js/abi'; import { jsonStringify } from '@aztec/foundation/json-rpc'; import { type RawAssertionPayload } from '@noir-lang/acvm_js'; diff --git a/yarn-project/simulator/src/common/simulation_provider.ts b/yarn-project/simulator/src/common/simulation_provider.ts index f927741af8fa..a93ab90efffc 100644 --- a/yarn-project/simulator/src/common/simulation_provider.ts +++ b/yarn-project/simulator/src/common/simulation_provider.ts @@ -1,4 +1,4 @@ -import { type NoirCompiledCircuit } from '@aztec/types/noir'; +import { type NoirCompiledCircuit } from '@aztec/circuits.js/noir'; import { type ExecutionError } from '@noir-lang/acvm_js'; import { abiDecodeError } from '@noir-lang/noirc_abi'; diff --git a/yarn-project/simulator/src/providers/acvm_native.ts b/yarn-project/simulator/src/providers/acvm_native.ts index 66613be10034..699318e99a81 100644 --- a/yarn-project/simulator/src/providers/acvm_native.ts +++ b/yarn-project/simulator/src/providers/acvm_native.ts @@ -1,7 +1,7 @@ +import { type NoirCompiledCircuit } from '@aztec/circuits.js/noir'; import { runInDirectory } from '@aztec/foundation/fs'; import { createLogger } from '@aztec/foundation/log'; import { Timer } from '@aztec/foundation/timer'; -import { type NoirCompiledCircuit } from '@aztec/types/noir'; import { type WitnessMap } from '@noir-lang/types'; import * as proc from 'child_process'; diff --git a/yarn-project/simulator/src/providers/acvm_wasm.ts b/yarn-project/simulator/src/providers/acvm_wasm.ts index 163031132d94..8293d018aac3 100644 --- a/yarn-project/simulator/src/providers/acvm_wasm.ts +++ b/yarn-project/simulator/src/providers/acvm_wasm.ts @@ -1,6 +1,6 @@ +import { type NoirCompiledCircuit } from '@aztec/circuits.js/noir'; import { createLogger } from '@aztec/foundation/log'; import { foreignCallHandler } from '@aztec/noir-protocol-circuits-types/client'; -import { type NoirCompiledCircuit } from '@aztec/types/noir'; import initACVM, { type ExecutionError, executeCircuit } from '@noir-lang/acvm_js'; import initAbi from '@noir-lang/noirc_abi'; diff --git a/yarn-project/simulator/src/providers/acvm_wasm_with_blobs.ts b/yarn-project/simulator/src/providers/acvm_wasm_with_blobs.ts index f85970b64974..4aa3e35a8511 100644 --- a/yarn-project/simulator/src/providers/acvm_wasm_with_blobs.ts +++ b/yarn-project/simulator/src/providers/acvm_wasm_with_blobs.ts @@ -1,5 +1,5 @@ +import { type NoirCompiledCircuit } from '@aztec/circuits.js/noir'; import { foreignCallHandler } from '@aztec/noir-protocol-circuits-types/server'; -import { type NoirCompiledCircuit } from '@aztec/types/noir'; import { type ExecutionError, executeCircuit } from '@noir-lang/acvm_js'; import { type WitnessMap } from '@noir-lang/types'; diff --git a/yarn-project/simulator/src/public/db_interfaces.ts b/yarn-project/simulator/src/public/db_interfaces.ts index ef37858d92b0..f4885ad061bd 100644 --- a/yarn-project/simulator/src/public/db_interfaces.ts +++ b/yarn-project/simulator/src/public/db_interfaces.ts @@ -1,9 +1,6 @@ -import { type NullifierMembershipWitness } from '@aztec/circuit-types'; -import { - type ContractInstanceWithAddress, - type FunctionSelector, - type L1_TO_L2_MSG_TREE_HEIGHT, -} from '@aztec/circuits.js'; +import { type NullifierMembershipWitness } from '@aztec/circuit-types/interfaces/server'; +import { type ContractInstanceWithAddress, type FunctionSelector } from '@aztec/circuits.js'; +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'; diff --git a/yarn-project/simulator/src/public/execution.ts b/yarn-project/simulator/src/public/execution.ts index 543fb8299daf..c0e1525e2bf7 100644 --- a/yarn-project/simulator/src/public/execution.ts +++ b/yarn-project/simulator/src/public/execution.ts @@ -1,6 +1,5 @@ import { type PublicExecutionRequest, type SimulationError } from '@aztec/circuit-types'; import { - type AvmExecutionHints, type ContractStorageRead, type ContractStorageUpdateRequest, type Fr, @@ -17,6 +16,7 @@ import { type ScopedL2ToL1Message, type TreeLeafReadRequest, } from '@aztec/circuits.js'; +import { type AvmExecutionHints } from '@aztec/circuits.js/avm'; import { computeVarArgsHash } from '@aztec/circuits.js/hash'; export interface PublicSideEffects { 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 5b6f497a19bc..d5c680236ac1 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 @@ -1,17 +1,15 @@ -import { MerkleTreeId, type MerkleTreeWriteOperations, PublicExecutionRequest, type Tx } from '@aztec/circuit-types'; +import { MerkleTreeId, PublicExecutionRequest, type Tx } from '@aztec/circuit-types'; +import { type MerkleTreeWriteOperations } from '@aztec/circuit-types/interfaces/server'; +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 AvmCircuitPublicInputs, - CallContext, - FunctionSelector, - GasFees, - GlobalVariables, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, NULLIFIER_SUBTREE_HEIGHT, PUBLIC_DATA_TREE_HEIGHT, PUBLIC_DISPATCH_SELECTOR, -} from '@aztec/circuits.js'; -import { type ContractArtifact, encodeArguments } from '@aztec/foundation/abi'; +} from '@aztec/constants'; import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { padArrayEnd } from '@aztec/foundation/collection'; import { Fr } from '@aztec/foundation/fields'; diff --git a/yarn-project/simulator/src/public/fixtures/utils.ts b/yarn-project/simulator/src/public/fixtures/utils.ts index 869ba063b16a..1864dec2983d 100644 --- a/yarn-project/simulator/src/public/fixtures/utils.ts +++ b/yarn-project/simulator/src/public/fixtures/utils.ts @@ -1,19 +1,20 @@ import { type PublicExecutionRequest, Tx } from '@aztec/circuit-types'; import { BlockHeader, - DEFAULT_GAS_LIMIT, FunctionSelector, Gas, GasFees, GasSettings, - MAX_L2_GAS_PER_TX_PUBLIC_PORTION, - PartialPrivateTailPublicInputsForPublic, - PrivateKernelTailCircuitPublicInputs, RollupValidationRequests, - TxConstantData, TxContext, } from '@aztec/circuits.js'; -import { type FunctionArtifact } from '@aztec/foundation/abi'; +import { type FunctionArtifact } from '@aztec/circuits.js/abi'; +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 { AvmTestContractArtifact } from '@aztec/noir-contracts.js/AvmTest'; diff --git a/yarn-project/simulator/src/public/public_db_sources.test.ts b/yarn-project/simulator/src/public/public_db_sources.test.ts index 24fed1209fae..efbea9de0d49 100644 --- a/yarn-project/simulator/src/public/public_db_sources.test.ts +++ b/yarn-project/simulator/src/public/public_db_sources.test.ts @@ -1,6 +1,8 @@ -import { MerkleTreeId, type MerkleTreeWriteOperations } from '@aztec/circuit-types'; -import { AztecAddress, type ContractDataSource, Fr, PublicDataTreeLeafPreimage } from '@aztec/circuits.js'; +import { MerkleTreeId } from '@aztec/circuit-types'; +import { type MerkleTreeWriteOperations } from '@aztec/circuit-types/interfaces/server'; +import { AztecAddress, type ContractDataSource, Fr } from '@aztec/circuits.js'; import { computePublicDataTreeLeafSlot } from '@aztec/circuits.js/hash'; +import { PublicDataTreeLeafPreimage } from '@aztec/circuits.js/trees'; import { timesParallel } from '@aztec/foundation/collection'; import { type IndexedTreeLeafPreimage } from '@aztec/foundation/trees'; diff --git a/yarn-project/simulator/src/public/public_db_sources.ts b/yarn-project/simulator/src/public/public_db_sources.ts index 69b2a5871b43..c159c46db6dc 100644 --- a/yarn-project/simulator/src/public/public_db_sources.ts +++ b/yarn-project/simulator/src/public/public_db_sources.ts @@ -1,11 +1,9 @@ +import { ContractClassTxL2Logs, MerkleTreeId, type Tx } from '@aztec/circuit-types'; import { - ContractClassTxL2Logs, - MerkleTreeId, type MerkleTreeReadOperations, type MerkleTreeWriteOperations, NullifierMembershipWitness, - type Tx, -} from '@aztec/circuit-types'; +} from '@aztec/circuit-types/interfaces/server'; import { type PublicDBAccessStats } from '@aztec/circuit-types/stats'; import { type AztecAddress, @@ -14,13 +12,11 @@ import { type ContractInstanceWithAddress, Fr, type FunctionSelector, - type L1_TO_L2_MSG_TREE_HEIGHT, - type NULLIFIER_TREE_HEIGHT, - type NullifierLeafPreimage, - type PublicDataTreeLeafPreimage, computePublicBytecodeCommitment, } from '@aztec/circuits.js'; import { computeL1ToL2MessageNullifier, computePublicDataTreeLeafSlot } from '@aztec/circuits.js/hash'; +import { type NullifierLeafPreimage, type PublicDataTreeLeafPreimage } from '@aztec/circuits.js/trees'; +import { type L1_TO_L2_MSG_TREE_HEIGHT, type NULLIFIER_TREE_HEIGHT } from '@aztec/constants'; import { createLogger } from '@aztec/foundation/log'; import { Timer } from '@aztec/foundation/timer'; import { ContractClassRegisteredEvent } from '@aztec/protocol-contracts/class-registerer'; diff --git a/yarn-project/simulator/src/public/public_processor.test.ts b/yarn-project/simulator/src/public/public_processor.test.ts index f22b9ae5b57f..d65dda0b9c68 100644 --- a/yarn-project/simulator/src/public/public_processor.test.ts +++ b/yarn-project/simulator/src/public/public_processor.test.ts @@ -1,23 +1,12 @@ +import { type ProcessedTx, SimulationError, type Tx, type TxValidator } from '@aztec/circuit-types'; import { type MerkleTreeWriteOperations, - type ProcessedTx, ProvingRequestType, - SimulationError, type TreeInfo, - type Tx, - type TxValidator, - mockTx, -} from '@aztec/circuit-types'; -import { - AvmCircuitInputs, - AztecAddress, - Fr, - Gas, - GasFees, - GlobalVariables, - PublicDataWrite, - RevertCode, -} from '@aztec/circuits.js'; +} from '@aztec/circuit-types/interfaces/server'; +import { mockTx } from '@aztec/circuit-types/testing'; +import { AztecAddress, Fr, Gas, GasFees, GlobalVariables, PublicDataWrite, RevertCode } from '@aztec/circuits.js'; +import { AvmCircuitInputs } from '@aztec/circuits.js/avm'; import { computePublicDataTreeLeafSlot } from '@aztec/circuits.js/hash'; import { timesParallel } from '@aztec/foundation/collection'; import { sleep } from '@aztec/foundation/sleep'; diff --git a/yarn-project/simulator/src/public/public_processor.ts b/yarn-project/simulator/src/public/public_processor.ts index 23a0de010d60..6e74e84faaf2 100644 --- a/yarn-project/simulator/src/public/public_processor.ts +++ b/yarn-project/simulator/src/public/public_processor.ts @@ -1,7 +1,6 @@ import { type FailedTx, MerkleTreeId, - type MerkleTreeWriteOperations, NestedProcessReturnValues, type ProcessedTx, Tx, @@ -10,17 +9,16 @@ import { makeProcessedTxFromPrivateOnlyTx, makeProcessedTxFromTxWithPublicCalls, } from '@aztec/circuit-types'; +import { type MerkleTreeWriteOperations } from '@aztec/circuit-types/interfaces/server'; import { type AztecAddress, type ContractDataSource, Fr, Gas, type GlobalVariables, - MAX_NOTE_HASHES_PER_TX, - MAX_NULLIFIERS_PER_TX, - NULLIFIER_SUBTREE_HEIGHT, PublicDataWrite, } from '@aztec/circuits.js'; +import { MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, NULLIFIER_SUBTREE_HEIGHT } from '@aztec/constants'; import { padArrayEnd } from '@aztec/foundation/collection'; import { createLogger } from '@aztec/foundation/log'; import { type DateProvider, Timer, elapsed, executeTimeout } from '@aztec/foundation/timer'; diff --git a/yarn-project/simulator/src/public/public_tx_context.ts b/yarn-project/simulator/src/public/public_tx_context.ts index a6e01d5115ff..3daad2e179c8 100644 --- a/yarn-project/simulator/src/public/public_tx_context.ts +++ b/yarn-project/simulator/src/public/public_tx_context.ts @@ -1,8 +1,5 @@ import { - type AvmProvingRequest, MerkleTreeId, - type MerkleTreeReadOperations, - ProvingRequestType, type PublicExecutionRequest, type SimulationError, type Tx, @@ -10,21 +7,16 @@ import { type TxHash, } from '@aztec/circuit-types'; import { - AvmCircuitInputs, - type AvmCircuitPublicInputs, + type AvmProvingRequest, + type MerkleTreeReadOperations, + ProvingRequestType, +} from '@aztec/circuit-types/interfaces/server'; +import { type AztecAddress, Fr, Gas, type GasSettings, type GlobalVariables, - MAX_L2_GAS_PER_TX_PUBLIC_PORTION, - MAX_L2_TO_L1_MSGS_PER_TX, - MAX_NOTE_HASHES_PER_TX, - MAX_NULLIFIERS_PER_TX, - MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, - PrivateToAvmAccumulatedData, - PrivateToAvmAccumulatedDataArrayLengths, - type PrivateToPublicAccumulatedData, PublicCallRequest, PublicDataWrite, RevertCode, @@ -34,6 +26,19 @@ import { countAccumulatedItems, mergeAccumulatedData, } from '@aztec/circuits.js'; +import { AvmCircuitInputs, type AvmCircuitPublicInputs } from '@aztec/circuits.js/avm'; +import { + PrivateToAvmAccumulatedData, + PrivateToAvmAccumulatedDataArrayLengths, + type PrivateToPublicAccumulatedData, +} from '@aztec/circuits.js/kernel'; +import { + MAX_L2_GAS_PER_TX_PUBLIC_PORTION, + MAX_L2_TO_L1_MSGS_PER_TX, + MAX_NOTE_HASHES_PER_TX, + MAX_NULLIFIERS_PER_TX, + MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, +} from '@aztec/constants'; import { padArrayEnd } from '@aztec/foundation/collection'; import { type Logger, createLogger } from '@aztec/foundation/log'; import { assertLength } from '@aztec/foundation/serialize'; diff --git a/yarn-project/simulator/src/public/public_tx_simulator.test.ts b/yarn-project/simulator/src/public/public_tx_simulator.test.ts index e6f7713c899a..1bc82c57cfb2 100644 --- a/yarn-project/simulator/src/public/public_tx_simulator.test.ts +++ b/yarn-project/simulator/src/public/public_tx_simulator.test.ts @@ -1,15 +1,14 @@ import { MerkleTreeId, - type MerkleTreeWriteOperations, SimulationError, type Tx, TxExecutionPhase, UnencryptedFunctionL2Logs, UnencryptedL2Log, - mockTx, } from '@aztec/circuit-types'; +import { type MerkleTreeWriteOperations } from '@aztec/circuit-types/interfaces/server'; +import { mockTx } from '@aztec/circuit-types/testing'; import { - AppendOnlyTreeSnapshot, AztecAddress, BlockHeader, type ContractDataSource, @@ -18,20 +17,18 @@ import { GasFees, GasSettings, GlobalVariables, - NULLIFIER_SUBTREE_HEIGHT, - PUBLIC_DATA_TREE_HEIGHT, PartialStateReference, - PublicDataTreeLeaf, PublicDataWrite, - REGISTERER_CONTRACT_ADDRESS, RevertCode, ScopedLogHash, StateReference, countAccumulatedItems, } from '@aztec/circuits.js'; +import { bufferAsFields } from '@aztec/circuits.js/abi'; import { computePublicDataTreeLeafSlot } from '@aztec/circuits.js/hash'; import { fr, makeContractClassPublic } from '@aztec/circuits.js/testing'; -import { bufferAsFields } from '@aztec/foundation/abi'; +import { AppendOnlyTreeSnapshot, PublicDataTreeLeaf } from '@aztec/circuits.js/trees'; +import { NULLIFIER_SUBTREE_HEIGHT, PUBLIC_DATA_TREE_HEIGHT, REGISTERER_CONTRACT_ADDRESS } from '@aztec/constants'; import { type AztecKVStore } from '@aztec/kv-store'; import { openTmpStore } from '@aztec/kv-store/lmdb'; import { type AppendOnlyTree, Poseidon, StandardTree, newTree } from '@aztec/merkle-tree'; diff --git a/yarn-project/simulator/src/public/public_tx_simulator.ts b/yarn-project/simulator/src/public/public_tx_simulator.ts index a03f3c7b3e4f..e533601ae2d1 100644 --- a/yarn-project/simulator/src/public/public_tx_simulator.ts +++ b/yarn-project/simulator/src/public/public_tx_simulator.ts @@ -1,13 +1,12 @@ import { - type AvmProvingRequest, type GasUsed, - type MerkleTreeReadOperations, NestedProcessReturnValues, type PublicExecutionRequest, type SimulationError, type Tx, TxExecutionPhase, } from '@aztec/circuit-types'; +import { type AvmProvingRequest, type MerkleTreeReadOperations } from '@aztec/circuit-types/interfaces/server'; import { type AvmSimulationStats } from '@aztec/circuit-types/stats'; import { type Fr, type Gas, type GlobalVariables, type PublicCallRequest, type RevertCode } from '@aztec/circuits.js'; import { type Logger, createLogger } from '@aztec/foundation/log'; diff --git a/yarn-project/simulator/src/public/side_effect_trace.test.ts b/yarn-project/simulator/src/public/side_effect_trace.test.ts index eed150757284..123da08ef6d1 100644 --- a/yarn-project/simulator/src/public/side_effect_trace.test.ts +++ b/yarn-project/simulator/src/public/side_effect_trace.test.ts @@ -1,31 +1,34 @@ +import { + AztecAddress, + type ContractClassIdPreimage, + EthAddress, + L2ToL1Message, + NoteHash, + Nullifier, + PublicDataUpdateRequest, + PublicLog, + SerializableContractInstance, + Vector, +} from '@aztec/circuits.js'; import { AvmAppendTreeHint, AvmNullifierReadTreeHint, AvmNullifierWriteTreeHint, AvmPublicDataReadTreeHint, AvmPublicDataWriteTreeHint, - AztecAddress, - type ContractClassIdPreimage, - EthAddress, - L2ToL1Message, +} from '@aztec/circuits.js/avm'; +import { computePublicDataTreeLeafSlot } from '@aztec/circuits.js/hash'; +import { NullifierLeafPreimage, PublicDataTreeLeafPreimage } from '@aztec/circuits.js/trees'; +import { MAX_L2_TO_L1_MSGS_PER_TX, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, MAX_PUBLIC_CALLS_TO_UNIQUE_CONTRACT_CLASS_IDS, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, MAX_PUBLIC_LOGS_PER_TX, - NoteHash, - Nullifier, - NullifierLeafPreimage, PROTOCOL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, PUBLIC_LOG_DATA_SIZE_IN_FIELDS, - PublicDataTreeLeafPreimage, - PublicDataUpdateRequest, - PublicLog, - SerializableContractInstance, - Vector, -} from '@aztec/circuits.js'; -import { computePublicDataTreeLeafSlot } from '@aztec/circuits.js/hash'; +} from '@aztec/constants'; import { padArrayEnd } from '@aztec/foundation/collection'; import { Fr } from '@aztec/foundation/fields'; diff --git a/yarn-project/simulator/src/public/side_effect_trace.ts b/yarn-project/simulator/src/public/side_effect_trace.ts index 960165ec5f8a..6eeca2fdceb9 100644 --- a/yarn-project/simulator/src/public/side_effect_trace.ts +++ b/yarn-project/simulator/src/public/side_effect_trace.ts @@ -1,3 +1,21 @@ +import { + type AztecAddress, + type ContractClassIdPreimage, + EthAddress, + type Gas, + type GasSettings, + type GlobalVariables, + L2ToL1Message, + NoteHash, + Nullifier, + PublicCallRequest, + PublicDataUpdateRequest, + PublicDataWrite, + PublicLog, + ScopedL2ToL1Message, + SerializableContractInstance, + type TreeSnapshots, +} from '@aztec/circuits.js'; import { AvmAccumulatedData, AvmAppendTreeHint, @@ -10,14 +28,12 @@ import { AvmNullifierWriteTreeHint, AvmPublicDataReadTreeHint, AvmPublicDataWriteTreeHint, - type AztecAddress, - type ContractClassIdPreimage, - EthAddress, - type Gas, - type GasSettings, - type GlobalVariables, +} from '@aztec/circuits.js/avm'; +import { computePublicDataTreeLeafSlot } from '@aztec/circuits.js/hash'; +import { PrivateToAvmAccumulatedData, PrivateToAvmAccumulatedDataArrayLengths } from '@aztec/circuits.js/kernel'; +import { NullifierLeafPreimage, PublicDataTreeLeafPreimage } from '@aztec/circuits.js/trees'; +import { L1_TO_L2_MSG_TREE_HEIGHT, - L2ToL1Message, MAX_ENQUEUED_CALLS_PER_TX, MAX_L2_TO_L1_MSGS_PER_TX, MAX_NOTE_HASHES_PER_TX, @@ -28,24 +44,10 @@ import { MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, NOTE_HASH_TREE_HEIGHT, NULLIFIER_TREE_HEIGHT, - NoteHash, - Nullifier, - NullifierLeafPreimage, PROTOCOL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, PUBLIC_DATA_TREE_HEIGHT, PUBLIC_LOG_DATA_SIZE_IN_FIELDS, - PrivateToAvmAccumulatedData, - PrivateToAvmAccumulatedDataArrayLengths, - PublicCallRequest, - PublicDataTreeLeafPreimage, - PublicDataUpdateRequest, - PublicDataWrite, - PublicLog, - ScopedL2ToL1Message, - SerializableContractInstance, - type TreeSnapshots, -} from '@aztec/circuits.js'; -import { computePublicDataTreeLeafSlot } from '@aztec/circuits.js/hash'; +} from '@aztec/constants'; import { padArrayEnd } from '@aztec/foundation/collection'; import { Fr } from '@aztec/foundation/fields'; import { jsonStringify } from '@aztec/foundation/json-rpc'; 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 223727aa522c..ea978c843aec 100644 --- a/yarn-project/simulator/src/public/side_effect_trace_interface.ts +++ b/yarn-project/simulator/src/public/side_effect_trace_interface.ts @@ -1,13 +1,11 @@ import { - type AvmNullifierReadTreeHint, - type AvmPublicDataReadTreeHint, type ContractClassIdPreimage, - type NullifierLeafPreimage, type PublicCallRequest, - type PublicDataTreeLeafPreimage, type PublicLog, type SerializableContractInstance, } from '@aztec/circuits.js'; +import { type AvmNullifierReadTreeHint, type AvmPublicDataReadTreeHint } from '@aztec/circuits.js/avm'; +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'; diff --git a/yarn-project/simulator/src/public/unique_class_ids.ts b/yarn-project/simulator/src/public/unique_class_ids.ts index 97540cfd0777..27c7193f8cba 100644 --- a/yarn-project/simulator/src/public/unique_class_ids.ts +++ b/yarn-project/simulator/src/public/unique_class_ids.ts @@ -1,4 +1,4 @@ -import { MAX_PUBLIC_CALLS_TO_UNIQUE_CONTRACT_CLASS_IDS } from '@aztec/circuits.js'; +import { MAX_PUBLIC_CALLS_TO_UNIQUE_CONTRACT_CLASS_IDS } from '@aztec/constants'; import { strict as assert } from 'assert'; diff --git a/yarn-project/simulator/tsconfig.json b/yarn-project/simulator/tsconfig.json index 60a3f7e62deb..2f957e40b947 100644 --- a/yarn-project/simulator/tsconfig.json +++ b/yarn-project/simulator/tsconfig.json @@ -12,6 +12,9 @@ { "path": "../circuits.js" }, + { + "path": "../constants" + }, { "path": "../foundation" }, diff --git a/yarn-project/tsconfig.json b/yarn-project/tsconfig.json index 85196405aab2..1f4d642aa7a0 100644 --- a/yarn-project/tsconfig.json +++ b/yarn-project/tsconfig.json @@ -30,6 +30,7 @@ { "path": "validator-client/tsconfig.json" }, { "path": "bb-prover/tsconfig.json" }, { "path": "bot/tsconfig.json" }, + { "path": "constants/tsconfig.json" }, { "path": "pxe/tsconfig.json" }, { "path": "aztec/tsconfig.json" }, { "path": "circuits.js/tsconfig.json" }, diff --git a/yarn-project/txe/package.json b/yarn-project/txe/package.json index e16ea3f470ac..477658227cf6 100644 --- a/yarn-project/txe/package.json +++ b/yarn-project/txe/package.json @@ -63,6 +63,7 @@ "@aztec/aztec.js": "workspace:^", "@aztec/circuit-types": "workspace:^", "@aztec/circuits.js": "workspace:^", + "@aztec/constants": "workspace:^", "@aztec/foundation": "workspace:^", "@aztec/key-store": "workspace:^", "@aztec/kv-store": "workspace:^", diff --git a/yarn-project/txe/src/node/txe_node.ts b/yarn-project/txe/src/node/txe_node.ts index 2ea207237980..0943a05c2205 100644 --- a/yarn-project/txe/src/node/txe_node.ts +++ b/yarn-project/txe/src/node/txe_node.ts @@ -1,22 +1,15 @@ import { createLogger } from '@aztec/aztec.js'; import { - type AztecNode, type GetContractClassLogsResponse, type GetPublicLogsResponse, type InBlock, type L2Block, L2BlockHash, - type L2BlockNumber, type L2Tips, type LogFilter, MerkleTreeId, - type MerkleTreeReadOperations, - type MerkleTreeWriteOperations, - type NullifierMembershipWitness, - type ProverConfig, type PublicDataWitness, type PublicSimulationOutput, - type SequencerConfig, type SiblingPath, type Tx, type TxEffect, @@ -25,25 +18,35 @@ import { TxScopedL2Log, type TxValidationResult, } from '@aztec/circuit-types'; +import { type AztecNode, type L2BlockNumber } from '@aztec/circuit-types/interfaces/client'; +import { + type MerkleTreeReadOperations, + type MerkleTreeWriteOperations, + type NullifierMembershipWitness, + type ProverConfig, + type SequencerConfig, +} from '@aztec/circuit-types/interfaces/server'; import { - type ARCHIVE_HEIGHT, type AztecAddress, type BlockHeader, type ContractClassPublic, type ContractInstanceWithAddress, type GasFees, - type L1_TO_L2_MSG_TREE_HEIGHT, - type NOTE_HASH_TREE_HEIGHT, - type NULLIFIER_TREE_HEIGHT, type NodeInfo, - type PUBLIC_DATA_TREE_HEIGHT, - PUBLIC_LOG_DATA_SIZE_IN_FIELDS, type PrivateLog, type ProtocolContractAddresses, - type PublicDataTreeLeafPreimage, type PublicLog, } from '@aztec/circuits.js'; import { computePublicDataTreeLeafSlot } from '@aztec/circuits.js/hash'; +import { type PublicDataTreeLeafPreimage } from '@aztec/circuits.js/trees'; +import { + type ARCHIVE_HEIGHT, + type L1_TO_L2_MSG_TREE_HEIGHT, + type NOTE_HASH_TREE_HEIGHT, + type NULLIFIER_TREE_HEIGHT, + type PUBLIC_DATA_TREE_HEIGHT, + PUBLIC_LOG_DATA_SIZE_IN_FIELDS, +} from '@aztec/constants'; import { type L1ContractAddresses } from '@aztec/ethereum'; import { poseidon2Hash } from '@aztec/foundation/crypto'; import { Fr } from '@aztec/foundation/fields'; diff --git a/yarn-project/txe/src/oracle/txe_oracle.ts b/yarn-project/txe/src/oracle/txe_oracle.ts index 69a6c2e89ecf..65a350d3f8e3 100644 --- a/yarn-project/txe/src/oracle/txe_oracle.ts +++ b/yarn-project/txe/src/oracle/txe_oracle.ts @@ -3,11 +3,8 @@ import { Body, L2Block, MerkleTreeId, - type MerkleTreeReadOperations, - type MerkleTreeWriteOperations, Note, type NoteStatus, - NullifierMembershipWitness, PublicDataWitness, PublicExecutionRequest, SimulationError, @@ -15,9 +12,13 @@ import { TxHash, type UnencryptedL2Log, } from '@aztec/circuit-types'; +import { + type MerkleTreeReadOperations, + type MerkleTreeWriteOperations, + NullifierMembershipWitness, +} from '@aztec/circuit-types/interfaces/server'; import { type CircuitWitnessGenerationStats } from '@aztec/circuit-types/stats'; import { - AppendOnlyTreeSnapshot, BlockHeader, CallContext, type ContractInstance, @@ -27,26 +28,20 @@ import { GlobalVariables, IndexedTaggingSecret, type KeyValidationRequest, - type L1_TO_L2_MSG_TREE_HEIGHT, - MAX_NOTE_HASHES_PER_TX, - MAX_NULLIFIERS_PER_TX, - NULLIFIER_SUBTREE_HEIGHT, - type NULLIFIER_TREE_HEIGHT, - NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, - type NullifierLeafPreimage, - PRIVATE_CONTEXT_INPUTS_LENGTH, - type PUBLIC_DATA_TREE_HEIGHT, - PUBLIC_DISPATCH_SELECTOR, PrivateContextInputs, type PrivateLog, - PublicDataTreeLeaf, - type PublicDataTreeLeafPreimage, PublicDataWrite, type PublicLog, computeTaggingSecretPoint, deriveKeys, } from '@aztec/circuits.js'; -import { Schnorr } from '@aztec/circuits.js/barretenberg'; +import { + type ContractArtifact, + type FunctionAbi, + FunctionSelector, + type NoteSelector, + countArgumentsSize, +} from '@aztec/circuits.js/abi'; import { computeNoteHashNonce, computePublicDataTreeLeafSlot, @@ -61,15 +56,25 @@ import { makeHeader, } from '@aztec/circuits.js/testing'; import { - type ContractArtifact, - type FunctionAbi, - FunctionSelector, - type NoteSelector, - countArgumentsSize, -} from '@aztec/foundation/abi'; + AppendOnlyTreeSnapshot, + type NullifierLeafPreimage, + PublicDataTreeLeaf, + type PublicDataTreeLeafPreimage, +} from '@aztec/circuits.js/trees'; +import { + type L1_TO_L2_MSG_TREE_HEIGHT, + MAX_NOTE_HASHES_PER_TX, + MAX_NULLIFIERS_PER_TX, + NULLIFIER_SUBTREE_HEIGHT, + type NULLIFIER_TREE_HEIGHT, + NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, + PRIVATE_CONTEXT_INPUTS_LENGTH, + 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 { poseidon2Hash } from '@aztec/foundation/crypto'; +import { Schnorr, poseidon2Hash } from '@aztec/foundation/crypto'; import { Fr } from '@aztec/foundation/fields'; import { type LogFn, type Logger, applyStringFormatting, createDebugOnlyLogger } from '@aztec/foundation/log'; import { Timer } from '@aztec/foundation/timer'; diff --git a/yarn-project/txe/src/txe_service/txe_service.ts b/yarn-project/txe/src/txe_service/txe_service.ts index 0fe60ecaa405..6a0c54de3918 100644 --- a/yarn-project/txe/src/txe_service/txe_service.ts +++ b/yarn-project/txe/src/txe_service/txe_service.ts @@ -1,14 +1,14 @@ import { MerkleTreeId, SimulationError } from '@aztec/circuit-types'; import { type ContractInstanceWithAddress, - DEPLOYER_CONTRACT_ADDRESS, Fr, FunctionSelector, PublicDataWrite, computePartialAddress, } from '@aztec/circuits.js'; +import { type ContractArtifact, NoteSelector } from '@aztec/circuits.js/abi'; import { computePublicDataTreeLeafSlot, siloNullifier } from '@aztec/circuits.js/hash'; -import { type ContractArtifact, NoteSelector } from '@aztec/foundation/abi'; +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'; diff --git a/yarn-project/txe/src/util/encoding.ts b/yarn-project/txe/src/util/encoding.ts index 5200090f2c0e..152470395067 100644 --- a/yarn-project/txe/src/util/encoding.ts +++ b/yarn-project/txe/src/util/encoding.ts @@ -1,5 +1,5 @@ import { AztecAddress, type ContractInstanceWithAddress, ContractInstanceWithAddressSchema } from '@aztec/circuits.js'; -import { type ContractArtifact, ContractArtifactSchema } from '@aztec/foundation/abi'; +import { type ContractArtifact, ContractArtifactSchema } from '@aztec/circuits.js/abi'; import { Fr } from '@aztec/foundation/fields'; import { hexToBuffer } from '@aztec/foundation/string'; diff --git a/yarn-project/txe/src/util/txe_public_contract_data_source.ts b/yarn-project/txe/src/util/txe_public_contract_data_source.ts index fdb61f26b6a3..420e170c0238 100644 --- a/yarn-project/txe/src/util/txe_public_contract_data_source.ts +++ b/yarn-project/txe/src/util/txe_public_contract_data_source.ts @@ -5,11 +5,11 @@ import { type ContractInstanceWithAddress, Fr, FunctionSelector, - PUBLIC_DISPATCH_SELECTOR, type PublicFunction, computePublicBytecodeCommitment, } from '@aztec/circuits.js'; -import { type ContractArtifact } from '@aztec/foundation/abi'; +import { type ContractArtifact } from '@aztec/circuits.js/abi'; +import { PUBLIC_DISPATCH_SELECTOR } from '@aztec/constants'; import { PrivateFunctionsTree } from '@aztec/pxe'; import { type TXE } from '../oracle/txe_oracle.js'; diff --git a/yarn-project/txe/src/util/txe_world_state_db.ts b/yarn-project/txe/src/util/txe_world_state_db.ts index 5618bdd964e5..4003e0afe559 100644 --- a/yarn-project/txe/src/util/txe_world_state_db.ts +++ b/yarn-project/txe/src/util/txe_world_state_db.ts @@ -1,12 +1,8 @@ -import { MerkleTreeId, type MerkleTreeWriteOperations } from '@aztec/circuit-types'; -import { - type AztecAddress, - type ContractDataSource, - Fr, - type PublicDataTreeLeafPreimage, - PublicDataWrite, -} from '@aztec/circuits.js'; +import { MerkleTreeId } from '@aztec/circuit-types'; +import { type MerkleTreeWriteOperations } from '@aztec/circuit-types/interfaces/server'; +import { type AztecAddress, type ContractDataSource, Fr, PublicDataWrite } from '@aztec/circuits.js'; import { computePublicDataTreeLeafSlot } from '@aztec/circuits.js/hash'; +import { type PublicDataTreeLeafPreimage } from '@aztec/circuits.js/trees'; import { WorldStateDB } from '@aztec/simulator/server'; import { type TXE } from '../oracle/txe_oracle.js'; diff --git a/yarn-project/txe/tsconfig.json b/yarn-project/txe/tsconfig.json index d9aeb0e4052c..d16dd596f4f2 100644 --- a/yarn-project/txe/tsconfig.json +++ b/yarn-project/txe/tsconfig.json @@ -18,6 +18,9 @@ { "path": "../circuits.js" }, + { + "path": "../constants" + }, { "path": "../foundation" }, diff --git a/yarn-project/types/package.json b/yarn-project/types/package.json index 8bcb70df76d5..b862210dfb0a 100644 --- a/yarn-project/types/package.json +++ b/yarn-project/types/package.json @@ -5,11 +5,7 @@ "main": "./dest/index.js", "types": "./dest/index.d.ts", "exports": { - "./abi": "./dest/abi/index.js", - "./contracts": "./dest/contracts/index.js", "./interfaces": "./dest/interfaces/index.js", - "./membership": "./dest/sibling-path/index.js", - "./noir": "./dest/noir/index.js", "./network": "./dest/network/index.js" }, "scripts": { diff --git a/yarn-project/types/src/abi/index.ts b/yarn-project/types/src/abi/index.ts deleted file mode 100644 index 27174adec05f..000000000000 --- a/yarn-project/types/src/abi/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './contract_artifact.js'; diff --git a/yarn-project/types/src/test/fixtures.ts b/yarn-project/types/src/test/fixtures.ts deleted file mode 100644 index 9796b24cb12f..000000000000 --- a/yarn-project/types/src/test/fixtures.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { type ContractArtifact } from '@aztec/foundation/abi'; - -import { readFileSync } from 'fs'; -import { dirname, resolve } from 'path'; -import { fileURLToPath } from 'url'; - -import { loadContractArtifact } from '../abi/contract_artifact.js'; -import { type NoirCompiledContract } from '../noir/index.js'; - -// Copied from the build output for the contract `Benchmarking` in noir-contracts -export function getSampleContractArtifact(): ContractArtifact { - const path = getPathToFixture('Benchmarking.test.json'); - const content = JSON.parse(readFileSync(path).toString()) as NoirCompiledContract; - return loadContractArtifact(content); -} - -function getPathToFixture(name: string) { - return resolve(dirname(fileURLToPath(import.meta.url)), `../../fixtures/${name}`); -} diff --git a/yarn-project/validator-client/src/validator.test.ts b/yarn-project/validator-client/src/validator.test.ts index 3f6e8d21755b..17fb98ff0395 100644 --- a/yarn-project/validator-client/src/validator.test.ts +++ b/yarn-project/validator-client/src/validator.test.ts @@ -1,7 +1,8 @@ /** * Validation logic unit tests */ -import { TxHash, mockTx } from '@aztec/circuit-types'; +import { TxHash } from '@aztec/circuit-types'; +import { makeBlockAttestation, makeBlockProposal, mockTx } from '@aztec/circuit-types/testing'; import { makeHeader } from '@aztec/circuits.js/testing'; import { type EpochCache } from '@aztec/epoch-cache'; import { Secp256k1Signer } from '@aztec/foundation/crypto'; @@ -14,7 +15,6 @@ import { describe, expect, it } from '@jest/globals'; import { type MockProxy, mock } from 'jest-mock-extended'; import { type PrivateKeyAccount, generatePrivateKey, privateKeyToAccount } from 'viem/accounts'; -import { makeBlockAttestation, makeBlockProposal } from '../../circuit-types/src/p2p/mocks.js'; import { type ValidatorClientConfig } from './config.js'; import { AttestationTimeoutError, diff --git a/yarn-project/world-state/package.json b/yarn-project/world-state/package.json index 0eb7d115ea94..0a4f79913c46 100644 --- a/yarn-project/world-state/package.json +++ b/yarn-project/world-state/package.json @@ -64,6 +64,7 @@ "dependencies": { "@aztec/circuit-types": "workspace:^", "@aztec/circuits.js": "workspace:^", + "@aztec/constants": "workspace:^", "@aztec/foundation": "workspace:^", "@aztec/kv-store": "workspace:^", "@aztec/merkle-tree": "workspace:^", diff --git a/yarn-project/world-state/src/native/merkle_trees_facade.ts b/yarn-project/world-state/src/native/merkle_trees_facade.ts index 8545382f27c2..4339802f62cf 100644 --- a/yarn-project/world-state/src/native/merkle_trees_facade.ts +++ b/yarn-project/world-state/src/native/merkle_trees_facade.ts @@ -1,24 +1,20 @@ +import { MerkleTreeId, SiblingPath } from '@aztec/circuit-types'; import { type BatchInsertionResult, type IndexedTreeId, - MerkleTreeId, type MerkleTreeLeafType, type MerkleTreeReadOperations, type MerkleTreeWriteOperations, type SequentialInsertionResult, - SiblingPath, type TreeInfo, -} from '@aztec/circuit-types'; +} from '@aztec/circuit-types/interfaces/server'; +import { type BlockHeader, Fr, PartialStateReference, StateReference } from '@aztec/circuits.js'; import { - type BlockHeader, - Fr, NullifierLeaf, NullifierLeafPreimage, - PartialStateReference, PublicDataTreeLeaf, PublicDataTreeLeafPreimage, - StateReference, -} from '@aztec/circuits.js'; +} from '@aztec/circuits.js/trees'; import { serializeToBuffer } from '@aztec/foundation/serialize'; import { type IndexedTreeLeafPreimage } from '@aztec/foundation/trees'; diff --git a/yarn-project/world-state/src/native/message.ts b/yarn-project/world-state/src/native/message.ts index 15af10b534b4..4bd79f6c2af6 100644 --- a/yarn-project/world-state/src/native/message.ts +++ b/yarn-project/world-state/src/native/message.ts @@ -1,5 +1,6 @@ import { MerkleTreeId } from '@aztec/circuit-types'; -import { AppendOnlyTreeSnapshot, Fr, type StateReference, type UInt32 } from '@aztec/circuits.js'; +import { Fr, type StateReference, type UInt32 } from '@aztec/circuits.js'; +import { AppendOnlyTreeSnapshot } from '@aztec/circuits.js/trees'; import { type Tuple } from '@aztec/foundation/serialize'; export enum WorldStateMessageType { diff --git a/yarn-project/world-state/src/native/native_world_state.test.ts b/yarn-project/world-state/src/native/native_world_state.test.ts index 5fa00c936861..683f334589e6 100644 --- a/yarn-project/world-state/src/native/native_world_state.test.ts +++ b/yarn-project/world-state/src/native/native_world_state.test.ts @@ -1,10 +1,10 @@ -import { type L2Block, MerkleTreeId, type MerkleTreeWriteOperations, type SiblingPath } from '@aztec/circuit-types'; +import { type L2Block, MerkleTreeId, type SiblingPath } from '@aztec/circuit-types'; +import { type MerkleTreeWriteOperations } from '@aztec/circuit-types/interfaces/server'; +import { BlockHeader, EthAddress, Fr, PublicDataWrite } from '@aztec/circuits.js'; +import { makeContentCommitment, makeGlobalVariables } from '@aztec/circuits.js/testing'; +import { AppendOnlyTreeSnapshot, PublicDataTreeLeaf } from '@aztec/circuits.js/trees'; import { ARCHIVE_HEIGHT, - AppendOnlyTreeSnapshot, - BlockHeader, - EthAddress, - Fr, L1_TO_L2_MSG_TREE_HEIGHT, MAX_L2_TO_L1_MSGS_PER_TX, MAX_NOTE_HASHES_PER_TX, @@ -13,10 +13,7 @@ import { NOTE_HASH_TREE_HEIGHT, NULLIFIER_TREE_HEIGHT, PUBLIC_DATA_TREE_HEIGHT, - PublicDataTreeLeaf, - PublicDataWrite, -} from '@aztec/circuits.js'; -import { makeContentCommitment, makeGlobalVariables } from '@aztec/circuits.js/testing'; +} from '@aztec/constants'; import { jest } from '@jest/globals'; import { mkdtemp, rm } from 'fs/promises'; diff --git a/yarn-project/world-state/src/native/native_world_state.ts b/yarn-project/world-state/src/native/native_world_state.ts index e18ccf0dc6b3..8bff5dee764c 100644 --- a/yarn-project/world-state/src/native/native_world_state.ts +++ b/yarn-project/world-state/src/native/native_world_state.ts @@ -1,23 +1,12 @@ +import { type L2Block, MerkleTreeId } from '@aztec/circuit-types'; import { type IndexedTreeId, - type L2Block, - MerkleTreeId, type MerkleTreeReadOperations, type MerkleTreeWriteOperations, -} from '@aztec/circuit-types'; -import { - BlockHeader, - EthAddress, - Fr, - MAX_NOTE_HASHES_PER_TX, - MAX_NULLIFIERS_PER_TX, - NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, - NullifierLeaf, - type NullifierLeafPreimage, - PartialStateReference, - PublicDataTreeLeaf, - StateReference, -} from '@aztec/circuits.js'; +} from '@aztec/circuit-types/interfaces/server'; +import { BlockHeader, EthAddress, Fr, PartialStateReference, StateReference } from '@aztec/circuits.js'; +import { NullifierLeaf, type NullifierLeafPreimage, PublicDataTreeLeaf } from '@aztec/circuits.js/trees'; +import { MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants'; import { padArrayEnd } from '@aztec/foundation/collection'; import { createLogger } from '@aztec/foundation/log'; import { getTelemetryClient } from '@aztec/telemetry-client'; diff --git a/yarn-project/world-state/src/native/native_world_state_instance.ts b/yarn-project/world-state/src/native/native_world_state_instance.ts index 92a2bf8c0dc5..0a6501056e5e 100644 --- a/yarn-project/world-state/src/native/native_world_state_instance.ts +++ b/yarn-project/world-state/src/native/native_world_state_instance.ts @@ -1,4 +1,5 @@ import { MerkleTreeId } from '@aztec/circuit-types'; +import type { PublicDataTreeLeaf } from '@aztec/circuits.js/trees'; import { ARCHIVE_HEIGHT, GeneratorIndex, @@ -8,8 +9,7 @@ import { NOTE_HASH_TREE_HEIGHT, NULLIFIER_TREE_HEIGHT, PUBLIC_DATA_TREE_HEIGHT, - type PublicDataTreeLeaf, -} from '@aztec/circuits.js'; +} from '@aztec/constants'; import { createLogger } from '@aztec/foundation/log'; import { NativeWorldState as BaseNativeWorldState, MsgpackChannel } from '@aztec/native'; diff --git a/yarn-project/world-state/src/synchronizer/factory.ts b/yarn-project/world-state/src/synchronizer/factory.ts index 2fcf7e4baa63..f8a8f7f0ac8f 100644 --- a/yarn-project/world-state/src/synchronizer/factory.ts +++ b/yarn-project/world-state/src/synchronizer/factory.ts @@ -1,5 +1,5 @@ import { type L1ToL2MessageSource, type L2BlockSource } from '@aztec/circuit-types'; -import { type PublicDataTreeLeaf } from '@aztec/circuits.js'; +import { type PublicDataTreeLeaf } from '@aztec/circuits.js/trees'; import { type DataStoreConfig } from '@aztec/kv-store/config'; import { type TelemetryClient, getTelemetryClient } from '@aztec/telemetry-client'; diff --git a/yarn-project/world-state/src/synchronizer/server_world_state_synchronizer.test.ts b/yarn-project/world-state/src/synchronizer/server_world_state_synchronizer.test.ts index 2e7d3d71a46f..2fce4ec3fa9b 100644 --- a/yarn-project/world-state/src/synchronizer/server_world_state_synchronizer.test.ts +++ b/yarn-project/world-state/src/synchronizer/server_world_state_synchronizer.test.ts @@ -1,16 +1,11 @@ -import { - type L1ToL2MessageSource, - L2Block, - type L2BlockSource, - type L2BlockStream, - type MerkleTreeReadOperations, - WorldStateRunningState, -} from '@aztec/circuit-types'; -import { Fr, MerkleTreeCalculator } from '@aztec/circuits.js'; -import { L1_TO_L2_MSG_SUBTREE_HEIGHT } from '@aztec/circuits.js/constants'; +import { type L1ToL2MessageSource, L2Block, type L2BlockSource, type L2BlockStream } from '@aztec/circuit-types'; +import { type MerkleTreeReadOperations, WorldStateRunningState } from '@aztec/circuit-types/interfaces/server'; +import { L1_TO_L2_MSG_SUBTREE_HEIGHT } from '@aztec/constants'; import { times, timesParallel } from '@aztec/foundation/collection'; import { randomInt } from '@aztec/foundation/crypto'; +import { Fr } from '@aztec/foundation/fields'; import { type Logger, createLogger } from '@aztec/foundation/log'; +import { MerkleTreeCalculator } from '@aztec/foundation/trees'; import { SHA256Trunc } from '@aztec/merkle-tree'; import { jest } from '@jest/globals'; diff --git a/yarn-project/world-state/src/synchronizer/server_world_state_synchronizer.ts b/yarn-project/world-state/src/synchronizer/server_world_state_synchronizer.ts index dd5d0337108f..5d1ca36eebfc 100644 --- a/yarn-project/world-state/src/synchronizer/server_world_state_synchronizer.ts +++ b/yarn-project/world-state/src/synchronizer/server_world_state_synchronizer.ts @@ -9,19 +9,21 @@ import { type L2BlockStreamLocalDataProvider, type L2Tips, MerkleTreeId, +} from '@aztec/circuit-types'; +import { type MerkleTreeReadOperations, type MerkleTreeWriteOperations, WorldStateRunningState, type WorldStateSynchronizer, type WorldStateSynchronizerStatus, -} from '@aztec/circuit-types'; +} from '@aztec/circuit-types/interfaces/server'; import { type L2BlockHandledStats } from '@aztec/circuit-types/stats'; -import { MerkleTreeCalculator } from '@aztec/circuits.js'; -import { L1_TO_L2_MSG_SUBTREE_HEIGHT } from '@aztec/circuits.js/constants'; +import { L1_TO_L2_MSG_SUBTREE_HEIGHT } from '@aztec/constants'; import { type Fr } from '@aztec/foundation/fields'; import { createLogger } from '@aztec/foundation/log'; import { promiseWithResolvers } from '@aztec/foundation/promise'; import { elapsed } from '@aztec/foundation/timer'; +import { MerkleTreeCalculator } from '@aztec/foundation/trees'; import { SHA256Trunc } from '@aztec/merkle-tree'; import { TraceableL2BlockStream, getTelemetryClient } from '@aztec/telemetry-client'; diff --git a/yarn-project/world-state/src/test/utils.ts b/yarn-project/world-state/src/test/utils.ts index 3f1cfaee0bb7..6c3c8c9b6f2d 100644 --- a/yarn-project/world-state/src/test/utils.ts +++ b/yarn-project/world-state/src/test/utils.ts @@ -1,17 +1,13 @@ +import { L2Block, MerkleTreeId } from '@aztec/circuit-types'; +import { type MerkleTreeReadOperations, type MerkleTreeWriteOperations } from '@aztec/circuit-types/interfaces/server'; +import { Fr } from '@aztec/circuits.js'; +import { AppendOnlyTreeSnapshot } from '@aztec/circuits.js/trees'; import { - L2Block, - MerkleTreeId, - type MerkleTreeReadOperations, - type MerkleTreeWriteOperations, -} from '@aztec/circuit-types'; -import { - AppendOnlyTreeSnapshot, - Fr, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, NULLIFIER_SUBTREE_HEIGHT, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, -} from '@aztec/circuits.js'; +} from '@aztec/constants'; import { padArrayEnd } from '@aztec/foundation/collection'; import { type NativeWorldStateService } from '../native/native_world_state.js'; diff --git a/yarn-project/world-state/src/testing.ts b/yarn-project/world-state/src/testing.ts index 16bd8c5ba7a0..c0062aee727a 100644 --- a/yarn-project/world-state/src/testing.ts +++ b/yarn-project/world-state/src/testing.ts @@ -1,11 +1,7 @@ import { MerkleTreeId } from '@aztec/circuit-types'; -import { - type AztecAddress, - Fr, - GENESIS_ARCHIVE_ROOT, - GENESIS_BLOCK_HASH, - PublicDataTreeLeaf, -} from '@aztec/circuits.js'; +import { type AztecAddress, Fr } from '@aztec/circuits.js'; +import { PublicDataTreeLeaf } from '@aztec/circuits.js/trees'; +import { GENESIS_ARCHIVE_ROOT, GENESIS_BLOCK_HASH } from '@aztec/constants'; import { computeFeePayerBalanceLeafSlot } from '@aztec/protocol-contracts/fee-juice'; import { NativeWorldStateService } from './native/index.js'; diff --git a/yarn-project/world-state/src/world-state-db/index.ts b/yarn-project/world-state/src/world-state-db/index.ts index a206745d4c68..41a17bada2d9 100644 --- a/yarn-project/world-state/src/world-state-db/index.ts +++ b/yarn-project/world-state/src/world-state-db/index.ts @@ -1,3 +1,3 @@ export * from './merkle_tree_db.js'; -export type { MerkleTreeReadOperations } from '@aztec/circuit-types/interfaces'; +export type { MerkleTreeReadOperations } from '@aztec/circuit-types/interfaces/server'; diff --git a/yarn-project/world-state/src/world-state-db/merkle_tree_db.ts b/yarn-project/world-state/src/world-state-db/merkle_tree_db.ts index 6410c8bc16d1..bab28cb820cc 100644 --- a/yarn-project/world-state/src/world-state-db/merkle_tree_db.ts +++ b/yarn-project/world-state/src/world-state-db/merkle_tree_db.ts @@ -1,6 +1,7 @@ import { type L2Block, type MerkleTreeId } from '@aztec/circuit-types'; -import { type ForkMerkleTreeOperations, type MerkleTreeReadOperations } from '@aztec/circuit-types/interfaces'; -import { type Fr, MAX_NULLIFIERS_PER_TX, MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX } from '@aztec/circuits.js'; +import { type ForkMerkleTreeOperations, type MerkleTreeReadOperations } from '@aztec/circuit-types/interfaces/server'; +import { type Fr } from '@aztec/circuits.js'; +import { MAX_NULLIFIERS_PER_TX, MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX } from '@aztec/constants'; import { type IndexedTreeSnapshot, type TreeSnapshot } from '@aztec/merkle-tree'; import { type WorldStateStatusFull, type WorldStateStatusSummary } from '../native/message.js'; diff --git a/yarn-project/world-state/tsconfig.json b/yarn-project/world-state/tsconfig.json index 094879fdb71b..2eacdd0308bb 100644 --- a/yarn-project/world-state/tsconfig.json +++ b/yarn-project/world-state/tsconfig.json @@ -12,6 +12,9 @@ { "path": "../circuits.js" }, + { + "path": "../constants" + }, { "path": "../foundation" }, diff --git a/yarn-project/yarn.lock b/yarn-project/yarn.lock index 48bb0b62a28c..9ff14471482b 100644 --- a/yarn-project/yarn.lock +++ b/yarn-project/yarn.lock @@ -91,6 +91,7 @@ __metadata: "@aztec/blob-sink": "workspace:^" "@aztec/circuit-types": "workspace:^" "@aztec/circuits.js": "workspace:^" + "@aztec/constants": "workspace:^" "@aztec/ethereum": "workspace:^" "@aztec/foundation": "workspace:^" "@aztec/kv-store": "workspace:^" @@ -156,6 +157,7 @@ __metadata: "@aztec/blob-sink": "workspace:^" "@aztec/circuit-types": "workspace:^" "@aztec/circuits.js": "workspace:^" + "@aztec/constants": "workspace:^" "@aztec/epoch-cache": "workspace:^" "@aztec/ethereum": "workspace:^" "@aztec/foundation": "workspace:^" @@ -191,6 +193,7 @@ __metadata: dependencies: "@aztec/circuit-types": "workspace:^" "@aztec/circuits.js": "workspace:^" + "@aztec/constants": "workspace:^" "@aztec/ethereum": "workspace:^" "@aztec/foundation": "workspace:^" "@aztec/l1-artifacts": "workspace:^" @@ -253,6 +256,7 @@ __metadata: "@aztec/circuits.js": "workspace:^" "@aztec/cli": "workspace:^" "@aztec/cli-wallet": "workspace:^" + "@aztec/constants": "workspace:^" "@aztec/entrypoints": "workspace:^" "@aztec/ethereum": "workspace:^" "@aztec/foundation": "workspace:^" @@ -322,6 +326,7 @@ __metadata: "@aztec/bb.js": "portal:../../barretenberg/ts" "@aztec/circuit-types": "workspace:^" "@aztec/circuits.js": "workspace:^" + "@aztec/constants": "workspace:^" "@aztec/ethereum": "workspace:^" "@aztec/foundation": "workspace:^" "@aztec/kv-store": "workspace:^" @@ -373,6 +378,7 @@ __metadata: version: 0.0.0-use.local resolution: "@aztec/blob-lib@workspace:blob-lib" dependencies: + "@aztec/constants": "workspace:^" "@aztec/foundation": "workspace:^" "@jest/globals": "npm:^29.5.0" "@types/jest": "npm:^29.5.0" @@ -449,8 +455,8 @@ __metadata: version: 0.0.0-use.local resolution: "@aztec/builder@workspace:builder" dependencies: + "@aztec/circuits.js": "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" @@ -468,6 +474,7 @@ __metadata: resolution: "@aztec/circuit-types@workspace:circuit-types" dependencies: "@aztec/circuits.js": "workspace:^" + "@aztec/constants": "workspace:^" "@aztec/ethereum": "workspace:^" "@aztec/foundation": "workspace:^" "@aztec/types": "workspace:^" @@ -500,15 +507,19 @@ __metadata: dependencies: "@aztec/bb.js": "portal:../../barretenberg/ts" "@aztec/blob-lib": "workspace:^" + "@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/lodash.chunk": "npm:^4.2.9" "@types/node": "npm:^18.7.23" + "@types/pako": "npm:^2.0.3" eslint: "npm:^8.35.0" jest: "npm:^29.5.0" + lodash.chunk: "npm:^4.2.0" msgpackr: "npm:^1.11.2" + pako: "npm:^2.1.0" prettier: "npm:^2.8.4" ts-node: "npm:^10.9.1" tslib: "npm:^2.4.0" @@ -558,6 +569,7 @@ __metadata: "@aztec/aztec.js": "workspace:^" "@aztec/circuit-types": "workspace:^" "@aztec/circuits.js": "workspace:^" + "@aztec/constants": "workspace:^" "@aztec/ethereum": "workspace:^" "@aztec/foundation": "workspace:^" "@aztec/l1-artifacts": "workspace:^" @@ -598,6 +610,22 @@ __metadata: languageName: unknown linkType: soft +"@aztec/constants@workspace:^, @aztec/constants@workspace:constants": + version: 0.0.0-use.local + resolution: "@aztec/constants@workspace:constants" + dependencies: + "@jest/globals": "npm:^29.5.0" + "@types/jest": "npm:^29.5.0" + "@types/node": "npm:^18.7.23" + eslint: "npm:^8.35.0" + jest: "npm:^29.5.0" + prettier: "npm:^2.8.4" + ts-node: "npm:^10.9.1" + tslib: "npm:^2.4.0" + typescript: "npm:^5.0.4" + languageName: unknown + linkType: soft + "@aztec/docs@workspace:docs": version: 0.0.0-use.local resolution: "@aztec/docs@workspace:docs" @@ -622,6 +650,7 @@ __metadata: "@aztec/bot": "workspace:^" "@aztec/circuit-types": "workspace:^" "@aztec/circuits.js": "workspace:^" + "@aztec/constants": "workspace:^" "@aztec/entrypoints": "workspace:^" "@aztec/epoch-cache": "workspace:^" "@aztec/ethereum": "workspace:^" @@ -825,6 +854,7 @@ __metadata: "@aztec/bb-prover": "workspace:^" "@aztec/bb.js": ../../ts "@aztec/circuits.js": "workspace:^" + "@aztec/constants": "workspace:^" "@aztec/foundation": "workspace:^" "@aztec/kv-store": "workspace:^" "@aztec/noir-contracts.js": "workspace:^" @@ -872,6 +902,7 @@ __metadata: dependencies: "@aztec/circuit-types": "workspace:^" "@aztec/circuits.js": "workspace:^" + "@aztec/constants": "workspace:^" "@aztec/foundation": "workspace:^" "@aztec/kv-store": "workspace:^" "@jest/globals": "npm:^29.5.0" @@ -989,6 +1020,7 @@ __metadata: dependencies: "@aztec/blob-lib": "workspace:^" "@aztec/circuits.js": "workspace:^" + "@aztec/constants": "workspace:^" "@aztec/foundation": "workspace:^" "@aztec/kv-store": "workspace:^" "@aztec/merkle-tree": "workspace:^" @@ -1041,6 +1073,7 @@ __metadata: "@aztec/archiver": "workspace:^" "@aztec/circuit-types": "workspace:^" "@aztec/circuits.js": "workspace:^" + "@aztec/constants": "workspace:^" "@aztec/epoch-cache": "workspace:^" "@aztec/foundation": "workspace:^" "@aztec/kv-store": "workspace:^" @@ -1115,6 +1148,7 @@ __metadata: resolution: "@aztec/protocol-contracts@workspace:protocol-contracts" dependencies: "@aztec/circuits.js": "workspace:^" + "@aztec/constants": "workspace:^" "@aztec/foundation": "workspace:^" "@aztec/types": "workspace:^" "@jest/globals": "npm:^29.5.0" @@ -1141,6 +1175,7 @@ __metadata: "@aztec/blob-lib": "workspace:^" "@aztec/circuit-types": "workspace:^" "@aztec/circuits.js": "workspace:^" + "@aztec/constants": "workspace:^" "@aztec/foundation": "workspace:^" "@aztec/kv-store": "workspace:^" "@aztec/noir-protocol-circuits-types": "workspace:^" @@ -1178,6 +1213,7 @@ __metadata: "@aztec/blob-sink": "workspace:^" "@aztec/circuit-types": "workspace:^" "@aztec/circuits.js": "workspace:^" + "@aztec/constants": "workspace:^" "@aztec/epoch-cache": "workspace:^" "@aztec/ethereum": "workspace:^" "@aztec/foundation": "workspace:^" @@ -1216,6 +1252,7 @@ __metadata: "@aztec/builder": "workspace:^" "@aztec/circuit-types": "workspace:^" "@aztec/circuits.js": "workspace:^" + "@aztec/constants": "workspace:^" "@aztec/ethereum": "workspace:^" "@aztec/foundation": "workspace:^" "@aztec/key-store": "workspace:^" @@ -1280,6 +1317,7 @@ __metadata: "@aztec/blob-sink": "workspace:^" "@aztec/circuit-types": "workspace:^" "@aztec/circuits.js": "workspace:^" + "@aztec/constants": "workspace:^" "@aztec/epoch-cache": "workspace:^" "@aztec/ethereum": "workspace:^" "@aztec/foundation": "workspace:^" @@ -1328,6 +1366,7 @@ __metadata: dependencies: "@aztec/circuit-types": "workspace:^" "@aztec/circuits.js": "workspace:^" + "@aztec/constants": "workspace:^" "@aztec/foundation": "workspace:^" "@aztec/kv-store": "workspace:^" "@aztec/merkle-tree": "workspace:^" @@ -1401,6 +1440,7 @@ __metadata: "@aztec/aztec.js": "workspace:^" "@aztec/circuit-types": "workspace:^" "@aztec/circuits.js": "workspace:^" + "@aztec/constants": "workspace:^" "@aztec/foundation": "workspace:^" "@aztec/key-store": "workspace:^" "@aztec/kv-store": "workspace:^" @@ -1484,6 +1524,7 @@ __metadata: "@aztec/archiver": "workspace:^" "@aztec/circuit-types": "workspace:^" "@aztec/circuits.js": "workspace:^" + "@aztec/constants": "workspace:^" "@aztec/foundation": "workspace:^" "@aztec/kv-store": "workspace:^" "@aztec/merkle-tree": "workspace:^"