From d3e12cdae4e77ac455909a2c0bd1b256677314a6 Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Wed, 4 Dec 2024 15:36:30 -0300 Subject: [PATCH] Rename modules scopes --- .../src/contract/base_contract_interaction.ts | 2 +- yarn-project/aztec.js/src/contract/deploy_sent_tx.ts | 2 +- yarn-project/aztec.js/src/utils/cheat_codes.ts | 4 ++-- yarn-project/aztec/src/examples/token.ts | 2 +- yarn-project/bb-prover/src/avm_proving.test.ts | 2 +- .../bb-prover/src/prover/bb_private_kernel_prover.ts | 2 +- .../bb-prover/src/test/test_circuit_prover.ts | 2 +- yarn-project/bb-prover/src/verifier/bb_verifier.ts | 2 +- .../src/interfaces/merkle_tree_operations.ts | 2 +- .../src/l2_block_downloader/l2_block_downloader.ts | 2 +- .../src/l2_block_downloader/l2_block_stream.ts | 2 +- .../src/barretenberg/crypto/grumpkin/index.test.ts | 2 +- .../src/composed/e2e_aztec_js_browser.test.ts | 4 ++-- .../src/composed/e2e_sandbox_example.test.ts | 4 ++-- .../src/fixtures/setup_l1_contracts.test.ts | 2 +- yarn-project/end-to-end/src/fixtures/utils.ts | 4 ++-- .../e2e_prover_coordination.test.ts | 4 ++-- .../end-to-end/src/sample-dapp/index.test.mjs | 2 +- .../end-to-end/src/spartan/gating-passive.test.ts | 2 +- yarn-project/end-to-end/src/spartan/proving.test.ts | 2 +- yarn-project/end-to-end/src/spartan/reorg.test.ts | 2 +- yarn-project/end-to-end/src/spartan/smoke.test.ts | 2 +- yarn-project/end-to-end/src/spartan/utils.ts | 2 +- yarn-project/ethereum/src/eth_cheat_codes.ts | 2 +- yarn-project/ethereum/src/l1_tx_utils.test.ts | 2 +- .../src/crypto/random/randomness_singleton.ts | 5 ++++- .../foundation/src/transport/transport_client.ts | 2 +- yarn-project/foundation/src/worker/worker_pool.ts | 2 +- .../ivc-integration/src/avm_integration.test.ts | 4 ++-- .../src/native_client_ivc_integration.test.ts | 2 +- .../src/wasm_client_ivc_integration.test.ts | 2 +- .../merkle-tree/src/sparse_tree/sparse_tree.test.ts | 2 +- yarn-project/p2p-bootstrap/src/index.ts | 2 +- yarn-project/p2p/src/bootstrap/bootstrap.ts | 2 +- .../attestation_pool/memory_attestation_pool.ts | 2 +- .../p2p/src/mem_pools/tx_pool/aztec_kv_tx_pool.ts | 2 +- .../p2p/src/mem_pools/tx_pool/memory_tx_pool.ts | 2 +- yarn-project/p2p/src/service/discV5_service.ts | 2 +- yarn-project/p2p/src/service/libp2p_service.ts | 2 +- .../src/service/reqresp/reqresp.integration.test.ts | 2 +- yarn-project/p2p/src/tx_validator/data_validator.ts | 2 +- .../p2p/src/tx_validator/double_spend_validator.ts | 2 +- .../p2p/src/tx_validator/metadata_validator.ts | 2 +- .../p2p/src/tx_validator/tx_proof_validator.ts | 2 +- yarn-project/proof-verifier/src/proof_verifier.ts | 2 +- .../prover-client/src/block_builder/light.test.ts | 2 +- .../prover-client/src/block_builder/light.ts | 2 +- .../prover-client/src/orchestrator/orchestrator.ts | 2 +- .../src/orchestrator/orchestrator_errors.test.ts | 2 +- .../src/orchestrator/orchestrator_failures.test.ts | 2 +- .../src/orchestrator/orchestrator_lifecycle.test.ts | 2 +- .../orchestrator/orchestrator_mixed_blocks.test.ts | 2 +- .../orchestrator_multi_public_functions.test.ts | 2 +- .../orchestrator_multiple_blocks.test.ts | 2 +- .../orchestrator_public_functions.test.ts | 2 +- .../orchestrator/orchestrator_single_blocks.test.ts | 2 +- .../src/orchestrator/orchestrator_workflow.test.ts | 2 +- .../src/test/bb_prover_base_rollup.test.ts | 2 +- .../src/test/bb_prover_full_rollup.test.ts | 2 +- .../prover-client/src/test/bb_prover_parity.test.ts | 2 +- yarn-project/prover-node/src/factory.ts | 2 +- .../prover-node/src/job/epoch-proving-job.ts | 2 +- .../prover-node/src/prover-coordination/factory.ts | 2 +- yarn-project/pxe/src/bin/index.ts | 2 +- yarn-project/pxe/src/kernel_prover/kernel_prover.ts | 2 +- .../src/kernel_prover/test/test_circuit_prover.ts | 2 +- yarn-project/simulator/src/avm/avm_memory_types.ts | 2 +- yarn-project/simulator/src/avm/journal/journal.ts | 2 +- yarn-project/simulator/src/avm/opcodes/misc.ts | 2 +- .../simulator/src/client/private_execution.test.ts | 2 +- yarn-project/simulator/src/providers/acvm_native.ts | 2 +- .../src/public/enqueued_call_side_effect_trace.ts | 2 +- .../simulator/src/public/public_db_sources.ts | 4 ++-- .../telemetry-client/src/prom_otel_adapter.ts | 5 ++++- yarn-project/telemetry-client/src/start.ts | 2 +- yarn-project/txe/src/bin/index.ts | 2 +- .../world-state/src/world-state-db/merkle_trees.ts | 12 ++++++++++-- 77 files changed, 99 insertions(+), 85 deletions(-) diff --git a/yarn-project/aztec.js/src/contract/base_contract_interaction.ts b/yarn-project/aztec.js/src/contract/base_contract_interaction.ts index ed2304577c6..8ab2f2c91bd 100644 --- a/yarn-project/aztec.js/src/contract/base_contract_interaction.ts +++ b/yarn-project/aztec.js/src/contract/base_contract_interaction.ts @@ -30,7 +30,7 @@ export type SendMethodOptions = { * Implements the sequence create/simulate/send. */ export abstract class BaseContractInteraction { - protected log = createLogger('js:contract_interaction'); + protected log = createLogger('aztecjs:contract_interaction'); constructor(protected wallet: Wallet) {} diff --git a/yarn-project/aztec.js/src/contract/deploy_sent_tx.ts b/yarn-project/aztec.js/src/contract/deploy_sent_tx.ts index 092112bab14..6f294db1f03 100644 --- a/yarn-project/aztec.js/src/contract/deploy_sent_tx.ts +++ b/yarn-project/aztec.js/src/contract/deploy_sent_tx.ts @@ -24,7 +24,7 @@ export type DeployTxReceipt = FieldsO * A contract deployment transaction sent to the network, extending SentTx with methods to create a contract instance. */ export class DeploySentTx extends SentTx { - private log = createLogger('js:deploy_sent_tx'); + private log = createLogger('aztecjs:deploy_sent_tx'); constructor( wallet: PXE | Wallet, diff --git a/yarn-project/aztec.js/src/utils/cheat_codes.ts b/yarn-project/aztec.js/src/utils/cheat_codes.ts index 06415b3b9b6..b92366b94e5 100644 --- a/yarn-project/aztec.js/src/utils/cheat_codes.ts +++ b/yarn-project/aztec.js/src/utils/cheat_codes.ts @@ -51,7 +51,7 @@ export class RollupCheatCodes { private client: WalletClient & PublicClient; private rollup: GetContractReturnType; - private logger = createLogger('js:cheat_codes'); + private logger = createLogger('aztecjs:cheat_codes'); constructor(private ethCheatCodes: EthCheatCodes, addresses: Pick) { this.client = createWalletClient({ chain: foundry, transport: http(ethCheatCodes.rpcUrl) }).extend(publicActions); @@ -197,7 +197,7 @@ export class AztecCheatCodes { /** * The logger to use for the aztec cheatcodes */ - public logger = createLogger('cheat_codes:aztec'), + public logger = createLogger('aztecjs:cheat_codes'), ) {} /** diff --git a/yarn-project/aztec/src/examples/token.ts b/yarn-project/aztec/src/examples/token.ts index 7f1e9550dd1..282ae050b86 100644 --- a/yarn-project/aztec/src/examples/token.ts +++ b/yarn-project/aztec/src/examples/token.ts @@ -3,7 +3,7 @@ import { type AccountWallet, Fr, createPXEClient } from '@aztec/aztec.js'; import { createLogger } from '@aztec/foundation/log'; import { TokenContract } from '@aztec/noir-contracts.js/Token'; -const logger = createLogger('http-rpc-client'); +const logger = createLogger('example:token'); export const alicePrivateKey = Fr.random(); export const bobPrivateKey = Fr.random(); diff --git a/yarn-project/bb-prover/src/avm_proving.test.ts b/yarn-project/bb-prover/src/avm_proving.test.ts index a0a1de8c60b..89cee260204 100644 --- a/yarn-project/bb-prover/src/avm_proving.test.ts +++ b/yarn-project/bb-prover/src/avm_proving.test.ts @@ -22,7 +22,7 @@ describe('AVM WitGen, proof generation and verification', () => { async function proveAndVerifyAvmTestContract(functionName: string, calldata: Fr[] = []) { const avmCircuitInputs = await simulateAvmTestContractGenerateCircuitInputs(functionName, calldata); - const internalLogger = createLogger('avm-proving-test'); + const internalLogger = createLogger('bb-prover:avm-proving-test'); const logger = (msg: string, _data?: any) => internalLogger.verbose(msg); // The paths for the barretenberg binary and the write path are hardcoded for now. diff --git a/yarn-project/bb-prover/src/prover/bb_private_kernel_prover.ts b/yarn-project/bb-prover/src/prover/bb_private_kernel_prover.ts index 3f22bb058a9..5ea97eb97ee 100644 --- a/yarn-project/bb-prover/src/prover/bb_private_kernel_prover.ts +++ b/yarn-project/bb-prover/src/prover/bb_private_kernel_prover.ts @@ -79,7 +79,7 @@ export class BBNativePrivateKernelProver implements PrivateKernelProver { private bbBinaryPath: string, private bbWorkingDirectory: string, private skipCleanup: boolean, - private log = createLogger('bb-native-prover'), + private log = createLogger('bb-prover:native'), ) {} public static async new(config: BBConfig, log?: Logger) { diff --git a/yarn-project/bb-prover/src/test/test_circuit_prover.ts b/yarn-project/bb-prover/src/test/test_circuit_prover.ts index 51ed4930fb4..ca81962cbda 100644 --- a/yarn-project/bb-prover/src/test/test_circuit_prover.ts +++ b/yarn-project/bb-prover/src/test/test_circuit_prover.ts @@ -78,7 +78,7 @@ import { mapProtocolArtifactNameToCircuitName } from '../stats.js'; export class TestCircuitProver implements ServerCircuitProver { private wasmSimulator = new WASMSimulator(); private instrumentation: ProverInstrumentation; - private logger = createLogger('test-prover'); + private logger = createLogger('bb-prover:test-prover'); constructor( telemetry: TelemetryClient, diff --git a/yarn-project/bb-prover/src/verifier/bb_verifier.ts b/yarn-project/bb-prover/src/verifier/bb_verifier.ts index d0f014d6fbf..b095755f24b 100644 --- a/yarn-project/bb-prover/src/verifier/bb_verifier.ts +++ b/yarn-project/bb-prover/src/verifier/bb_verifier.ts @@ -36,7 +36,7 @@ export class BBCircuitVerifier implements ClientProtocolCircuitVerifier { public static async new( config: BBConfig, initialCircuits: ProtocolArtifact[] = [], - logger = createLogger('bb-verifier'), + logger = createLogger('bb-prover:verifier'), ) { await fs.mkdir(config.bbWorkingDirectory, { recursive: true }); const keys = new Map>(); diff --git a/yarn-project/circuit-types/src/interfaces/merkle_tree_operations.ts b/yarn-project/circuit-types/src/interfaces/merkle_tree_operations.ts index 04a62cef236..c9edef7a1c0 100644 --- a/yarn-project/circuit-types/src/interfaces/merkle_tree_operations.ts +++ b/yarn-project/circuit-types/src/interfaces/merkle_tree_operations.ts @@ -263,7 +263,7 @@ export interface MerkleTreeWriteOperations extends MerkleTreeReadOperations { export async function inspectTree( db: MerkleTreeReadOperations, treeId: MerkleTreeId, - log = createLogger('inspect-tree'), + log = createLogger('types:inspect-tree'), ) { const info = await db.getTreeInfo(treeId); const output = [`Tree id=${treeId} size=${info.size} root=0x${info.root.toString('hex')}`]; diff --git a/yarn-project/circuit-types/src/l2_block_downloader/l2_block_downloader.ts b/yarn-project/circuit-types/src/l2_block_downloader/l2_block_downloader.ts index 185ffdb08ca..6aae7fe32f0 100644 --- a/yarn-project/circuit-types/src/l2_block_downloader/l2_block_downloader.ts +++ b/yarn-project/circuit-types/src/l2_block_downloader/l2_block_downloader.ts @@ -6,7 +6,7 @@ import { InterruptibleSleep } from '@aztec/foundation/sleep'; import { type L2Block } from '../l2_block.js'; import { type L2BlockSource } from '../l2_block_source.js'; -const log = createLogger('l2_block_downloader'); +const log = createLogger('types:l2_block_downloader'); /** * Downloads L2 blocks from a L2BlockSource. diff --git a/yarn-project/circuit-types/src/l2_block_downloader/l2_block_stream.ts b/yarn-project/circuit-types/src/l2_block_downloader/l2_block_stream.ts index 73802bc9622..b4fce559ca9 100644 --- a/yarn-project/circuit-types/src/l2_block_downloader/l2_block_stream.ts +++ b/yarn-project/circuit-types/src/l2_block_downloader/l2_block_stream.ts @@ -9,7 +9,7 @@ import { type L2BlockId, type L2BlockSource, type L2Tips } from '../l2_block_sou export class L2BlockStream { private readonly runningPromise: RunningPromise; - private readonly log = createLogger('l2_block_stream'); + private readonly log = createLogger('types:l2_block_stream'); constructor( private l2BlockSource: Pick, 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 2be77718b46..db0b31c6fcf 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 @@ -3,7 +3,7 @@ import { createLogger } from '@aztec/foundation/log'; import { GrumpkinScalar, type Point } from '../../../index.js'; import { Grumpkin } from './index.js'; -const log = createLogger('bb:grumpkin_test'); +const log = createLogger('circuits:grumpkin_test'); describe('grumpkin', () => { let grumpkin!: Grumpkin; diff --git a/yarn-project/end-to-end/src/composed/e2e_aztec_js_browser.test.ts b/yarn-project/end-to-end/src/composed/e2e_aztec_js_browser.test.ts index 8eeaff94126..51c7d8eab45 100644 --- a/yarn-project/end-to-end/src/composed/e2e_aztec_js_browser.test.ts +++ b/yarn-project/end-to-end/src/composed/e2e_aztec_js_browser.test.ts @@ -15,8 +15,8 @@ const __dirname = dirname(__filename); const PORT = 4000; const PXE_PORT = 4001; -const logger = createLogger('e2e_aztec_browser.js:web'); -const pageLogger = createLogger('e2e_aztec_browser.js:web:page'); +const logger = createLogger('e2e:aztec_browser.js:web'); +const pageLogger = createLogger('e2e:aztec_browser.js:web:page'); /** * This test is a bit of a special case as it's on a web browser and not only on anvil and node.js. diff --git a/yarn-project/end-to-end/src/composed/e2e_sandbox_example.test.ts b/yarn-project/end-to-end/src/composed/e2e_sandbox_example.test.ts index de6c835a297..77697c5a779 100644 --- a/yarn-project/end-to-end/src/composed/e2e_sandbox_example.test.ts +++ b/yarn-project/end-to-end/src/composed/e2e_sandbox_example.test.ts @@ -14,7 +14,7 @@ describe('e2e_sandbox_example', () => { it('sandbox example works', async () => { // docs:start:setup ////////////// CREATE THE CLIENT INTERFACE AND CONTACT THE SANDBOX ////////////// - const logger = createLogger('token'); + const logger = createLogger('e2e:token'); // We create PXE client connected to the sandbox URL const pxe = createPXEClient(PXE_URL); @@ -118,7 +118,7 @@ describe('e2e_sandbox_example', () => { }); it('can create accounts on the sandbox', async () => { - const logger = createLogger('token'); + const logger = createLogger('e2e:token'); // We create PXE client connected to the sandbox URL const pxe = createPXEClient(PXE_URL); // Wait for sandbox to be ready diff --git a/yarn-project/end-to-end/src/fixtures/setup_l1_contracts.test.ts b/yarn-project/end-to-end/src/fixtures/setup_l1_contracts.test.ts index 4c37779fbf2..fc0ac7d818e 100644 --- a/yarn-project/end-to-end/src/fixtures/setup_l1_contracts.test.ts +++ b/yarn-project/end-to-end/src/fixtures/setup_l1_contracts.test.ts @@ -13,7 +13,7 @@ describe('deploy_l1_contracts', () => { let logger: Logger; beforeAll(async () => { - logger = createLogger('setup_l1_contracts'); + logger = createLogger('e2e:setup_l1_contracts'); privateKey = privateKeyToAccount('0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba'); ({ anvil, rpcUrl } = await startAnvil()); diff --git a/yarn-project/end-to-end/src/fixtures/utils.ts b/yarn-project/end-to-end/src/fixtures/utils.ts index 77d2bfdaee5..be464667723 100644 --- a/yarn-project/end-to-end/src/fixtures/utils.ts +++ b/yarn-project/end-to-end/src/fixtures/utils.ts @@ -544,9 +544,9 @@ export function getLogger() { const describeBlockName = expect.getState().currentTestName?.split(' ')[0].replaceAll('/', ':'); if (!describeBlockName) { const name = expect.getState().testPath?.split('/').pop()?.split('.')[0] ?? 'unknown'; - return createLogger('' + name); + return createLogger('e2e:' + name); } - return createLogger('' + describeBlockName); + return createLogger('e2e:' + describeBlockName); } /** diff --git a/yarn-project/end-to-end/src/prover-coordination/e2e_prover_coordination.test.ts b/yarn-project/end-to-end/src/prover-coordination/e2e_prover_coordination.test.ts index cbdd480bae3..25755714a88 100644 --- a/yarn-project/end-to-end/src/prover-coordination/e2e_prover_coordination.test.ts +++ b/yarn-project/end-to-end/src/prover-coordination/e2e_prover_coordination.test.ts @@ -61,9 +61,9 @@ describe('e2e_prover_coordination', () => { let snapshotManager: ISnapshotManager; beforeEach(async () => { - logger = createLogger('prover_coordination:e2e_json_coordination'); + logger = createLogger('e2e:prover_coordination'); snapshotManager = createSnapshotManager( - `prover_coordination/e2e_json_coordination`, + `prover_coordination/e2e_prover_coordination`, process.env.E2E_DATA_PATH, { startProverNode: true }, { assumeProvenThrough: undefined }, diff --git a/yarn-project/end-to-end/src/sample-dapp/index.test.mjs b/yarn-project/end-to-end/src/sample-dapp/index.test.mjs index f242709bc64..bbf26d494fe 100644 --- a/yarn-project/end-to-end/src/sample-dapp/index.test.mjs +++ b/yarn-project/end-to-end/src/sample-dapp/index.test.mjs @@ -18,7 +18,7 @@ describe('token', () => { recipient = await createAccount(pxe); const initialBalance = 69; - token = await deployToken(owner, initialBalance, createLogger('sample_dapp')); + token = await deployToken(owner, initialBalance, createLogger('e2e:sample_dapp')); }, 120_000); // docs:end:setup diff --git a/yarn-project/end-to-end/src/spartan/gating-passive.test.ts b/yarn-project/end-to-end/src/spartan/gating-passive.test.ts index dafbad879f5..aaf700cf596 100644 --- a/yarn-project/end-to-end/src/spartan/gating-passive.test.ts +++ b/yarn-project/end-to-end/src/spartan/gating-passive.test.ts @@ -41,7 +41,7 @@ const { SPARTAN_DIR, INSTANCE_NAME, } = config; -const debugLogger = createLogger('spartan-test:reorg'); +const debugLogger = createLogger('e2e:spartan-test:reorg'); describe('a test that passively observes the network in the presence of network chaos', () => { jest.setTimeout(60 * 60 * 1000); // 60 minutes diff --git a/yarn-project/end-to-end/src/spartan/proving.test.ts b/yarn-project/end-to-end/src/spartan/proving.test.ts index e7bcd040ea7..fd1ea281dba 100644 --- a/yarn-project/end-to-end/src/spartan/proving.test.ts +++ b/yarn-project/end-to-end/src/spartan/proving.test.ts @@ -9,7 +9,7 @@ import { isK8sConfig, setupEnvironment, startPortForward } from './utils.js'; jest.setTimeout(2_400_000); // 40 minutes const config = setupEnvironment(process.env); -const debugLogger = createLogger('spartan-test:proving'); +const debugLogger = createLogger('e2e:spartan-test:proving'); const SLEEP_MS = 1000; describe('proving test', () => { diff --git a/yarn-project/end-to-end/src/spartan/reorg.test.ts b/yarn-project/end-to-end/src/spartan/reorg.test.ts index fcc0a6fcb7e..f524503a4cf 100644 --- a/yarn-project/end-to-end/src/spartan/reorg.test.ts +++ b/yarn-project/end-to-end/src/spartan/reorg.test.ts @@ -20,7 +20,7 @@ if (!isK8sConfig(config)) { } const { NAMESPACE, HOST_PXE_PORT, HOST_ETHEREUM_PORT, CONTAINER_PXE_PORT, CONTAINER_ETHEREUM_PORT, SPARTAN_DIR } = config; -const debugLogger = createLogger('spartan-test:reorg'); +const debugLogger = createLogger('e2e:spartan-test:reorg'); async function checkBalances(testWallets: TestWallets, mintAmount: bigint, totalAmountTransferred: bigint) { testWallets.wallets.forEach(async w => { diff --git a/yarn-project/end-to-end/src/spartan/smoke.test.ts b/yarn-project/end-to-end/src/spartan/smoke.test.ts index 1f491c22cf6..5b4e2eb68c1 100644 --- a/yarn-project/end-to-end/src/spartan/smoke.test.ts +++ b/yarn-project/end-to-end/src/spartan/smoke.test.ts @@ -10,7 +10,7 @@ import { isK8sConfig, runAlertCheck, setupEnvironment, startPortForward } from ' const config = setupEnvironment(process.env); -const debugLogger = createLogger('spartan-test:smoke'); +const debugLogger = createLogger('e2e:spartan-test:smoke'); // QoS alerts for when we are running in k8s const qosAlerts: AlertConfig[] = [ diff --git a/yarn-project/end-to-end/src/spartan/utils.ts b/yarn-project/end-to-end/src/spartan/utils.ts index d9907049f44..82a4c56d610 100644 --- a/yarn-project/end-to-end/src/spartan/utils.ts +++ b/yarn-project/end-to-end/src/spartan/utils.ts @@ -11,7 +11,7 @@ import { AlertChecker, type AlertConfig } from '../quality_of_service/alert_chec const execAsync = promisify(exec); -const logger = createLogger('k8s-utils'); +const logger = createLogger('e2e:k8s-utils'); const k8sLocalConfigSchema = z.object({ INSTANCE_NAME: z.string().min(1, 'INSTANCE_NAME env variable must be set'), diff --git a/yarn-project/ethereum/src/eth_cheat_codes.ts b/yarn-project/ethereum/src/eth_cheat_codes.ts index 5f7216e8955..ae2f6793891 100644 --- a/yarn-project/ethereum/src/eth_cheat_codes.ts +++ b/yarn-project/ethereum/src/eth_cheat_codes.ts @@ -18,7 +18,7 @@ export class EthCheatCodes { /** * The logger to use for the eth cheatcodes */ - public logger = createLogger('cheat_codes:eth'), + public logger = createLogger('ethereum:cheat_codes'), ) {} async rpcCall(method: string, params: any[]) { diff --git a/yarn-project/ethereum/src/l1_tx_utils.test.ts b/yarn-project/ethereum/src/l1_tx_utils.test.ts index d77f0ac82bc..91d4c87e9a7 100644 --- a/yarn-project/ethereum/src/l1_tx_utils.test.ts +++ b/yarn-project/ethereum/src/l1_tx_utils.test.ts @@ -38,7 +38,7 @@ describe('GasUtils', () => { let anvil: Anvil; let cheatCodes: EthCheatCodes; const initialBaseFee = WEI_CONST; // 1 gwei - const logger = createLogger('l1_gas_test'); + const logger = createLogger('ethereum:test:l1_gas_test'); beforeAll(async () => { const { anvil: anvilInstance, rpcUrl } = await startAnvil(1); diff --git a/yarn-project/foundation/src/crypto/random/randomness_singleton.ts b/yarn-project/foundation/src/crypto/random/randomness_singleton.ts index 3c9e5a955e3..fb7181b0d82 100644 --- a/yarn-project/foundation/src/crypto/random/randomness_singleton.ts +++ b/yarn-project/foundation/src/crypto/random/randomness_singleton.ts @@ -13,7 +13,10 @@ export class RandomnessSingleton { private counter = 0; - private constructor(private readonly seed?: number, private readonly log = createLogger('randomness_singleton')) { + private constructor( + private readonly seed?: number, + private readonly log = createLogger('foundation:randomness_singleton'), + ) { if (seed !== undefined) { this.log.debug(`Using pseudo-randomness with seed: ${seed}`); this.counter = seed; diff --git a/yarn-project/foundation/src/transport/transport_client.ts b/yarn-project/foundation/src/transport/transport_client.ts index 176bc803cf1..ff29a457488 100644 --- a/yarn-project/foundation/src/transport/transport_client.ts +++ b/yarn-project/foundation/src/transport/transport_client.ts @@ -6,7 +6,7 @@ import { type EventMessage, type ResponseMessage, isEventMessage } from './dispa import { type Connector } from './interface/connector.js'; import { type Socket } from './interface/socket.js'; -const log = createLogger('transport_client'); +const log = createLogger('foundation:transport_client'); /** * Represents a pending request in the TransportClient. diff --git a/yarn-project/foundation/src/worker/worker_pool.ts b/yarn-project/foundation/src/worker/worker_pool.ts index 2b5cd5c4f4a..e32e250b19f 100644 --- a/yarn-project/foundation/src/worker/worker_pool.ts +++ b/yarn-project/foundation/src/worker/worker_pool.ts @@ -1,7 +1,7 @@ import { createLogger } from '../log/index.js'; import { type WasmWorker } from './wasm_worker.js'; -const log = createLogger('bb:worker_pool'); +const log = createLogger('foundation:worker_pool'); /** * Type of a worker factory. diff --git a/yarn-project/ivc-integration/src/avm_integration.test.ts b/yarn-project/ivc-integration/src/avm_integration.test.ts index 6c243a816b8..570c7ab3af3 100644 --- a/yarn-project/ivc-integration/src/avm_integration.test.ts +++ b/yarn-project/ivc-integration/src/avm_integration.test.ts @@ -22,7 +22,7 @@ import { MockPublicBaseCircuit, witnessGenMockPublicBaseCircuit } from './index. // Auto-generated types from noir are not in camel case. /* eslint-disable camelcase */ -const logger = createLogger('avm-integration'); +const logger = createLogger('ivc-integration:test:avm-integration'); describe('AVM Integration', () => { let bbWorkingDirectory: string; @@ -122,7 +122,7 @@ describe('AVM Integration', () => { async function proveAvmTestContract(functionName: string, calldata: Fr[] = []): Promise { const avmCircuitInputs = await simulateAvmTestContractGenerateCircuitInputs(functionName, calldata); - const internalLogger = createLogger('avm-proving-test'); + const internalLogger = createLogger('ivc-integration:test:avm-proving'); // The paths for the barretenberg binary and the write path are hardcoded for now. const bbPath = path.resolve('../../barretenberg/cpp/build/bin/bb'); diff --git a/yarn-project/ivc-integration/src/native_client_ivc_integration.test.ts b/yarn-project/ivc-integration/src/native_client_ivc_integration.test.ts index 79725bdb64c..476afeff11f 100644 --- a/yarn-project/ivc-integration/src/native_client_ivc_integration.test.ts +++ b/yarn-project/ivc-integration/src/native_client_ivc_integration.test.ts @@ -13,7 +13,7 @@ import { generate3FunctionTestingIVCStack, generate6FunctionTestingIVCStack } fr /* eslint-disable camelcase */ -const logger = createLogger('clientivc-integration'); +const logger = createLogger('ivc-integration:test:native'); jest.setTimeout(120_000); diff --git a/yarn-project/ivc-integration/src/wasm_client_ivc_integration.test.ts b/yarn-project/ivc-integration/src/wasm_client_ivc_integration.test.ts index 23ba7461580..84ea09c69b7 100644 --- a/yarn-project/ivc-integration/src/wasm_client_ivc_integration.test.ts +++ b/yarn-project/ivc-integration/src/wasm_client_ivc_integration.test.ts @@ -21,7 +21,7 @@ import { /* eslint-disable camelcase */ -const logger = createLogger('clientivc-integration'); +const logger = createLogger('ivc-integration:test:wasm'); jest.setTimeout(120_000); 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 130c1f9e235..68c776b64fb 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 @@ -14,7 +14,7 @@ import { standardBasedTreeTestSuite } from '../test/standard_based_test_suite.js import { treeTestSuite } from '../test/test_suite.js'; import { SparseTree } from './sparse_tree.js'; -const log = createLogger('sparse_tree_test'); +const log = createLogger('merkle-tree:test:sparse_tree'); const createDb = async ( db: AztecKVStore, diff --git a/yarn-project/p2p-bootstrap/src/index.ts b/yarn-project/p2p-bootstrap/src/index.ts index 4614c23f29f..d6eec090fe2 100644 --- a/yarn-project/p2p-bootstrap/src/index.ts +++ b/yarn-project/p2p-bootstrap/src/index.ts @@ -7,7 +7,7 @@ import { NoopTelemetryClient } from '@aztec/telemetry-client/noop'; import Koa from 'koa'; import Router from 'koa-router'; -const debugLogger = createLogger('bootstrap_node'); +const debugLogger = createLogger('p2p-bootstrap:bootstrap_node'); const { HTTP_PORT } = process.env; diff --git a/yarn-project/p2p/src/bootstrap/bootstrap.ts b/yarn-project/p2p/src/bootstrap/bootstrap.ts index 481914301a6..d0d459be642 100644 --- a/yarn-project/p2p/src/bootstrap/bootstrap.ts +++ b/yarn-project/p2p/src/bootstrap/bootstrap.ts @@ -21,7 +21,7 @@ export class BootstrapNode { constructor( private store: AztecKVStore, private telemetry: TelemetryClient, - private logger = createLogger('p2p_bootstrap'), + private logger = createLogger('p2p:bootstrap'), ) {} /** diff --git a/yarn-project/p2p/src/mem_pools/attestation_pool/memory_attestation_pool.ts b/yarn-project/p2p/src/mem_pools/attestation_pool/memory_attestation_pool.ts index bacae157f65..fe39a3fba18 100644 --- a/yarn-project/p2p/src/mem_pools/attestation_pool/memory_attestation_pool.ts +++ b/yarn-project/p2p/src/mem_pools/attestation_pool/memory_attestation_pool.ts @@ -10,7 +10,7 @@ export class InMemoryAttestationPool implements AttestationPool { private attestations: Map>>; - constructor(telemetry: TelemetryClient, private log = createLogger('attestation_pool')) { + constructor(telemetry: TelemetryClient, private log = createLogger('p2p:attestation_pool')) { this.attestations = new Map(); this.metrics = new PoolInstrumentation(telemetry, PoolName.ATTESTATION_POOL); } diff --git a/yarn-project/p2p/src/mem_pools/tx_pool/aztec_kv_tx_pool.ts b/yarn-project/p2p/src/mem_pools/tx_pool/aztec_kv_tx_pool.ts index 7916ab506e3..27c87c1432e 100644 --- a/yarn-project/p2p/src/mem_pools/tx_pool/aztec_kv_tx_pool.ts +++ b/yarn-project/p2p/src/mem_pools/tx_pool/aztec_kv_tx_pool.ts @@ -30,7 +30,7 @@ export class AztecKVTxPool implements TxPool { * @param store - A KV store. * @param log - A logger. */ - constructor(store: AztecKVStore, telemetry: TelemetryClient, log = createLogger('tx_pool')) { + constructor(store: AztecKVStore, telemetry: TelemetryClient, log = createLogger('p2p:tx_pool')) { this.#txs = store.openMap('txs'); this.#minedTxs = store.openMap('minedTxs'); this.#pendingTxs = store.openSet('pendingTxs'); diff --git a/yarn-project/p2p/src/mem_pools/tx_pool/memory_tx_pool.ts b/yarn-project/p2p/src/mem_pools/tx_pool/memory_tx_pool.ts index 3570184d976..12619656ef4 100644 --- a/yarn-project/p2p/src/mem_pools/tx_pool/memory_tx_pool.ts +++ b/yarn-project/p2p/src/mem_pools/tx_pool/memory_tx_pool.ts @@ -23,7 +23,7 @@ export class InMemoryTxPool implements TxPool { * Class constructor for in-memory TxPool. Initiates our transaction pool as a JS Map. * @param log - A logger. */ - constructor(telemetry: TelemetryClient, private log = createLogger('tx_pool')) { + constructor(telemetry: TelemetryClient, private log = createLogger('p2p:tx_pool')) { this.txs = new Map(); this.minedTxs = new Map(); this.pendingTxs = new Set(); diff --git a/yarn-project/p2p/src/service/discV5_service.ts b/yarn-project/p2p/src/service/discV5_service.ts index cb50d02bce4..a39d58725e8 100644 --- a/yarn-project/p2p/src/service/discV5_service.ts +++ b/yarn-project/p2p/src/service/discV5_service.ts @@ -46,7 +46,7 @@ export class DiscV5Service extends EventEmitter implements PeerDiscoveryService private peerId: PeerId, config: P2PConfig, telemetry: TelemetryClient, - private logger = createLogger('discv5_service'), + private logger = createLogger('p2p:discv5_service'), ) { super(); const { tcpAnnounceAddress, udpAnnounceAddress, udpListenAddress, bootstrapNodes } = config; diff --git a/yarn-project/p2p/src/service/libp2p_service.ts b/yarn-project/p2p/src/service/libp2p_service.ts index 611f1be2744..350989851e0 100644 --- a/yarn-project/p2p/src/service/libp2p_service.ts +++ b/yarn-project/p2p/src/service/libp2p_service.ts @@ -87,7 +87,7 @@ export class LibP2PService extends WithTracer implements P2PService { private worldStateSynchronizer: WorldStateSynchronizer, private telemetry: TelemetryClient, private requestResponseHandlers: ReqRespSubProtocolHandlers = DEFAULT_SUB_PROTOCOL_HANDLERS, - private logger = createLogger('libp2p_service'), + private logger = createLogger('p2p:libp2p_service'), ) { super(telemetry, 'LibP2PService'); diff --git a/yarn-project/p2p/src/service/reqresp/reqresp.integration.test.ts b/yarn-project/p2p/src/service/reqresp/reqresp.integration.test.ts index 0c588a92e79..8ec811f024e 100644 --- a/yarn-project/p2p/src/service/reqresp/reqresp.integration.test.ts +++ b/yarn-project/p2p/src/service/reqresp/reqresp.integration.test.ts @@ -82,7 +82,7 @@ describe('Req Resp p2p client integration', () => { let kvStore: AztecKVStore; let worldState: WorldStateSynchronizer; let proofVerifier: ClientProtocolCircuitVerifier; - const logger = createLogger('p2p-client-integration-test'); + const logger = createLogger('p2p:test:client-integration'); beforeEach(() => { ({ txPool, attestationPool, epochProofQuotePool } = makeMockPools()); diff --git a/yarn-project/p2p/src/tx_validator/data_validator.ts b/yarn-project/p2p/src/tx_validator/data_validator.ts index f34b9e779b7..143713cc280 100644 --- a/yarn-project/p2p/src/tx_validator/data_validator.ts +++ b/yarn-project/p2p/src/tx_validator/data_validator.ts @@ -2,7 +2,7 @@ import { Tx, type TxValidator } from '@aztec/circuit-types'; import { createLogger } from '@aztec/foundation/log'; export class DataTxValidator implements TxValidator { - #log = createLogger('sequencer:tx_validator:tx_data'); + #log = createLogger('p2p:tx_validator:tx_data'); validateTxs(txs: Tx[]): Promise<[validTxs: Tx[], invalidTxs: Tx[]]> { const validTxs: Tx[] = []; diff --git a/yarn-project/p2p/src/tx_validator/double_spend_validator.ts b/yarn-project/p2p/src/tx_validator/double_spend_validator.ts index ad1120d2631..5bb06bf1fa9 100644 --- a/yarn-project/p2p/src/tx_validator/double_spend_validator.ts +++ b/yarn-project/p2p/src/tx_validator/double_spend_validator.ts @@ -7,7 +7,7 @@ export interface NullifierSource { } export class DoubleSpendTxValidator implements TxValidator { - #log = createLogger('sequencer:tx_validator:tx_double_spend'); + #log = createLogger('p2p:tx_validator:tx_double_spend'); #nullifierSource: NullifierSource; constructor(nullifierSource: NullifierSource, private readonly isValidatingBlock: boolean = true) { diff --git a/yarn-project/p2p/src/tx_validator/metadata_validator.ts b/yarn-project/p2p/src/tx_validator/metadata_validator.ts index 2491ceb1b8b..fe3194a454e 100644 --- a/yarn-project/p2p/src/tx_validator/metadata_validator.ts +++ b/yarn-project/p2p/src/tx_validator/metadata_validator.ts @@ -3,7 +3,7 @@ import { type Fr } from '@aztec/circuits.js'; import { createLogger } from '@aztec/foundation/log'; export class MetadataTxValidator implements TxValidator { - #log = createLogger('sequencer:tx_validator:tx_metadata'); + #log = createLogger('p2p:tx_validator:tx_metadata'); constructor(private chainId: Fr, private blockNumber: Fr) {} diff --git a/yarn-project/p2p/src/tx_validator/tx_proof_validator.ts b/yarn-project/p2p/src/tx_validator/tx_proof_validator.ts index 4dbffea9e39..172234ce3bc 100644 --- a/yarn-project/p2p/src/tx_validator/tx_proof_validator.ts +++ b/yarn-project/p2p/src/tx_validator/tx_proof_validator.ts @@ -2,7 +2,7 @@ import { type ClientProtocolCircuitVerifier, Tx, type TxValidator } from '@aztec import { createLogger } from '@aztec/foundation/log'; export class TxProofValidator implements TxValidator { - #log = createLogger('sequencer:tx_validator:private_proof'); + #log = createLogger('p2p:tx_validator:private_proof'); constructor(private verifier: ClientProtocolCircuitVerifier) {} diff --git a/yarn-project/proof-verifier/src/proof_verifier.ts b/yarn-project/proof-verifier/src/proof_verifier.ts index ab9a55e0d5a..f87f50612a0 100644 --- a/yarn-project/proof-verifier/src/proof_verifier.ts +++ b/yarn-project/proof-verifier/src/proof_verifier.ts @@ -33,7 +33,7 @@ export class ProofVerifier { } static async new(config: ProofVerifierConfig, telemetryClient: TelemetryClient): Promise { - const logger = createLogger('block-verifier-bot'); + const logger = createLogger('proof-verifier:block-verifier-bot'); const verifier = await BBCircuitVerifier.new(config, [], logger); const client = createPublicClient({ chain: createEthereumChain(config.l1Url, config.l1ChainId).chainInfo, diff --git a/yarn-project/prover-client/src/block_builder/light.test.ts b/yarn-project/prover-client/src/block_builder/light.test.ts index 5213682ccf5..337492e5ff4 100644 --- a/yarn-project/prover-client/src/block_builder/light.test.ts +++ b/yarn-project/prover-client/src/block_builder/light.test.ts @@ -78,7 +78,7 @@ describe('LightBlockBuilder', () => { let emptyProof: RecursiveProof; beforeAll(async () => { - logger = createLogger('sequencer-client:test:block-builder'); + logger = createLogger('prover-client:test:block-builder'); simulator = new TestCircuitProver(new NoopTelemetryClient()); vkTreeRoot = getVKTreeRoot(); emptyProof = makeEmptyRecursiveProof(NESTED_RECURSIVE_PROOF_LENGTH); diff --git a/yarn-project/prover-client/src/block_builder/light.ts b/yarn-project/prover-client/src/block_builder/light.ts index f81e90fbf2e..efda5e61dd1 100644 --- a/yarn-project/prover-client/src/block_builder/light.ts +++ b/yarn-project/prover-client/src/block_builder/light.ts @@ -32,7 +32,7 @@ export class LightweightBlockBuilder implements BlockBuilder { private readonly txs: ProcessedTx[] = []; - private readonly logger = createLogger('sequencer-client:block_builder_light'); + private readonly logger = createLogger('prover-client:block_builder'); constructor(private db: MerkleTreeWriteOperations, private telemetry: TelemetryClient) {} diff --git a/yarn-project/prover-client/src/orchestrator/orchestrator.ts b/yarn-project/prover-client/src/orchestrator/orchestrator.ts index 4ad4a9c58c1..c5991ff67d7 100644 --- a/yarn-project/prover-client/src/orchestrator/orchestrator.ts +++ b/yarn-project/prover-client/src/orchestrator/orchestrator.ts @@ -77,7 +77,7 @@ import { import { ProvingOrchestratorMetrics } from './orchestrator_metrics.js'; import { TxProvingState } from './tx-proving-state.js'; -const logger = createLogger('prover:proving-orchestrator'); +const logger = createLogger('prover-client:orchestrator'); /** * Implements an event driven proving scheduler to build the recursive proof tree. The idea being: diff --git a/yarn-project/prover-client/src/orchestrator/orchestrator_errors.test.ts b/yarn-project/prover-client/src/orchestrator/orchestrator_errors.test.ts index 402739f724e..a9691584743 100644 --- a/yarn-project/prover-client/src/orchestrator/orchestrator_errors.test.ts +++ b/yarn-project/prover-client/src/orchestrator/orchestrator_errors.test.ts @@ -5,7 +5,7 @@ import { createLogger } from '@aztec/foundation/log'; import { TestContext } from '../mocks/test_context.js'; import { type ProvingOrchestrator } from './orchestrator.js'; -const logger = createLogger('orchestrator-errors'); +const logger = createLogger('prover-client:test:orchestrator-errors'); describe('prover/orchestrator/errors', () => { let context: TestContext; diff --git a/yarn-project/prover-client/src/orchestrator/orchestrator_failures.test.ts b/yarn-project/prover-client/src/orchestrator/orchestrator_failures.test.ts index 3871279b9c5..5b6f59c1f0d 100644 --- a/yarn-project/prover-client/src/orchestrator/orchestrator_failures.test.ts +++ b/yarn-project/prover-client/src/orchestrator/orchestrator_failures.test.ts @@ -10,7 +10,7 @@ import { jest } from '@jest/globals'; import { TestContext } from '../mocks/test_context.js'; import { ProvingOrchestrator } from './orchestrator.js'; -const logger = createLogger('orchestrator-failures'); +const logger = createLogger('prover-client:test:orchestrator-failures'); describe('prover/orchestrator/failures', () => { let context: TestContext; diff --git a/yarn-project/prover-client/src/orchestrator/orchestrator_lifecycle.test.ts b/yarn-project/prover-client/src/orchestrator/orchestrator_lifecycle.test.ts index 279a856a038..89b0e58fdd0 100644 --- a/yarn-project/prover-client/src/orchestrator/orchestrator_lifecycle.test.ts +++ b/yarn-project/prover-client/src/orchestrator/orchestrator_lifecycle.test.ts @@ -11,7 +11,7 @@ import { TestCircuitProver } from '../../../bb-prover/src/test/test_circuit_prov import { TestContext } from '../mocks/test_context.js'; import { ProvingOrchestrator } from './orchestrator.js'; -const logger = createLogger('orchestrator-lifecycle'); +const logger = createLogger('prover-client:test:orchestrator-lifecycle'); describe('prover/orchestrator/lifecycle', () => { let context: TestContext; diff --git a/yarn-project/prover-client/src/orchestrator/orchestrator_mixed_blocks.test.ts b/yarn-project/prover-client/src/orchestrator/orchestrator_mixed_blocks.test.ts index 477a3f3e78e..c22e9ce1df6 100644 --- a/yarn-project/prover-client/src/orchestrator/orchestrator_mixed_blocks.test.ts +++ b/yarn-project/prover-client/src/orchestrator/orchestrator_mixed_blocks.test.ts @@ -6,7 +6,7 @@ import { createLogger } from '@aztec/foundation/log'; import { TestContext } from '../mocks/test_context.js'; -const logger = createLogger('orchestrator-mixed-blocks'); +const logger = createLogger('prover-client:test:orchestrator-mixed-blocks'); describe('prover/orchestrator/mixed-blocks', () => { let context: TestContext; diff --git a/yarn-project/prover-client/src/orchestrator/orchestrator_multi_public_functions.test.ts b/yarn-project/prover-client/src/orchestrator/orchestrator_multi_public_functions.test.ts index aa52a274bcd..48a62caa227 100644 --- a/yarn-project/prover-client/src/orchestrator/orchestrator_multi_public_functions.test.ts +++ b/yarn-project/prover-client/src/orchestrator/orchestrator_multi_public_functions.test.ts @@ -6,7 +6,7 @@ import { protocolContractTreeRoot } from '@aztec/protocol-contracts'; import { TestContext } from '../mocks/test_context.js'; -const logger = createLogger('orchestrator-multi-public-functions'); +const logger = createLogger('prover-client:test:orchestrator-multi-public-functions'); describe('prover/orchestrator/public-functions', () => { let context: TestContext; diff --git a/yarn-project/prover-client/src/orchestrator/orchestrator_multiple_blocks.test.ts b/yarn-project/prover-client/src/orchestrator/orchestrator_multiple_blocks.test.ts index 910fc84963f..4b20b74480f 100644 --- a/yarn-project/prover-client/src/orchestrator/orchestrator_multiple_blocks.test.ts +++ b/yarn-project/prover-client/src/orchestrator/orchestrator_multiple_blocks.test.ts @@ -3,7 +3,7 @@ import { createLogger } from '@aztec/foundation/log'; import { TestContext } from '../mocks/test_context.js'; -const logger = createLogger('orchestrator-multi-blocks'); +const logger = createLogger('prover-client:test:orchestrator-multi-blocks'); describe('prover/orchestrator/multi-block', () => { let context: TestContext; diff --git a/yarn-project/prover-client/src/orchestrator/orchestrator_public_functions.test.ts b/yarn-project/prover-client/src/orchestrator/orchestrator_public_functions.test.ts index 1d3d2152fed..c41e85a4800 100644 --- a/yarn-project/prover-client/src/orchestrator/orchestrator_public_functions.test.ts +++ b/yarn-project/prover-client/src/orchestrator/orchestrator_public_functions.test.ts @@ -5,7 +5,7 @@ import { protocolContractTreeRoot } from '@aztec/protocol-contracts'; import { TestContext } from '../mocks/test_context.js'; -const logger = createLogger('orchestrator-public-functions'); +const logger = createLogger('prover-client:test:orchestrator-public-functions'); describe('prover/orchestrator/public-functions', () => { let context: TestContext; diff --git a/yarn-project/prover-client/src/orchestrator/orchestrator_single_blocks.test.ts b/yarn-project/prover-client/src/orchestrator/orchestrator_single_blocks.test.ts index 982ae526ded..daf63d32757 100644 --- a/yarn-project/prover-client/src/orchestrator/orchestrator_single_blocks.test.ts +++ b/yarn-project/prover-client/src/orchestrator/orchestrator_single_blocks.test.ts @@ -7,7 +7,7 @@ import { sleep } from '@aztec/foundation/sleep'; import { TestContext } from '../mocks/test_context.js'; -const logger = createLogger('orchestrator-single-blocks'); +const logger = createLogger('prover-client:test:orchestrator-single-blocks'); describe('prover/orchestrator/blocks', () => { let context: TestContext; diff --git a/yarn-project/prover-client/src/orchestrator/orchestrator_workflow.test.ts b/yarn-project/prover-client/src/orchestrator/orchestrator_workflow.test.ts index 1508578cd07..e5a1ed7d591 100644 --- a/yarn-project/prover-client/src/orchestrator/orchestrator_workflow.test.ts +++ b/yarn-project/prover-client/src/orchestrator/orchestrator_workflow.test.ts @@ -23,7 +23,7 @@ import { type MockProxy, mock } from 'jest-mock-extended'; import { TestContext } from '../mocks/test_context.js'; import { type ProvingOrchestrator } from './orchestrator.js'; -const logger = createLogger('orchestrator-workflow'); +const logger = createLogger('prover-client:test:orchestrator-workflow'); describe('prover/orchestrator', () => { describe('workflow', () => { diff --git a/yarn-project/prover-client/src/test/bb_prover_base_rollup.test.ts b/yarn-project/prover-client/src/test/bb_prover_base_rollup.test.ts index a1cad54e465..915606e65dd 100644 --- a/yarn-project/prover-client/src/test/bb_prover_base_rollup.test.ts +++ b/yarn-project/prover-client/src/test/bb_prover_base_rollup.test.ts @@ -16,7 +16,7 @@ import { NoopTelemetryClient } from '@aztec/telemetry-client/noop'; import { TestContext } from '../mocks/test_context.js'; import { buildBaseRollupHints } from '../orchestrator/block-building-helpers.js'; -const logger = createLogger('bb-prover-base-rollup'); +const logger = createLogger('prover-client:test:bb-prover-base-rollup'); describe('prover/bb_prover/base-rollup', () => { let context: TestContext; diff --git a/yarn-project/prover-client/src/test/bb_prover_full_rollup.test.ts b/yarn-project/prover-client/src/test/bb_prover_full_rollup.test.ts index 434d03b114a..6c1b4f4dceb 100644 --- a/yarn-project/prover-client/src/test/bb_prover_full_rollup.test.ts +++ b/yarn-project/prover-client/src/test/bb_prover_full_rollup.test.ts @@ -22,7 +22,7 @@ describe('prover/bb_prover/full-rollup', () => { prover = await BBNativeRollupProver.new(bbConfig, new NoopTelemetryClient()); return prover; }; - log = createLogger('bb-prover-full-rollup'); + log = createLogger('prover-client:test:bb-prover-full-rollup'); context = await TestContext.new(log, 1, buildProver); }); diff --git a/yarn-project/prover-client/src/test/bb_prover_parity.test.ts b/yarn-project/prover-client/src/test/bb_prover_parity.test.ts index 978e6347219..12a3b16e000 100644 --- a/yarn-project/prover-client/src/test/bb_prover_parity.test.ts +++ b/yarn-project/prover-client/src/test/bb_prover_parity.test.ts @@ -24,7 +24,7 @@ import { NoopTelemetryClient } from '@aztec/telemetry-client/noop'; import { TestContext } from '../mocks/test_context.js'; -const logger = createLogger('bb-prover-parity'); +const logger = createLogger('prover-client:test:bb-prover-parity'); describe('prover/bb_prover/parity', () => { let context: TestContext; diff --git a/yarn-project/prover-node/src/factory.ts b/yarn-project/prover-node/src/factory.ts index ab3c6b8f207..a2ac17191de 100644 --- a/yarn-project/prover-node/src/factory.ts +++ b/yarn-project/prover-node/src/factory.ts @@ -39,7 +39,7 @@ export async function createProverNode( } = {}, ) { const telemetry = deps.telemetry ?? new NoopTelemetryClient(); - const log = deps.log ?? createLogger('prover'); + const log = deps.log ?? createLogger('prover-node'); const archiver = deps.archiver ?? (await createArchiver(config, telemetry, { blockUntilSync: true })); log.verbose(`Created archiver and synced to block ${await archiver.getBlockNumber()}`); diff --git a/yarn-project/prover-node/src/job/epoch-proving-job.ts b/yarn-project/prover-node/src/job/epoch-proving-job.ts index 1222206a27b..ba48a49bde3 100644 --- a/yarn-project/prover-node/src/job/epoch-proving-job.ts +++ b/yarn-project/prover-node/src/job/epoch-proving-job.ts @@ -29,7 +29,7 @@ import { type ProverNodeMetrics } from '../metrics.js'; */ export class EpochProvingJob { private state: EpochProvingJobState = 'initialized'; - private log = createLogger('epoch-proving-job'); + private log = createLogger('prover-node:epoch-proving-job'); private uuid: string; private runPromise: Promise | undefined; diff --git a/yarn-project/prover-node/src/prover-coordination/factory.ts b/yarn-project/prover-node/src/prover-coordination/factory.ts index 9318bb74f37..e8e94f1153a 100644 --- a/yarn-project/prover-node/src/prover-coordination/factory.ts +++ b/yarn-project/prover-node/src/prover-coordination/factory.ts @@ -26,7 +26,7 @@ export async function createProverCoordination( config: ProverNodeConfig & DataStoreConfig, deps: ProverCoordinationDeps, ): Promise { - const log = createLogger('createProverCoordination'); + const log = createLogger('prover-node:prover-coordination'); if (deps.aztecNodeTxProvider) { log.info('Using prover coordination via aztec node'); diff --git a/yarn-project/pxe/src/bin/index.ts b/yarn-project/pxe/src/bin/index.ts index 519b66b5e36..e80a9d99eeb 100644 --- a/yarn-project/pxe/src/bin/index.ts +++ b/yarn-project/pxe/src/bin/index.ts @@ -9,7 +9,7 @@ import { createPXEService } from '../pxe_service/index.js'; const { PXE_PORT = 8080, AZTEC_NODE_URL = 'http://localhost:8079' } = process.env; -const logger = createLogger('pxe_service'); +const logger = createLogger('pxe:service'); /** * Create and start a new PXE HTTP Server diff --git a/yarn-project/pxe/src/kernel_prover/kernel_prover.ts b/yarn-project/pxe/src/kernel_prover/kernel_prover.ts index 4e63a255ae5..4bb018a75b3 100644 --- a/yarn-project/pxe/src/kernel_prover/kernel_prover.ts +++ b/yarn-project/pxe/src/kernel_prover/kernel_prover.ts @@ -55,7 +55,7 @@ const NULL_PROVE_OUTPUT: PrivateKernelSimulateOutput { return Promise.resolve(ClientIvcProof.empty()); diff --git a/yarn-project/simulator/src/avm/avm_memory_types.ts b/yarn-project/simulator/src/avm/avm_memory_types.ts index 9522af0fcb7..bc9aa66e468 100644 --- a/yarn-project/simulator/src/avm/avm_memory_types.ts +++ b/yarn-project/simulator/src/avm/avm_memory_types.ts @@ -227,7 +227,7 @@ export enum TypeTag { export type TaggedMemoryInterface = FunctionsOf; export class TaggedMemory implements TaggedMemoryInterface { - static readonly log: Logger = createLogger('avm_simulator:memory'); + static readonly log: Logger = createLogger('simulator:avm:memory'); // Whether to track and validate memory accesses for each instruction. static readonly TRACK_MEMORY_ACCESSES = process.env.NODE_ENV === 'test'; diff --git a/yarn-project/simulator/src/avm/journal/journal.ts b/yarn-project/simulator/src/avm/journal/journal.ts index 7f533f4f2d5..b24e39ab050 100644 --- a/yarn-project/simulator/src/avm/journal/journal.ts +++ b/yarn-project/simulator/src/avm/journal/journal.ts @@ -33,7 +33,7 @@ import { PublicStorage } from './public_storage.js'; * Manages merging of successful/reverted child state into current state. */ export class AvmPersistableStateManager { - private readonly log = createLogger('avm_simulator:state_manager'); + private readonly log = createLogger('simulator:avm:state_manager'); /** Make sure a forked state is never merged twice. */ private alreadyMergedIntoParent = false; diff --git a/yarn-project/simulator/src/avm/opcodes/misc.ts b/yarn-project/simulator/src/avm/opcodes/misc.ts index f1cc4001d9f..13b348588d8 100644 --- a/yarn-project/simulator/src/avm/opcodes/misc.ts +++ b/yarn-project/simulator/src/avm/opcodes/misc.ts @@ -9,7 +9,7 @@ import { Instruction } from './instruction.js'; export class DebugLog extends Instruction { static type: string = 'DEBUGLOG'; static readonly opcode: Opcode = Opcode.DEBUGLOG; - static readonly logger = createLogger('avm_simulator:debug_log'); + static readonly logger = createLogger('simulator:avm:debug_log'); // Informs (de)serialization. See Instruction.deserialize. static readonly wireFormat: OperandType[] = [ diff --git a/yarn-project/simulator/src/client/private_execution.test.ts b/yarn-project/simulator/src/client/private_execution.test.ts index e93167ce47b..5c4b8af8212 100644 --- a/yarn-project/simulator/src/client/private_execution.test.ts +++ b/yarn-project/simulator/src/client/private_execution.test.ts @@ -184,7 +184,7 @@ describe('Private Execution test suite', () => { }; beforeAll(() => { - logger = createLogger('test:private_execution'); + logger = createLogger('simulator:test:private_execution'); const ownerPartialAddress = Fr.random(); ownerCompleteAddress = CompleteAddress.fromSecretKeyAndPartialAddress(ownerSk, ownerPartialAddress); diff --git a/yarn-project/simulator/src/providers/acvm_native.ts b/yarn-project/simulator/src/providers/acvm_native.ts index 9b08deaec50..0cdfb68769a 100644 --- a/yarn-project/simulator/src/providers/acvm_native.ts +++ b/yarn-project/simulator/src/providers/acvm_native.ts @@ -9,7 +9,7 @@ import fs from 'fs/promises'; import { type SimulationProvider } from './simulation_provider.js'; -const logger = createLogger('acvm-native'); +const logger = createLogger('simulator:acvm-native'); export enum ACVM_RESULT { SUCCESS, diff --git a/yarn-project/simulator/src/public/enqueued_call_side_effect_trace.ts b/yarn-project/simulator/src/public/enqueued_call_side_effect_trace.ts index 66b1e469727..5d09d3544e2 100644 --- a/yarn-project/simulator/src/public/enqueued_call_side_effect_trace.ts +++ b/yarn-project/simulator/src/public/enqueued_call_side_effect_trace.ts @@ -99,7 +99,7 @@ export class SideEffectArrayLengths { * Trace side effects for an entire enqueued call. */ export class PublicEnqueuedCallSideEffectTrace implements PublicSideEffectTraceInterface { - public log = createLogger('public_enqueued_call_side_effect_trace'); + public log = createLogger('simulator:public_enqueued_call_side_effect_trace'); /** The side effect counter increments with every call to the trace. */ private sideEffectCounter: number; diff --git a/yarn-project/simulator/src/public/public_db_sources.ts b/yarn-project/simulator/src/public/public_db_sources.ts index 32c6f27cdf7..ab9add3a40b 100644 --- a/yarn-project/simulator/src/public/public_db_sources.ts +++ b/yarn-project/simulator/src/public/public_db_sources.ts @@ -39,7 +39,7 @@ export class ContractsDataSourcePublicDB implements PublicContractsDB { private classCache = new Map(); private bytecodeCommitmentCache = new Map(); - private log = createLogger('sequencer:contracts-data-source'); + private log = createLogger('simulator:contracts-data-source'); constructor(private dataSource: ContractDataSource) {} /** @@ -152,7 +152,7 @@ export class ContractsDataSourcePublicDB implements PublicContractsDB { * A public state DB that reads and writes to the world state. */ export class WorldStateDB extends ContractsDataSourcePublicDB implements PublicStateDB, CommitmentsDB { - private logger = createLogger('sequencer:world-state-db'); + private logger = createLogger('simulator:world-state-db'); private publicCommittedWriteCache: Map = new Map(); private publicCheckpointedWriteCache: Map = new Map(); diff --git a/yarn-project/telemetry-client/src/prom_otel_adapter.ts b/yarn-project/telemetry-client/src/prom_otel_adapter.ts index c0ebf8ea775..4cd8197a54a 100644 --- a/yarn-project/telemetry-client/src/prom_otel_adapter.ts +++ b/yarn-project/telemetry-client/src/prom_otel_adapter.ts @@ -285,7 +285,10 @@ class NoopOtelAvgMinMax implements IAvg export class OtelMetricsAdapter extends Registry implements MetricsRegister { private readonly meter: Meter; - constructor(telemetryClient: TelemetryClient, private logger: Logger = createLogger('otel-metrics-adapter')) { + constructor( + telemetryClient: TelemetryClient, + private logger: Logger = createLogger('telemetry:otel-metrics-adapter'), + ) { super(); this.meter = telemetryClient.getMeter('metrics-adapter'); } diff --git a/yarn-project/telemetry-client/src/start.ts b/yarn-project/telemetry-client/src/start.ts index 272415f56e3..d33866c6c1b 100644 --- a/yarn-project/telemetry-client/src/start.ts +++ b/yarn-project/telemetry-client/src/start.ts @@ -8,7 +8,7 @@ import { type TelemetryClient } from './telemetry.js'; export * from './config.js'; export async function createAndStartTelemetryClient(config: TelemetryClientConfig): Promise { - const log = createLogger('telemetry-client'); + const log = createLogger('telemetry:client'); if (config.metricsCollectorUrl) { log.info('Using OpenTelemetry client'); return await OpenTelemetryClient.createAndStart(config, log); diff --git a/yarn-project/txe/src/bin/index.ts b/yarn-project/txe/src/bin/index.ts index a2f0de0a44e..43390bb1074 100644 --- a/yarn-project/txe/src/bin/index.ts +++ b/yarn-project/txe/src/bin/index.ts @@ -10,7 +10,7 @@ import { createTXERpcServer } from '../index.js'; async function main() { const { TXE_PORT = 8080 } = process.env; - const logger = createLogger('txe_service'); + const logger = createLogger('txe:service'); logger.info(`Setting up TXE...`); const txeServer = createTXERpcServer(logger); 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 da31c85582f..35118425035 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 @@ -121,7 +121,11 @@ export class MerkleTrees implements MerkleTreeAdminDatabase { * @param store - The db instance to use for data persistance. * @returns - A fully initialized MerkleTrees instance. */ - public static async new(store: AztecKVStore, client: TelemetryClient, log = createLogger('merkle_trees')) { + public static async new( + store: AztecKVStore, + client: TelemetryClient, + log = createLogger('world-state:merkle_trees'), + ) { const merkleTrees = new MerkleTrees(store, client, log); await merkleTrees.#init(); return merkleTrees; @@ -236,7 +240,11 @@ export class MerkleTrees implements MerkleTreeAdminDatabase { // that can work on a read-only store and one that actually writes to the store. This implies // having read-only versions of the kv-stores, all kv-containers, and all trees. public async ephemeralFork(): Promise { - const forked = new MerkleTrees(this.store, this.telemetryClient, createLogger('merkle_trees:ephemeral_fork')); + const forked = new MerkleTrees( + this.store, + this.telemetryClient, + createLogger('world-state:merkle_trees:ephemeral_fork'), + ); await forked.#init(true); return new MerkleTreeReadOperationsFacade(forked, true); }