diff --git a/yarn-project/acir-simulator/src/acvm/acvm.ts b/yarn-project/acir-simulator/src/acvm/acvm.ts index db29d457247..9af5fccf5a4 100644 --- a/yarn-project/acir-simulator/src/acvm/acvm.ts +++ b/yarn-project/acir-simulator/src/acvm/acvm.ts @@ -2,6 +2,7 @@ import { AztecAddress } from '@aztec/foundation/aztec-address'; import { EthAddress } from '@aztec/foundation/eth-address'; import { Fr } from '@aztec/foundation/fields'; import { createDebugLogger } from '@aztec/foundation/log'; + import { ForeignCallInput, ForeignCallOutput, WitnessMap, executeCircuit } from 'acvm_js'; /** diff --git a/yarn-project/acir-simulator/src/acvm/acvm_fields_reader.ts b/yarn-project/acir-simulator/src/acvm/acvm_fields_reader.ts index efbc8197205..60d95829fa1 100644 --- a/yarn-project/acir-simulator/src/acvm/acvm_fields_reader.ts +++ b/yarn-project/acir-simulator/src/acvm/acvm_fields_reader.ts @@ -1,4 +1,5 @@ import { Fr } from '@aztec/foundation/fields'; + import { ACVMField, fromACVMField } from './acvm.js'; /** diff --git a/yarn-project/acir-simulator/src/acvm/deserialize.ts b/yarn-project/acir-simulator/src/acvm/deserialize.ts index 335cfd60eb4..f38418a1707 100644 --- a/yarn-project/acir-simulator/src/acvm/deserialize.ts +++ b/yarn-project/acir-simulator/src/acvm/deserialize.ts @@ -4,9 +4,9 @@ import { MAX_NEW_COMMITMENTS_PER_CALL, MAX_NEW_L2_TO_L1_MSGS_PER_CALL, MAX_NEW_NULLIFIERS_PER_CALL, - NUM_FIELDS_PER_SHA256, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL, + NUM_FIELDS_PER_SHA256, PrivateCircuitPublicInputs, MAX_READ_REQUESTS_PER_CALL, RETURN_VALUES_LENGTH, @@ -14,7 +14,9 @@ import { import { AztecAddress } from '@aztec/foundation/aztec-address'; import { EthAddress } from '@aztec/foundation/eth-address'; import { Fr, Point } from '@aztec/foundation/fields'; + import { getReturnWitness } from 'acvm_js'; + import { ACVMField, ACVMWitness, fromACVMField } from './acvm.js'; // Utilities to read TS classes from ACVM Field arrays diff --git a/yarn-project/acir-simulator/src/acvm/serialize.ts b/yarn-project/acir-simulator/src/acvm/serialize.ts index 555074e3af7..db5a6eeb6d8 100644 --- a/yarn-project/acir-simulator/src/acvm/serialize.ts +++ b/yarn-project/acir-simulator/src/acvm/serialize.ts @@ -1,5 +1,3 @@ -import { ACVMField, toACVMField } from './acvm.js'; - import { CallContext, ContractDeploymentData, @@ -8,9 +6,11 @@ import { PrivateCircuitPublicInputs, PublicCallRequest, } from '@aztec/circuits.js'; -import { CommitmentDataOracleInputs, MessageLoadOracleInputs } from '../client/db_oracle.js'; import { Fr } from '@aztec/foundation/fields'; +import { CommitmentDataOracleInputs, MessageLoadOracleInputs } from '../client/db_oracle.js'; +import { ACVMField, toACVMField } from './acvm.js'; + // Utilities to write TS classes to ACVM Field arrays // In the order that the ACVM expects them diff --git a/yarn-project/acir-simulator/src/client/client_execution_context.ts b/yarn-project/acir-simulator/src/client/client_execution_context.ts index 1345b35710b..37cb62affff 100644 --- a/yarn-project/acir-simulator/src/client/client_execution_context.ts +++ b/yarn-project/acir-simulator/src/client/client_execution_context.ts @@ -1,6 +1,7 @@ import { PrivateHistoricTreeRoots, ReadRequestMembershipWitness, TxContext } from '@aztec/circuits.js'; import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr, Point } from '@aztec/foundation/fields'; + import { ACVMField, fromACVMField, diff --git a/yarn-project/acir-simulator/src/client/db_oracle.ts b/yarn-project/acir-simulator/src/client/db_oracle.ts index dfc1d65514b..e182b6c9461 100644 --- a/yarn-project/acir-simulator/src/client/db_oracle.ts +++ b/yarn-project/acir-simulator/src/client/db_oracle.ts @@ -1,8 +1,8 @@ +import { PartialContractAddress } from '@aztec/circuits.js'; +import { FunctionAbi } from '@aztec/foundation/abi'; import { AztecAddress } from '@aztec/foundation/aztec-address'; import { EthAddress } from '@aztec/foundation/eth-address'; import { Fr, Point } from '@aztec/foundation/fields'; -import { FunctionAbi } from '@aztec/foundation/abi'; -import { PartialContractAddress } from '@aztec/circuits.js'; import { CommitmentsDB } from '../index.js'; diff --git a/yarn-project/acir-simulator/src/client/debug.ts b/yarn-project/acir-simulator/src/client/debug.ts index 7c1b3d70bdb..b1c38afbeef 100644 --- a/yarn-project/acir-simulator/src/client/debug.ts +++ b/yarn-project/acir-simulator/src/client/debug.ts @@ -1,4 +1,5 @@ import { ForeignCallInput } from 'acvm_js'; + import { ACVMField } from '../acvm/index.js'; /** diff --git a/yarn-project/acir-simulator/src/client/execution_result.ts b/yarn-project/acir-simulator/src/client/execution_result.ts index 59621c3e077..4ccd2a2a719 100644 --- a/yarn-project/acir-simulator/src/client/execution_result.ts +++ b/yarn-project/acir-simulator/src/client/execution_result.ts @@ -1,6 +1,7 @@ import { PrivateCallStackItem, PublicCallRequest, ReadRequestMembershipWitness } from '@aztec/circuits.js'; import { Fr } from '@aztec/foundation/fields'; import { FunctionL2Logs } from '@aztec/types'; + import { ACVMField } from '../acvm/index.js'; /** diff --git a/yarn-project/acir-simulator/src/client/private_execution.test.ts b/yarn-project/acir-simulator/src/client/private_execution.test.ts index f9bb3fa3920..c39b919bb1a 100644 --- a/yarn-project/acir-simulator/src/client/private_execution.test.ts +++ b/yarn-project/acir-simulator/src/client/private_execution.test.ts @@ -29,10 +29,11 @@ import { ZkTokenContractAbi, } from '@aztec/noir-contracts/examples'; import { PackedArguments, TxExecutionRequest } from '@aztec/types'; + import { jest } from '@jest/globals'; import { MockProxy, mock } from 'jest-mock-extended'; import { default as levelup } from 'levelup'; -import { default as memdown, type MemDown } from 'memdown'; +import { type MemDown, default as memdown } from 'memdown'; import { buildL1ToL2Message } from '../test/utils.js'; import { NoirPoint, computeSlotForMapping, toPublicKey } from '../utils.js'; diff --git a/yarn-project/acir-simulator/src/client/private_execution.ts b/yarn-project/acir-simulator/src/client/private_execution.ts index 6e7f4f1edc6..67908cad5f9 100644 --- a/yarn-project/acir-simulator/src/client/private_execution.ts +++ b/yarn-project/acir-simulator/src/client/private_execution.ts @@ -16,6 +16,7 @@ import { Fr, Point } from '@aztec/foundation/fields'; import { createDebugLogger } from '@aztec/foundation/log'; import { to2Fields } from '@aztec/foundation/serialize'; import { FunctionL2Logs, NotePreimage, NoteSpendingInfo } from '@aztec/types'; + import { extractPublicInputs, frToAztecAddress, frToSelector } from '../acvm/deserialize.js'; import { ZERO_ACVM_FIELD, diff --git a/yarn-project/acir-simulator/src/client/simulator.ts b/yarn-project/acir-simulator/src/client/simulator.ts index a44bc9a305d..7bfc3c011ae 100644 --- a/yarn-project/acir-simulator/src/client/simulator.ts +++ b/yarn-project/acir-simulator/src/client/simulator.ts @@ -6,6 +6,7 @@ import { EthAddress } from '@aztec/foundation/eth-address'; import { Fr } from '@aztec/foundation/fields'; import { DebugLogger, createDebugLogger } from '@aztec/foundation/log'; import { ExecutionRequest, TxExecutionRequest } from '@aztec/types'; + import { PackedArgsCache } from '../packed_args_cache.js'; import { ClientTxExecutionContext } from './client_execution_context.js'; import { DBOracle } from './db_oracle.js'; diff --git a/yarn-project/acir-simulator/src/client/unconstrained_execution.test.ts b/yarn-project/acir-simulator/src/client/unconstrained_execution.test.ts index 9828ab3159c..bde77e6ac16 100644 --- a/yarn-project/acir-simulator/src/client/unconstrained_execution.test.ts +++ b/yarn-project/acir-simulator/src/client/unconstrained_execution.test.ts @@ -1,16 +1,17 @@ import { CircuitsWasm, FunctionData, PrivateHistoricTreeRoots } from '@aztec/circuits.js'; import { Grumpkin } from '@aztec/circuits.js/barretenberg'; - +import { encodeArguments } from '@aztec/foundation/abi'; import { AztecAddress } from '@aztec/foundation/aztec-address'; import { EthAddress } from '@aztec/foundation/eth-address'; import { Fr } from '@aztec/foundation/fields'; import { ZkTokenContractAbi } from '@aztec/noir-contracts/examples'; import { ExecutionRequest } from '@aztec/types'; + import { mock } from 'jest-mock-extended'; + import { NoirPoint, toPublicKey } from '../utils.js'; import { DBOracle } from './db_oracle.js'; import { AcirSimulator } from './simulator.js'; -import { encodeArguments } from '@aztec/foundation/abi'; describe('Unconstrained Execution test suite', () => { let bbWasm: CircuitsWasm; diff --git a/yarn-project/acir-simulator/src/public/db.ts b/yarn-project/acir-simulator/src/public/db.ts index 04c740e800b..6474480f451 100644 --- a/yarn-project/acir-simulator/src/public/db.ts +++ b/yarn-project/acir-simulator/src/public/db.ts @@ -1,6 +1,7 @@ import { EthAddress, PrivateHistoricTreeRoots } from '@aztec/circuits.js'; import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; + import { CommitmentDataOracleInputs, MessageLoadOracleInputs } from '../index.js'; /** diff --git a/yarn-project/acir-simulator/src/public/executor.ts b/yarn-project/acir-simulator/src/public/executor.ts index dacca80326f..7eb6f5ac390 100644 --- a/yarn-project/acir-simulator/src/public/executor.ts +++ b/yarn-project/acir-simulator/src/public/executor.ts @@ -10,6 +10,7 @@ import { import { padArrayEnd } from '@aztec/foundation/collection'; import { createDebugLogger } from '@aztec/foundation/log'; import { FunctionL2Logs } from '@aztec/types'; + import { ZERO_ACVM_FIELD, acvm, @@ -23,11 +24,11 @@ import { toAcvmCommitmentLoadOracleInputs, toAcvmL1ToL2MessageLoadOracleInputs, } from '../acvm/index.js'; +import { oracleDebugCallToFormattedStr } from '../client/debug.js'; +import { PackedArgsCache } from '../packed_args_cache.js'; import { CommitmentsDB, PublicContractsDB, PublicStateDB } from './db.js'; import { PublicExecution, PublicExecutionResult } from './execution.js'; import { ContractStorageActionsCollector } from './state_actions.js'; -import { oracleDebugCallToFormattedStr } from '../client/debug.js'; -import { PackedArgsCache } from '../packed_args_cache.js'; // Copied from crate::abi at noir-contracts/src/contracts/noir-aztec/src/abi.nr const NOIR_MAX_RETURN_VALUES = 4; diff --git a/yarn-project/acir-simulator/src/public/index.test.ts b/yarn-project/acir-simulator/src/public/index.test.ts index e439adba6b9..6d36ee572d1 100644 --- a/yarn-project/acir-simulator/src/public/index.test.ts +++ b/yarn-project/acir-simulator/src/public/index.test.ts @@ -1,16 +1,18 @@ -import { Grumpkin, pedersenPlookupCommitInputs } from '@aztec/circuits.js/barretenberg'; import { CallContext, - FunctionData, CircuitsWasm, - PrivateHistoricTreeRoots, - L1_TO_L2_MSG_TREE_HEIGHT, + FunctionData, GlobalVariables, + L1_TO_L2_MSG_TREE_HEIGHT, + PrivateHistoricTreeRoots, } from '@aztec/circuits.js'; +import { Grumpkin, pedersenPlookupCommitInputs } from '@aztec/circuits.js/barretenberg'; +import { FunctionAbi, encodeArguments } from '@aztec/foundation/abi'; import { AztecAddress } from '@aztec/foundation/aztec-address'; +import { keccak } from '@aztec/foundation/crypto'; import { EthAddress } from '@aztec/foundation/eth-address'; import { Fr } from '@aztec/foundation/fields'; -import { FunctionAbi, encodeArguments } from '@aztec/foundation/abi'; +import { toBigInt } from '@aztec/foundation/serialize'; import { ChildAbi, NonNativeTokenContractAbi, @@ -18,16 +20,15 @@ import { PublicTokenContractAbi, TestContractAbi, } from '@aztec/noir-contracts/examples'; -import { toBigInt } from '@aztec/foundation/serialize'; -import { keccak } from '@aztec/foundation/crypto'; + import { MockProxy, mock } from 'jest-mock-extended'; -import { default as memdown, type MemDown } from 'memdown'; +import { type MemDown, default as memdown } from 'memdown'; +import { buildL1ToL2Message } from '../test/utils.js'; import { NoirPoint, computeSlotForMapping, toPublicKey } from '../utils.js'; import { CommitmentsDB, PublicContractsDB, PublicStateDB } from './db.js'; import { PublicExecution } from './execution.js'; import { PublicExecutor } from './executor.js'; -import { buildL1ToL2Message } from '../test/utils.js'; export const createMemDown = () => (memdown as any)() as MemDown; diff --git a/yarn-project/acir-simulator/src/public/state_actions.ts b/yarn-project/acir-simulator/src/public/state_actions.ts index 453541b348f..f8891270ff2 100644 --- a/yarn-project/acir-simulator/src/public/state_actions.ts +++ b/yarn-project/acir-simulator/src/public/state_actions.ts @@ -1,6 +1,7 @@ import { ContractStorageRead, ContractStorageUpdateRequest } from '@aztec/circuits.js'; import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; + import { PublicStateDB } from './db.js'; /** diff --git a/yarn-project/acir-simulator/src/test/utils.ts b/yarn-project/acir-simulator/src/test/utils.ts index 35e18249074..a44c9b1be3d 100644 --- a/yarn-project/acir-simulator/src/test/utils.ts +++ b/yarn-project/acir-simulator/src/test/utils.ts @@ -1,7 +1,7 @@ +import { AztecAddress, CircuitsWasm, EthAddress, Fr } from '@aztec/circuits.js'; import { computeSecretMessageHash } from '@aztec/circuits.js/abis'; -import { L1ToL2Message, L1Actor, L2Actor } from '@aztec/types'; import { sha256ToField } from '@aztec/foundation/crypto'; -import { AztecAddress, CircuitsWasm, EthAddress, Fr } from '@aztec/circuits.js'; +import { L1Actor, L1ToL2Message, L2Actor } from '@aztec/types'; /** * Test utility function to craft an L1 to L2 message. diff --git a/yarn-project/acir-simulator/src/utils.ts b/yarn-project/acir-simulator/src/utils.ts index f8af5d393ce..acea06ec2fe 100644 --- a/yarn-project/acir-simulator/src/utils.ts +++ b/yarn-project/acir-simulator/src/utils.ts @@ -1,6 +1,6 @@ -import { Fr, Point } from '@aztec/foundation/fields'; -import { Grumpkin, pedersenPlookupCommitInputs } from '@aztec/circuits.js/barretenberg'; import { CircuitsWasm } from '@aztec/circuits.js'; +import { Grumpkin, pedersenPlookupCommitInputs } from '@aztec/circuits.js/barretenberg'; +import { Fr, Point } from '@aztec/foundation/fields'; /** * A point in the format that noir uses. diff --git a/yarn-project/archiver/src/archiver/archiver.test.ts b/yarn-project/archiver/src/archiver/archiver.test.ts index f836474ef92..45fa164a7e8 100644 --- a/yarn-project/archiver/src/archiver/archiver.test.ts +++ b/yarn-project/archiver/src/archiver/archiver.test.ts @@ -1,4 +1,9 @@ -import { InboxAbi, RollupAbi, ContractDeploymentEmitterAbi } from '@aztec/l1-artifacts'; +import { AztecAddress } from '@aztec/foundation/aztec-address'; +import { randomBytes } from '@aztec/foundation/crypto'; +import { EthAddress } from '@aztec/foundation/eth-address'; +import { Fr } from '@aztec/foundation/fields'; +import { sleep } from '@aztec/foundation/sleep'; +import { ContractDeploymentEmitterAbi, InboxAbi, RollupAbi } from '@aztec/l1-artifacts'; import { ContractData, ContractPublicData, @@ -7,15 +12,12 @@ import { L2BlockL2Logs, LogType, } from '@aztec/types'; + import { MockProxy, mock } from 'jest-mock-extended'; import { Chain, HttpTransport, Log, PublicClient, Transaction, encodeFunctionData, toHex } from 'viem'; + import { Archiver } from './archiver.js'; -import { EthAddress } from '@aztec/foundation/eth-address'; -import { sleep } from '@aztec/foundation/sleep'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; -import { randomBytes } from '@aztec/foundation/crypto'; import { ArchiverDataStore, MemoryArchiverStore } from './archiver_store.js'; -import { Fr } from '@aztec/foundation/fields'; describe('Archiver', () => { const rollupAddress = '0x0000000000000000000000000000000000000000'; diff --git a/yarn-project/archiver/src/archiver/archiver.ts b/yarn-project/archiver/src/archiver/archiver.ts index 4504bcaad84..2cdc6a2eb45 100644 --- a/yarn-project/archiver/src/archiver/archiver.ts +++ b/yarn-project/archiver/src/archiver/archiver.ts @@ -1,30 +1,31 @@ -import omit from 'lodash.omit'; +import { createEthereumChain } from '@aztec/ethereum'; +import { AztecAddress } from '@aztec/foundation/aztec-address'; +import { EthAddress } from '@aztec/foundation/eth-address'; +import { Fr } from '@aztec/foundation/fields'; import { DebugLogger, createDebugLogger } from '@aztec/foundation/log'; import { RunningPromise } from '@aztec/foundation/running-promise'; -import { EthAddress } from '@aztec/foundation/eth-address'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; import { INITIAL_L2_BLOCK_NUM, L1ToL2Message, L1ToL2MessageSource, L2BlockL2Logs, LogType } from '@aztec/types'; import { ContractData, - ContractPublicData, ContractDataSource, + ContractPublicData, EncodedContractFunction, L2Block, L2BlockSource, L2LogsSource, } from '@aztec/types'; + +import omit from 'lodash.omit'; import { Chain, HttpTransport, PublicClient, createPublicClient, http } from 'viem'; -import { createEthereumChain } from '@aztec/ethereum'; -import { Fr } from '@aztec/foundation/fields'; +import { ArchiverDataStore, MemoryArchiverStore } from './archiver_store.js'; import { ArchiverConfig } from './config.js'; import { retrieveBlocks, + retrieveNewCancelledL1ToL2Messages, retrieveNewContractData, retrieveNewPendingL1ToL2Messages, - retrieveNewCancelledL1ToL2Messages, } from './data_retrieval.js'; -import { ArchiverDataStore, MemoryArchiverStore } from './archiver_store.js'; /** * Pulls L2 blocks in a non-blocking manner and provides interface for their retrieval. diff --git a/yarn-project/archiver/src/archiver/archiver_store.ts b/yarn-project/archiver/src/archiver/archiver_store.ts index 90fc9ca8feb..c43a32b1aa3 100644 --- a/yarn-project/archiver/src/archiver/archiver_store.ts +++ b/yarn-project/archiver/src/archiver/archiver_store.ts @@ -1,14 +1,15 @@ +import { Fr, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/circuits.js'; +import { AztecAddress } from '@aztec/foundation/aztec-address'; import { + ContractData, ContractPublicData, - L2Block, INITIAL_L2_BLOCK_NUM, - ContractData, L1ToL2Message, + L2Block, L2BlockL2Logs, LogType, } from '@aztec/types'; -import { Fr, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/circuits.js'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; + import { L1ToL2MessageStore, PendingL1ToL2MessageStore } from './l1_to_l2_message_store.js'; /** diff --git a/yarn-project/archiver/src/archiver/data_retrieval.ts b/yarn-project/archiver/src/archiver/data_retrieval.ts index 324d9bab092..55927f3a06b 100644 --- a/yarn-project/archiver/src/archiver/data_retrieval.ts +++ b/yarn-project/archiver/src/archiver/data_retrieval.ts @@ -1,17 +1,19 @@ +import { EthAddress } from '@aztec/foundation/eth-address'; +import { Fr } from '@aztec/foundation/fields'; +import { ContractPublicData, L1ToL2Message, L2Block } from '@aztec/types'; + import { PublicClient } from 'viem'; + import { getContractDeploymentLogs, + getL1ToL2MessageCancelledLogs, getL2BlockProcessedLogs, getPendingL1ToL2MessageLogs, - getL1ToL2MessageCancelledLogs, processBlockLogs, + processCancelledL1ToL2MessagesLogs, processContractDeploymentLogs, processPendingL1ToL2MessageAddedLogs, - processCancelledL1ToL2MessagesLogs, } from './eth_log_handlers.js'; -import { EthAddress } from '@aztec/foundation/eth-address'; -import { ContractPublicData, L1ToL2Message, L2Block } from '@aztec/types'; -import { Fr } from '@aztec/foundation/fields'; /** * Data retrieved from logs diff --git a/yarn-project/archiver/src/archiver/eth_log_handlers.ts b/yarn-project/archiver/src/archiver/eth_log_handlers.ts index 284698510c6..c85b8ac7244 100644 --- a/yarn-project/archiver/src/archiver/eth_log_handlers.ts +++ b/yarn-project/archiver/src/archiver/eth_log_handlers.ts @@ -1,18 +1,19 @@ -import { Hex, Log, PublicClient, decodeFunctionData, getAbiItem, getAddress, hexToBytes } from 'viem'; -import { InboxAbi, RollupAbi, ContractDeploymentEmitterAbi } from '@aztec/l1-artifacts'; +import { AztecAddress } from '@aztec/foundation/aztec-address'; +import { EthAddress } from '@aztec/foundation/eth-address'; import { Fr } from '@aztec/foundation/fields'; +import { ContractDeploymentEmitterAbi, InboxAbi, RollupAbi } from '@aztec/l1-artifacts'; import { - L1ToL2Message, - L1Actor, - L2Actor, - L2Block, - ContractPublicData, BufferReader, ContractData, + ContractPublicData, EncodedContractFunction, + L1Actor, + L1ToL2Message, + L2Actor, + L2Block, } from '@aztec/types'; -import { EthAddress } from '@aztec/foundation/eth-address'; -import { AztecAddress } from '@aztec/foundation/aztec-address'; + +import { Hex, Log, PublicClient, decodeFunctionData, getAbiItem, getAddress, hexToBytes } from 'viem'; /** * Processes newly received MessageAdded (L1 to L2) logs. diff --git a/yarn-project/archiver/src/archiver/l1_to_l2_message_store.test.ts b/yarn-project/archiver/src/archiver/l1_to_l2_message_store.test.ts index b2d65894798..aabf40f2cc7 100644 --- a/yarn-project/archiver/src/archiver/l1_to_l2_message_store.test.ts +++ b/yarn-project/archiver/src/archiver/l1_to_l2_message_store.test.ts @@ -1,7 +1,8 @@ import { Fr } from '@aztec/foundation/fields'; -import { L1ToL2MessageStore, PendingL1ToL2MessageStore } from './l1_to_l2_message_store.js'; import { L1Actor, L1ToL2Message, L2Actor } from '@aztec/types'; +import { L1ToL2MessageStore, PendingL1ToL2MessageStore } from './l1_to_l2_message_store.js'; + describe('l1_to_l2_message_store', () => { let store: L1ToL2MessageStore; let entryKey: Fr; diff --git a/yarn-project/archiver/src/index.ts b/yarn-project/archiver/src/index.ts index 42b322dd7df..f416c48d2db 100644 --- a/yarn-project/archiver/src/index.ts +++ b/yarn-project/archiver/src/index.ts @@ -1,9 +1,11 @@ +import { createLogger } from '@aztec/foundation/log'; + import { fileURLToPath } from 'url'; import { createPublicClient, http } from 'viem'; import { localhost } from 'viem/chains'; -import { Archiver, getConfigEnvVars } from './archiver/index.js'; + import { MemoryArchiverStore } from './archiver/archiver_store.js'; -import { createLogger } from '@aztec/foundation/log'; +import { Archiver, getConfigEnvVars } from './archiver/index.js'; export * from './archiver/index.js'; diff --git a/yarn-project/aztec-cli/src/index.ts b/yarn-project/aztec-cli/src/index.ts index cc13e013ee0..9e3f1ad003f 100644 --- a/yarn-project/aztec-cli/src/index.ts +++ b/yarn-project/aztec-cli/src/index.ts @@ -1,8 +1,4 @@ #!/usr/bin/env -S node --no-warnings -import { Command } from 'commander'; -import { mnemonicToAccount } from 'viem/accounts'; -import { createLogger } from '@aztec/foundation/log'; -import { createDebugLogger } from '@aztec/foundation/log'; import { AztecAddress, Contract, @@ -16,8 +12,13 @@ import { import { StructType } from '@aztec/foundation/abi'; import { randomBytes } from '@aztec/foundation/crypto'; import { JsonStringify } from '@aztec/foundation/json-rpc'; -import { ContractData, TxHash, L2BlockL2Logs } from '@aztec/types'; +import { createLogger } from '@aztec/foundation/log'; +import { createDebugLogger } from '@aztec/foundation/log'; import { SchnorrAccountContractAbi } from '@aztec/noir-contracts/examples'; +import { ContractData, L2BlockL2Logs, TxHash } from '@aztec/types'; + +import { Command } from 'commander'; +import { mnemonicToAccount } from 'viem/accounts'; import { encodeArgs, parseStructString } from './cli_encoder.js'; import { deployAztecContracts, getContractAbi, getTxSender, prepTx } from './utils.js'; diff --git a/yarn-project/aztec-cli/src/utils.ts b/yarn-project/aztec-cli/src/utils.ts index b74c88a125f..8ac4befcd11 100644 --- a/yarn-project/aztec-cli/src/utils.ts +++ b/yarn-project/aztec-cli/src/utils.ts @@ -1,9 +1,11 @@ -import { mnemonicToAccount, privateKeyToAccount } from 'viem/accounts'; -import fs from 'fs'; +import { AztecAddress, AztecRPC } from '@aztec/aztec.js'; import { createEthereumChain, deployL1Contracts } from '@aztec/ethereum'; -import { DebugLogger, Logger } from '@aztec/foundation/log'; import { ContractAbi } from '@aztec/foundation/abi'; -import { AztecAddress, AztecRPC } from '@aztec/aztec.js'; +import { DebugLogger, Logger } from '@aztec/foundation/log'; + +import fs from 'fs'; +import { mnemonicToAccount, privateKeyToAccount } from 'viem/accounts'; + import { encodeArgs } from './cli_encoder.js'; /** diff --git a/yarn-project/aztec-node/src/aztec-node/config.ts b/yarn-project/aztec-node/src/aztec-node/config.ts index e2c7772cff9..fa90036c15e 100644 --- a/yarn-project/aztec-node/src/aztec-node/config.ts +++ b/yarn-project/aztec-node/src/aztec-node/config.ts @@ -1,7 +1,7 @@ import { ArchiverConfig, getConfigEnvVars as getArchiverVars } from '@aztec/archiver'; +import { P2PConfig, getP2PConfigEnvVars } from '@aztec/p2p'; import { SequencerClientConfig, getConfigEnvVars as getSequencerVars } from '@aztec/sequencer-client'; import { getConfigEnvVars as getWorldStateVars } from '@aztec/world-state'; -import { P2PConfig, getP2PConfigEnvVars } from '@aztec/p2p'; /** * The configuration the aztec node. diff --git a/yarn-project/aztec-node/src/aztec-node/http-node.test.ts b/yarn-project/aztec-node/src/aztec-node/http-node.test.ts index 2657a2f0a2a..f4f34306163 100644 --- a/yarn-project/aztec-node/src/aztec-node/http-node.test.ts +++ b/yarn-project/aztec-node/src/aztec-node/http-node.test.ts @@ -9,11 +9,13 @@ import { L2BlockL2Logs, LogType, MerkleTreeId, - mockTx, SiblingPath, TxHash, + mockTx, } from '@aztec/types'; + import { jest } from '@jest/globals'; + import { HttpNode } from './http-node.js'; const TEST_URL = 'http://aztec-node-url.com/'; diff --git a/yarn-project/aztec-node/src/aztec-node/server.ts b/yarn-project/aztec-node/src/aztec-node/server.ts index 1ec97455e04..b0210f626ca 100644 --- a/yarn-project/aztec-node/src/aztec-node/server.ts +++ b/yarn-project/aztec-node/src/aztec-node/server.ts @@ -10,6 +10,7 @@ import { AztecAddress } from '@aztec/foundation/aztec-address'; import { InMemoryTxPool, P2P, createP2PClient } from '@aztec/p2p'; import { SequencerClient, getCombinedHistoricTreeRoots } from '@aztec/sequencer-client'; import { + AztecNode, ContractData, ContractDataSource, ContractPublicData, @@ -21,10 +22,9 @@ import { L2LogsSource, LogType, MerkleTreeId, + SiblingPath, Tx, TxHash, - SiblingPath, - AztecNode, } from '@aztec/types'; import { MerkleTrees, @@ -32,8 +32,10 @@ import { WorldStateSynchroniser, computePublicDataTreeLeafIndex, } from '@aztec/world-state'; + import { default as levelup } from 'levelup'; import { MemDown, default as memdown } from 'memdown'; + import { AztecNodeConfig } from './config.js'; export const createMemDown = () => (memdown as any)() as MemDown; diff --git a/yarn-project/aztec-rpc/src/aztec_rpc_http/aztec_rpc_http_server.ts b/yarn-project/aztec-rpc/src/aztec_rpc_http/aztec_rpc_http_server.ts index 3114a782a9e..94a01829324 100644 --- a/yarn-project/aztec-rpc/src/aztec_rpc_http/aztec_rpc_http_server.ts +++ b/yarn-project/aztec-rpc/src/aztec_rpc_http/aztec_rpc_http_server.ts @@ -2,6 +2,7 @@ import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr, Point } from '@aztec/foundation/fields'; import { JsonRpcServer } from '@aztec/foundation/json-rpc'; import { ContractData, ContractDeploymentTx, ContractPublicData, Tx, TxExecutionRequest, TxHash } from '@aztec/types'; + import { foundry } from 'viem/chains'; import { AztecRPCServer, EthAddress } from '../index.js'; diff --git a/yarn-project/aztec-rpc/src/aztec_rpc_server/aztec_rpc_server.test.ts b/yarn-project/aztec-rpc/src/aztec_rpc_server/aztec_rpc_server.test.ts index ae0f3767879..635d3bb73a0 100644 --- a/yarn-project/aztec-rpc/src/aztec_rpc_server/aztec_rpc_server.test.ts +++ b/yarn-project/aztec-rpc/src/aztec_rpc_server/aztec_rpc_server.test.ts @@ -2,8 +2,10 @@ import { AztecAddress, CircuitsWasm, Fr } from '@aztec/circuits.js'; import { computeContractAddressFromPartial } from '@aztec/circuits.js/abis'; import { Grumpkin } from '@aztec/circuits.js/barretenberg'; import { ConstantKeyPair, TestKeyStore } from '@aztec/key-store'; + import { randomBytes } from 'crypto'; import { MockProxy, mock } from 'jest-mock-extended'; + import { MemoryDB } from '../database/memory_db.js'; import { AztecRPCServer } from './aztec_rpc_server.js'; import { AztecNode } from '@aztec/types'; diff --git a/yarn-project/aztec-rpc/src/aztec_rpc_server/create_aztec_rpc_server.ts b/yarn-project/aztec-rpc/src/aztec_rpc_server/create_aztec_rpc_server.ts index 77d366a8256..4142112f894 100644 --- a/yarn-project/aztec-rpc/src/aztec_rpc_server/create_aztec_rpc_server.ts +++ b/yarn-project/aztec-rpc/src/aztec_rpc_server/create_aztec_rpc_server.ts @@ -2,9 +2,9 @@ import { Grumpkin } from '@aztec/circuits.js/barretenberg'; import { TestKeyStore } from '@aztec/key-store'; import { AztecNode, KeyStore } from '@aztec/types'; -import { AztecRPCServer } from './aztec_rpc_server.js'; -import { Database, MemoryDB } from '../database/index.js'; import { RpcServerConfig } from '../config/index.js'; +import { Database, MemoryDB } from '../database/index.js'; +import { AztecRPCServer } from './aztec_rpc_server.js'; /** * Optional information for creating an AztecRPCServer. diff --git a/yarn-project/aztec-rpc/src/contract_tree/index.ts b/yarn-project/aztec-rpc/src/contract_tree/index.ts index f2ebbf84409..9e7d3c041d7 100644 --- a/yarn-project/aztec-rpc/src/contract_tree/index.ts +++ b/yarn-project/aztec-rpc/src/contract_tree/index.ts @@ -6,9 +6,9 @@ import { Fr, FunctionData, MembershipWitness, + NewContractConstructor, NewContractData, computeFunctionTree, - NewContractConstructor, computeFunctionTreeData, generateFunctionLeaves, hashVKStr, diff --git a/yarn-project/aztec-rpc/src/database/database.ts b/yarn-project/aztec-rpc/src/database/database.ts index 37dfba22233..c47fca1ce5f 100644 --- a/yarn-project/aztec-rpc/src/database/database.ts +++ b/yarn-project/aztec-rpc/src/database/database.ts @@ -1,8 +1,8 @@ -import { ContractDatabase, TxHash, PublicKey } from '@aztec/types'; +import { PartialContractAddress } from '@aztec/circuits.js'; import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr, Point } from '@aztec/foundation/fields'; +import { ContractDatabase, PublicKey, TxHash } from '@aztec/types'; import { MerkleTreeId } from '@aztec/types'; -import { PartialContractAddress } from '@aztec/circuits.js'; import { NoteSpendingInfoDao } from './note_spending_info_dao.js'; import { TxDao } from './tx_dao.js'; diff --git a/yarn-project/aztec-rpc/src/database/memory_db.test.ts b/yarn-project/aztec-rpc/src/database/memory_db.test.ts index eca89d2df0d..a9e032922b9 100644 --- a/yarn-project/aztec-rpc/src/database/memory_db.test.ts +++ b/yarn-project/aztec-rpc/src/database/memory_db.test.ts @@ -1,7 +1,8 @@ import { AztecAddress, Fr } from '@aztec/circuits.js'; +import { NotePreimage } from '@aztec/types'; + import { MemoryDB } from './memory_db.js'; import { NoteSpendingInfoDao, createRandomNoteSpendingInfoDao } from './note_spending_info_dao.js'; -import { NotePreimage } from '@aztec/types'; describe('Memory DB', () => { let db: MemoryDB; diff --git a/yarn-project/aztec-rpc/src/database/memory_db.ts b/yarn-project/aztec-rpc/src/database/memory_db.ts index 7cb2a365e1b..8d9c7f8fa6f 100644 --- a/yarn-project/aztec-rpc/src/database/memory_db.ts +++ b/yarn-project/aztec-rpc/src/database/memory_db.ts @@ -1,8 +1,8 @@ -import { TxHash } from '@aztec/types'; +import { PartialContractAddress } from '@aztec/circuits.js'; import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr, Point } from '@aztec/foundation/fields'; +import { TxHash } from '@aztec/types'; import { MerkleTreeId, PublicKey } from '@aztec/types'; -import { PartialContractAddress } from '@aztec/circuits.js'; import { MemoryContractDatabase } from '../contract_database/index.js'; import { Database, GetOptions } from './database.js'; diff --git a/yarn-project/aztec-rpc/src/kernel_oracle/index.ts b/yarn-project/aztec-rpc/src/kernel_oracle/index.ts index d51b36b0ace..778a25dd230 100644 --- a/yarn-project/aztec-rpc/src/kernel_oracle/index.ts +++ b/yarn-project/aztec-rpc/src/kernel_oracle/index.ts @@ -1,8 +1,9 @@ import { AztecAddress, Fr, MembershipWitness, PRIVATE_DATA_TREE_HEIGHT } from '@aztec/circuits.js'; +import { Tuple } from '@aztec/foundation/serialize'; +import { AztecNode, MerkleTreeId } from '@aztec/types'; + import { ContractDataOracle } from '../contract_data_oracle/index.js'; import { ProvingDataOracle } from './../kernel_prover/proving_data_oracle.js'; -import { AztecNode, MerkleTreeId } from '@aztec/types'; -import { Tuple } from '@aztec/foundation/serialize'; /** * A data oracle that provides information needed for simulating a transaction. diff --git a/yarn-project/aztec-rpc/src/kernel_prover/kernel_prover.test.ts b/yarn-project/aztec-rpc/src/kernel_prover/kernel_prover.test.ts index 8caa2be7a6c..fe49288c10a 100644 --- a/yarn-project/aztec-rpc/src/kernel_prover/kernel_prover.test.ts +++ b/yarn-project/aztec-rpc/src/kernel_prover/kernel_prover.test.ts @@ -1,9 +1,9 @@ import { ExecutionResult, NewNoteData } from '@aztec/acir-simulator'; import { - MAX_NEW_COMMITMENTS_PER_TX, KernelCircuitPublicInputs, - MembershipWitness, + MAX_NEW_COMMITMENTS_PER_TX, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, + MembershipWitness, PrivateCallStackItem, PrivateCircuitPublicInputs, MAX_READ_REQUESTS_PER_CALL, @@ -18,7 +18,9 @@ import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { Tuple } from '@aztec/foundation/serialize'; import { FunctionL2Logs } from '@aztec/types'; + import { mock } from 'jest-mock-extended'; + import { KernelProver, OutputNoteData } from './kernel_prover.js'; import { ProofCreator } from './proof_creator.js'; import { ProvingDataOracle } from './proving_data_oracle.js'; diff --git a/yarn-project/aztec-rpc/src/kernel_prover/kernel_prover.ts b/yarn-project/aztec-rpc/src/kernel_prover/kernel_prover.ts index 6a54c22c262..6a28afe056d 100644 --- a/yarn-project/aztec-rpc/src/kernel_prover/kernel_prover.ts +++ b/yarn-project/aztec-rpc/src/kernel_prover/kernel_prover.ts @@ -4,8 +4,8 @@ import { CONTRACT_TREE_HEIGHT, Fr, KernelCircuitPublicInputs, - MembershipWitness, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, + MembershipWitness, PreviousKernelData, PrivateCallData, PrivateCallStackItem, @@ -17,6 +17,7 @@ import { makeEmptyProof, } from '@aztec/circuits.js'; import { assertLength } from '@aztec/foundation/serialize'; + import { KernelProofCreator, ProofCreator, ProofOutput } from './proof_creator.js'; import { ProvingDataOracle } from './proving_data_oracle.js'; diff --git a/yarn-project/aztec-rpc/src/kernel_prover/proof_creator.ts b/yarn-project/aztec-rpc/src/kernel_prover/proof_creator.ts index b884076c0b7..d7ae36ee982 100644 --- a/yarn-project/aztec-rpc/src/kernel_prover/proof_creator.ts +++ b/yarn-project/aztec-rpc/src/kernel_prover/proof_creator.ts @@ -130,7 +130,7 @@ export class KernelProofCreator { const proof = makeEmptyProof(); this.log('Ordering Kernel Prover Ordering Completed!'); - const publicInputs = result; + const publicInputs = result as KernelCircuitPublicInputs; return { publicInputs, diff --git a/yarn-project/aztec-rpc/src/note_processor/note_processor.test.ts b/yarn-project/aztec-rpc/src/note_processor/note_processor.test.ts index c873d8505ca..ac54a1b6278 100644 --- a/yarn-project/aztec-rpc/src/note_processor/note_processor.test.ts +++ b/yarn-project/aztec-rpc/src/note_processor/note_processor.test.ts @@ -1,4 +1,4 @@ -import { AztecAddress, CircuitsWasm, MAX_NEW_COMMITMENTS_PER_TX, Fr } from '@aztec/circuits.js'; +import { AztecAddress, CircuitsWasm, Fr, MAX_NEW_COMMITMENTS_PER_TX } from '@aztec/circuits.js'; import { Grumpkin } from '@aztec/circuits.js/barretenberg'; import { Point } from '@aztec/foundation/fields'; import { ConstantKeyPair } from '@aztec/key-store'; @@ -13,8 +13,10 @@ import { NoteSpendingInfo, TxL2Logs, } from '@aztec/types'; + import { jest } from '@jest/globals'; import { MockProxy, mock } from 'jest-mock-extended'; + import { Database, MemoryDB } from '../database/index.js'; import { NoteProcessor } from './note_processor.js'; diff --git a/yarn-project/aztec-rpc/src/simulator_oracle/index.ts b/yarn-project/aztec-rpc/src/simulator_oracle/index.ts index 4911814eb46..dd56e010d27 100644 --- a/yarn-project/aztec-rpc/src/simulator_oracle/index.ts +++ b/yarn-project/aztec-rpc/src/simulator_oracle/index.ts @@ -8,13 +8,13 @@ import { Point, PrivateHistoricTreeRoots, } from '@aztec/circuits.js'; -import { FunctionAbi } from '@aztec/foundation/abi'; import { siloCommitment } from '@aztec/circuits.js/abis'; +import { FunctionAbi } from '@aztec/foundation/abi'; import { KeyStore, MerkleTreeId } from '@aztec/types'; +import { DataCommitmentProvider, L1ToL2MessageProvider } from '@aztec/types'; import { ContractDataOracle } from '../contract_data_oracle/index.js'; import { Database } from '../database/index.js'; -import { DataCommitmentProvider, L1ToL2MessageProvider } from '@aztec/types'; /** * A data oracle that provides information needed for simulating a transaction. diff --git a/yarn-project/aztec-rpc/src/synchroniser/synchroniser.test.ts b/yarn-project/aztec-rpc/src/synchroniser/synchroniser.test.ts index 889d9e08da8..0eeb7d5044c 100644 --- a/yarn-project/aztec-rpc/src/synchroniser/synchroniser.test.ts +++ b/yarn-project/aztec-rpc/src/synchroniser/synchroniser.test.ts @@ -1,7 +1,9 @@ import { Fr } from '@aztec/circuits.js'; import { AztecNode, L2Block, MerkleTreeId } from '@aztec/types'; + import { MockProxy, mock } from 'jest-mock-extended'; import omit from 'lodash.omit'; + import { Database, MemoryDB } from '../database/index.js'; import { Synchroniser } from './synchroniser.js'; diff --git a/yarn-project/aztec-rpc/src/synchroniser/synchroniser.ts b/yarn-project/aztec-rpc/src/synchroniser/synchroniser.ts index 13445f11fa3..303624f017b 100644 --- a/yarn-project/aztec-rpc/src/synchroniser/synchroniser.ts +++ b/yarn-project/aztec-rpc/src/synchroniser/synchroniser.ts @@ -2,8 +2,10 @@ import { AztecAddress, Fr, PublicKey } from '@aztec/circuits.js'; import { createDebugLogger } from '@aztec/foundation/log'; import { InterruptableSleep } from '@aztec/foundation/sleep'; import { AztecNode, KeyStore, L2BlockContext, LogType, MerkleTreeId } from '@aztec/types'; + import { Database, TxDao } from '../database/index.js'; import { NoteProcessor } from '../note_processor/index.js'; + /** * The Synchroniser class manages the synchronization of note processors and interacts with the Aztec node * to obtain encrypted logs, blocks, and other necessary information for the accounts. diff --git a/yarn-project/aztec-sandbox/src/examples/uniswap_trade_on_l1_from_l2.ts b/yarn-project/aztec-sandbox/src/examples/uniswap_trade_on_l1_from_l2.ts index e9fd2dfafc3..c1cd5254fa0 100644 --- a/yarn-project/aztec-sandbox/src/examples/uniswap_trade_on_l1_from_l2.ts +++ b/yarn-project/aztec-sandbox/src/examples/uniswap_trade_on_l1_from_l2.ts @@ -1,23 +1,25 @@ import { + AztecAddress, Contract, ContractDeployer, - createAccounts, - createAztecRpcClient, - getL1ContractAddresses, - AztecAddress, EthAddress, Fr, Wallet, computeMessageSecretHash, + createAccounts, + createAztecRpcClient, + getL1ContractAddresses, } from '@aztec/aztec.js'; import { createDebugLogger } from '@aztec/foundation/log'; -import { UniswapContractAbi, SchnorrAccountContractAbi } from '@aztec/noir-contracts/examples'; +import { UniswapPortalAbi, UniswapPortalBytecode } from '@aztec/l1-artifacts'; +import { SchnorrAccountContractAbi, UniswapContractAbi } from '@aztec/noir-contracts/examples'; +import { AztecRPC, TxStatus } from '@aztec/types'; + import { createPublicClient, createWalletClient, getContract, http, parseEther } from 'viem'; import { mnemonicToAccount } from 'viem/accounts'; import { foundry } from 'viem/chains'; + import { delay, deployAndInitializeNonNativeL2TokenContracts, deployL1Contract } from './util.js'; -import { UniswapPortalAbi, UniswapPortalBytecode } from '@aztec/l1-artifacts'; -import { AztecRPC, TxStatus } from '@aztec/types'; /** * Type representation of a Public key's coordinates. diff --git a/yarn-project/aztec-sandbox/src/examples/util.ts b/yarn-project/aztec-sandbox/src/examples/util.ts index cd5d1649ba5..1d2944a3ecf 100644 --- a/yarn-project/aztec-sandbox/src/examples/util.ts +++ b/yarn-project/aztec-sandbox/src/examples/util.ts @@ -1,6 +1,7 @@ import { Contract, ContractDeployer, EthAddress, Wallet } from '@aztec/aztec.js'; import { PortalERC20Abi, PortalERC20Bytecode, TokenPortalAbi, TokenPortalBytecode } from '@aztec/l1-artifacts'; import { NonNativeTokenContractAbi } from '@aztec/noir-contracts/examples'; + import type { Abi, Narrow } from 'abitype'; import { Account, Chain, Hex, HttpTransport, PublicClient, WalletClient, getContract } from 'viem'; diff --git a/yarn-project/aztec-sandbox/src/examples/zk_token_contract.ts b/yarn-project/aztec-sandbox/src/examples/zk_token_contract.ts index 8e704cb4cbf..794486b42a2 100644 --- a/yarn-project/aztec-sandbox/src/examples/zk_token_contract.ts +++ b/yarn-project/aztec-sandbox/src/examples/zk_token_contract.ts @@ -1,7 +1,7 @@ import { Contract, ContractDeployer, Wallet, createAccounts, createAztecRpcClient } from '@aztec/aztec.js'; import { AztecAddress, Fr, Point } from '@aztec/circuits.js'; import { createDebugLogger } from '@aztec/foundation/log'; -import { ZkTokenContractAbi, SchnorrAccountContractAbi } from '@aztec/noir-contracts/examples'; +import { SchnorrAccountContractAbi, ZkTokenContractAbi } from '@aztec/noir-contracts/examples'; const logger = createDebugLogger('aztec:http-rpc-client'); diff --git a/yarn-project/aztec-sandbox/src/index.ts b/yarn-project/aztec-sandbox/src/index.ts index ba08fd448c4..287dc7e9143 100644 --- a/yarn-project/aztec-sandbox/src/index.ts +++ b/yarn-project/aztec-sandbox/src/index.ts @@ -1,13 +1,13 @@ -import http from 'http'; -import { foundry } from 'viem/chains'; -import { http as httpViemTransport, createPublicClient, HDAccount } from 'viem'; - -import { mnemonicToAccount } from 'viem/accounts'; +import { AztecNodeConfig, AztecNodeService, getConfigEnvVars } from '@aztec/aztec-node'; import { createAztecRPCServer, getHttpRpcServer, getConfigEnvVars as getRpcConfigEnvVars } from '@aztec/aztec-rpc'; +import { deployL1Contracts } from '@aztec/ethereum'; import { createDebugLogger } from '@aztec/foundation/log'; import { retryUntil } from '@aztec/foundation/retry'; -import { AztecNodeConfig, AztecNodeService, getConfigEnvVars } from '@aztec/aztec-node'; -import { deployL1Contracts } from '@aztec/ethereum'; + +import http from 'http'; +import { HDAccount, createPublicClient, http as httpViemTransport } from 'viem'; +import { mnemonicToAccount } from 'viem/accounts'; +import { foundry } from 'viem/chains'; import { createApiRouter } from './routes.js'; diff --git a/yarn-project/aztec-sandbox/src/routes.ts b/yarn-project/aztec-sandbox/src/routes.ts index c037a1547dd..c10bc7303c8 100644 --- a/yarn-project/aztec-sandbox/src/routes.ts +++ b/yarn-project/aztec-sandbox/src/routes.ts @@ -1,6 +1,7 @@ +import { DeployL1Contracts } from '@aztec/ethereum'; + import Koa from 'koa'; import Router from 'koa-router'; -import { DeployL1Contracts } from '@aztec/ethereum'; /** * Creates a router for helper API endpoints of the Aztec RPC Server. diff --git a/yarn-project/aztec.js/src/account_impl/account_collection.ts b/yarn-project/aztec.js/src/account_impl/account_collection.ts index 90147b5cbe0..b7d606db2c5 100644 --- a/yarn-project/aztec.js/src/account_impl/account_collection.ts +++ b/yarn-project/aztec.js/src/account_impl/account_collection.ts @@ -1,5 +1,6 @@ import { AztecAddress, TxContext } from '@aztec/circuits.js'; import { ExecutionRequest, TxExecutionRequest } from '@aztec/types'; + import { AccountImplementation } from './index.js'; /** diff --git a/yarn-project/aztec.js/src/aztec_rpc_client/aztec_rpc_client.ts b/yarn-project/aztec.js/src/aztec_rpc_client/aztec_rpc_client.ts index 8b181dd4e69..1f0b51a24eb 100644 --- a/yarn-project/aztec.js/src/aztec_rpc_client/aztec_rpc_client.ts +++ b/yarn-project/aztec.js/src/aztec_rpc_client/aztec_rpc_client.ts @@ -5,9 +5,9 @@ import { ContractData, ContractDeploymentTx, ContractPublicData, + Tx, TxExecutionRequest, TxHash, - Tx, } from '@aztec/types'; export const createAztecRpcClient = (url: string): AztecRPC => diff --git a/yarn-project/aztec.js/src/contract/contract.test.ts b/yarn-project/aztec.js/src/contract/contract.test.ts index cb81f2e509e..ffa0e3b6550 100644 --- a/yarn-project/aztec.js/src/contract/contract.test.ts +++ b/yarn-project/aztec.js/src/contract/contract.test.ts @@ -1,11 +1,13 @@ -import { MockProxy, mock } from 'jest-mock-extended'; -import { DeployedContract, NodeInfo, Tx, TxHash, TxReceipt } from '@aztec/types'; +import { AztecAddress, EthAddress } from '@aztec/circuits.js'; import { ABIParameterVisibility, ContractAbi, FunctionType } from '@aztec/foundation/abi'; import { randomBytes } from '@aztec/foundation/crypto'; +import { DeployedContract, NodeInfo, Tx, TxHash, TxReceipt } from '@aztec/types'; import { TxExecutionRequest } from '@aztec/types'; + +import { MockProxy, mock } from 'jest-mock-extended'; + import { Wallet } from '../aztec_rpc_client/wallet.js'; import { Contract } from './contract.js'; -import { AztecAddress, EthAddress } from '@aztec/circuits.js'; describe('Contract Class', () => { let wallet: MockProxy; diff --git a/yarn-project/aztec.js/src/contract/contract.ts b/yarn-project/aztec.js/src/contract/contract.ts index 7d39c2f2adf..f33daa275b4 100644 --- a/yarn-project/aztec.js/src/contract/contract.ts +++ b/yarn-project/aztec.js/src/contract/contract.ts @@ -1,9 +1,10 @@ import { ContractAbi, FunctionAbi, generateFunctionSelector } from '@aztec/foundation/abi'; import { AztecAddress } from '@aztec/foundation/aztec-address'; import { EthAddress } from '@aztec/foundation/eth-address'; +import { DeployedContract } from '@aztec/types'; + import { Wallet } from '../aztec_rpc_client/wallet.js'; import { ContractFunctionInteraction } from './contract_function_interaction.js'; -import { DeployedContract } from '@aztec/types'; /** * Type representing a contract method that returns a ContractFunctionInteraction instance diff --git a/yarn-project/aztec.js/src/contract_deployer/contract_deployer.test.ts b/yarn-project/aztec.js/src/contract_deployer/contract_deployer.test.ts index 8fc8a57b296..d9755ffd876 100644 --- a/yarn-project/aztec.js/src/contract_deployer/contract_deployer.test.ts +++ b/yarn-project/aztec.js/src/contract_deployer/contract_deployer.test.ts @@ -1,8 +1,9 @@ -import { randomBytes } from 'crypto'; -import { MockProxy, mock } from 'jest-mock-extended'; import { AztecAddress, EthAddress, Fr, Point } from '@aztec/circuits.js'; import { ContractAbi, FunctionType } from '@aztec/foundation/abi'; -import { AztecRPC, Tx, TxHash, TxReceipt, PublicKey } from '@aztec/types'; +import { AztecRPC, PublicKey, Tx, TxHash, TxReceipt } from '@aztec/types'; + +import { randomBytes } from 'crypto'; +import { MockProxy, mock } from 'jest-mock-extended'; import { ContractDeployer } from './contract_deployer.js'; diff --git a/yarn-project/circuits.js/src/abis/abis.test.ts b/yarn-project/circuits.js/src/abis/abis.test.ts index 6b5153c822a..b8af90f709d 100644 --- a/yarn-project/circuits.js/src/abis/abis.test.ts +++ b/yarn-project/circuits.js/src/abis/abis.test.ts @@ -1,4 +1,5 @@ import times from 'lodash.times'; + import { AztecAddress, Fr, FunctionData, FunctionLeafPreimage, NewContractData } from '../index.js'; import { makeAztecAddress, makeEthAddress, makePoint, makeTxRequest, makeVerificationKey } from '../tests/factories.js'; import { CircuitsWasm } from '../wasm/circuits_wasm.js'; diff --git a/yarn-project/circuits.js/src/abis/abis.ts b/yarn-project/circuits.js/src/abis/abis.ts index 8e25b3952ea..085ef84866e 100644 --- a/yarn-project/circuits.js/src/abis/abis.ts +++ b/yarn-project/circuits.js/src/abis/abis.ts @@ -1,7 +1,9 @@ import { padArrayEnd } from '@aztec/foundation/collection'; import { IWasmModule } from '@aztec/foundation/wasm'; + import { Buffer } from 'buffer'; import chunk from 'lodash.chunk'; + import { abisSiloCommitment, abisSiloNullifier } from '../cbind/circuits.gen.js'; import { AztecAddress, diff --git a/yarn-project/circuits.js/src/barretenberg/crs/index.ts b/yarn-project/circuits.js/src/barretenberg/crs/index.ts index 0aeccda4fcb..f2b50b40861 100644 --- a/yarn-project/circuits.js/src/barretenberg/crs/index.ts +++ b/yarn-project/circuits.js/src/barretenberg/crs/index.ts @@ -1,6 +1,5 @@ -import { open } from 'fs/promises'; import { existsSync } from 'fs'; - +import { open } from 'fs/promises'; import { dirname } from 'path'; import { fileURLToPath } from 'url'; diff --git a/yarn-project/circuits.js/src/barretenberg/crypto/aes128/index.test.ts b/yarn-project/circuits.js/src/barretenberg/crypto/aes128/index.test.ts index d49968e9f54..e8a1f91b533 100644 --- a/yarn-project/circuits.js/src/barretenberg/crypto/aes128/index.test.ts +++ b/yarn-project/circuits.js/src/barretenberg/crypto/aes128/index.test.ts @@ -1,7 +1,8 @@ import { CircuitsWasm } from '@aztec/circuits.js'; -import { Aes128 } from './index.js'; -import { randomBytes, createCipheriv, createDecipheriv } from 'crypto'; +import { createCipheriv, createDecipheriv, randomBytes } from 'crypto'; + +import { Aes128 } from './index.js'; describe('aes128', () => { let barretenberg!: CircuitsWasm; diff --git a/yarn-project/circuits.js/src/barretenberg/crypto/aes128/index.ts b/yarn-project/circuits.js/src/barretenberg/crypto/aes128/index.ts index 967c7c07ef6..47e8b7c90da 100644 --- a/yarn-project/circuits.js/src/barretenberg/crypto/aes128/index.ts +++ b/yarn-project/circuits.js/src/barretenberg/crypto/aes128/index.ts @@ -1,6 +1,7 @@ -import { Buffer } from 'buffer'; import { IWasmModule } from '@aztec/foundation/wasm'; +import { Buffer } from 'buffer'; + /** * AES-128-CBC encryption/decryption. */ diff --git a/yarn-project/circuits.js/src/barretenberg/crypto/ecdsa/index.test.ts b/yarn-project/circuits.js/src/barretenberg/crypto/ecdsa/index.test.ts index b30730e8f5b..a05f16f9b8c 100644 --- a/yarn-project/circuits.js/src/barretenberg/crypto/ecdsa/index.test.ts +++ b/yarn-project/circuits.js/src/barretenberg/crypto/ecdsa/index.test.ts @@ -1,6 +1,7 @@ +import { TextEncoder } from 'util'; + import { CircuitsWasm } from '../../../index.js'; import { Ecdsa } from './index.js'; -import { TextEncoder } from 'util'; describe('ecdsa', () => { let ecdsa!: Ecdsa; diff --git a/yarn-project/circuits.js/src/barretenberg/crypto/ecdsa/index.ts b/yarn-project/circuits.js/src/barretenberg/crypto/ecdsa/index.ts index 762c60a3990..9e8eb99d689 100644 --- a/yarn-project/circuits.js/src/barretenberg/crypto/ecdsa/index.ts +++ b/yarn-project/circuits.js/src/barretenberg/crypto/ecdsa/index.ts @@ -1,4 +1,5 @@ import { IWasmModule } from '@aztec/foundation/wasm'; + import { CircuitsWasm } from '../../../index.js'; import { Signer } from '../index.js'; import { EcdsaSignature } from './signature.js'; diff --git a/yarn-project/circuits.js/src/barretenberg/crypto/ecdsa/signature.ts b/yarn-project/circuits.js/src/barretenberg/crypto/ecdsa/signature.ts index 97e9367ddf2..80c334f07f2 100644 --- a/yarn-project/circuits.js/src/barretenberg/crypto/ecdsa/signature.ts +++ b/yarn-project/circuits.js/src/barretenberg/crypto/ecdsa/signature.ts @@ -1,8 +1,10 @@ +import { toBufferBE } from '@aztec/foundation/bigint-buffer'; +import { Fr } from '@aztec/foundation/fields'; +import { mapTuple } from '@aztec/foundation/serialize'; + import { randomBytes } from 'crypto'; + import { Signature } from '../index.js'; -import { mapTuple } from '@aztec/foundation/serialize'; -import { Fr } from '@aztec/foundation/fields'; -import { toBufferBE } from '@aztec/foundation/bigint-buffer'; /** * ECDSA signature used for transactions. diff --git a/yarn-project/circuits.js/src/barretenberg/crypto/grumpkin/index.test.ts b/yarn-project/circuits.js/src/barretenberg/crypto/grumpkin/index.test.ts index ac83d19210f..bcae5fbddea 100644 --- a/yarn-project/circuits.js/src/barretenberg/crypto/grumpkin/index.test.ts +++ b/yarn-project/circuits.js/src/barretenberg/crypto/grumpkin/index.test.ts @@ -1,7 +1,9 @@ -import { Grumpkin } from './index.js'; import { randomBytes } from '@aztec/foundation/crypto'; + import createDebug from 'debug'; + import { CircuitsWasm } from '../../../index.js'; +import { Grumpkin } from './index.js'; const debug = createDebug('bb:grumpkin_test'); diff --git a/yarn-project/circuits.js/src/barretenberg/crypto/grumpkin/index.ts b/yarn-project/circuits.js/src/barretenberg/crypto/grumpkin/index.ts index 2e80312de87..780c681c153 100644 --- a/yarn-project/circuits.js/src/barretenberg/crypto/grumpkin/index.ts +++ b/yarn-project/circuits.js/src/barretenberg/crypto/grumpkin/index.ts @@ -1,4 +1,5 @@ import { IWasmModule } from '@aztec/foundation/wasm'; + import { CircuitsWasm } from '../../../index.js'; import { Curve } from '../index.js'; diff --git a/yarn-project/circuits.js/src/barretenberg/crypto/pedersen/pedersen.test.ts b/yarn-project/circuits.js/src/barretenberg/crypto/pedersen/pedersen.test.ts index beca39e8487..1ff650d30b1 100644 --- a/yarn-project/circuits.js/src/barretenberg/crypto/pedersen/pedersen.test.ts +++ b/yarn-project/circuits.js/src/barretenberg/crypto/pedersen/pedersen.test.ts @@ -1,6 +1,8 @@ +import { CircuitsWasm } from '@aztec/circuits.js'; + import { Buffer } from 'buffer'; + import { pedersenGetHashTree } from './pedersen.js'; -import { CircuitsWasm } from '@aztec/circuits.js'; describe('pedersen', () => { let barretenbergWasm!: CircuitsWasm; diff --git a/yarn-project/circuits.js/src/barretenberg/crypto/pedersen/pedersen.ts b/yarn-project/circuits.js/src/barretenberg/crypto/pedersen/pedersen.ts index bafbb278a78..238b36caaa5 100644 --- a/yarn-project/circuits.js/src/barretenberg/crypto/pedersen/pedersen.ts +++ b/yarn-project/circuits.js/src/barretenberg/crypto/pedersen/pedersen.ts @@ -1,6 +1,8 @@ +import { IWasmModule } from '@aztec/foundation/wasm'; + import { Buffer } from 'buffer'; + import { deserializeArrayFromVector, deserializeField, serializeBufferArrayToVector } from '../../serialize.js'; -import { IWasmModule } from '@aztec/foundation/wasm'; /** * Compresses two 32-byte hashes. diff --git a/yarn-project/circuits.js/src/barretenberg/crypto/schnorr/index.test.ts b/yarn-project/circuits.js/src/barretenberg/crypto/schnorr/index.test.ts index ed5cd420219..22d98fe7c0a 100644 --- a/yarn-project/circuits.js/src/barretenberg/crypto/schnorr/index.test.ts +++ b/yarn-project/circuits.js/src/barretenberg/crypto/schnorr/index.test.ts @@ -1,7 +1,8 @@ -import { Schnorr } from './index.js'; +import { randomBytes } from 'crypto'; import { TextEncoder } from 'util'; + import { CircuitsWasm } from '../../../index.js'; -import { randomBytes } from 'crypto'; +import { Schnorr } from './index.js'; describe('schnorr', () => { let schnorr!: Schnorr; diff --git a/yarn-project/circuits.js/src/barretenberg/crypto/schnorr/index.ts b/yarn-project/circuits.js/src/barretenberg/crypto/schnorr/index.ts index 5c21beda1b1..15fa14d48df 100644 --- a/yarn-project/circuits.js/src/barretenberg/crypto/schnorr/index.ts +++ b/yarn-project/circuits.js/src/barretenberg/crypto/schnorr/index.ts @@ -1,8 +1,9 @@ +import { numToUInt32BE } from '@aztec/foundation/serialize'; import { IWasmModule } from '@aztec/foundation/wasm'; -import { SchnorrSignature } from './signature.js'; + import { CircuitsWasm } from '../../../index.js'; import { Signer } from '../index.js'; -import { numToUInt32BE } from '@aztec/foundation/serialize'; +import { SchnorrSignature } from './signature.js'; export * from './signature.js'; diff --git a/yarn-project/circuits.js/src/barretenberg/crypto/schnorr/signature.ts b/yarn-project/circuits.js/src/barretenberg/crypto/schnorr/signature.ts index 9aabe2d6711..4ab11cb4992 100644 --- a/yarn-project/circuits.js/src/barretenberg/crypto/schnorr/signature.ts +++ b/yarn-project/circuits.js/src/barretenberg/crypto/schnorr/signature.ts @@ -1,7 +1,8 @@ import { randomBytes } from '@aztec/foundation/crypto'; -import { Signature } from '../index.js'; -import { BufferReader, mapTuple } from '@aztec/foundation/serialize'; import { Fr } from '@aztec/foundation/fields'; +import { BufferReader, mapTuple } from '@aztec/foundation/serialize'; + +import { Signature } from '../index.js'; /** * Schnorr signature used for transactions. diff --git a/yarn-project/circuits.js/src/barretenberg/crypto/secp256k1/index.test.ts b/yarn-project/circuits.js/src/barretenberg/crypto/secp256k1/index.test.ts index f736edc7048..801b45d796e 100644 --- a/yarn-project/circuits.js/src/barretenberg/crypto/secp256k1/index.test.ts +++ b/yarn-project/circuits.js/src/barretenberg/crypto/secp256k1/index.test.ts @@ -1,7 +1,8 @@ -import { Secp256k1 } from './index.js'; import { randomBytes } from '@aztec/foundation/crypto'; -import { Ecdsa } from '../ecdsa/index.js'; + import { CircuitsWasm } from '../../../index.js'; +import { Ecdsa } from '../ecdsa/index.js'; +import { Secp256k1 } from './index.js'; describe('secp256k1', () => { let secp256k1!: Secp256k1; diff --git a/yarn-project/circuits.js/src/barretenberg/crypto/secp256k1/index.ts b/yarn-project/circuits.js/src/barretenberg/crypto/secp256k1/index.ts index b4a6b840612..b3028d8460d 100644 --- a/yarn-project/circuits.js/src/barretenberg/crypto/secp256k1/index.ts +++ b/yarn-project/circuits.js/src/barretenberg/crypto/secp256k1/index.ts @@ -1,4 +1,5 @@ import { IWasmModule } from '@aztec/foundation/wasm'; + import { CircuitsWasm } from '../../../index.js'; import { Curve } from '../curve/index.js'; diff --git a/yarn-project/circuits.js/src/cbind/cbind.ts b/yarn-project/circuits.js/src/cbind/cbind.ts index ba55036a3c2..d7f87ca0543 100644 --- a/yarn-project/circuits.js/src/cbind/cbind.ts +++ b/yarn-project/circuits.js/src/cbind/cbind.ts @@ -1,7 +1,9 @@ import { IWasmModule } from '@aztec/foundation/wasm'; -import { CircuitsWasm } from '../wasm/index.js'; + import { decode, encode } from '@msgpack/msgpack'; +import { CircuitsWasm } from '../wasm/index.js'; + /** * Recursively converts Uint8Arrays to Buffers in the input data structure. * The function traverses through the given data, and if it encounters a Uint8Array, diff --git a/yarn-project/circuits.js/src/cbind/circuits.gen.ts b/yarn-project/circuits.js/src/cbind/circuits.gen.ts index 0d09228bc26..5618e9a2ba9 100644 --- a/yarn-project/circuits.js/src/cbind/circuits.gen.ts +++ b/yarn-project/circuits.js/src/cbind/circuits.gen.ts @@ -1,44 +1,47 @@ /* eslint-disable */ // GENERATED FILE DO NOT EDIT, RUN yarn remake-bindings +import { Tuple, mapTuple } from '@aztec/foundation/serialize'; +import { IWasmModule } from '@aztec/foundation/wasm'; + import { Buffer } from 'buffer'; +import mapValues from 'lodash.mapvalues'; + import { callCbind } from './cbind.js'; -import { IWasmModule } from '@aztec/foundation/wasm'; import { toBuffer, Address, - Fr, + CallContext, + CircuitError, + CombinedAccumulatedData, + CombinedConstantData, + CombinedHistoricTreeRoots, + ContractDeploymentData, + ContractStorageRead, + ContractStorageUpdateRequest, Fq, + Fr, + FunctionData, G1AffineElement, + KernelCircuitPublicInputs, NativeAggregationState, ReadRequestMembershipWitness, NewContractData, - FunctionData, OptionallyRevealedData, - PublicDataUpdateRequest, - PublicDataRead, - CombinedAccumulatedData, - PrivateHistoricTreeRoots, - CombinedHistoricTreeRoots, Point, - ContractDeploymentData, - TxContext, - CombinedConstantData, - KernelCircuitPublicInputs, - Proof, - VerificationKeyData, PreviousKernelData, - CircuitError, - isCircuitError, - CallContext, - ContractStorageUpdateRequest, - ContractStorageRead, - PublicCircuitPublicInputs, - PublicCallStackItem, + PrivateHistoricTreeRoots, + Proof, PublicCallData, + PublicCallStackItem, + PublicCircuitPublicInputs, + PublicDataRead, + PublicDataUpdateRequest, PublicKernelInputs, + TxContext, + VerificationKeyData, + isCircuitError, } from './types.js'; -import { Tuple, mapTuple } from '@aztec/foundation/serialize'; -import mapValues from 'lodash.mapvalues'; + interface MsgpackG1AffineElement { x: Buffer; y: Buffer; diff --git a/yarn-project/circuits.js/src/cbind/circuits.in.ts b/yarn-project/circuits.js/src/cbind/circuits.in.ts index 8c088d81c69..a32d43a5a18 100644 --- a/yarn-project/circuits.js/src/cbind/circuits.in.ts +++ b/yarn-project/circuits.js/src/cbind/circuits.in.ts @@ -1,8 +1,9 @@ -import { getCbindSchema } from './cbind.js'; import { writeFileSync } from 'fs'; -import { fileURLToPath } from 'url'; import { dirname } from 'path'; +import { fileURLToPath } from 'url'; + import { CircuitsWasm } from '../wasm/circuits_wasm.js'; +import { getCbindSchema } from './cbind.js'; import { CbindCompiler } from './compiler.js'; /** diff --git a/yarn-project/circuits.js/src/cbind/compiler.ts b/yarn-project/circuits.js/src/cbind/compiler.ts index f7c069c0db4..e9d8414602a 100644 --- a/yarn-project/circuits.js/src/cbind/compiler.ts +++ b/yarn-project/circuits.js/src/cbind/compiler.ts @@ -1,4 +1,5 @@ import camelCase from 'lodash.camelcase'; + import { USES_MSGPACK_BUFFER_METHODS } from './type_data.js'; /** diff --git a/yarn-project/circuits.js/src/cbind/constants.in.ts b/yarn-project/circuits.js/src/cbind/constants.in.ts index abdfa4b7f9f..89cf28da5c9 100644 --- a/yarn-project/circuits.js/src/cbind/constants.in.ts +++ b/yarn-project/circuits.js/src/cbind/constants.in.ts @@ -1,8 +1,9 @@ import * as fs from 'fs'; import { dirname, join } from 'path'; import { fileURLToPath } from 'url'; -import { callCbind } from './cbind.js'; + import { CircuitsWasm } from '../wasm/circuits_wasm.js'; +import { callCbind } from './cbind.js'; /** * Convert the C++ constants to TypeScript and Noir. diff --git a/yarn-project/circuits.js/src/contract/contract_deployment_info.ts b/yarn-project/circuits.js/src/contract/contract_deployment_info.ts index 00b5454b6ed..1150cd36cf4 100644 --- a/yarn-project/circuits.js/src/contract/contract_deployment_info.ts +++ b/yarn-project/circuits.js/src/contract/contract_deployment_info.ts @@ -1,4 +1,3 @@ -import { ContractAbi, encodeArguments, generateFunctionSelector } from '@aztec/foundation/abi'; import { computeContractAddress, computeFunctionTreeRoot, @@ -6,9 +5,10 @@ import { computeVarArgsHash, hashConstructor, } from '@aztec/circuits.js/abis'; +import { ContractAbi, encodeArguments, generateFunctionSelector } from '@aztec/foundation/abi'; -import { generateFunctionLeaves, hashVKStr, isConstructor } from './contract_tree/contract_tree.js'; import { CircuitsWasm, DeploymentInfo, Fr, FunctionData, PublicKey } from '../index.js'; +import { generateFunctionLeaves, hashVKStr, isConstructor } from './contract_tree/contract_tree.js'; /** * Generates the deployment info for a contract diff --git a/yarn-project/circuits.js/src/contract/contract_tree/function_tree_data.test.ts b/yarn-project/circuits.js/src/contract/contract_tree/function_tree_data.test.ts index 093415a93f7..aac4187726f 100644 --- a/yarn-project/circuits.js/src/contract/contract_tree/function_tree_data.test.ts +++ b/yarn-project/circuits.js/src/contract/contract_tree/function_tree_data.test.ts @@ -1,6 +1,7 @@ -import { computeFunctionTreeData } from './function_tree_data.js'; import { Fr } from '@aztec/foundation/fields'; +import { computeFunctionTreeData } from './function_tree_data.js'; + const getFr = (index: number) => Fr.fromBuffer(Buffer.alloc(32, index)); const Tree = [ // leaves diff --git a/yarn-project/circuits.js/src/crs/index.ts b/yarn-project/circuits.js/src/crs/index.ts index 0aeccda4fcb..f2b50b40861 100644 --- a/yarn-project/circuits.js/src/crs/index.ts +++ b/yarn-project/circuits.js/src/crs/index.ts @@ -1,6 +1,5 @@ -import { open } from 'fs/promises'; import { existsSync } from 'fs'; - +import { open } from 'fs/promises'; import { dirname } from 'path'; import { fileURLToPath } from 'url'; diff --git a/yarn-project/circuits.js/src/kernel/private_kernel.test.ts b/yarn-project/circuits.js/src/kernel/private_kernel.test.ts index e43e478506a..3ac47d213ae 100644 --- a/yarn-project/circuits.js/src/kernel/private_kernel.test.ts +++ b/yarn-project/circuits.js/src/kernel/private_kernel.test.ts @@ -1,10 +1,11 @@ import times from 'lodash.times'; -import { fr } from '../tests/factories.js'; -import { CircuitsWasm } from '../wasm/circuits_wasm.js'; + import { computeFunctionTreeRoot } from '../abis/abis.js'; import { privateKernelDummyPreviousKernel } from '../cbind/circuits.gen.js'; -import { computeFunctionTree } from './private_kernel.js'; import { FUNCTION_TREE_HEIGHT } from '../cbind/constants.gen.js'; +import { fr } from '../tests/factories.js'; +import { CircuitsWasm } from '../wasm/circuits_wasm.js'; +import { computeFunctionTree } from './private_kernel.js'; describe('kernel/private_kernel', () => { let wasm: CircuitsWasm; diff --git a/yarn-project/circuits.js/src/kernel/private_kernel.ts b/yarn-project/circuits.js/src/kernel/private_kernel.ts index f263dfdab29..a210feb5a0a 100644 --- a/yarn-project/circuits.js/src/kernel/private_kernel.ts +++ b/yarn-project/circuits.js/src/kernel/private_kernel.ts @@ -1,5 +1,7 @@ import { BufferReader } from '@aztec/foundation/serialize'; + import { Buffer } from 'buffer'; + import { FUNCTION_TREE_HEIGHT, Fr, @@ -11,6 +13,7 @@ import { import { handleCircuitOutput } from '../utils/call_wasm.js'; import { serializeBufferArrayToVector, uint8ArrayToNum } from '../utils/serialize.js'; import { CircuitsWasm } from '../wasm/index.js'; + export { privateKernelSimOrdering } from '../cbind/circuits.gen.js'; /** diff --git a/yarn-project/circuits.js/src/structs/aggregation_object.ts b/yarn-project/circuits.js/src/structs/aggregation_object.ts index 93f01e5b582..e4dd278e344 100644 --- a/yarn-project/circuits.js/src/structs/aggregation_object.ts +++ b/yarn-project/circuits.js/src/structs/aggregation_object.ts @@ -1,8 +1,10 @@ import { Fq, Fr } from '@aztec/foundation/fields'; -import { serializeToBuffer } from '../utils/serialize.js'; -import times from 'lodash.times'; -import { Vector, UInt32 } from './shared.js'; import { BufferReader } from '@aztec/foundation/serialize'; + +import times from 'lodash.times'; + +import { serializeToBuffer } from '../utils/serialize.js'; +import { UInt32, Vector } from './shared.js'; import { G1AffineElement } from './verification_key.js'; /** diff --git a/yarn-project/circuits.js/src/structs/call_context.ts b/yarn-project/circuits.js/src/structs/call_context.ts index 3ebed2b703e..cb64dac8d44 100644 --- a/yarn-project/circuits.js/src/structs/call_context.ts +++ b/yarn-project/circuits.js/src/structs/call_context.ts @@ -1,8 +1,9 @@ -import { serializeToBuffer } from '../utils/serialize.js'; import { AztecAddress } from '@aztec/foundation/aztec-address'; import { EthAddress } from '@aztec/foundation/eth-address'; -import { FieldsOf } from '../utils/jsUtils.js'; import { BufferReader } from '@aztec/foundation/serialize'; + +import { FieldsOf } from '../utils/jsUtils.js'; +import { serializeToBuffer } from '../utils/serialize.js'; import { Fr } from './index.js'; /** diff --git a/yarn-project/circuits.js/src/structs/call_stack_item.ts b/yarn-project/circuits.js/src/structs/call_stack_item.ts index cf44f8e0943..2a8410f708b 100644 --- a/yarn-project/circuits.js/src/structs/call_stack_item.ts +++ b/yarn-project/circuits.js/src/structs/call_stack_item.ts @@ -1,4 +1,5 @@ import { AztecAddress } from '@aztec/foundation/aztec-address'; + import { serializeToBuffer } from '../utils/serialize.js'; import { FunctionData } from './function_data.js'; import { PrivateCircuitPublicInputs } from './private_circuit_public_inputs.js'; diff --git a/yarn-project/circuits.js/src/structs/circuit_error.ts b/yarn-project/circuits.js/src/structs/circuit_error.ts index 65e5a9a8f9a..d8357f30200 100644 --- a/yarn-project/circuits.js/src/structs/circuit_error.ts +++ b/yarn-project/circuits.js/src/structs/circuit_error.ts @@ -1,4 +1,5 @@ import { BufferReader } from '@aztec/foundation/serialize'; + import { serializeToBuffer } from '../utils/serialize.js'; /** diff --git a/yarn-project/circuits.js/src/structs/function_data.ts b/yarn-project/circuits.js/src/structs/function_data.ts index fefb4e070fd..dbff049bcc0 100644 --- a/yarn-project/circuits.js/src/structs/function_data.ts +++ b/yarn-project/circuits.js/src/structs/function_data.ts @@ -1,4 +1,5 @@ -import { numToUInt32BE, deserializeUInt32, BufferReader } from '@aztec/foundation/serialize'; +import { BufferReader, deserializeUInt32, numToUInt32BE } from '@aztec/foundation/serialize'; + import { serializeToBuffer } from '../utils/serialize.js'; const FUNCTION_SELECTOR_LENGTH = 4; diff --git a/yarn-project/circuits.js/src/structs/function_leaf_preimage.test.ts b/yarn-project/circuits.js/src/structs/function_leaf_preimage.test.ts index 275b9a1945b..9f6ef12440b 100644 --- a/yarn-project/circuits.js/src/structs/function_leaf_preimage.test.ts +++ b/yarn-project/circuits.js/src/structs/function_leaf_preimage.test.ts @@ -1,4 +1,5 @@ import { Fr } from '@aztec/foundation/fields'; + import { expectSerializeToMatchSnapshot } from '../tests/expectSerialize.js'; import { FunctionLeafPreimage } from './function_leaf_preimage.js'; diff --git a/yarn-project/circuits.js/src/structs/function_leaf_preimage.ts b/yarn-project/circuits.js/src/structs/function_leaf_preimage.ts index b1a6afcae47..17c7d09f517 100644 --- a/yarn-project/circuits.js/src/structs/function_leaf_preimage.ts +++ b/yarn-project/circuits.js/src/structs/function_leaf_preimage.ts @@ -1,6 +1,7 @@ +import { Fr } from '@aztec/foundation/fields'; import { BufferReader } from '@aztec/foundation/serialize'; + import { serializeToBuffer } from '../utils/serialize.js'; -import { Fr } from '@aztec/foundation/fields'; /** * A class representing the "preimage" of a function tree leaf. diff --git a/yarn-project/circuits.js/src/structs/global_variables.ts b/yarn-project/circuits.js/src/structs/global_variables.ts index 5037b0ed915..10509a5d015 100644 --- a/yarn-project/circuits.js/src/structs/global_variables.ts +++ b/yarn-project/circuits.js/src/structs/global_variables.ts @@ -1,5 +1,6 @@ import { Fr } from '@aztec/foundation/fields'; import { BufferReader } from '@aztec/foundation/serialize'; + import { FieldsOf } from '../index.js'; import { serializeToBuffer } from '../utils/index.js'; diff --git a/yarn-project/circuits.js/src/structs/kernel/combined_accumulated_data.ts b/yarn-project/circuits.js/src/structs/kernel/combined_accumulated_data.ts index d6a9e72f67f..220f55edad6 100644 --- a/yarn-project/circuits.js/src/structs/kernel/combined_accumulated_data.ts +++ b/yarn-project/circuits.js/src/structs/kernel/combined_accumulated_data.ts @@ -1,23 +1,29 @@ -import { serializeToBuffer } from '../../utils/serialize.js'; -import { AggregationObject } from '../aggregation_object.js'; +import { BufferReader, Tuple } from '@aztec/foundation/serialize'; + import { - MAX_NEW_L2_TO_L1_MSGS_PER_TX, - MAX_READ_REQUESTS_PER_TX, MAX_NEW_COMMITMENTS_PER_TX, MAX_NEW_CONTRACTS_PER_TX, + MAX_NEW_L2_TO_L1_MSGS_PER_CALL, + MAX_NEW_L2_TO_L1_MSGS_PER_TX, MAX_NEW_NULLIFIERS_PER_TX, MAX_OPTIONALLY_REVEALED_DATA_LENGTH_PER_TX, MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX, MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX, MAX_PUBLIC_DATA_READS_PER_TX, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, - MAX_NEW_L2_TO_L1_MSGS_PER_CALL, + MAX_READ_REQUESTS_PER_TX, NUM_FIELDS_PER_SHA256, } from '../../cbind/constants.gen.js'; -import { FunctionData } from '../function_data.js'; -import { BufferReader, Tuple } from '@aztec/foundation/serialize'; import { assertMemberLength, makeTuple } from '../../index.js'; -import { EthAddress, AztecAddress, Fr, ReadRequestMembershipWitness } from '../index.js'; +import { serializeToBuffer } from '../../utils/serialize.js'; +import { + AggregationObject, + AztecAddress, + EthAddress, + Fr, + FunctionData, + ReadRequestMembershipWitness, +} from '../index.js'; /** * The information assembled after the contract deployment was processed by the private kernel circuit. diff --git a/yarn-project/circuits.js/src/structs/kernel/combined_constant_data.ts b/yarn-project/circuits.js/src/structs/kernel/combined_constant_data.ts index e1f0796541f..d5b5ee35bf2 100644 --- a/yarn-project/circuits.js/src/structs/kernel/combined_constant_data.ts +++ b/yarn-project/circuits.js/src/structs/kernel/combined_constant_data.ts @@ -1,5 +1,6 @@ import { Fr } from '@aztec/foundation/fields'; import { BufferReader } from '@aztec/foundation/serialize'; + import { FieldsOf } from '../../utils/jsUtils.js'; import { serializeToBuffer } from '../../utils/serialize.js'; import { TxContext } from '../tx_context.js'; diff --git a/yarn-project/circuits.js/src/structs/kernel/index.test.ts b/yarn-project/circuits.js/src/structs/kernel/index.test.ts index 852bb7145cb..76d68d72f78 100644 --- a/yarn-project/circuits.js/src/structs/kernel/index.test.ts +++ b/yarn-project/circuits.js/src/structs/kernel/index.test.ts @@ -1,12 +1,12 @@ import { expectSerializeToMatchSnapshot } from '../../tests/expectSerialize.js'; import { makeSchnorrSignature } from '../../tests/factories.js'; import { + makeAccumulatedData, + makeKernelPublicInputs, makePreviousKernelData, - makePrivateKernelInputsInner, makePrivateKernelInputsInit, - makeKernelPublicInputs, + makePrivateKernelInputsInner, makePublicKernelInputs, - makeAccumulatedData, } from '../../tests/factories.js'; describe('structs/kernel', () => { diff --git a/yarn-project/circuits.js/src/structs/kernel/previous_kernel_data.ts b/yarn-project/circuits.js/src/structs/kernel/previous_kernel_data.ts index d7af3d6c4b9..0b9628c7bb2 100644 --- a/yarn-project/circuits.js/src/structs/kernel/previous_kernel_data.ts +++ b/yarn-project/circuits.js/src/structs/kernel/previous_kernel_data.ts @@ -1,12 +1,13 @@ -import { Tuple, BufferReader } from '@aztec/foundation/serialize'; +import { BufferReader, Tuple } from '@aztec/foundation/serialize'; + import { privateKernelDummyPreviousKernel } from '../../cbind/circuits.gen.js'; +import { CircuitsWasm, VK_TREE_HEIGHT, assertMemberLength, makeTuple } from '../../index.js'; import { serializeToBuffer } from '../../utils/serialize.js'; import { Fr } from '../index.js'; import { Proof, makeEmptyProof } from '../proof.js'; import { UInt32 } from '../shared.js'; import { VerificationKey } from '../verification_key.js'; import { KernelCircuitPublicInputs } from './public_inputs.js'; -import { CircuitsWasm, VK_TREE_HEIGHT, assertMemberLength, makeTuple } from '../../index.js'; /** * Data of the previous kernel iteration in the chain of kernels. diff --git a/yarn-project/circuits.js/src/structs/kernel/private_kernel.ts b/yarn-project/circuits.js/src/structs/kernel/private_kernel.ts index 0007ff9ca5f..4221652a65e 100644 --- a/yarn-project/circuits.js/src/structs/kernel/private_kernel.ts +++ b/yarn-project/circuits.js/src/structs/kernel/private_kernel.ts @@ -1,4 +1,11 @@ import { EthAddress } from '@aztec/foundation/eth-address'; + +import { + CONTRACT_TREE_HEIGHT, + FUNCTION_TREE_HEIGHT, + MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, + MAX_READ_REQUESTS_PER_CALL, +} from '../../cbind/constants.gen.js'; import { FieldsOf, assertMemberLength } from '../../utils/jsUtils.js'; import { serializeToBuffer } from '../../utils/serialize.js'; import { PrivateCallStackItem } from '../call_stack_item.js'; @@ -9,12 +16,6 @@ import { ReadRequestMembershipWitness } from '../read_request_membership_witness import { TxRequest } from '../tx_request.js'; import { VerificationKey } from '../verification_key.js'; import { PreviousKernelData } from './previous_kernel_data.js'; -import { - CONTRACT_TREE_HEIGHT, - FUNCTION_TREE_HEIGHT, - MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, - MAX_READ_REQUESTS_PER_CALL, -} from '../../cbind/constants.gen.js'; /** * Private call data. diff --git a/yarn-project/circuits.js/src/structs/kernel/public_inputs.ts b/yarn-project/circuits.js/src/structs/kernel/public_inputs.ts index aa17dc73590..a31ac642faa 100644 --- a/yarn-project/circuits.js/src/structs/kernel/public_inputs.ts +++ b/yarn-project/circuits.js/src/structs/kernel/public_inputs.ts @@ -1,4 +1,5 @@ import { BufferReader } from '@aztec/foundation/serialize'; + import { serializeToBuffer } from '../../utils/serialize.js'; import { CombinedAccumulatedData } from './combined_accumulated_data.js'; import { CombinedConstantData } from './combined_constant_data.js'; diff --git a/yarn-project/circuits.js/src/structs/kernel/public_kernel.ts b/yarn-project/circuits.js/src/structs/kernel/public_kernel.ts index 56ebd09300e..5f842a30c73 100644 --- a/yarn-project/circuits.js/src/structs/kernel/public_kernel.ts +++ b/yarn-project/circuits.js/src/structs/kernel/public_kernel.ts @@ -1,17 +1,18 @@ import { Fr } from '@aztec/foundation/fields'; import { Tuple } from '@aztec/foundation/serialize'; -import { assertMemberLength } from '../../utils/jsUtils.js'; -import { serializeToBuffer } from '../../utils/serialize.js'; -import { PublicCallStackItem } from '../call_stack_item.js'; -import { MembershipWitness } from '../membership_witness.js'; -import { Proof } from '../proof.js'; -import { PreviousKernelData } from './previous_kernel_data.js'; + import { MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL, MAX_PUBLIC_DATA_READS_PER_TX, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, PUBLIC_DATA_TREE_HEIGHT, } from '../../cbind/constants.gen.js'; +import { assertMemberLength } from '../../utils/jsUtils.js'; +import { serializeToBuffer } from '../../utils/serialize.js'; +import { PublicCallStackItem } from '../call_stack_item.js'; +import { MembershipWitness } from '../membership_witness.js'; +import { Proof } from '../proof.js'; +import { PreviousKernelData } from './previous_kernel_data.js'; /** * Inputs to the public kernel circuit. diff --git a/yarn-project/circuits.js/src/structs/membership_witness.ts b/yarn-project/circuits.js/src/structs/membership_witness.ts index f43129fc5ae..8065bba0232 100644 --- a/yarn-project/circuits.js/src/structs/membership_witness.ts +++ b/yarn-project/circuits.js/src/structs/membership_witness.ts @@ -1,9 +1,10 @@ +import { toBigIntBE, toBufferBE } from '@aztec/foundation/bigint-buffer'; import { Fr } from '@aztec/foundation/fields'; -import { assertMemberLength, range } from '../utils/jsUtils.js'; -import { serializeToBuffer } from '../utils/serialize.js'; -import { toBufferBE, toBigIntBE } from '@aztec/foundation/bigint-buffer'; import { BufferReader, Tuple } from '@aztec/foundation/serialize'; + import { PRIVATE_DATA_TREE_HEIGHT } from '../cbind/constants.gen.js'; +import { assertMemberLength, range } from '../utils/jsUtils.js'; +import { serializeToBuffer } from '../utils/serialize.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/structs/private_circuit_public_inputs.ts b/yarn-project/circuits.js/src/structs/private_circuit_public_inputs.ts index 9a4581fa63d..d43d00d4098 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,17 +1,18 @@ import { Fr } from '@aztec/foundation/fields'; -import { assertMemberLength, FieldsOf } from '../utils/jsUtils.js'; -import { serializeToBuffer } from '../utils/serialize.js'; -import { CallContext } from './call_context.js'; + import { MAX_NEW_COMMITMENTS_PER_CALL, MAX_NEW_L2_TO_L1_MSGS_PER_CALL, MAX_NEW_NULLIFIERS_PER_CALL, - NUM_FIELDS_PER_SHA256, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL, MAX_READ_REQUESTS_PER_CALL, + NUM_FIELDS_PER_SHA256, RETURN_VALUES_LENGTH, } from '../cbind/constants.gen.js'; +import { FieldsOf, assertMemberLength } from '../utils/jsUtils.js'; +import { serializeToBuffer } from '../utils/serialize.js'; +import { CallContext } from './call_context.js'; import { ContractDeploymentData } from './tx_context.js'; /** diff --git a/yarn-project/circuits.js/src/structs/proof.ts b/yarn-project/circuits.js/src/structs/proof.ts index 6ed44107df4..86c1871e6c0 100644 --- a/yarn-project/circuits.js/src/structs/proof.ts +++ b/yarn-project/circuits.js/src/structs/proof.ts @@ -1,4 +1,5 @@ import { BufferReader } from '@aztec/foundation/serialize'; + import { serializeToBuffer } from '../utils/serialize.js'; /** diff --git a/yarn-project/circuits.js/src/structs/public_call_request.ts b/yarn-project/circuits.js/src/structs/public_call_request.ts index 5956378051f..5d092c44d4e 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,5 @@ import { BufferReader } from '@aztec/foundation/serialize'; + import { computeVarArgsHash } from '../abis/abis.js'; import { CircuitsWasm, FieldsOf } from '../index.js'; import { serializeToBuffer } from '../utils/serialize.js'; diff --git a/yarn-project/circuits.js/src/structs/public_circuit_public_inputs.ts b/yarn-project/circuits.js/src/structs/public_circuit_public_inputs.ts index c9ad895cabd..9fbc10502a9 100644 --- a/yarn-project/circuits.js/src/structs/public_circuit_public_inputs.ts +++ b/yarn-project/circuits.js/src/structs/public_circuit_public_inputs.ts @@ -2,9 +2,7 @@ import { AztecAddress } from '@aztec/foundation/aztec-address'; import { isArrayEmpty } from '@aztec/foundation/collection'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader, Tuple } from '@aztec/foundation/serialize'; -import { FieldsOf, assertMemberLength, makeTuple } from '../utils/jsUtils.js'; -import { serializeToBuffer } from '../utils/serialize.js'; -import { CallContext } from './call_context.js'; + import { MAX_NEW_COMMITMENTS_PER_CALL, MAX_NEW_L2_TO_L1_MSGS_PER_CALL, @@ -15,6 +13,9 @@ import { NUM_FIELDS_PER_SHA256, RETURN_VALUES_LENGTH, } from '../cbind/constants.gen.js'; +import { FieldsOf, assertMemberLength, makeTuple } from '../utils/jsUtils.js'; +import { serializeToBuffer } from '../utils/serialize.js'; +import { CallContext } from './call_context.js'; /** * Contract storage read operation on a specific contract. diff --git a/yarn-project/circuits.js/src/structs/read_request_membership_witness.ts b/yarn-project/circuits.js/src/structs/read_request_membership_witness.ts index 6a54140635b..f0af8311d59 100644 --- a/yarn-project/circuits.js/src/structs/read_request_membership_witness.ts +++ b/yarn-project/circuits.js/src/structs/read_request_membership_witness.ts @@ -1,10 +1,11 @@ +import { toBufferBE } from '@aztec/foundation/bigint-buffer'; import { Fr } from '@aztec/foundation/fields'; +import { BufferReader, Tuple } from '@aztec/foundation/serialize'; + +import { MAX_NEW_COMMITMENTS_PER_CALL, PRIVATE_DATA_TREE_HEIGHT } from '../cbind/constants.gen.js'; import { assertMemberLength, makeTuple, range } from '../utils/jsUtils.js'; import { serializeToBuffer } from '../utils/serialize.js'; -import { toBufferBE } from '@aztec/foundation/bigint-buffer'; -import { BufferReader, Tuple } from '@aztec/foundation/serialize'; import { MembershipWitness } from './membership_witness.js'; -import { MAX_NEW_COMMITMENTS_PER_CALL, PRIVATE_DATA_TREE_HEIGHT } from '../cbind/constants.gen.js'; /** * A ReadRequestMembershipWitness is similar to a MembershipWitness but includes diff --git a/yarn-project/circuits.js/src/structs/rollup/append_only_tree_snapshot.ts b/yarn-project/circuits.js/src/structs/rollup/append_only_tree_snapshot.ts index 082d94fc16c..90dec1eebdf 100644 --- a/yarn-project/circuits.js/src/structs/rollup/append_only_tree_snapshot.ts +++ b/yarn-project/circuits.js/src/structs/rollup/append_only_tree_snapshot.ts @@ -1,7 +1,8 @@ import { Fr } from '@aztec/foundation/fields'; +import { BufferReader } from '@aztec/foundation/serialize'; + import { serializeToBuffer } from '../../utils/serialize.js'; import { UInt32 } from '../shared.js'; -import { BufferReader } from '@aztec/foundation/serialize'; /** * Snapshot of an append only tree. 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 75b399015ea..446c4e2d668 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,12 @@ +import { Fr } from '@aztec/foundation/fields'; +import { BufferReader } from '@aztec/foundation/serialize'; + +import { NUM_FIELDS_PER_SHA256 } from '../../cbind/constants.gen.js'; import { serializeToBuffer } from '../../utils/serialize.js'; -import { RollupTypes } from '../shared.js'; import { AggregationObject } from '../aggregation_object.js'; +import { RollupTypes } from '../shared.js'; import { AppendOnlyTreeSnapshot } from './append_only_tree_snapshot.js'; import { ConstantBaseRollupData } from './base_rollup.js'; -import { Fr } from '@aztec/foundation/fields'; -import { BufferReader } from '@aztec/foundation/serialize'; -import { NUM_FIELDS_PER_SHA256 } from '../../cbind/constants.gen.js'; /** * Output of the base and merge rollup circuits. diff --git a/yarn-project/circuits.js/src/structs/rollup/base_rollup.test.ts b/yarn-project/circuits.js/src/structs/rollup/base_rollup.test.ts index 1c2d24b92f0..86fb3f480b0 100644 --- a/yarn-project/circuits.js/src/structs/rollup/base_rollup.test.ts +++ b/yarn-project/circuits.js/src/structs/rollup/base_rollup.test.ts @@ -1,5 +1,5 @@ -import { expectSerializeToMatchSnapshot, expectReserializeToMatchObject } from '../../tests/expectSerialize.js'; -import { makeBaseRollupInputs, makeBaseOrMergeRollupPublicInputs } from '../../tests/factories.js'; +import { expectReserializeToMatchObject, expectSerializeToMatchSnapshot } from '../../tests/expectSerialize.js'; +import { makeBaseOrMergeRollupPublicInputs, makeBaseRollupInputs } from '../../tests/factories.js'; import { BaseOrMergeRollupPublicInputs } from './base_or_merge_rollup_public_inputs.js'; describe('structs/base_rollup', () => { diff --git a/yarn-project/circuits.js/src/structs/rollup/base_rollup.ts b/yarn-project/circuits.js/src/structs/rollup/base_rollup.ts index cbb5d035499..cf9349c91c3 100644 --- a/yarn-project/circuits.js/src/structs/rollup/base_rollup.ts +++ b/yarn-project/circuits.js/src/structs/rollup/base_rollup.ts @@ -1,12 +1,6 @@ import { Fr } from '@aztec/foundation/fields'; import { BufferReader } from '@aztec/foundation/serialize'; -import { assertItemsLength, assertMemberLength, FieldsOf } from '../../utils/jsUtils.js'; -import { serializeToBuffer } from '../../utils/serialize.js'; -import { PreviousKernelData } from '../kernel/previous_kernel_data.js'; -import { MembershipWitness } from '../membership_witness.js'; -import { UInt32 } from '../shared.js'; -import { AppendOnlyTreeSnapshot } from './append_only_tree_snapshot.js'; -import { GlobalVariables } from '../global_variables.js'; + import { CONTRACT_TREE_HEIGHT, CONTRACT_TREE_ROOTS_TREE_HEIGHT, @@ -21,6 +15,13 @@ import { PRIVATE_DATA_TREE_ROOTS_TREE_HEIGHT, PUBLIC_DATA_TREE_HEIGHT, } from '../../cbind/constants.gen.js'; +import { FieldsOf, assertItemsLength, assertMemberLength } from '../../utils/jsUtils.js'; +import { serializeToBuffer } from '../../utils/serialize.js'; +import { GlobalVariables } from '../global_variables.js'; +import { PreviousKernelData } from '../kernel/previous_kernel_data.js'; +import { MembershipWitness } from '../membership_witness.js'; +import { UInt32 } from '../shared.js'; +import { AppendOnlyTreeSnapshot } from './append_only_tree_snapshot.js'; /** * Class containing the data of a preimage of a single leaf in the nullifier tree. 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 41962263364..c112e541cf9 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,10 +1,10 @@ +import { ROLLUP_VK_TREE_HEIGHT } from '../../cbind/constants.gen.js'; import { serializeToBuffer } from '../../utils/serialize.js'; -import { BaseOrMergeRollupPublicInputs } from './base_or_merge_rollup_public_inputs.js'; -import { UInt32 } from '../shared.js'; import { MembershipWitness } from '../membership_witness.js'; -import { VerificationKey } from '../verification_key.js'; import { Proof } from '../proof.js'; -import { ROLLUP_VK_TREE_HEIGHT } from '../../cbind/constants.gen.js'; +import { UInt32 } from '../shared.js'; +import { VerificationKey } from '../verification_key.js'; +import { BaseOrMergeRollupPublicInputs } from './base_or_merge_rollup_public_inputs.js'; /** * Represents the data of a previous merge or base rollup circuit. 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 75c67bd0553..eed4548e156 100644 --- a/yarn-project/circuits.js/src/structs/rollup/root_rollup.ts +++ b/yarn-project/circuits.js/src/structs/rollup/root_rollup.ts @@ -1,18 +1,19 @@ -import { assertMemberLength, FieldsOf } from '../../utils/jsUtils.js'; -import { serializeToBuffer } from '../../utils/serialize.js'; -import { AppendOnlyTreeSnapshot } from './append_only_tree_snapshot.js'; +import { Fr } from '@aztec/foundation/fields'; +import { BufferReader } from '@aztec/foundation/serialize'; + import { CONTRACT_TREE_ROOTS_TREE_HEIGHT, - L1_TO_L2_MSG_TREE_ROOTS_TREE_HEIGHT, L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH, + L1_TO_L2_MSG_TREE_ROOTS_TREE_HEIGHT, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, PRIVATE_DATA_TREE_ROOTS_TREE_HEIGHT, } from '../../cbind/constants.gen.js'; -import { PreviousRollupData } from './previous_rollup_data.js'; +import { FieldsOf, assertMemberLength } from '../../utils/jsUtils.js'; +import { serializeToBuffer } from '../../utils/serialize.js'; import { AggregationObject } from '../aggregation_object.js'; -import { Fr } from '@aztec/foundation/fields'; -import { BufferReader } from '@aztec/foundation/serialize'; import { GlobalVariables } from '../global_variables.js'; +import { AppendOnlyTreeSnapshot } from './append_only_tree_snapshot.js'; +import { PreviousRollupData } from './previous_rollup_data.js'; /** * Represents inputs of the root rollup circuit. diff --git a/yarn-project/circuits.js/src/structs/tx_context.ts b/yarn-project/circuits.js/src/structs/tx_context.ts index e1f1d42e98c..65e1978dd92 100644 --- a/yarn-project/circuits.js/src/structs/tx_context.ts +++ b/yarn-project/circuits.js/src/structs/tx_context.ts @@ -1,4 +1,5 @@ import { BufferReader } from '@aztec/foundation/serialize'; + import { serializeToBuffer } from '../utils/serialize.js'; import { AztecAddress, EthAddress, Fr, Point } from './index.js'; diff --git a/yarn-project/circuits.js/src/structs/tx_request.ts b/yarn-project/circuits.js/src/structs/tx_request.ts index 4139eeee41f..6f30046cc9e 100644 --- a/yarn-project/circuits.js/src/structs/tx_request.ts +++ b/yarn-project/circuits.js/src/structs/tx_request.ts @@ -1,10 +1,12 @@ import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader } from '@aztec/foundation/serialize'; + import { FieldsOf } from '../utils/jsUtils.js'; import { serializeToBuffer } from '../utils/serialize.js'; import { FunctionData } from './function_data.js'; import { TxContext } from './tx_context.js'; + /** * Transaction request. * @see cpp/src/aztec3/circuits/abis/tx_request.hpp. diff --git a/yarn-project/circuits.js/src/structs/verification_key.ts b/yarn-project/circuits.js/src/structs/verification_key.ts index 2b079f86e0d..28135bb2ce5 100644 --- a/yarn-project/circuits.js/src/structs/verification_key.ts +++ b/yarn-project/circuits.js/src/structs/verification_key.ts @@ -1,8 +1,10 @@ import { BufferReader } from '@aztec/foundation/serialize'; + +import times from 'lodash.times'; + import { serializeToBuffer } from '../utils/serialize.js'; import { Fq } from './index.js'; import { CircuitType } from './shared.js'; -import times from 'lodash.times'; /** * Curve data. diff --git a/yarn-project/circuits.js/src/tests/expectSerialize.ts b/yarn-project/circuits.js/src/tests/expectSerialize.ts index 7608ba146b8..7bae8a9d2ba 100644 --- a/yarn-project/circuits.js/src/tests/expectSerialize.ts +++ b/yarn-project/circuits.js/src/tests/expectSerialize.ts @@ -1,5 +1,5 @@ -import { CircuitsWasm } from '../wasm/circuits_wasm.js'; import { uint8ArrayToNum } from '../utils/serialize.js'; +import { CircuitsWasm } from '../wasm/circuits_wasm.js'; /** * Simplify e.g. 0x0003 into 0x3. diff --git a/yarn-project/circuits.js/src/tests/factories.ts b/yarn-project/circuits.js/src/tests/factories.ts index e1ef99bcd57..bdb22937cc9 100644 --- a/yarn-project/circuits.js/src/tests/factories.ts +++ b/yarn-project/circuits.js/src/tests/factories.ts @@ -1,6 +1,7 @@ import { AztecAddress } from '@aztec/foundation/aztec-address'; import { EthAddress } from '@aztec/foundation/eth-address'; import { mapTuple, numToUInt32BE } from '@aztec/foundation/serialize'; + import { computeCallStackItemHash } from '../abis/abis.js'; import { SchnorrSignature } from '../barretenberg/index.js'; import { @@ -27,8 +28,8 @@ import { FunctionData, G1AffineElement, KernelCircuitPublicInputs, - L1_TO_L2_MSG_TREE_ROOTS_TREE_HEIGHT, L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH, + L1_TO_L2_MSG_TREE_ROOTS_TREE_HEIGHT, MAX_NEW_COMMITMENTS_PER_CALL, MAX_NEW_COMMITMENTS_PER_TX, MAX_NEW_CONTRACTS_PER_TX, diff --git a/yarn-project/circuits.js/src/types/index.ts b/yarn-project/circuits.js/src/types/index.ts index 5d7c7d8dea1..29a0f3ae747 100644 --- a/yarn-project/circuits.js/src/types/index.ts +++ b/yarn-project/circuits.js/src/types/index.ts @@ -1,4 +1,5 @@ import { FunctionAbi } from '@aztec/foundation/abi'; + import { AztecAddress, Fr, Point } from '../index.js'; /** Represents a user public key. */ diff --git a/yarn-project/circuits.js/src/utils/call_wasm.ts b/yarn-project/circuits.js/src/utils/call_wasm.ts index d2dabc9235b..adf0645bc8b 100644 --- a/yarn-project/circuits.js/src/utils/call_wasm.ts +++ b/yarn-project/circuits.js/src/utils/call_wasm.ts @@ -1,4 +1,5 @@ import { IWasmModule } from '@aztec/foundation/wasm'; + import { CircuitError } from '../index.js'; import { uint8ArrayToNum } from './serialize.js'; diff --git a/yarn-project/circuits.js/src/utils/jsUtils.ts b/yarn-project/circuits.js/src/utils/jsUtils.ts index 916b2269a4f..c2554751728 100644 --- a/yarn-project/circuits.js/src/utils/jsUtils.ts +++ b/yarn-project/circuits.js/src/utils/jsUtils.ts @@ -1,4 +1,5 @@ import { Tuple } from '@aztec/foundation/serialize'; + export type { FieldsOf } from '@aztec/foundation/types'; /** diff --git a/yarn-project/circuits.js/src/wasm/circuits_wasm.ts b/yarn-project/circuits.js/src/wasm/circuits_wasm.ts index cd6b1799c2b..ecc547a7333 100644 --- a/yarn-project/circuits.js/src/wasm/circuits_wasm.ts +++ b/yarn-project/circuits.js/src/wasm/circuits_wasm.ts @@ -1,11 +1,11 @@ -import { readFile } from 'fs/promises'; +import { numToUInt32BE } from '@aztec/foundation/serialize'; +import { IWasmModule, WasmModule } from '@aztec/foundation/wasm'; + import isNode from 'detect-node'; +import { readFile } from 'fs/promises'; import { dirname, join } from 'path'; import { fileURLToPath } from 'url'; -import { IWasmModule, WasmModule } from '@aztec/foundation/wasm'; -import { numToUInt32BE } from '@aztec/foundation/serialize'; - import { Crs } from '../crs/index.js'; const NAME = '/aztec3-circuits'; diff --git a/yarn-project/end-to-end/src/cross_chain/test_harness.ts b/yarn-project/end-to-end/src/cross_chain/test_harness.ts index 38fa97cb03d..ccb2816eaf5 100644 --- a/yarn-project/end-to-end/src/cross_chain/test_harness.ts +++ b/yarn-project/end-to-end/src/cross_chain/test_harness.ts @@ -1,14 +1,15 @@ import { AztecNodeService } from '@aztec/aztec-node'; +import { AztecRPCServer } from '@aztec/aztec-rpc'; import { Contract, Wallet, computeMessageSecretHash } from '@aztec/aztec.js'; import { AztecAddress, EthAddress, Fr, Point } from '@aztec/circuits.js'; import { DeployL1Contracts } from '@aztec/ethereum'; +import { toBufferBE } from '@aztec/foundation/bigint-buffer'; +import { sha256ToField } from '@aztec/foundation/crypto'; import { DebugLogger } from '@aztec/foundation/log'; import { OutboxAbi } from '@aztec/l1-artifacts'; -import { sha256ToField } from '@aztec/foundation/crypto'; -import { toBufferBE } from '@aztec/foundation/bigint-buffer'; -import { AztecRPCServer } from '@aztec/aztec-rpc'; import { TxStatus } from '@aztec/types'; -import { PublicClient, HttpTransport, Chain, getContract } from 'viem'; + +import { Chain, HttpTransport, PublicClient, getContract } from 'viem'; import { deployAndInitializeNonNativeL2TokenContracts, expectAztecStorageSlot } from '../utils.js'; 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 acc8779f403..9dc003f2152 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 @@ -1,9 +1,10 @@ import { AztecNodeService } from '@aztec/aztec-node'; +import { AztecRPCServer } from '@aztec/aztec-rpc'; import { ContractDeployer, Fr } from '@aztec/aztec.js'; import { DebugLogger } from '@aztec/foundation/log'; import { TestContractAbi } from '@aztec/noir-contracts/examples'; -import { AztecRPCServer } from '@aztec/aztec-rpc'; import { TxStatus } from '@aztec/types'; + import times from 'lodash.times'; import { setup } from './utils.js'; diff --git a/yarn-project/end-to-end/src/e2e_cross_chain_messaging.test.ts b/yarn-project/end-to-end/src/e2e_cross_chain_messaging.test.ts index 4f4f7e917ad..38e3395b5aa 100644 --- a/yarn-project/end-to-end/src/e2e_cross_chain_messaging.test.ts +++ b/yarn-project/end-to-end/src/e2e_cross_chain_messaging.test.ts @@ -1,13 +1,13 @@ import { AztecNodeService } from '@aztec/aztec-node'; +import { AztecRPCServer } from '@aztec/aztec-rpc'; import { AztecAddress, Contract } from '@aztec/aztec.js'; import { EthAddress } from '@aztec/foundation/eth-address'; import { Point } from '@aztec/foundation/fields'; import { DebugLogger } from '@aztec/foundation/log'; -import { AztecRPCServer } from '@aztec/aztec-rpc'; +import { TxStatus } from '@aztec/types'; -import { delay, setup } from './utils.js'; import { CrossChainTestHarness } from './cross_chain/test_harness.js'; -import { TxStatus } from '@aztec/types'; +import { delay, setup } from './utils.js'; describe('e2e_cross_chain_messaging', () => { let aztecNode: AztecNodeService; diff --git a/yarn-project/end-to-end/src/e2e_deploy_contract.test.ts b/yarn-project/end-to-end/src/e2e_deploy_contract.test.ts index 8c347a18f68..70c178dfdf0 100644 --- a/yarn-project/end-to-end/src/e2e_deploy_contract.test.ts +++ b/yarn-project/end-to-end/src/e2e_deploy_contract.test.ts @@ -1,8 +1,8 @@ import { AztecNodeService } from '@aztec/aztec-node'; +import { AztecRPCServer } from '@aztec/aztec-rpc'; import { AztecAddress, ContractDeployer, Fr } from '@aztec/aztec.js'; import { DebugLogger } from '@aztec/foundation/log'; import { TestContractAbi } from '@aztec/noir-contracts/examples'; -import { AztecRPCServer } from '@aztec/aztec-rpc'; import { TxStatus } from '@aztec/types'; import { setup } from './utils.js'; diff --git a/yarn-project/end-to-end/src/e2e_nested_contract.test.ts b/yarn-project/end-to-end/src/e2e_nested_contract.test.ts index 3f1e72df19f..6bd6788a7dd 100644 --- a/yarn-project/end-to-end/src/e2e_nested_contract.test.ts +++ b/yarn-project/end-to-end/src/e2e_nested_contract.test.ts @@ -1,10 +1,10 @@ import { AztecNodeService } from '@aztec/aztec-node'; +import { AztecRPCServer } from '@aztec/aztec-rpc'; import { AztecAddress, Contract, ContractDeployer, Fr, Wallet } from '@aztec/aztec.js'; import { ContractAbi } from '@aztec/foundation/abi'; import { DebugLogger } from '@aztec/foundation/log'; -import { ChildAbi, ParentAbi } from '@aztec/noir-contracts/examples'; import { toBigInt } from '@aztec/foundation/serialize'; -import { AztecRPCServer } from '@aztec/aztec-rpc'; +import { ChildAbi, ParentAbi } from '@aztec/noir-contracts/examples'; import { TxStatus } from '@aztec/types'; import { setup } from './utils.js'; diff --git a/yarn-project/end-to-end/src/e2e_p2p_network.test.ts b/yarn-project/end-to-end/src/e2e_p2p_network.test.ts index 6dfb4a5fb33..96ba2eb698a 100644 --- a/yarn-project/end-to-end/src/e2e_p2p_network.test.ts +++ b/yarn-project/end-to-end/src/e2e_p2p_network.test.ts @@ -1,18 +1,18 @@ import { AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node'; -import { AztecAddress, ContractDeployer, Fr, SentTx } from '@aztec/aztec.js'; -import { DebugLogger } from '@aztec/foundation/log'; -import { TestContractAbi } from '@aztec/noir-contracts/examples'; -import { BootstrapNode, P2PConfig, createLibP2PPeerId, exportLibP2PPeerIdToString } from '@aztec/p2p'; import { AztecRPCServer, ConstantKeyPair, createAztecRPCServer, getConfigEnvVars as getRpcConfig, } from '@aztec/aztec-rpc'; -import { TxStatus } from '@aztec/types'; +import { AztecAddress, ContractDeployer, Fr, SentTx } from '@aztec/aztec.js'; import { CircuitsWasm, Point, getContractDeploymentInfo } from '@aztec/circuits.js'; import { computeContractAddressFromPartial } from '@aztec/circuits.js/abis'; import { Grumpkin } from '@aztec/circuits.js/barretenberg'; +import { DebugLogger } from '@aztec/foundation/log'; +import { TestContractAbi } from '@aztec/noir-contracts/examples'; +import { BootstrapNode, P2PConfig, createLibP2PPeerId, exportLibP2PPeerIdToString } from '@aztec/p2p'; +import { TxStatus } from '@aztec/types'; import { setup } from './utils.js'; diff --git a/yarn-project/end-to-end/src/e2e_pending_commitments_contract.test.ts b/yarn-project/end-to-end/src/e2e_pending_commitments_contract.test.ts index aa912206942..e87a2abc538 100644 --- a/yarn-project/end-to-end/src/e2e_pending_commitments_contract.test.ts +++ b/yarn-project/end-to-end/src/e2e_pending_commitments_contract.test.ts @@ -1,13 +1,12 @@ import { AztecNodeService } from '@aztec/aztec-node'; +import { AztecRPCServer } from '@aztec/aztec-rpc'; import { AztecAddress, Contract, ContractDeployer, Fr, Wallet } from '@aztec/aztec.js'; -import { PendingCommitmentsContractAbi } from '@aztec/noir-contracts/examples'; import { DebugLogger } from '@aztec/foundation/log'; -import { AztecRPCServer } from '@aztec/aztec-rpc'; +import { PendingCommitmentsContractAbi } from '@aztec/noir-contracts/examples'; +import { TxStatus } from '@aztec/types'; import { setup } from './utils.js'; -import { TxStatus } from '@aztec/types'; - describe('e2e_pending_commitments_contract', () => { let aztecNode: AztecNodeService; let aztecRpcServer: AztecRPCServer; diff --git a/yarn-project/end-to-end/src/e2e_public_cross_chain_messaging.test.ts b/yarn-project/end-to-end/src/e2e_public_cross_chain_messaging.test.ts index f0fd20b3516..5098e6973b5 100644 --- a/yarn-project/end-to-end/src/e2e_public_cross_chain_messaging.test.ts +++ b/yarn-project/end-to-end/src/e2e_public_cross_chain_messaging.test.ts @@ -1,12 +1,12 @@ import { AztecNodeService } from '@aztec/aztec-node'; +import { AztecRPCServer } from '@aztec/aztec-rpc'; import { AztecAddress, Contract } from '@aztec/aztec.js'; import { EthAddress } from '@aztec/foundation/eth-address'; -import { AztecRPCServer } from '@aztec/aztec-rpc'; import { DebugLogger } from '@aztec/foundation/log'; import { TxStatus } from '@aztec/types'; -import { delay, setup } from './utils.js'; import { CrossChainTestHarness } from './cross_chain/test_harness.js'; +import { delay, setup } from './utils.js'; describe('e2e_public_cross_chain_messaging', () => { let aztecNode: AztecNodeService; diff --git a/yarn-project/end-to-end/src/e2e_public_to_private_messaging.test.ts b/yarn-project/end-to-end/src/e2e_public_to_private_messaging.test.ts index 27ca415bc68..2bef3e85d75 100644 --- a/yarn-project/end-to-end/src/e2e_public_to_private_messaging.test.ts +++ b/yarn-project/end-to-end/src/e2e_public_to_private_messaging.test.ts @@ -1,8 +1,8 @@ import { AztecNodeService } from '@aztec/aztec-node'; +import { AztecRPCServer } from '@aztec/aztec-rpc'; import { AztecAddress } from '@aztec/aztec.js'; -import { DebugLogger } from '@aztec/foundation/log'; import { EthAddress } from '@aztec/circuits.js'; -import { AztecRPCServer } from '@aztec/aztec-rpc'; +import { DebugLogger } from '@aztec/foundation/log'; import { CrossChainTestHarness } from './cross_chain/test_harness.js'; import { delay, setup } from './utils.js'; diff --git a/yarn-project/end-to-end/src/e2e_public_token_contract.test.ts b/yarn-project/end-to-end/src/e2e_public_token_contract.test.ts index c41c532b9bd..4ca1579156f 100644 --- a/yarn-project/end-to-end/src/e2e_public_token_contract.test.ts +++ b/yarn-project/end-to-end/src/e2e_public_token_contract.test.ts @@ -1,9 +1,10 @@ import { AztecNodeService } from '@aztec/aztec-node'; +import { AztecRPCServer } from '@aztec/aztec-rpc'; import { AztecAddress, Contract, ContractDeployer, Fr, Wallet } from '@aztec/aztec.js'; import { DebugLogger } from '@aztec/foundation/log'; import { PublicTokenContractAbi } from '@aztec/noir-contracts/examples'; import { L2BlockL2Logs, LogType, TxStatus } from '@aztec/types'; -import { AztecRPCServer } from '@aztec/aztec-rpc'; + import times from 'lodash.times'; import { expectAztecStorageSlot, setup } from './utils.js'; diff --git a/yarn-project/end-to-end/src/e2e_zk_token_contract.test.ts b/yarn-project/end-to-end/src/e2e_zk_token_contract.test.ts index 69fb1b3605c..b0d9ea204b3 100644 --- a/yarn-project/end-to-end/src/e2e_zk_token_contract.test.ts +++ b/yarn-project/end-to-end/src/e2e_zk_token_contract.test.ts @@ -1,9 +1,9 @@ import { AztecNodeService } from '@aztec/aztec-node'; +import { AztecRPCServer } from '@aztec/aztec-rpc'; import { AztecAddress, Contract, ContractDeployer, Wallet } from '@aztec/aztec.js'; -import { ZkTokenContractAbi } from '@aztec/noir-contracts/examples'; import { DebugLogger } from '@aztec/foundation/log'; +import { ZkTokenContractAbi } from '@aztec/noir-contracts/examples'; import { L2BlockL2Logs, LogType, TxStatus } from '@aztec/types'; -import { AztecRPCServer } from '@aztec/aztec-rpc'; import { setup } from './utils.js'; diff --git a/yarn-project/end-to-end/src/integration_archiver_l1_to_l2.test.ts b/yarn-project/end-to-end/src/integration_archiver_l1_to_l2.test.ts index dd72821ac7a..347d6bbe7af 100644 --- a/yarn-project/end-to-end/src/integration_archiver_l1_to_l2.test.ts +++ b/yarn-project/end-to-end/src/integration_archiver_l1_to_l2.test.ts @@ -1,12 +1,13 @@ +import { Archiver } from '@aztec/archiver'; import { AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node'; +import { AztecRPCServer } from '@aztec/aztec-rpc'; import { AztecAddress, Contract, Wallet, computeMessageSecretHash } from '@aztec/aztec.js'; -import { EthAddress } from '@aztec/foundation/eth-address'; import { DeployL1Contracts } from '@aztec/ethereum'; +import { EthAddress } from '@aztec/foundation/eth-address'; import { Fr } from '@aztec/foundation/fields'; import { DebugLogger } from '@aztec/foundation/log'; + import { Chain, HttpTransport, PublicClient } from 'viem'; -import { Archiver } from '@aztec/archiver'; -import { AztecRPCServer } from '@aztec/aztec-rpc'; import { delay, deployAndInitializeNonNativeL2TokenContracts, setNextBlockTimestamp, setup } from './utils.js'; diff --git a/yarn-project/end-to-end/src/integration_l1_publisher.test.ts b/yarn-project/end-to-end/src/integration_l1_publisher.test.ts index 640ea409fe3..e2651f4fa1b 100644 --- a/yarn-project/end-to-end/src/integration_l1_publisher.test.ts +++ b/yarn-project/end-to-end/src/integration_l1_publisher.test.ts @@ -2,11 +2,11 @@ import { createMemDown, getConfigEnvVars } from '@aztec/aztec-node'; import { AztecAddress, GlobalVariables, + KernelCircuitPublicInputs, MAX_NEW_COMMITMENTS_PER_TX, MAX_NEW_L2_TO_L1_MSGS_PER_TX, MAX_NEW_NULLIFIERS_PER_TX, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, - KernelCircuitPublicInputs, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, PublicDataUpdateRequest, makeTuple, @@ -17,6 +17,7 @@ import { deployL1Contracts } from '@aztec/ethereum'; import { EthAddress } from '@aztec/foundation/eth-address'; import { Fr } from '@aztec/foundation/fields'; import { createDebugLogger } from '@aztec/foundation/log'; +import { to2Fields } from '@aztec/foundation/serialize'; import { DecoderHelperAbi, InboxAbi, OutboxAbi, RollupAbi } from '@aztec/l1-artifacts'; import { EmptyRollupProver, @@ -31,7 +32,7 @@ import { } from '@aztec/sequencer-client'; import { L2Actor, L2Block, mockTx } from '@aztec/types'; import { MerkleTreeOperations, MerkleTrees } from '@aztec/world-state'; -import { to2Fields } from '@aztec/foundation/serialize'; + import { beforeEach, describe, expect, it } from '@jest/globals'; import { default as levelup } from 'levelup'; import { diff --git a/yarn-project/end-to-end/src/uniswap_trade_on_l1_from_l2.test.ts b/yarn-project/end-to-end/src/uniswap_trade_on_l1_from_l2.test.ts index 2d6fb06e241..e52033b7e4b 100644 --- a/yarn-project/end-to-end/src/uniswap_trade_on_l1_from_l2.test.ts +++ b/yarn-project/end-to-end/src/uniswap_trade_on_l1_from_l2.test.ts @@ -1,15 +1,16 @@ import { AztecNodeService } from '@aztec/aztec-node'; +import { AztecRPCServer } from '@aztec/aztec-rpc'; import { AztecAddress, Contract, ContractDeployer, Fr, Wallet } from '@aztec/aztec.js'; import { deployL1Contract } from '@aztec/ethereum'; +import { DeployL1Contracts } from '@aztec/ethereum'; import { EthAddress } from '@aztec/foundation/eth-address'; import { DebugLogger } from '@aztec/foundation/log'; -import { getContract, parseEther } from 'viem'; -import { DeployL1Contracts } from '@aztec/ethereum'; import { UniswapPortalAbi, UniswapPortalBytecode } from '@aztec/l1-artifacts'; import { UniswapContractAbi } from '@aztec/noir-contracts/examples'; -import { AztecRPCServer } from '@aztec/aztec-rpc'; import { TxStatus } from '@aztec/types'; +import { getContract, parseEther } from 'viem'; + import { CrossChainTestHarness } from './cross_chain/test_harness.js'; import { delay, deployAndInitializeNonNativeL2TokenContracts, setup } from './utils.js'; diff --git a/yarn-project/end-to-end/src/utils.ts b/yarn-project/end-to-end/src/utils.ts index af68e27784e..3d0161af04c 100644 --- a/yarn-project/end-to-end/src/utils.ts +++ b/yarn-project/end-to-end/src/utils.ts @@ -6,29 +6,30 @@ import { AztecAddress, Contract, ContractDeployer, + DeployMethod, EthAddress, + SentTx, SingleKeyAccountContract, Wallet, generatePublicKey, - DeployMethod, - SentTx, } from '@aztec/aztec.js'; import { CircuitsWasm, DeploymentInfo, getContractDeploymentInfo } from '@aztec/circuits.js'; import { Schnorr, pedersenPlookupCommitInputs } from '@aztec/circuits.js/barretenberg'; import { DeployL1Contracts, deployL1Contract, deployL1Contracts } from '@aztec/ethereum'; import { ContractAbi } from '@aztec/foundation/abi'; import { toBigIntBE } from '@aztec/foundation/bigint-buffer'; +import { randomBytes } from '@aztec/foundation/crypto'; import { Fr } from '@aztec/foundation/fields'; import { DebugLogger, Logger, createDebugLogger } from '@aztec/foundation/log'; import { PortalERC20Abi, PortalERC20Bytecode, TokenPortalAbi, TokenPortalBytecode } from '@aztec/l1-artifacts'; import { NonNativeTokenContractAbi, SchnorrAccountContractAbi } from '@aztec/noir-contracts/examples'; -import { Account, Chain, HttpTransport, PublicClient, WalletClient, getContract } from 'viem'; -import { mnemonicToAccount } from 'viem/accounts'; +import { TxStatus } from '@aztec/types'; + import every from 'lodash.every'; import zipWith from 'lodash.zipwith'; +import { Account, Chain, HttpTransport, PublicClient, WalletClient, getContract } from 'viem'; +import { mnemonicToAccount } from 'viem/accounts'; -import { TxStatus } from '@aztec/types'; -import { randomBytes } from '@aztec/foundation/crypto'; import { MNEMONIC, localAnvil } from './fixtures.js'; /** diff --git a/yarn-project/ethereum/src/deploy_l1_contracts.ts b/yarn-project/ethereum/src/deploy_l1_contracts.ts index 8c3dcbce082..4a8a7998e03 100644 --- a/yarn-project/ethereum/src/deploy_l1_contracts.ts +++ b/yarn-project/ethereum/src/deploy_l1_contracts.ts @@ -1,19 +1,20 @@ import { EthAddress } from '@aztec/foundation/eth-address'; import { DebugLogger } from '@aztec/foundation/log'; import { - RollupAbi, - RollupBytecode, ContractDeploymentEmitterAbi, ContractDeploymentEmitterBytecode, - RegistryAbi, - RegistryBytecode, + DecoderHelperAbi, + DecoderHelperBytecode, InboxAbi, InboxBytecode, OutboxAbi, OutboxBytecode, - DecoderHelperAbi, - DecoderHelperBytecode, + RegistryAbi, + RegistryBytecode, + RollupAbi, + RollupBytecode, } from '@aztec/l1-artifacts'; + import type { Abi, Narrow } from 'abitype'; import { Account, diff --git a/yarn-project/ethereum/src/index.ts b/yarn-project/ethereum/src/index.ts index b0e81066ac4..e3ba499d6bc 100644 --- a/yarn-project/ethereum/src/index.ts +++ b/yarn-project/ethereum/src/index.ts @@ -1,4 +1,5 @@ import { foundry } from 'viem/chains'; + import { EthereumChain } from './ethereum_chain.js'; import { createTestnetChain } from './testnet.js'; diff --git a/yarn-project/ethereum/src/testnet.ts b/yarn-project/ethereum/src/testnet.ts index 2fa5943b8e4..b260356df75 100644 --- a/yarn-project/ethereum/src/testnet.ts +++ b/yarn-project/ethereum/src/testnet.ts @@ -1,4 +1,5 @@ import { Chain } from 'viem'; + import { EthereumChain } from './ethereum_chain.js'; export const createTestnetChain = (apiKey: string) => { diff --git a/yarn-project/foundation/.prettierrc.json b/yarn-project/foundation/.prettierrc.json index 7c3bbec6848..0579ad16775 100644 --- a/yarn-project/foundation/.prettierrc.json +++ b/yarn-project/foundation/.prettierrc.json @@ -2,5 +2,12 @@ "singleQuote": true, "trailingComma": "all", "printWidth": 120, - "arrowParens": "avoid" -} + "arrowParens": "avoid", + "importOrder": [ + "^@aztec/(.*)$", + "", + "^\\.\/|\\.\\.\/" + ], + "importOrderSeparation": true, + "importOrderSortSpecifiers": true +} \ No newline at end of file diff --git a/yarn-project/foundation/src/abi/abi_coder.ts b/yarn-project/foundation/src/abi/abi_coder.ts index 960128733a5..c33e3db4cd9 100644 --- a/yarn-project/foundation/src/abi/abi_coder.ts +++ b/yarn-project/foundation/src/abi/abi_coder.ts @@ -1,5 +1,5 @@ -import { keccak } from '@aztec/foundation/crypto'; import { ABIParameter, ABIType } from '@aztec/foundation/abi'; +import { keccak } from '@aztec/foundation/crypto'; /** * Generate a function signature string for a given function name and parameters. diff --git a/yarn-project/foundation/src/abi/decoder.ts b/yarn-project/foundation/src/abi/decoder.ts index d83b0ed35ed..1f989122a37 100644 --- a/yarn-project/foundation/src/abi/decoder.ts +++ b/yarn-project/foundation/src/abi/decoder.ts @@ -1,5 +1,5 @@ -import { Fr } from '@aztec/foundation/fields'; import { ABIType, FunctionAbi } from '@aztec/foundation/abi'; +import { Fr } from '@aztec/foundation/fields'; /** * The type of our decoded ABI. diff --git a/yarn-project/foundation/src/crypto/random/index.ts b/yarn-project/foundation/src/crypto/random/index.ts index 8b5df8f5643..f9c4979776e 100644 --- a/yarn-project/foundation/src/crypto/random/index.ts +++ b/yarn-project/foundation/src/crypto/random/index.ts @@ -1,5 +1,5 @@ -import isNode from 'detect-node'; import nodeCrypto from 'crypto'; +import isNode from 'detect-node'; // limit of Crypto.getRandomValues() // https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues diff --git a/yarn-project/foundation/src/crypto/sha256/index.test.ts b/yarn-project/foundation/src/crypto/sha256/index.test.ts index c82815565aa..8b30661302a 100644 --- a/yarn-project/foundation/src/crypto/sha256/index.test.ts +++ b/yarn-project/foundation/src/crypto/sha256/index.test.ts @@ -1,5 +1,6 @@ +import { createHash, randomBytes } from 'crypto'; + import { sha256 } from './index.js'; -import { randomBytes, createHash } from 'crypto'; describe('sha256', () => { it('should correctly hash data using hash.js', () => { diff --git a/yarn-project/foundation/src/crypto/sha256/index.ts b/yarn-project/foundation/src/crypto/sha256/index.ts index 124d9c738e5..99c2bedc7ab 100644 --- a/yarn-project/foundation/src/crypto/sha256/index.ts +++ b/yarn-project/foundation/src/crypto/sha256/index.ts @@ -1,4 +1,5 @@ import { default as hash } from 'hash.js'; + import { toBigIntBE, toBufferBE } from '../../bigint-buffer/index.js'; import { Fr } from '../../fields/fields.js'; diff --git a/yarn-project/foundation/src/fields/fields.ts b/yarn-project/foundation/src/fields/fields.ts index 065b0191c83..f50bcd6114e 100644 --- a/yarn-project/foundation/src/fields/fields.ts +++ b/yarn-project/foundation/src/fields/fields.ts @@ -1,6 +1,7 @@ import { randomBytes } from 'crypto'; -import { BufferReader } from '../serialize/buffer_reader.js'; + import { toBigIntBE, toBufferBE, toHex } from '../bigint-buffer/index.js'; +import { BufferReader } from '../serialize/buffer_reader.js'; /** * Fr represents a field of integers modulo the prime number MODULUS. diff --git a/yarn-project/foundation/src/json-rpc/client/json_rpc_client.test.ts b/yarn-project/foundation/src/json-rpc/client/json_rpc_client.test.ts index 4c6b2c4a413..fe993d26579 100644 --- a/yarn-project/foundation/src/json-rpc/client/json_rpc_client.test.ts +++ b/yarn-project/foundation/src/json-rpc/client/json_rpc_client.test.ts @@ -1,6 +1,7 @@ import request from 'supertest'; + +import { TestNote, TestState } from '../fixtures/test_state.js'; import { JsonRpcServer } from '../server/json_rpc_server.js'; -import { TestState, TestNote } from '../fixtures/test_state.js'; import { createJsonRpcClient } from './json_rpc_client.js'; test('test an RPC function over client', async () => { diff --git a/yarn-project/foundation/src/json-rpc/client/json_rpc_client.ts b/yarn-project/foundation/src/json-rpc/client/json_rpc_client.ts index 0e0ba3b60b8..2812b4a5dac 100644 --- a/yarn-project/foundation/src/json-rpc/client/json_rpc_client.ts +++ b/yarn-project/foundation/src/json-rpc/client/json_rpc_client.ts @@ -3,9 +3,10 @@ // This takes a {foo(): T} and makes {foo(): Promise} // while avoiding Promise of Promise. import { RemoteObject } from 'comlink'; + import { createDebugLogger } from '../../log/index.js'; import { retry } from '../../retry/index.js'; -import { ClassConverter, StringClassConverterInput, JsonClassConverterInput } from '../class_converter.js'; +import { ClassConverter, JsonClassConverterInput, StringClassConverterInput } from '../class_converter.js'; import { JsonStringify, convertFromJsonObj, convertToJsonObj } from '../convert.js'; export { JsonStringify } from '../convert.js'; diff --git a/yarn-project/foundation/src/json-rpc/convert.test.ts b/yarn-project/foundation/src/json-rpc/convert.test.ts index 07aada5cba4..dcc03085593 100644 --- a/yarn-project/foundation/src/json-rpc/convert.test.ts +++ b/yarn-project/foundation/src/json-rpc/convert.test.ts @@ -1,9 +1,9 @@ +import { Buffer } from 'buffer'; + import { ClassConverter } from './class_converter.js'; import { convertFromJsonObj, convertToJsonObj } from './convert.js'; import { TestNote } from './fixtures/test_state.js'; -import { Buffer } from 'buffer'; - const TEST_BASE64 = 'YmFzZTY0IGRlY29kZXI='; test('test an RPC function over client', () => { const cc = new ClassConverter({ TestNote }); diff --git a/yarn-project/foundation/src/json-rpc/convert.ts b/yarn-project/foundation/src/json-rpc/convert.ts index dd71903cc3a..9b192dfc52b 100644 --- a/yarn-project/foundation/src/json-rpc/convert.ts +++ b/yarn-project/foundation/src/json-rpc/convert.ts @@ -1,6 +1,7 @@ -import { ClassConverter } from './class_converter.js'; import { Buffer } from 'buffer'; +import { ClassConverter } from './class_converter.js'; + /** * Recursively looks through an object for bigints and converts them to object format. * @param obj - The object to convert. diff --git a/yarn-project/foundation/src/json-rpc/server/json_proxy.ts b/yarn-project/foundation/src/json-rpc/server/json_proxy.ts index a9148192b76..f3444b192c2 100644 --- a/yarn-project/foundation/src/json-rpc/server/json_proxy.ts +++ b/yarn-project/foundation/src/json-rpc/server/json_proxy.ts @@ -1,5 +1,5 @@ import { createDebugLogger } from '../../log/index.js'; -import { ClassConverter, StringClassConverterInput, JsonClassConverterInput } from '../class_converter.js'; +import { ClassConverter, JsonClassConverterInput, StringClassConverterInput } from '../class_converter.js'; import { convertFromJsonObj, convertToJsonObj } from '../convert.js'; import { assert, hasOwnProperty } from '../js_utils.js'; diff --git a/yarn-project/foundation/src/json-rpc/server/json_rpc_server.test.ts b/yarn-project/foundation/src/json-rpc/server/json_rpc_server.test.ts index 38a8935730b..23adea9c325 100644 --- a/yarn-project/foundation/src/json-rpc/server/json_rpc_server.test.ts +++ b/yarn-project/foundation/src/json-rpc/server/json_rpc_server.test.ts @@ -1,5 +1,6 @@ import request from 'supertest'; -import { TestState, TestNote } from '../fixtures/test_state.js'; + +import { TestNote, TestState } from '../fixtures/test_state.js'; import { JsonRpcServer } from './json_rpc_server.js'; test('test an RPC function with a primitive parameter', async () => { diff --git a/yarn-project/foundation/src/json-rpc/server/json_rpc_server.ts b/yarn-project/foundation/src/json-rpc/server/json_rpc_server.ts index 2d8aa81ed40..da74a587559 100644 --- a/yarn-project/foundation/src/json-rpc/server/json_rpc_server.ts +++ b/yarn-project/foundation/src/json-rpc/server/json_rpc_server.ts @@ -1,14 +1,14 @@ -import http from 'http'; -import Router from 'koa-router'; import cors from '@koa/cors'; -import compress from 'koa-compress'; +import http from 'http'; import Koa from 'koa'; import bodyParser from 'koa-bodyparser'; +import compress from 'koa-compress'; +import Router from 'koa-router'; import { createLogger } from '../../log/index.js'; -import { StringClassConverterInput, JsonClassConverterInput } from '../class_converter.js'; -import { JsonProxy } from './json_proxy.js'; +import { JsonClassConverterInput, StringClassConverterInput } from '../class_converter.js'; import { convertBigintsInObj } from '../convert.js'; +import { JsonProxy } from './json_proxy.js'; /** * JsonRpcServer. diff --git a/yarn-project/foundation/src/log/log_history.test.ts b/yarn-project/foundation/src/log/log_history.test.ts index 2a58b004a19..11f13d135b1 100644 --- a/yarn-project/foundation/src/log/log_history.test.ts +++ b/yarn-project/foundation/src/log/log_history.test.ts @@ -1,4 +1,5 @@ import { jest } from '@jest/globals'; + import { createDebugLogger, enableLogs } from './debug.js'; import { LogHistory } from './log_history.js'; diff --git a/yarn-project/foundation/src/mutex/mutex.test.ts b/yarn-project/foundation/src/mutex/mutex.test.ts index e9ed9b3af64..0c2eb485d89 100644 --- a/yarn-project/foundation/src/mutex/mutex.test.ts +++ b/yarn-project/foundation/src/mutex/mutex.test.ts @@ -1,4 +1,5 @@ import { jest } from '@jest/globals'; + import { Mutex } from './index.js'; import { MutexDatabase } from './mutex_database.js'; diff --git a/yarn-project/foundation/src/serialize/buffer_reader.test.ts b/yarn-project/foundation/src/serialize/buffer_reader.test.ts index 8276d3976d3..1bc92a95f66 100644 --- a/yarn-project/foundation/src/serialize/buffer_reader.test.ts +++ b/yarn-project/foundation/src/serialize/buffer_reader.test.ts @@ -1,8 +1,9 @@ import { jest } from '@jest/globals'; + +import { randomBytes } from '../crypto/index.js'; import { Fq, Fr } from '../fields/fields.js'; import { BufferReader } from './buffer_reader.js'; import { serializeBufferArrayToVector } from './free_funcs.js'; -import { randomBytes } from '../crypto/index.js'; const ARRAY = Array.from(Array(32)).map((_, idx) => (idx % 2 === 0 ? 0 : 1)); const BUFFER = Buffer.from(ARRAY); diff --git a/yarn-project/foundation/src/serialize/buffer_reader.ts b/yarn-project/foundation/src/serialize/buffer_reader.ts index ea86bc0bbe3..a4409399173 100644 --- a/yarn-project/foundation/src/serialize/buffer_reader.ts +++ b/yarn-project/foundation/src/serialize/buffer_reader.ts @@ -1,4 +1,4 @@ -import { Fr, Fq } from '../fields/fields.js'; +import { Fq, Fr } from '../fields/fields.js'; import { Tuple } from './types.js'; /** diff --git a/yarn-project/foundation/src/serialize/serialize.test.ts b/yarn-project/foundation/src/serialize/serialize.test.ts index bbdaa8af47c..32d0851069d 100644 --- a/yarn-project/foundation/src/serialize/serialize.test.ts +++ b/yarn-project/foundation/src/serialize/serialize.test.ts @@ -1,12 +1,12 @@ import { randomBytes } from '../crypto/index.js'; import { Fr } from '../fields/fields.js'; import { - serializeBufferToVector, + deserializeArrayFromVector, deserializeBufferFromVector, - deserializeUInt32, deserializeField, + deserializeUInt32, serializeBufferArrayToVector, - deserializeArrayFromVector, + serializeBufferToVector, } from './index.js'; describe('serialize', () => { diff --git a/yarn-project/foundation/src/serialize/serializer.ts b/yarn-project/foundation/src/serialize/serializer.ts index a75dd131408..90eae6e171e 100644 --- a/yarn-project/foundation/src/serialize/serializer.ts +++ b/yarn-project/foundation/src/serialize/serializer.ts @@ -1,4 +1,3 @@ -import { serializeBufferArrayToVector } from './index.js'; import { boolToByte, numToInt32BE, @@ -7,6 +6,7 @@ import { serializeBufferToVector, serializeDate, } from './free_funcs.js'; +import { serializeBufferArrayToVector } from './index.js'; /** * The Serializer class provides a convenient and efficient way to serialize various data types into binary format. diff --git a/yarn-project/foundation/src/transport/browser/shared_worker_listener.ts b/yarn-project/foundation/src/transport/browser/shared_worker_listener.ts index 16120c7ab83..779a21cd224 100644 --- a/yarn-project/foundation/src/transport/browser/shared_worker_listener.ts +++ b/yarn-project/foundation/src/transport/browser/shared_worker_listener.ts @@ -1,4 +1,5 @@ import EventEmitter from 'events'; + import { Listener } from '../interface/listener.js'; import { MessagePortSocket } from './message_port_socket.js'; diff --git a/yarn-project/foundation/src/transport/browser/worker_listener.ts b/yarn-project/foundation/src/transport/browser/worker_listener.ts index 46dac85b5ff..502f65c7a17 100644 --- a/yarn-project/foundation/src/transport/browser/worker_listener.ts +++ b/yarn-project/foundation/src/transport/browser/worker_listener.ts @@ -1,4 +1,5 @@ import EventEmitter from 'events'; + import { Listener } from '../interface/listener.js'; import { MessagePortSocket } from './message_port_socket.js'; diff --git a/yarn-project/foundation/src/transport/dispatch/create_dispatch_proxy.ts b/yarn-project/foundation/src/transport/dispatch/create_dispatch_proxy.ts index 9ce69c1c161..e4dba2498cb 100644 --- a/yarn-project/foundation/src/transport/dispatch/create_dispatch_proxy.ts +++ b/yarn-project/foundation/src/transport/dispatch/create_dispatch_proxy.ts @@ -1,7 +1,8 @@ -import { DispatchMsg } from './create_dispatch_fn.js'; -import { TransportClient } from '../transport_client.js'; import { EventEmitter } from 'events'; -import { isTransferDescriptor, TransferDescriptor } from '../interface/transferable.js'; + +import { TransferDescriptor, isTransferDescriptor } from '../interface/transferable.js'; +import { TransportClient } from '../transport_client.js'; +import { DispatchMsg } from './create_dispatch_fn.js'; /** * FilterOutAttributes type filters out all non-method properties of an object, leaving only the attributes diff --git a/yarn-project/foundation/src/transport/interface/listener.ts b/yarn-project/foundation/src/transport/interface/listener.ts index b6e533570a7..f4e31e928b8 100644 --- a/yarn-project/foundation/src/transport/interface/listener.ts +++ b/yarn-project/foundation/src/transport/interface/listener.ts @@ -1,4 +1,5 @@ import EventEmitter from 'events'; + import { Socket } from './socket.js'; /** diff --git a/yarn-project/foundation/src/transport/node/node_connector.ts b/yarn-project/foundation/src/transport/node/node_connector.ts index 1db901b717e..37524380ca4 100644 --- a/yarn-project/foundation/src/transport/node/node_connector.ts +++ b/yarn-project/foundation/src/transport/node/node_connector.ts @@ -1,4 +1,5 @@ import { Worker } from 'worker_threads'; + import { Connector } from '../interface/connector.js'; import { NodeConnectorSocket } from './node_connector_socket.js'; diff --git a/yarn-project/foundation/src/transport/node/node_connector_socket.ts b/yarn-project/foundation/src/transport/node/node_connector_socket.ts index f7e460d6aa0..11cbb7d129e 100644 --- a/yarn-project/foundation/src/transport/node/node_connector_socket.ts +++ b/yarn-project/foundation/src/transport/node/node_connector_socket.ts @@ -1,4 +1,5 @@ import { TransferListItem, Worker } from 'worker_threads'; + import { Socket } from '../interface/socket.js'; /** diff --git a/yarn-project/foundation/src/transport/node/node_listener.ts b/yarn-project/foundation/src/transport/node/node_listener.ts index 4398f28941c..447aec1f08e 100644 --- a/yarn-project/foundation/src/transport/node/node_listener.ts +++ b/yarn-project/foundation/src/transport/node/node_listener.ts @@ -1,5 +1,6 @@ -import { parentPort } from 'worker_threads'; import EventEmitter from 'events'; +import { parentPort } from 'worker_threads'; + import { Listener } from '../interface/listener.js'; import { NodeListenerSocket } from './node_listener_socket.js'; diff --git a/yarn-project/foundation/src/transport/node/node_listener_socket.ts b/yarn-project/foundation/src/transport/node/node_listener_socket.ts index 18f7fb2aed3..25ebc40738e 100644 --- a/yarn-project/foundation/src/transport/node/node_listener_socket.ts +++ b/yarn-project/foundation/src/transport/node/node_listener_socket.ts @@ -1,4 +1,5 @@ import { MessagePort, TransferListItem } from 'worker_threads'; + import { Socket } from '../interface/socket.js'; /** diff --git a/yarn-project/foundation/src/transport/transport_client.ts b/yarn-project/foundation/src/transport/transport_client.ts index a478d415540..373d0f74f87 100644 --- a/yarn-project/foundation/src/transport/transport_client.ts +++ b/yarn-project/foundation/src/transport/transport_client.ts @@ -1,8 +1,9 @@ import EventEmitter from 'events'; -import { EventMessage, isEventMessage, ResponseMessage } from './dispatch/messages.js'; + +import { createDebugLogger } from '../log/index.js'; +import { EventMessage, ResponseMessage, isEventMessage } from './dispatch/messages.js'; import { Connector } from './interface/connector.js'; import { Socket } from './interface/socket.js'; -import { createDebugLogger } from '../log/index.js'; const debug = createDebugLogger('aztec:transport_client'); diff --git a/yarn-project/foundation/src/wasm/wasm/wasm_module.test.ts b/yarn-project/foundation/src/wasm/wasm/wasm_module.test.ts index 99db3f4af51..bdb96610963 100644 --- a/yarn-project/foundation/src/wasm/wasm/wasm_module.test.ts +++ b/yarn-project/foundation/src/wasm/wasm/wasm_module.test.ts @@ -1,7 +1,8 @@ -import { WasmModule } from './wasm_module.js'; -import { fileURLToPath } from 'url'; import { readFile } from 'fs/promises'; import { dirname } from 'path'; +import { fileURLToPath } from 'url'; + +import { WasmModule } from './wasm_module.js'; /** * Fetch a simple WASM. diff --git a/yarn-project/foundation/src/wasm/wasm/wasm_module.ts b/yarn-project/foundation/src/wasm/wasm/wasm_module.ts index 7810c758e00..a9b70dd138f 100644 --- a/yarn-project/foundation/src/wasm/wasm/wasm_module.ts +++ b/yarn-project/foundation/src/wasm/wasm/wasm_module.ts @@ -1,8 +1,9 @@ import { Buffer } from 'buffer'; import { randomBytes } from 'crypto'; -import { createDebugLogger, DebugLogger } from '../../log/index.js'; -import { getEmptyWasiSdk } from './empty_wasi_sdk.js'; + import { MemoryFifo } from '../../fifo/index.js'; +import { DebugLogger, createDebugLogger } from '../../log/index.js'; +import { getEmptyWasiSdk } from './empty_wasi_sdk.js'; /** * The base shape of a WASM module providing low level memory and synchronous call access. diff --git a/yarn-project/foundation/src/wasm/worker/browser/web_data_store.ts b/yarn-project/foundation/src/wasm/worker/browser/web_data_store.ts index 79f9c6a60eb..6e5322a3723 100644 --- a/yarn-project/foundation/src/wasm/worker/browser/web_data_store.ts +++ b/yarn-project/foundation/src/wasm/worker/browser/web_data_store.ts @@ -1,7 +1,8 @@ -import { DataStore } from '../data_store.js'; import levelup, { LevelUp } from 'levelup'; import memdown from 'memdown'; +import { DataStore } from '../data_store.js'; + /** * Cache for data used by wasm module. * Stores in a LevelUp database. diff --git a/yarn-project/foundation/src/wasm/worker/node/node_data_store.ts b/yarn-project/foundation/src/wasm/worker/node/node_data_store.ts index d3835350c30..007e4bc643d 100644 --- a/yarn-project/foundation/src/wasm/worker/node/node_data_store.ts +++ b/yarn-project/foundation/src/wasm/worker/node/node_data_store.ts @@ -1,8 +1,9 @@ -import { DataStore } from '../data_store.js'; -import levelup, { LevelUp } from 'levelup'; import leveldown from 'leveldown'; +import levelup, { LevelUp } from 'levelup'; import memdown from 'memdown'; +import { DataStore } from '../data_store.js'; + /** * Cache for data used by wasm module. */ diff --git a/yarn-project/foundation/src/wasm/worker/node/node_worker.ts b/yarn-project/foundation/src/wasm/worker/node/node_worker.ts index 4aec1d3fd3a..3b689121bb5 100644 --- a/yarn-project/foundation/src/wasm/worker/node/node_worker.ts +++ b/yarn-project/foundation/src/wasm/worker/node/node_worker.ts @@ -1,7 +1,8 @@ import { Worker } from 'worker_threads'; + +import { DispatchMsg, NodeConnector, TransportClient, createDispatchProxy } from '../../../transport/index.js'; import { WasmModule } from '../../wasm/wasm_module.js'; import { WasmWorker } from '../wasm_worker.js'; -import { DispatchMsg, NodeConnector, TransportClient, createDispatchProxy } from '../../../transport/index.js'; /** * Creates a node worker. diff --git a/yarn-project/foundation/src/wasm/worker/node/start_node_module.ts b/yarn-project/foundation/src/wasm/worker/node/start_node_module.ts index 607eb65b30f..1d9df67cf54 100644 --- a/yarn-project/foundation/src/wasm/worker/node/start_node_module.ts +++ b/yarn-project/foundation/src/wasm/worker/node/start_node_module.ts @@ -1,6 +1,7 @@ import { parentPort } from 'worker_threads'; -import { WasmModule } from '../../wasm/wasm_module.js'; + import { DispatchMsg, NodeListener, TransportServer } from '../../../transport/index.js'; +import { WasmModule } from '../../wasm/wasm_module.js'; if (!parentPort) { throw new Error('InvalidWorker'); diff --git a/yarn-project/key-store/src/test_key_store.ts b/yarn-project/key-store/src/test_key_store.ts index 652e2b275f5..c63f5f06635 100644 --- a/yarn-project/key-store/src/test_key_store.ts +++ b/yarn-project/key-store/src/test_key_store.ts @@ -1,8 +1,9 @@ -import { Curve } from '@aztec/circuits.js/barretenberg'; -import { ConstantKeyPair } from './key_pair.js'; import { Point } from '@aztec/circuits.js'; +import { Curve } from '@aztec/circuits.js/barretenberg'; import { KeyPair, KeyStore, PublicKey } from '@aztec/types'; +import { ConstantKeyPair } from './key_pair.js'; + /** * TestKeyStore is an implementation of the KeyStore interface, used for managing key pairs in a testing environment. * It should be utilized in testing scenarios where secure key management is not required, and ease-of-use is prioritized. diff --git a/yarn-project/merkle-tree/src/load_tree.ts b/yarn-project/merkle-tree/src/load_tree.ts index 920752e9c8f..baabe852735 100644 --- a/yarn-project/merkle-tree/src/load_tree.ts +++ b/yarn-project/merkle-tree/src/load_tree.ts @@ -1,6 +1,8 @@ +import { Hasher } from '@aztec/types'; + import { LevelUp } from 'levelup'; + import { TreeBase, decodeMeta } from './tree_base.js'; -import { Hasher } from '@aztec/types'; /** * Creates a new tree and sets its root, depth and size based on the meta data which are associated with the name. diff --git a/yarn-project/merkle-tree/src/new_tree.ts b/yarn-project/merkle-tree/src/new_tree.ts index 48e9b8a9ae3..f1cd4c2d3b5 100644 --- a/yarn-project/merkle-tree/src/new_tree.ts +++ b/yarn-project/merkle-tree/src/new_tree.ts @@ -1,6 +1,8 @@ +import { Hasher } from '@aztec/types'; + import { LevelUp } from 'levelup'; + import { TreeBase } from './tree_base.js'; -import { Hasher } from '@aztec/types'; /** * Creates a new tree. diff --git a/yarn-project/merkle-tree/src/pedersen.ts b/yarn-project/merkle-tree/src/pedersen.ts index 858cf6b7368..b4c3b19124d 100644 --- a/yarn-project/merkle-tree/src/pedersen.ts +++ b/yarn-project/merkle-tree/src/pedersen.ts @@ -1,10 +1,10 @@ -import { IWasmModule } from '@aztec/foundation/wasm'; import { pedersenCompress, pedersenGetHash, pedersenGetHashTree, pedersenHashInputs, } from '@aztec/circuits.js/barretenberg'; +import { IWasmModule } from '@aztec/foundation/wasm'; import { Hasher } from '@aztec/types'; /** diff --git a/yarn-project/merkle-tree/src/sparse_tree/sparse_tree.test.ts b/yarn-project/merkle-tree/src/sparse_tree/sparse_tree.test.ts index 73e9c51af83..e949894de58 100644 --- a/yarn-project/merkle-tree/src/sparse_tree/sparse_tree.test.ts +++ b/yarn-project/merkle-tree/src/sparse_tree/sparse_tree.test.ts @@ -1,19 +1,20 @@ -import { default as levelup } from 'levelup'; -import { treeTestSuite } from '../test/test_suite.js'; -import { SparseTree } from './sparse_tree.js'; -import { standardBasedTreeTestSuite } from '../test/standard_based_test_suite.js'; -import { createMemDown } from '../test/utils/create_mem_down.js'; -import { Pedersen } from '../pedersen.js'; -import { randomBytes } from 'crypto'; -import { INITIAL_LEAF } from '../index.js'; -import { UpdateOnlyTree } from '../interfaces/update_only_tree.js'; -import { newTree } from '../new_tree.js'; -import { loadTree } from '../load_tree.js'; +import { CircuitsWasm } from '@aztec/circuits.js'; import { createLogger } from '@aztec/foundation/log'; import { IWasmModule } from '@aztec/foundation/wasm'; -import { CircuitsWasm } from '@aztec/circuits.js'; import { Hasher, SiblingPath } from '@aztec/types'; +import { randomBytes } from 'crypto'; +import { default as levelup } from 'levelup'; + +import { INITIAL_LEAF, newTree } from '../index.js'; +import { UpdateOnlyTree } from '../interfaces/update_only_tree.js'; +import { loadTree } from '../load_tree.js'; +import { Pedersen } from '../pedersen.js'; +import { standardBasedTreeTestSuite } from '../test/standard_based_test_suite.js'; +import { treeTestSuite } from '../test/test_suite.js'; +import { createMemDown } from '../test/utils/create_mem_down.js'; +import { SparseTree } from './sparse_tree.js'; + const log = createLogger('aztec:sparse_tree_test'); const createDb = async ( 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 3f68f8063b0..ae06ad4fd1c 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,8 +1,9 @@ import { toBigIntBE, toBufferBE } from '@aztec/foundation/bigint-buffer'; import { createLogger } from '@aztec/foundation/log'; +import { SiblingPath } from '@aztec/types'; + import { IndexedTree, LeafData } from '../interfaces/indexed_tree.js'; import { TreeBase } from '../tree_base.js'; -import { SiblingPath } from '@aztec/types'; const log = createLogger('aztec:standard-indexed-tree'); 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 c5226cc3d95..cb3f861dde2 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,15 +1,14 @@ +import { CircuitsWasm } from '@aztec/circuits.js'; +import { toBufferBE } from '@aztec/foundation/bigint-buffer'; +import { IWasmModule } from '@aztec/foundation/wasm'; +import { Hasher, SiblingPath } from '@aztec/types'; + import { default as levelup } from 'levelup'; -import { INITIAL_LEAF, MerkleTree, Pedersen } from '../../index.js'; -import { treeTestSuite } from '../../test/test_suite.js'; +import { INITIAL_LEAF, MerkleTree, Pedersen, loadTree, newTree } from '../../index.js'; +import { treeTestSuite } from '../../test/test_suite.js'; import { createMemDown } from '../../test/utils/create_mem_down.js'; -import { newTree } from '../../new_tree.js'; -import { loadTree } from '../../load_tree.js'; -import { toBufferBE } from '@aztec/foundation/bigint-buffer'; -import { IWasmModule } from '@aztec/foundation/wasm'; -import { CircuitsWasm } from '@aztec/circuits.js'; import { StandardIndexedTreeWithAppend } from './standard_indexed_tree_with_append.js'; -import { Hasher, SiblingPath } from '@aztec/types'; const createDb = async (levelUp: levelup.LevelUp, hasher: Hasher, name: string, depth: number, prefilledSize = 1) => { return await newTree(StandardIndexedTreeWithAppend, levelUp, hasher, name, depth, prefilledSize); diff --git a/yarn-project/merkle-tree/src/standard_indexed_tree/test/standard_indexed_tree_with_append.ts b/yarn-project/merkle-tree/src/standard_indexed_tree/test/standard_indexed_tree_with_append.ts index fb47cda4915..e3ebc9b167b 100644 --- a/yarn-project/merkle-tree/src/standard_indexed_tree/test/standard_indexed_tree_with_append.ts +++ b/yarn-project/merkle-tree/src/standard_indexed_tree/test/standard_indexed_tree_with_append.ts @@ -1,4 +1,5 @@ import { toBigIntBE } from '@aztec/foundation/bigint-buffer'; + import { LeafData, StandardIndexedTree } from '../../index.js'; /** diff --git a/yarn-project/merkle-tree/src/standard_tree/standard_tree.test.ts b/yarn-project/merkle-tree/src/standard_tree/standard_tree.test.ts index a80379dc1fc..22b340f9973 100644 --- a/yarn-project/merkle-tree/src/standard_tree/standard_tree.test.ts +++ b/yarn-project/merkle-tree/src/standard_tree/standard_tree.test.ts @@ -1,16 +1,18 @@ import { CircuitsWasm } from '@aztec/circuits.js'; +import { randomBytes } from '@aztec/foundation/crypto'; import { IWasmModule } from '@aztec/foundation/wasm'; +import { Hasher } from '@aztec/types'; + import { default as levelup } from 'levelup'; + import { loadTree } from '../load_tree.js'; import { newTree } from '../new_tree.js'; import { standardBasedTreeTestSuite } from '../test/standard_based_test_suite.js'; import { treeTestSuite } from '../test/test_suite.js'; -import { PedersenWithCounter } from '../test/utils/pedersen_with_counter.js'; -import { StandardTree } from './standard_tree.js'; import { createMemDown } from '../test/utils/create_mem_down.js'; -import { randomBytes } from '@aztec/foundation/crypto'; +import { PedersenWithCounter } from '../test/utils/pedersen_with_counter.js'; import { INITIAL_LEAF } from '../tree_base.js'; -import { Hasher } from '@aztec/types'; +import { StandardTree } from './standard_tree.js'; const createDb = async (levelUp: levelup.LevelUp, hasher: Hasher, name: string, depth: number) => { return await newTree(StandardTree, levelUp, hasher, name, depth); diff --git a/yarn-project/merkle-tree/src/test/standard_based_test_suite.ts b/yarn-project/merkle-tree/src/test/standard_based_test_suite.ts index 1b4221d642a..67a2232bf44 100644 --- a/yarn-project/merkle-tree/src/test/standard_based_test_suite.ts +++ b/yarn-project/merkle-tree/src/test/standard_based_test_suite.ts @@ -1,13 +1,15 @@ +import { CircuitsWasm } from '@aztec/circuits.js'; +import { IWasmModule } from '@aztec/foundation/wasm'; +import { Hasher, SiblingPath } from '@aztec/types'; + +import { randomBytes } from 'crypto'; import { default as levelup } from 'levelup'; + import { INITIAL_LEAF, Pedersen } from '../index.js'; -import { appendLeaves } from './utils/append_leaves.js'; -import { createMemDown } from './utils/create_mem_down.js'; -import { randomBytes } from 'crypto'; import { AppendOnlyTree } from '../interfaces/append_only_tree.js'; import { UpdateOnlyTree } from '../interfaces/update_only_tree.js'; -import { IWasmModule } from '@aztec/foundation/wasm'; -import { CircuitsWasm } from '@aztec/circuits.js'; -import { Hasher, SiblingPath } from '@aztec/types'; +import { appendLeaves } from './utils/append_leaves.js'; +import { createMemDown } from './utils/create_mem_down.js'; const TEST_TREE_DEPTH = 2; diff --git a/yarn-project/merkle-tree/src/test/test_suite.ts b/yarn-project/merkle-tree/src/test/test_suite.ts index 4d32c40fa58..9192e399fd1 100644 --- a/yarn-project/merkle-tree/src/test/test_suite.ts +++ b/yarn-project/merkle-tree/src/test/test_suite.ts @@ -1,12 +1,14 @@ +import { CircuitsWasm } from '@aztec/circuits.js'; import { IWasmModule } from '@aztec/foundation/wasm'; +import { Hasher, SiblingPath } from '@aztec/types'; + import { default as levelup } from 'levelup'; + import { Pedersen } from '../index.js'; -import { appendLeaves } from './utils/append_leaves.js'; -import { createMemDown } from './utils/create_mem_down.js'; import { AppendOnlyTree } from '../interfaces/append_only_tree.js'; import { UpdateOnlyTree } from '../interfaces/update_only_tree.js'; -import { CircuitsWasm } from '@aztec/circuits.js'; -import { Hasher, SiblingPath } from '@aztec/types'; +import { appendLeaves } from './utils/append_leaves.js'; +import { createMemDown } from './utils/create_mem_down.js'; const expectSameTrees = async ( tree1: AppendOnlyTree | UpdateOnlyTree, diff --git a/yarn-project/merkle-tree/src/test/utils/create_mem_down.ts b/yarn-project/merkle-tree/src/test/utils/create_mem_down.ts index 7b3be556315..0be5ac35604 100644 --- a/yarn-project/merkle-tree/src/test/utils/create_mem_down.ts +++ b/yarn-project/merkle-tree/src/test/utils/create_mem_down.ts @@ -1,3 +1,3 @@ -import { default as memdown, type MemDown } from 'memdown'; +import { type MemDown, default as memdown } from 'memdown'; export const createMemDown = () => (memdown as any)() as MemDown; diff --git a/yarn-project/merkle-tree/src/tree_base.ts b/yarn-project/merkle-tree/src/tree_base.ts index 11494f99e8c..4275d16b0b3 100644 --- a/yarn-project/merkle-tree/src/tree_base.ts +++ b/yarn-project/merkle-tree/src/tree_base.ts @@ -1,8 +1,10 @@ -import { LevelUp, LevelUpChain } from 'levelup'; -import { MerkleTree } from './interfaces/merkle_tree.js'; import { toBigIntLE, toBufferLE } from '@aztec/foundation/bigint-buffer'; import { Hasher, SiblingPath } from '@aztec/types'; +import { LevelUp, LevelUpChain } from 'levelup'; + +import { MerkleTree } from './interfaces/merkle_tree.js'; + const MAX_DEPTH = 254; const indexToKeyHash = (name: string, level: number, index: bigint) => `${name}:${level}:${index}`; diff --git a/yarn-project/noir-compiler/src/cli.ts b/yarn-project/noir-compiler/src/cli.ts index 25f7355e5ab..5a20e04ed7b 100644 --- a/yarn-project/noir-compiler/src/cli.ts +++ b/yarn-project/noir-compiler/src/cli.ts @@ -1,10 +1,12 @@ #!/usr/bin/env node -import nodePath from 'path'; -import fs from 'fs/promises'; -import fsExtra from 'fs-extra'; +import { createLogger } from '@aztec/foundation/log'; + import { Command } from 'commander'; +import fsExtra from 'fs-extra'; +import fs from 'fs/promises'; +import nodePath from 'path'; + import { ContractCompiler } from './compile.js'; -import { createLogger } from '@aztec/foundation/log'; const program = new Command(); const log = createLogger('noir-compiler-cli'); diff --git a/yarn-project/noir-compiler/src/compile.ts b/yarn-project/noir-compiler/src/compile.ts index aa93e6cbe84..1d43d9a4d86 100644 --- a/yarn-project/noir-compiler/src/compile.ts +++ b/yarn-project/noir-compiler/src/compile.ts @@ -1,12 +1,14 @@ +import { ContractAbi, FunctionType } from '@aztec/foundation/abi'; + +import noirResolver from '@noir-lang/noir-source-resolver'; import { compile } from '@noir-lang/noir_wasm'; -import nodePath from 'path'; import fsSync from 'fs'; import fs from 'fs/promises'; -import noirResolver from '@noir-lang/noir-source-resolver'; +import nodePath from 'path'; import toml from 'toml'; -import { NoirCompiledContract } from './noir_artifact.js'; -import { ContractAbi, FunctionType } from '@aztec/foundation/abi'; + import { mockVerificationKey } from './mockedKeys.js'; +import { NoirCompiledContract } from './noir_artifact.js'; /** * A dependency entry of Nargo.toml. diff --git a/yarn-project/noir-compiler/src/index.test.ts b/yarn-project/noir-compiler/src/index.test.ts index 3e0706b71f9..98651765b9d 100644 --- a/yarn-project/noir-compiler/src/index.test.ts +++ b/yarn-project/noir-compiler/src/index.test.ts @@ -1,5 +1,6 @@ import path from 'path'; import { fileURLToPath } from 'url'; + import { ContractCompiler } from './compile.js'; const getCurentDirname = () => path.dirname(fileURLToPath(import.meta.url)); diff --git a/yarn-project/noir-contracts/src/scripts/copy_output.ts b/yarn-project/noir-contracts/src/scripts/copy_output.ts index 03c5d8db547..ba66361f1c3 100644 --- a/yarn-project/noir-contracts/src/scripts/copy_output.ts +++ b/yarn-project/noir-contracts/src/scripts/copy_output.ts @@ -1,12 +1,14 @@ +import { ABIParameter, ABIType, FunctionType } from '@aztec/foundation/abi'; +import { createLogger } from '@aztec/foundation/log'; + import { readFileSync, writeFileSync } from 'fs'; import camelCase from 'lodash.camelcase'; +import omit from 'lodash.omit'; import snakeCase from 'lodash.snakecase'; import upperFirst from 'lodash.upperfirst'; -import mockedKeys from './mockedKeys.json' assert { type: 'json' }; -import { ABIParameter, ABIType, FunctionType } from '@aztec/foundation/abi'; -import { createLogger } from '@aztec/foundation/log'; import { join as pathJoin } from 'path'; -import omit from 'lodash.omit'; + +import mockedKeys from './mockedKeys.json' assert { type: 'json' }; const STATEMENT_TYPES = ['type', 'params', 'return'] as const; const log = createLogger('aztec:noir-contracts'); diff --git a/yarn-project/p2p-bootstrap/src/index.ts b/yarn-project/p2p-bootstrap/src/index.ts index fa73468881b..91a83afb2b0 100644 --- a/yarn-project/p2p-bootstrap/src/index.ts +++ b/yarn-project/p2p-bootstrap/src/index.ts @@ -1,7 +1,8 @@ -import 'dotenv/config'; import { createDebugLogger } from '@aztec/foundation/log'; import { BootstrapNode, getP2PConfigEnvVars } from '@aztec/p2p'; +import 'dotenv/config'; + const logger = createDebugLogger('aztec:bootstrap_node'); /** diff --git a/yarn-project/p2p/src/bootstrap/bootstrap.ts b/yarn-project/p2p/src/bootstrap/bootstrap.ts index a0d49f7dac9..5c02976f1e2 100644 --- a/yarn-project/p2p/src/bootstrap/bootstrap.ts +++ b/yarn-project/p2p/src/bootstrap/bootstrap.ts @@ -1,14 +1,16 @@ -import { Libp2p, Libp2pOptions, ServiceFactoryMap, createLibp2p } from 'libp2p'; -import { tcp } from '@libp2p/tcp'; +import { createDebugLogger } from '@aztec/foundation/log'; + import { noise } from '@chainsafe/libp2p-noise'; -import { mplex } from '@libp2p/mplex'; +import { yamux } from '@chainsafe/libp2p-yamux'; +import type { ServiceMap } from '@libp2p/interface-libp2p'; import { kadDHT } from '@libp2p/kad-dht'; +import { mplex } from '@libp2p/mplex'; import { createFromProtobuf } from '@libp2p/peer-id-factory'; -import { createDebugLogger } from '@aztec/foundation/log'; -import { P2PConfig } from '../config.js'; -import { yamux } from '@chainsafe/libp2p-yamux'; +import { tcp } from '@libp2p/tcp'; +import { Libp2p, Libp2pOptions, ServiceFactoryMap, createLibp2p } from 'libp2p'; import { identifyService } from 'libp2p/identify'; -import type { ServiceMap } from '@libp2p/interface-libp2p'; + +import { P2PConfig } from '../config.js'; import { createLibP2PPeerId } from '../index.js'; /** diff --git a/yarn-project/p2p/src/client/index.ts b/yarn-project/p2p/src/client/index.ts index fab61c92a1d..4406a24af0a 100644 --- a/yarn-project/p2p/src/client/index.ts +++ b/yarn-project/p2p/src/client/index.ts @@ -1,4 +1,5 @@ import { L2BlockSource } from '@aztec/types'; + import { LibP2PService, P2PClient, P2PConfig, TxPool } from '../index.js'; import { DummyP2PService } from '../service/dummy_service.js'; diff --git a/yarn-project/p2p/src/client/p2p_client.test.ts b/yarn-project/p2p/src/client/p2p_client.test.ts index f3c70ca9511..0726ab56e6d 100644 --- a/yarn-project/p2p/src/client/p2p_client.test.ts +++ b/yarn-project/p2p/src/client/p2p_client.test.ts @@ -1,10 +1,11 @@ -import { expect, jest } from '@jest/globals'; import { L2BlockSource, mockTx } from '@aztec/types'; -import { P2PClient } from './p2p_client.js'; +import { expect, jest } from '@jest/globals'; + +import { P2PService } from '../index.js'; import { TxPool } from '../tx_pool/index.js'; import { MockBlockSource } from './mocks.js'; -import { P2PService } from '../index.js'; +import { P2PClient } from './p2p_client.js'; /** * Mockify helper for testing purposes. diff --git a/yarn-project/p2p/src/client/p2p_client.ts b/yarn-project/p2p/src/client/p2p_client.ts index 083f3b63057..d92795f9bfe 100644 --- a/yarn-project/p2p/src/client/p2p_client.ts +++ b/yarn-project/p2p/src/client/p2p_client.ts @@ -1,10 +1,10 @@ +import { createDebugLogger } from '@aztec/foundation/log'; import { L2Block, L2BlockContext, L2BlockDownloader, L2BlockSource } from '@aztec/types'; import { Tx, TxHash } from '@aztec/types'; -import { TxPool } from '../tx_pool/index.js'; import { getP2PConfigEnvVars } from '../config.js'; -import { createDebugLogger } from '@aztec/foundation/log'; import { P2PService } from '../service/service.js'; +import { TxPool } from '../tx_pool/index.js'; /** * Enum defining the possible states of the p2p client. diff --git a/yarn-project/p2p/src/service/dummy_service.ts b/yarn-project/p2p/src/service/dummy_service.ts index e6afb69493d..3c83cca8e91 100644 --- a/yarn-project/p2p/src/service/dummy_service.ts +++ b/yarn-project/p2p/src/service/dummy_service.ts @@ -1,4 +1,5 @@ import { Tx, TxHash } from '@aztec/types'; + import { P2PService } from './service.js'; /** diff --git a/yarn-project/p2p/src/service/known_txs.test.ts b/yarn-project/p2p/src/service/known_txs.test.ts index c36254f905f..1b9de9d570a 100644 --- a/yarn-project/p2p/src/service/known_txs.test.ts +++ b/yarn-project/p2p/src/service/known_txs.test.ts @@ -1,9 +1,11 @@ +import { randomBytes } from '@aztec/foundation/crypto'; +import { TxHash } from '@aztec/types'; + import { expect } from '@jest/globals'; +import { Ed25519PeerId, PeerId } from '@libp2p/interface-peer-id'; import { mock } from 'jest-mock-extended'; -import { PeerId, Ed25519PeerId } from '@libp2p/interface-peer-id'; + import { KnownTxLookup } from './known_txs.js'; -import { TxHash } from '@aztec/types'; -import { randomBytes } from '@aztec/foundation/crypto'; const createMockPeerId = (peerId: string): PeerId => { return mock({ diff --git a/yarn-project/p2p/src/service/libp2p_service.ts b/yarn-project/p2p/src/service/libp2p_service.ts index b0e0fff59aa..9abbe7e0862 100644 --- a/yarn-project/p2p/src/service/libp2p_service.ts +++ b/yarn-project/p2p/src/service/libp2p_service.ts @@ -1,20 +1,26 @@ -import { Libp2p, Libp2pOptions, ServiceFactoryMap, createLibp2p } from 'libp2p'; -import { tcp } from '@libp2p/tcp'; +import { SerialQueue } from '@aztec/foundation/fifo'; +import { createDebugLogger } from '@aztec/foundation/log'; +import { Tx, TxHash } from '@aztec/types'; + import { noise } from '@chainsafe/libp2p-noise'; import { yamux } from '@chainsafe/libp2p-yamux'; -import { mplex } from '@libp2p/mplex'; import { bootstrap } from '@libp2p/bootstrap'; -import { DualKadDHT, kadDHT } from '@libp2p/kad-dht'; -import { createEd25519PeerId, createFromProtobuf, exportToProtobuf } from '@libp2p/peer-id-factory'; import type { ServiceMap } from '@libp2p/interface-libp2p'; import { PeerId } from '@libp2p/interface-peer-id'; import { IncomingStreamData } from '@libp2p/interface-registrar'; -import { P2PService } from './service.js'; -import { createDebugLogger } from '@aztec/foundation/log'; -import { SerialQueue } from '@aztec/foundation/fifo'; -import { P2PConfig } from '../config.js'; -import { Tx, TxHash } from '@aztec/types'; +import { DualKadDHT, kadDHT } from '@libp2p/kad-dht'; +import { mplex } from '@libp2p/mplex'; +import { createEd25519PeerId, createFromProtobuf, exportToProtobuf } from '@libp2p/peer-id-factory'; +import { tcp } from '@libp2p/tcp'; import { pipe } from 'it-pipe'; +import { Libp2p, Libp2pOptions, ServiceFactoryMap, createLibp2p } from 'libp2p'; +import { autoNATService } from 'libp2p/autonat'; +import { identifyService } from 'libp2p/identify'; + +import { P2PConfig } from '../config.js'; +import { TxPool } from '../index.js'; +import { KnownTxLookup } from './known_txs.js'; +import { P2PService } from './service.js'; import { Messages, createGetTransactionsRequestMessage, @@ -25,10 +31,6 @@ import { decodeTransactionsMessage, getEncodedMessage, } from './tx_messages.js'; -import { KnownTxLookup } from './known_txs.js'; -import { TxPool } from '../index.js'; -import { autoNATService } from 'libp2p/autonat'; -import { identifyService } from 'libp2p/identify'; const INITIAL_PEER_REFRESH_INTERVAL = 20000; diff --git a/yarn-project/p2p/src/service/tx_messages.test.ts b/yarn-project/p2p/src/service/tx_messages.test.ts index a70a33ec0db..21cc5c51efe 100644 --- a/yarn-project/p2p/src/service/tx_messages.test.ts +++ b/yarn-project/p2p/src/service/tx_messages.test.ts @@ -1,9 +1,11 @@ import { MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX, Proof } from '@aztec/circuits.js'; import { makeKernelPublicInputs, makePublicCallRequest } from '@aztec/circuits.js/factories'; import { EncodedContractFunction, Tx, TxHash, TxL2Logs } from '@aztec/types'; + import { expect } from '@jest/globals'; import { randomBytes } from 'crypto'; import times from 'lodash.times'; + import { Messages, createGetTransactionsRequestMessage, diff --git a/yarn-project/p2p/src/tx_pool/tx_pool.test.ts b/yarn-project/p2p/src/tx_pool/tx_pool.test.ts index e5817bbdc7c..be88190d729 100644 --- a/yarn-project/p2p/src/tx_pool/tx_pool.test.ts +++ b/yarn-project/p2p/src/tx_pool/tx_pool.test.ts @@ -1,4 +1,5 @@ import { mockTx } from '@aztec/types'; + import { InMemoryTxPool } from './index.js'; describe('In-Memory TX pool', () => { diff --git a/yarn-project/rollup-provider/src/app.ts b/yarn-project/rollup-provider/src/app.ts index 051f76d96de..8cf06eff8ec 100644 --- a/yarn-project/rollup-provider/src/app.ts +++ b/yarn-project/rollup-provider/src/app.ts @@ -2,6 +2,7 @@ import { Fr } from '@aztec/circuits.js'; import { AztecAddress } from '@aztec/foundation/aztec-address'; import { createDebugLogger } from '@aztec/foundation/log'; import { AztecNode, MerkleTreeId, Tx, TxHash } from '@aztec/types'; + import Koa, { Context, DefaultState } from 'koa'; import Router from 'koa-router'; import { PromiseReadable } from 'promise-readable'; diff --git a/yarn-project/rollup-provider/src/index.ts b/yarn-project/rollup-provider/src/index.ts index ea5056c048d..a9b431e8e9f 100644 --- a/yarn-project/rollup-provider/src/index.ts +++ b/yarn-project/rollup-provider/src/index.ts @@ -1,9 +1,11 @@ -import 'dotenv/config'; import { AztecNodeConfig, AztecNodeService, getConfigEnvVars } from '@aztec/aztec-node'; -import { appFactory } from './app.js'; -import http from 'http'; import { createDebugLogger } from '@aztec/foundation/log'; +import 'dotenv/config'; +import http from 'http'; + +import { appFactory } from './app.js'; + const logger = createDebugLogger('aztec:rollup_provider'); const { SERVER_PORT = 9000 } = process.env; diff --git a/yarn-project/sequencer-client/src/block_builder/index.ts b/yarn-project/sequencer-client/src/block_builder/index.ts index fac474f867f..a3679494ef2 100644 --- a/yarn-project/sequencer-client/src/block_builder/index.ts +++ b/yarn-project/sequencer-client/src/block_builder/index.ts @@ -1,7 +1,8 @@ -import { L2Block } from '@aztec/types'; -import { ProcessedTx } from '../sequencer/processed_tx.js'; import { GlobalVariables, Proof } from '@aztec/circuits.js'; import { Fr } from '@aztec/foundation/fields'; +import { L2Block } from '@aztec/types'; + +import { ProcessedTx } from '../sequencer/processed_tx.js'; /** * Assembles an L2Block from a set of processed transactions. diff --git a/yarn-project/sequencer-client/src/block_builder/solo_block_builder.test.ts b/yarn-project/sequencer-client/src/block_builder/solo_block_builder.test.ts index b310593264f..d2ada0b618d 100644 --- a/yarn-project/sequencer-client/src/block_builder/solo_block_builder.test.ts +++ b/yarn-project/sequencer-client/src/block_builder/solo_block_builder.test.ts @@ -5,12 +5,12 @@ import { CircuitsWasm, Fr, GlobalVariables, + KernelCircuitPublicInputs, MAX_NEW_COMMITMENTS_PER_TX, MAX_NEW_L2_TO_L1_MSGS_PER_TX, MAX_NEW_NULLIFIERS_PER_TX, MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, - KernelCircuitPublicInputs, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, Proof, PublicDataUpdateRequest, @@ -29,23 +29,26 @@ import { makeRootRollupPublicInputs, } from '@aztec/circuits.js/factories'; import { toBufferBE } from '@aztec/foundation/bigint-buffer'; +import { to2Fields } from '@aztec/foundation/serialize'; import { ContractData, L2Block, L2BlockL2Logs, MerkleTreeId, - mockTx, PublicDataWrite, Tx, TxL2Logs, makeEmptyLogs, + mockTx, } from '@aztec/types'; import { MerkleTreeOperations, MerkleTrees } from '@aztec/world-state'; + import { MockProxy, mock } from 'jest-mock-extended'; import { default as levelup } from 'levelup'; import flatMap from 'lodash.flatmap'; import times from 'lodash.times'; -import { default as memdown, type MemDown } from 'memdown'; +import { type MemDown, default as memdown } from 'memdown'; + import { VerificationKeys, getVerificationKeys } from '../mocks/verification_keys.js'; import { EmptyRollupProver } from '../prover/empty.js'; import { RollupProver } from '../prover/index.js'; @@ -58,7 +61,6 @@ import { getCombinedHistoricTreeRoots } from '../sequencer/utils.js'; import { RollupSimulator } from '../simulator/index.js'; import { WasmRollupCircuitSimulator } from '../simulator/rollup.js'; import { SoloBlockBuilder } from './solo_block_builder.js'; -import { to2Fields } from '@aztec/foundation/serialize'; export const createMemDown = () => (memdown as any)() as MemDown; diff --git a/yarn-project/sequencer-client/src/block_builder/solo_block_builder.ts b/yarn-project/sequencer-client/src/block_builder/solo_block_builder.ts index 7720633569b..0c4631c62b5 100644 --- a/yarn-project/sequencer-client/src/block_builder/solo_block_builder.ts +++ b/yarn-project/sequencer-client/src/block_builder/solo_block_builder.ts @@ -6,8 +6,8 @@ import { CircuitsWasm, ConstantBaseRollupData, GlobalVariables, - L1_TO_L2_MSG_TREE_ROOTS_TREE_HEIGHT, L1_TO_L2_MSG_SUBTREE_HEIGHT, + L1_TO_L2_MSG_TREE_ROOTS_TREE_HEIGHT, MembershipWitness, MergeRollupInputs, NULLIFIER_TREE_HEIGHT, @@ -26,23 +26,24 @@ import { makeTuple, } from '@aztec/circuits.js'; import { computeContractLeaf } from '@aztec/circuits.js/abis'; -import { MerkleTreeId, ContractData, L2Block, PublicDataWrite, TxL2Logs, L2BlockL2Logs } from '@aztec/types'; -import { MerkleTreeOperations } from '@aztec/world-state'; -import chunk from 'lodash.chunk'; -import flatMap from 'lodash.flatmap'; -import { VerificationKeys } from '../mocks/verification_keys.js'; -import { RollupProver } from '../prover/index.js'; -import { RollupSimulator } from '../simulator/index.js'; - import { toFriendlyJSON } from '@aztec/circuits.js/utils'; import { toBigIntBE } from '@aztec/foundation/bigint-buffer'; +import { padArrayEnd } from '@aztec/foundation/collection'; import { Fr } from '@aztec/foundation/fields'; import { createDebugLogger } from '@aztec/foundation/log'; import { assertLength } from '@aztec/foundation/serialize'; +import { ContractData, L2Block, L2BlockL2Logs, MerkleTreeId, PublicDataWrite, TxL2Logs } from '@aztec/types'; +import { MerkleTreeOperations } from '@aztec/world-state'; + +import chunk from 'lodash.chunk'; +import flatMap from 'lodash.flatmap'; + +import { VerificationKeys } from '../mocks/verification_keys.js'; +import { RollupProver } from '../prover/index.js'; import { ProcessedTx } from '../sequencer/processed_tx.js'; +import { RollupSimulator } from '../simulator/index.js'; import { BlockBuilder } from './index.js'; import { AllowedTreeNames, OutputWithTreeSnapshot } from './types.js'; -import { padArrayEnd } from '@aztec/foundation/collection'; const frToBigInt = (fr: Fr) => toBigIntBE(fr.toBuffer()); const bigintToFr = (num: bigint) => new Fr(num); diff --git a/yarn-project/sequencer-client/src/client/sequencer-client.ts b/yarn-project/sequencer-client/src/client/sequencer-client.ts index 392ac56d18d..47d9b976df7 100644 --- a/yarn-project/sequencer-client/src/client/sequencer-client.ts +++ b/yarn-project/sequencer-client/src/client/sequencer-client.ts @@ -1,14 +1,14 @@ import { P2P } from '@aztec/p2p'; +import { ContractDataSource, L1ToL2MessageSource, L2BlockSource } from '@aztec/types'; import { WorldStateSynchroniser } from '@aztec/world-state'; -import { ContractDataSource, L1ToL2MessageSource, L2BlockSource } from '@aztec/types'; import { SoloBlockBuilder } from '../block_builder/solo_block_builder.js'; import { SequencerClientConfig } from '../config.js'; -import { getL1Publisher, getVerificationKeys, Sequencer } from '../index.js'; +import { getGlobalVariableBuilder } from '../global_variable_builder/index.js'; +import { Sequencer, getL1Publisher, getVerificationKeys } from '../index.js'; import { EmptyRollupProver } from '../prover/empty.js'; import { PublicProcessorFactory } from '../sequencer/public_processor.js'; import { WasmRollupCircuitSimulator } from '../simulator/rollup.js'; -import { getGlobalVariableBuilder } from '../global_variable_builder/index.js'; /** * Encapsulates the full sequencer and publisher. diff --git a/yarn-project/sequencer-client/src/config.ts b/yarn-project/sequencer-client/src/config.ts index f3bb81fab5c..695d43deace 100644 --- a/yarn-project/sequencer-client/src/config.ts +++ b/yarn-project/sequencer-client/src/config.ts @@ -1,7 +1,8 @@ -import { SequencerConfig } from './sequencer/config.js'; -import { PublisherConfig, TxSenderConfig } from './publisher/config.js'; import { EthAddress } from '@aztec/foundation/eth-address'; + import { GlobalReaderConfig } from './global_variable_builder/index.js'; +import { PublisherConfig, TxSenderConfig } from './publisher/config.js'; +import { SequencerConfig } from './sequencer/config.js'; /** * Configuration settings for the SequencerClient. diff --git a/yarn-project/sequencer-client/src/global_variable_builder/viem-reader.ts b/yarn-project/sequencer-client/src/global_variable_builder/viem-reader.ts index 00c903fec90..d7ffbad0f40 100644 --- a/yarn-project/sequencer-client/src/global_variable_builder/viem-reader.ts +++ b/yarn-project/sequencer-client/src/global_variable_builder/viem-reader.ts @@ -1,15 +1,17 @@ import { createEthereumChain } from '@aztec/ethereum'; import { RollupAbi } from '@aztec/l1-artifacts'; + import { GetContractReturnType, - PublicClient, HttpTransport, + PublicClient, createPublicClient, - http, - getContract, getAddress, + getContract, + http, } from 'viem'; import * as chains from 'viem/chains'; + import { GlobalReaderConfig } from './config.js'; import { L1GlobalReader } from './global_builder.js'; diff --git a/yarn-project/sequencer-client/src/prover/empty.ts b/yarn-project/sequencer-client/src/prover/empty.ts index 4fe004aeeca..b96f1633f3d 100644 --- a/yarn-project/sequencer-client/src/prover/empty.ts +++ b/yarn-project/sequencer-client/src/prover/empty.ts @@ -10,6 +10,7 @@ import { RootRollupInputs, RootRollupPublicInputs, } from '@aztec/circuits.js'; + import { PublicProver, RollupProver } from './index.js'; const EMPTY_PROOF_SIZE = 42; diff --git a/yarn-project/sequencer-client/src/publisher/l1-publisher.test.ts b/yarn-project/sequencer-client/src/publisher/l1-publisher.test.ts index ffb0b05e22c..63b34ebc624 100644 --- a/yarn-project/sequencer-client/src/publisher/l1-publisher.test.ts +++ b/yarn-project/sequencer-client/src/publisher/l1-publisher.test.ts @@ -1,5 +1,6 @@ import { L2Block } from '@aztec/types'; -import { mock, MockProxy } from 'jest-mock-extended'; + +import { MockProxy, mock } from 'jest-mock-extended'; import { sleep } from '../utils.js'; import { L1Publisher, L1PublisherTxSender, MinimalTransactionReceipt } from './l1-publisher.js'; diff --git a/yarn-project/sequencer-client/src/publisher/l1-publisher.ts b/yarn-project/sequencer-client/src/publisher/l1-publisher.ts index f8678a7463b..58827da7252 100644 --- a/yarn-project/sequencer-client/src/publisher/l1-publisher.ts +++ b/yarn-project/sequencer-client/src/publisher/l1-publisher.ts @@ -1,9 +1,9 @@ +import { createDebugLogger } from '@aztec/foundation/log'; +import { InterruptableSleep } from '@aztec/foundation/sleep'; import { ContractPublicData, L2Block } from '@aztec/types'; import { L2BlockReceiver } from '../receiver.js'; import { PublisherConfig } from './config.js'; -import { InterruptableSleep } from '@aztec/foundation/sleep'; -import { createDebugLogger } from '@aztec/foundation/log'; /** * Minimal information from a tx receipt returned by an L1PublisherTxSender. diff --git a/yarn-project/sequencer-client/src/publisher/viem-tx-sender.ts b/yarn-project/sequencer-client/src/publisher/viem-tx-sender.ts index 3c061c38ee9..f50d68a4c8f 100644 --- a/yarn-project/sequencer-client/src/publisher/viem-tx-sender.ts +++ b/yarn-project/sequencer-client/src/publisher/viem-tx-sender.ts @@ -1,5 +1,6 @@ -import { TxSenderConfig } from './config.js'; -import { L1ProcessArgs as ProcessTxArgs, L1PublisherTxSender, MinimalTransactionReceipt } from './l1-publisher.js'; +import { createEthereumChain } from '@aztec/ethereum'; +import { createDebugLogger } from '@aztec/foundation/log'; +import { ContractDeploymentEmitterAbi, RollupAbi } from '@aztec/l1-artifacts'; import { ContractPublicData } from '@aztec/types'; import { @@ -14,11 +15,11 @@ import { getContract, http, } from 'viem'; -import { RollupAbi, ContractDeploymentEmitterAbi } from '@aztec/l1-artifacts'; import { PrivateKeyAccount, privateKeyToAccount } from 'viem/accounts'; import * as chains from 'viem/chains'; -import { createDebugLogger } from '@aztec/foundation/log'; -import { createEthereumChain } from '@aztec/ethereum'; + +import { TxSenderConfig } from './config.js'; +import { L1PublisherTxSender, MinimalTransactionReceipt, L1ProcessArgs as ProcessTxArgs } from './l1-publisher.js'; /** * Pushes transactions to the L1 rollup contract using viem. diff --git a/yarn-project/sequencer-client/src/sequencer/processed_tx.ts b/yarn-project/sequencer-client/src/sequencer/processed_tx.ts index 982f535bf3b..85d9a0d6dc1 100644 --- a/yarn-project/sequencer-client/src/sequencer/processed_tx.ts +++ b/yarn-project/sequencer-client/src/sequencer/processed_tx.ts @@ -1,4 +1,4 @@ -import { KernelCircuitPublicInputs, Proof, CombinedHistoricTreeRoots, makeEmptyProof, Fr } from '@aztec/circuits.js'; +import { CombinedHistoricTreeRoots, Fr, KernelCircuitPublicInputs, Proof, makeEmptyProof } from '@aztec/circuits.js'; import { Tx, TxHash, TxL2Logs } from '@aztec/types'; /** diff --git a/yarn-project/sequencer-client/src/sequencer/public_processor.test.ts b/yarn-project/sequencer-client/src/sequencer/public_processor.test.ts index c3a3e34b033..70bc0be8c63 100644 --- a/yarn-project/sequencer-client/src/sequencer/public_processor.test.ts +++ b/yarn-project/sequencer-client/src/sequencer/public_processor.test.ts @@ -29,15 +29,17 @@ import { EncodedContractFunction, ExecutionRequest, FunctionL2Logs, - mockTx, SiblingPath, Tx, TxL2Logs, + mockTx, } from '@aztec/types'; import { MerkleTreeOperations, TreeInfo } from '@aztec/world-state'; + import { MockProxy, mock } from 'jest-mock-extended'; import pick from 'lodash.pick'; import times from 'lodash.times'; + import { PublicProver } from '../prover/index.js'; import { PublicKernelCircuitSimulator } from '../simulator/index.js'; import { WasmPublicKernelCircuitSimulator } from '../simulator/public_kernel.js'; diff --git a/yarn-project/sequencer-client/src/sequencer/public_processor.ts b/yarn-project/sequencer-client/src/sequencer/public_processor.ts index 6e57986eaba..933da858f7e 100644 --- a/yarn-project/sequencer-client/src/sequencer/public_processor.ts +++ b/yarn-project/sequencer-client/src/sequencer/public_processor.ts @@ -6,14 +6,14 @@ import { ContractStorageUpdateRequest, Fr, GlobalVariables, - MAX_PUBLIC_DATA_READS_PER_CALL, - MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL, KernelCircuitPublicInputs, - MembershipWitness, MAX_NEW_COMMITMENTS_PER_CALL, MAX_NEW_L2_TO_L1_MSGS_PER_CALL, MAX_NEW_NULLIFIERS_PER_CALL, MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL, + MAX_PUBLIC_DATA_READS_PER_CALL, + MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL, + MembershipWitness, PreviousKernelData, Proof, PublicCallData, @@ -30,6 +30,7 @@ import { createDebugLogger } from '@aztec/foundation/log'; import { Tuple, mapTuple, to2Fields } from '@aztec/foundation/serialize'; import { ContractDataSource, FunctionL2Logs, L1ToL2MessageSource, MerkleTreeId, Tx } from '@aztec/types'; import { MerkleTreeOperations } from '@aztec/world-state'; + import { getVerificationKeys } from '../index.js'; import { EmptyPublicProver } from '../prover/empty.js'; import { PublicProver } from '../prover/index.js'; diff --git a/yarn-project/sequencer-client/src/sequencer/sequencer.test.ts b/yarn-project/sequencer-client/src/sequencer/sequencer.test.ts index d40e0132ca5..8de7c6f38ac 100644 --- a/yarn-project/sequencer-client/src/sequencer/sequencer.test.ts +++ b/yarn-project/sequencer-client/src/sequencer/sequencer.test.ts @@ -6,16 +6,18 @@ import { makeEmptyProof, } from '@aztec/circuits.js'; import { P2P, P2PClientState } from '@aztec/p2p'; -import { L1ToL2MessageSource, L2Block, L2BlockSource, MerkleTreeId, mockTx, Tx, TxHash } from '@aztec/types'; +import { L1ToL2MessageSource, L2Block, L2BlockSource, MerkleTreeId, Tx, TxHash, mockTx } from '@aztec/types'; import { MerkleTreeOperations, WorldStateRunningState, WorldStateSynchroniser } from '@aztec/world-state'; + import { MockProxy, mock } from 'jest-mock-extended'; import times from 'lodash.times'; + import { BlockBuilder } from '../block_builder/index.js'; +import { GlobalVariableBuilder } from '../global_variable_builder/global_builder.js'; import { L1Publisher } from '../index.js'; import { makeEmptyProcessedTx, makeProcessedTx } from './processed_tx.js'; import { PublicProcessor, PublicProcessorFactory } from './public_processor.js'; import { Sequencer } from './sequencer.js'; -import { GlobalVariableBuilder } from '../global_variable_builder/global_builder.js'; describe('sequencer', () => { let publisher: MockProxy; diff --git a/yarn-project/sequencer-client/src/sequencer/sequencer.ts b/yarn-project/sequencer-client/src/sequencer/sequencer.ts index e0c9b9fe77a..d28ccdc0e4a 100644 --- a/yarn-project/sequencer-client/src/sequencer/sequencer.ts +++ b/yarn-project/sequencer-client/src/sequencer/sequencer.ts @@ -1,3 +1,4 @@ +import { GlobalVariables } from '@aztec/circuits.js'; import { Fr } from '@aztec/foundation/fields'; import { createDebugLogger } from '@aztec/foundation/log'; import { RunningPromise } from '@aztec/foundation/running-promise'; @@ -12,15 +13,16 @@ import { Tx, } from '@aztec/types'; import { WorldStateStatus, WorldStateSynchroniser } from '@aztec/world-state'; + import times from 'lodash.times'; + import { BlockBuilder } from '../block_builder/index.js'; +import { GlobalVariableBuilder } from '../global_variable_builder/global_builder.js'; import { L1Publisher } from '../publisher/l1-publisher.js'; import { ceilPowerOfTwo } from '../utils.js'; import { SequencerConfig } from './config.js'; import { ProcessedTx } from './processed_tx.js'; import { PublicProcessorFactory } from './public_processor.js'; -import { GlobalVariables } from '@aztec/circuits.js'; -import { GlobalVariableBuilder } from '../global_variable_builder/global_builder.js'; /** * Sequencer client diff --git a/yarn-project/sequencer-client/src/simulator/public_kernel.ts b/yarn-project/sequencer-client/src/simulator/public_kernel.ts index 335652e6c4c..ec7c3c522b9 100644 --- a/yarn-project/sequencer-client/src/simulator/public_kernel.ts +++ b/yarn-project/sequencer-client/src/simulator/public_kernel.ts @@ -1,4 +1,5 @@ import { PublicKernelInputs, PublicKernelPublicInputs, simulatePublicKernelCircuit } from '@aztec/circuits.js'; + import { PublicKernelCircuitSimulator } from './index.js'; /** diff --git a/yarn-project/sequencer-client/src/simulator/rollup.ts b/yarn-project/sequencer-client/src/simulator/rollup.ts index 4de14dccbf5..787f0c46784 100644 --- a/yarn-project/sequencer-client/src/simulator/rollup.ts +++ b/yarn-project/sequencer-client/src/simulator/rollup.ts @@ -7,6 +7,7 @@ import { RootRollupInputs, RootRollupPublicInputs, } from '@aztec/circuits.js'; + import { RollupSimulator } from './index.js'; /** diff --git a/yarn-project/types/src/contract_data.test.ts b/yarn-project/types/src/contract_data.test.ts index 30891c1341b..923ba2b17b7 100644 --- a/yarn-project/types/src/contract_data.test.ts +++ b/yarn-project/types/src/contract_data.test.ts @@ -1,7 +1,8 @@ import { AztecAddress } from '@aztec/foundation/aztec-address'; -import { ContractData, ContractPublicData, EncodedContractFunction } from './contract_data.js'; import { EthAddress } from '@aztec/foundation/eth-address'; +import { ContractData, ContractPublicData, EncodedContractFunction } from './contract_data.js'; + describe('ContractData', () => { const aztecAddress = AztecAddress.random(); const portalAddress = EthAddress.random(); diff --git a/yarn-project/types/src/contract_data.ts b/yarn-project/types/src/contract_data.ts index 300c4663116..af9aa8fce5a 100644 --- a/yarn-project/types/src/contract_data.ts +++ b/yarn-project/types/src/contract_data.ts @@ -1,10 +1,10 @@ +import { FUNCTION_SELECTOR_NUM_BYTES } from '@aztec/circuits.js'; +import { BufferReader, serializeToBuffer } from '@aztec/circuits.js/utils'; import { AztecAddress } from '@aztec/foundation/aztec-address'; +import { randomBytes } from '@aztec/foundation/crypto'; import { EthAddress } from '@aztec/foundation/eth-address'; import { numToInt32BE } from '@aztec/foundation/serialize'; -import { randomBytes } from '@aztec/foundation/crypto'; import { serializeBufferArrayToVector } from '@aztec/foundation/serialize'; -import { BufferReader, serializeToBuffer } from '@aztec/circuits.js/utils'; -import { FUNCTION_SELECTOR_NUM_BYTES } from '@aztec/circuits.js'; export { BufferReader } from '@aztec/circuits.js/utils'; diff --git a/yarn-project/types/src/contract_database.ts b/yarn-project/types/src/contract_database.ts index 9354699c6e9..c2928be91a7 100644 --- a/yarn-project/types/src/contract_database.ts +++ b/yarn-project/types/src/contract_database.ts @@ -1,4 +1,5 @@ import { AztecAddress } from '@aztec/foundation/aztec-address'; + import { ContractDao } from './contract_dao.js'; /** diff --git a/yarn-project/types/src/interfaces/aztec-node.ts b/yarn-project/types/src/interfaces/aztec-node.ts index 1df345f6511..3229ffa8417 100644 --- a/yarn-project/types/src/interfaces/aztec-node.ts +++ b/yarn-project/types/src/interfaces/aztec-node.ts @@ -1,17 +1,18 @@ import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; + import { ContractCommitmentProvider, + ContractData, + ContractPublicData, DataCommitmentProvider, L1ToL2MessageProvider, + L2Block, L2BlockL2Logs, LogType, MerkleTreeId, Tx, TxHash, - L2Block, - ContractData, - ContractPublicData, } from '../index.js'; /** diff --git a/yarn-project/types/src/l1_to_l2_message.ts b/yarn-project/types/src/l1_to_l2_message.ts index f8596428fdb..d7311a8d01e 100644 --- a/yarn-project/types/src/l1_to_l2_message.ts +++ b/yarn-project/types/src/l1_to_l2_message.ts @@ -1,7 +1,7 @@ -import { EthAddress } from '@aztec/foundation/eth-address'; +import { BufferReader, serializeToBuffer } from '@aztec/circuits.js/utils'; import { AztecAddress } from '@aztec/foundation/aztec-address'; +import { EthAddress } from '@aztec/foundation/eth-address'; import { Fr } from '@aztec/foundation/fields'; -import { BufferReader, serializeToBuffer } from '@aztec/circuits.js/utils'; /** * Interface of classes allowing for the retrieval of L1 to L2 messages. diff --git a/yarn-project/types/src/l2_block.ts b/yarn-project/types/src/l2_block.ts index 0019ccd2bfe..ec6dbb22a23 100644 --- a/yarn-project/types/src/l2_block.ts +++ b/yarn-project/types/src/l2_block.ts @@ -1,20 +1,22 @@ import { AppendOnlyTreeSnapshot, + GlobalVariables, MAX_NEW_COMMITMENTS_PER_TX, MAX_NEW_CONTRACTS_PER_TX, + MAX_NEW_L2_TO_L1_MSGS_PER_TX, MAX_NEW_NULLIFIERS_PER_TX, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, - MAX_NEW_L2_TO_L1_MSGS_PER_TX, - GlobalVariables, } from '@aztec/circuits.js'; import { makeAppendOnlyTreeSnapshot, makeGlobalVariables } from '@aztec/circuits.js/factories'; import { BufferReader, serializeToBuffer } from '@aztec/circuits.js/utils'; +import { sha256, sha256ToField } from '@aztec/foundation/crypto'; import { Fr } from '@aztec/foundation/fields'; + import times from 'lodash.times'; -import { sha256, sha256ToField } from '@aztec/foundation/crypto'; + +import { ContractData, L2Tx, LogType, PublicDataWrite, TxL2Logs } from './index.js'; import { L2BlockL2Logs } from './logs/l2_block_l2_logs.js'; -import { LogType, TxL2Logs, PublicDataWrite, ContractData, L2Tx } from './index.js'; /** * The data that makes up the rollup proof, with encoder decoder functions. diff --git a/yarn-project/types/src/l2_block_context.ts b/yarn-project/types/src/l2_block_context.ts index 7647b351215..445ff9d0083 100644 --- a/yarn-project/types/src/l2_block_context.ts +++ b/yarn-project/types/src/l2_block_context.ts @@ -1,8 +1,8 @@ import { MAX_NEW_COMMITMENTS_PER_TX } from '@aztec/circuits.js'; +import { keccak } from '@aztec/foundation/crypto'; import { L2Block } from './l2_block.js'; import { TxHash } from './tx/tx_hash.js'; -import { keccak } from '@aztec/foundation/crypto'; /** * A wrapper around L2 block used to cache results of expensive operations. diff --git a/yarn-project/types/src/l2_block_downloader/l2_block_downloader.ts b/yarn-project/types/src/l2_block_downloader/l2_block_downloader.ts index 7eb837dce04..b01beb87113 100644 --- a/yarn-project/types/src/l2_block_downloader/l2_block_downloader.ts +++ b/yarn-project/types/src/l2_block_downloader/l2_block_downloader.ts @@ -1,7 +1,8 @@ -import { InterruptableSleep } from '@aztec/foundation/sleep'; import { MemoryFifo, Semaphore } from '@aztec/foundation/fifo'; -import { L2BlockSource, L2Block, INITIAL_L2_BLOCK_NUM } from '../index.js'; import { createLogger } from '@aztec/foundation/log'; +import { InterruptableSleep } from '@aztec/foundation/sleep'; + +import { INITIAL_L2_BLOCK_NUM, L2Block, L2BlockSource } from '../index.js'; const log = createLogger('aztec:l2_block_downloader'); diff --git a/yarn-project/types/src/l2_tx.ts b/yarn-project/types/src/l2_tx.ts index 5e84d05e65f..0fe007c0d13 100644 --- a/yarn-project/types/src/l2_tx.ts +++ b/yarn-project/types/src/l2_tx.ts @@ -1,4 +1,5 @@ import { Fr } from '@aztec/foundation/fields'; + import { ContractData } from './contract_data.js'; import { PublicDataWrite } from './public_data_write.js'; import { TxHash } from './tx/tx_hash.js'; diff --git a/yarn-project/types/src/logs/function_l2_logs.ts b/yarn-project/types/src/logs/function_l2_logs.ts index 3566ac1803d..b782116ee0b 100644 --- a/yarn-project/types/src/logs/function_l2_logs.ts +++ b/yarn-project/types/src/logs/function_l2_logs.ts @@ -1,6 +1,7 @@ +import { sha256 } from '@aztec/foundation/crypto'; import { BufferReader, serializeBufferToVector } from '@aztec/foundation/serialize'; + import { randomBytes } from 'crypto'; -import { sha256 } from '@aztec/foundation/crypto'; /** * Data container of logs emitted in 1 function invocation (corresponds to 1 kernel iteration). diff --git a/yarn-project/types/src/logs/l2_block_l2_logs.ts b/yarn-project/types/src/logs/l2_block_l2_logs.ts index 7cb164960d5..192cf7263f2 100644 --- a/yarn-project/types/src/logs/l2_block_l2_logs.ts +++ b/yarn-project/types/src/logs/l2_block_l2_logs.ts @@ -1,4 +1,5 @@ import { BufferReader, serializeBufferToVector } from '@aztec/foundation/serialize'; + import { TxL2Logs } from './tx_l2_logs.js'; /** diff --git a/yarn-project/types/src/logs/note_spending_info/encrypt_buffer.test.ts b/yarn-project/types/src/logs/note_spending_info/encrypt_buffer.test.ts index 0eb8273840b..4ebcc5dcbf5 100644 --- a/yarn-project/types/src/logs/note_spending_info/encrypt_buffer.test.ts +++ b/yarn-project/types/src/logs/note_spending_info/encrypt_buffer.test.ts @@ -1,9 +1,10 @@ -import { Grumpkin } from '@aztec/circuits.js/barretenberg'; import { CircuitsWasm } from '@aztec/circuits.js'; +import { Grumpkin } from '@aztec/circuits.js/barretenberg'; import { randomBytes } from '@aztec/foundation/crypto'; -import { decryptBuffer, deriveAESSecret, encryptBuffer } from './encrypt_buffer.js'; import { Point } from '@aztec/foundation/fields'; +import { decryptBuffer, deriveAESSecret, encryptBuffer } from './encrypt_buffer.js'; + describe('encrypt buffer', () => { let grumpkin: Grumpkin; diff --git a/yarn-project/types/src/logs/note_spending_info/encrypt_buffer.ts b/yarn-project/types/src/logs/note_spending_info/encrypt_buffer.ts index 19fa5982fd1..008d4744c5f 100644 --- a/yarn-project/types/src/logs/note_spending_info/encrypt_buffer.ts +++ b/yarn-project/types/src/logs/note_spending_info/encrypt_buffer.ts @@ -1,8 +1,9 @@ -import { createCipheriv, createDecipheriv } from 'browserify-cipher'; import { Curve } from '@aztec/circuits.js/barretenberg'; -import { numToUInt8 } from '@aztec/foundation/serialize'; import { sha256 } from '@aztec/foundation/crypto'; import { Point } from '@aztec/foundation/fields'; +import { numToUInt8 } from '@aztec/foundation/serialize'; + +import { createCipheriv, createDecipheriv } from 'browserify-cipher'; /** * Derive an AES secret key using Elliptic Curve Diffie-Hellman (ECDH) and SHA-256. diff --git a/yarn-project/types/src/logs/note_spending_info/note_preimage.test.ts b/yarn-project/types/src/logs/note_spending_info/note_preimage.test.ts index cfa69f48b16..dfed1ca38f8 100644 --- a/yarn-project/types/src/logs/note_spending_info/note_preimage.test.ts +++ b/yarn-project/types/src/logs/note_spending_info/note_preimage.test.ts @@ -1,4 +1,5 @@ import { Fr } from '@aztec/foundation/fields'; + import { NotePreimage } from './note_preimage.js'; describe('note_preimage', () => { diff --git a/yarn-project/types/src/logs/note_spending_info/note_preimage.ts b/yarn-project/types/src/logs/note_spending_info/note_preimage.ts index 9d0786e2bba..a2a3c24126d 100644 --- a/yarn-project/types/src/logs/note_spending_info/note_preimage.ts +++ b/yarn-project/types/src/logs/note_spending_info/note_preimage.ts @@ -1,5 +1,5 @@ -import { Fr } from '@aztec/foundation/fields'; import { Vector } from '@aztec/circuits.js'; +import { Fr } from '@aztec/foundation/fields'; import { BufferReader } from '@aztec/foundation/serialize'; /** diff --git a/yarn-project/types/src/logs/note_spending_info/note_spending_info.test.ts b/yarn-project/types/src/logs/note_spending_info/note_spending_info.test.ts index 967d687013c..9e6e2be9ec1 100644 --- a/yarn-project/types/src/logs/note_spending_info/note_spending_info.test.ts +++ b/yarn-project/types/src/logs/note_spending_info/note_spending_info.test.ts @@ -1,8 +1,9 @@ -import { Grumpkin } from '@aztec/circuits.js/barretenberg'; import { CircuitsWasm } from '@aztec/circuits.js'; +import { Grumpkin } from '@aztec/circuits.js/barretenberg'; +import { randomBytes } from '@aztec/foundation/crypto'; import { Point } from '@aztec/foundation/fields'; + import { NoteSpendingInfo } from './note_spending_info.js'; -import { randomBytes } from '@aztec/foundation/crypto'; describe('note_spending_info', () => { let grumpkin: Grumpkin; diff --git a/yarn-project/types/src/logs/note_spending_info/note_spending_info.ts b/yarn-project/types/src/logs/note_spending_info/note_spending_info.ts index de8b5c3ebd8..b24c63cf412 100644 --- a/yarn-project/types/src/logs/note_spending_info/note_spending_info.ts +++ b/yarn-project/types/src/logs/note_spending_info/note_spending_info.ts @@ -1,11 +1,12 @@ -import { Fr, Point } from '@aztec/foundation/fields'; import { AztecAddress } from '@aztec/circuits.js'; -import { BufferReader } from '@aztec/foundation/serialize'; -import { NotePreimage } from './note_preimage.js'; -import { serializeToBuffer } from '@aztec/circuits.js/utils'; -import { decryptBuffer, encryptBuffer } from './encrypt_buffer.js'; import { Curve } from '@aztec/circuits.js/barretenberg'; +import { serializeToBuffer } from '@aztec/circuits.js/utils'; import { randomBytes } from '@aztec/foundation/crypto'; +import { Fr, Point } from '@aztec/foundation/fields'; +import { BufferReader } from '@aztec/foundation/serialize'; + +import { decryptBuffer, encryptBuffer } from './encrypt_buffer.js'; +import { NotePreimage } from './note_preimage.js'; /** * A class which wraps the data required to compute a nullifier/to spend a note. Along with that this class contains diff --git a/yarn-project/types/src/logs/tx_l2_logs.ts b/yarn-project/types/src/logs/tx_l2_logs.ts index 3f9fca77f26..a4b39167ffb 100644 --- a/yarn-project/types/src/logs/tx_l2_logs.ts +++ b/yarn-project/types/src/logs/tx_l2_logs.ts @@ -1,4 +1,5 @@ import { BufferReader, serializeBufferToVector } from '@aztec/foundation/serialize'; + import { FunctionL2Logs } from './function_l2_logs.js'; /** diff --git a/yarn-project/types/src/mocks.ts b/yarn-project/types/src/mocks.ts index 56aa6ab0793..5ec58ec3e08 100644 --- a/yarn-project/types/src/mocks.ts +++ b/yarn-project/types/src/mocks.ts @@ -1,6 +1,8 @@ import { MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX, Proof } from '@aztec/circuits.js'; import { makeKernelPublicInputs, makePublicCallRequest } from '@aztec/circuits.js/factories'; + import times from 'lodash.times'; + import { EncodedContractFunction, FunctionL2Logs, TxL2Logs } from './index.js'; import { Tx } from './tx/index.js'; diff --git a/yarn-project/types/src/public_data_write.ts b/yarn-project/types/src/public_data_write.ts index 252fd725ba7..71999319e03 100644 --- a/yarn-project/types/src/public_data_write.ts +++ b/yarn-project/types/src/public_data_write.ts @@ -1,6 +1,7 @@ import { serializeToBuffer } from '@aztec/circuits.js/utils'; import { Fr } from '@aztec/foundation/fields'; import { BufferReader } from '@aztec/foundation/serialize'; + /** * Write operations on the public state tree. */ diff --git a/yarn-project/types/src/sibling_path.ts b/yarn-project/types/src/sibling_path.ts index e0d807ab9d9..4323ca30818 100644 --- a/yarn-project/types/src/sibling_path.ts +++ b/yarn-project/types/src/sibling_path.ts @@ -1,10 +1,11 @@ +import { Fr } from '@aztec/foundation/fields'; import { Tuple, assertLength, deserializeArrayFromVector, serializeBufferArrayToVector, } from '@aztec/foundation/serialize'; -import { Fr } from '@aztec/foundation/fields'; + import { Hasher } from './interfaces/index.js'; /** diff --git a/yarn-project/types/src/tx/tx.ts b/yarn-project/types/src/tx/tx.ts index bb76ef14ff5..a3265f4743b 100644 --- a/yarn-project/types/src/tx/tx.ts +++ b/yarn-project/types/src/tx/tx.ts @@ -1,8 +1,8 @@ import { AztecAddress, Fr, - MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX, KernelCircuitPublicInputs, + MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX, PartialContractAddress, Proof, PublicCallRequest, diff --git a/yarn-project/types/src/tx/tx_hash.ts b/yarn-project/types/src/tx/tx_hash.ts index d85583b17aa..138aa6dbe0f 100644 --- a/yarn-project/types/src/tx/tx_hash.ts +++ b/yarn-project/types/src/tx/tx_hash.ts @@ -1,5 +1,5 @@ -import { deserializeBigInt, serializeBigInt } from '@aztec/foundation/serialize'; import { assertMemberLength } from '@aztec/circuits.js'; +import { deserializeBigInt, serializeBigInt } from '@aztec/foundation/serialize'; /** * A class representing hash of Aztec transaction. diff --git a/yarn-project/types/src/tx/tx_receipt.ts b/yarn-project/types/src/tx/tx_receipt.ts index 0092ca1077a..2ab4d97d015 100644 --- a/yarn-project/types/src/tx/tx_receipt.ts +++ b/yarn-project/types/src/tx/tx_receipt.ts @@ -1,5 +1,5 @@ -import { TxHash } from '@aztec/types'; import { AztecAddress } from '@aztec/foundation/aztec-address'; +import { TxHash } from '@aztec/types'; /** * Possible status of a transaction. diff --git a/yarn-project/types/src/tx_execution_request.ts b/yarn-project/types/src/tx_execution_request.ts index c00e7acfab8..2e0b35b6607 100644 --- a/yarn-project/types/src/tx_execution_request.ts +++ b/yarn-project/types/src/tx_execution_request.ts @@ -1,5 +1,6 @@ import { AztecAddress, FieldsOf, Fr, FunctionData, TxContext, TxRequest, Vector } from '@aztec/circuits.js'; import { BufferReader, serializeToBuffer } from '@aztec/circuits.js/utils'; + import { PackedArguments } from './packed_arguments.js'; /** diff --git a/yarn-project/world-state/src/merkle-tree/merkle_tree_operations_facade.ts b/yarn-project/world-state/src/merkle-tree/merkle_tree_operations_facade.ts index c737940e609..411e1f81697 100644 --- a/yarn-project/world-state/src/merkle-tree/merkle_tree_operations_facade.ts +++ b/yarn-project/world-state/src/merkle-tree/merkle_tree_operations_facade.ts @@ -1,6 +1,7 @@ -import { LeafData, MerkleTreeDb, TreeInfo, MerkleTreeOperations, CurrentCommitmentTreeRoots } from '../index.js'; -import { L2Block, MerkleTreeId, SiblingPath } from '@aztec/types'; import { LowLeafWitnessData } from '@aztec/merkle-tree'; +import { L2Block, MerkleTreeId, SiblingPath } from '@aztec/types'; + +import { CurrentCommitmentTreeRoots, LeafData, MerkleTreeDb, MerkleTreeOperations, TreeInfo } from '../index.js'; /** * Wraps a MerkleTreeDbOperations to call all functions with a preset includeUncommitted flag. diff --git a/yarn-project/world-state/src/synchroniser/server_world_state_synchroniser.test.ts b/yarn-project/world-state/src/synchroniser/server_world_state_synchroniser.test.ts index 9b51a95cf89..8dcb564a22b 100644 --- a/yarn-project/world-state/src/synchroniser/server_world_state_synchroniser.test.ts +++ b/yarn-project/world-state/src/synchroniser/server_world_state_synchroniser.test.ts @@ -1,14 +1,17 @@ import { AppendOnlyTreeSnapshot, CircuitsWasm, + Fr, GlobalVariables, MAX_NEW_COMMITMENTS_PER_TX, MAX_NEW_CONTRACTS_PER_TX, + MAX_NEW_L2_TO_L1_MSGS_PER_CALL, MAX_NEW_NULLIFIERS_PER_TX, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, - MAX_NEW_L2_TO_L1_MSGS_PER_CALL, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, } from '@aztec/circuits.js'; +import { createLogger } from '@aztec/foundation/log'; +import { sleep } from '@aztec/foundation/sleep'; import { INITIAL_LEAF, Pedersen } from '@aztec/merkle-tree'; import { ContractData, @@ -19,10 +22,8 @@ import { PublicDataWrite, SiblingPath, } from '@aztec/types'; + import { jest } from '@jest/globals'; -import { Fr } from '@aztec/foundation/fields'; -import { sleep } from '@aztec/foundation/sleep'; -import { createLogger } from '@aztec/foundation/log'; import times from 'lodash.times'; import { MerkleTreeDb } from '../index.js'; diff --git a/yarn-project/world-state/src/synchroniser/server_world_state_synchroniser.ts b/yarn-project/world-state/src/synchroniser/server_world_state_synchroniser.ts index c239e3d0cd4..79fda0599c9 100644 --- a/yarn-project/world-state/src/synchroniser/server_world_state_synchroniser.ts +++ b/yarn-project/world-state/src/synchroniser/server_world_state_synchroniser.ts @@ -1,9 +1,10 @@ +import { createDebugLogger } from '@aztec/foundation/log'; import { L2Block, L2BlockDownloader, L2BlockSource } from '@aztec/types'; + import { MerkleTreeDb, MerkleTreeOperations } from '../index.js'; import { MerkleTreeOperationsFacade } from '../merkle-tree/merkle_tree_operations_facade.js'; -import { WorldStateRunningState, WorldStateStatus, WorldStateSynchroniser } from './world_state_synchroniser.js'; import { getConfigEnvVars } from './config.js'; -import { createDebugLogger } from '@aztec/foundation/log'; +import { WorldStateRunningState, WorldStateStatus, WorldStateSynchroniser } from './world_state_synchroniser.js'; /** * Synchronises the world state with the L2 blocks from a L2BlockSource. diff --git a/yarn-project/world-state/src/utils.ts b/yarn-project/world-state/src/utils.ts index b07e6107114..ac77a1fab92 100644 --- a/yarn-project/world-state/src/utils.ts +++ b/yarn-project/world-state/src/utils.ts @@ -3,7 +3,6 @@ import { pedersenCompressWithHashIndex } from '@aztec/circuits.js/barretenberg'; import { AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; import { toBigInt } from '@aztec/foundation/serialize'; - import { IWasmModule } from '@aztec/foundation/wasm'; /** 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 7e0aa76e960..a678a5e8d37 100644 --- a/yarn-project/world-state/src/world-state-db/index.ts +++ b/yarn-project/world-state/src/world-state-db/index.ts @@ -1,7 +1,7 @@ +import { MAX_NEW_NULLIFIERS_PER_TX } from '@aztec/circuits.js'; +import { createDebugLogger } from '@aztec/foundation/log'; import { LeafData, LowLeafWitnessData } from '@aztec/merkle-tree'; import { L2Block, MerkleTreeId, SiblingPath } from '@aztec/types'; -import { createDebugLogger } from '@aztec/foundation/log'; -import { MAX_NEW_NULLIFIERS_PER_TX } from '@aztec/circuits.js'; export * from './merkle_trees.js'; export { LeafData } from '@aztec/merkle-tree'; diff --git a/yarn-project/world-state/src/world-state-db/merkle_trees.ts b/yarn-project/world-state/src/world-state-db/merkle_trees.ts index 95802e56a1e..b96c371aff9 100644 --- a/yarn-project/world-state/src/world-state-db/merkle_trees.ts +++ b/yarn-project/world-state/src/world-state-db/merkle_trees.ts @@ -4,13 +4,16 @@ import { CONTRACT_TREE_ROOTS_TREE_HEIGHT, CircuitsWasm, Fr, - L1_TO_L2_MSG_TREE_ROOTS_TREE_HEIGHT, L1_TO_L2_MSG_TREE_HEIGHT, + L1_TO_L2_MSG_TREE_ROOTS_TREE_HEIGHT, NULLIFIER_TREE_HEIGHT, PRIVATE_DATA_TREE_HEIGHT, PRIVATE_DATA_TREE_ROOTS_TREE_HEIGHT, PUBLIC_DATA_TREE_HEIGHT, } from '@aztec/circuits.js'; +import { SerialQueue } from '@aztec/foundation/fifo'; +import { createDebugLogger } from '@aztec/foundation/log'; +import { IWasmModule } from '@aztec/foundation/wasm'; import { AppendOnlyTree, IndexedTree, @@ -23,7 +26,11 @@ import { UpdateOnlyTree, newTree, } from '@aztec/merkle-tree'; +import { L2Block, MerkleTreeId, SiblingPath, merkleTreeIds } from '@aztec/types'; + import { default as levelup } from 'levelup'; + +import { MerkleTreeOperationsFacade } from '../merkle-tree/merkle_tree_operations_facade.js'; import { CurrentCommitmentTreeRoots, INITIAL_NULLIFIER_TREE_SIZE, @@ -33,11 +40,6 @@ import { PublicTreeId, TreeInfo, } from './index.js'; -import { MerkleTreeOperationsFacade } from '../merkle-tree/merkle_tree_operations_facade.js'; -import { L2Block, MerkleTreeId, SiblingPath, merkleTreeIds } from '@aztec/types'; -import { SerialQueue } from '@aztec/foundation/fifo'; -import { createDebugLogger } from '@aztec/foundation/log'; -import { IWasmModule } from '@aztec/foundation/wasm'; /** * A convenience class for managing multiple merkle trees.